Loading Workspace_msvc/lib_dec.vcxproj +0 −2 Original line number Diff line number Diff line Loading @@ -270,7 +270,6 @@ <ClCompile Include="..\lib_dec\jbm_jb4_inputbuffer.c" /> <ClCompile Include="..\lib_dec\jbm_jb4_jmf.c" /> <ClCompile Include="..\lib_dec\jbm_pcmdsp_apa.c" /> <ClCompile Include="..\lib_dec\jbm_pcmdsp_fifo.c" /> <ClCompile Include="..\lib_dec\jbm_pcmdsp_similarityestimation.c" /> <ClCompile Include="..\lib_dec\jbm_pcmdsp_window.c" /> <ClCompile Include="..\lib_dec\LD_music_post_filter.c" /> Loading Loading @@ -318,7 +317,6 @@ <ClInclude Include="..\lib_dec\jbm_jb4_inputbuffer.h" /> <ClInclude Include="..\lib_dec\jbm_jb4_jmf.h" /> <ClInclude Include="..\lib_dec\jbm_pcmdsp_apa.h" /> <ClInclude Include="..\lib_dec\jbm_pcmdsp_fifo.h" /> <ClInclude Include="..\lib_dec\jbm_pcmdsp_similarityestimation.h" /> <ClInclude Include="..\lib_dec\jbm_pcmdsp_window.h" /> <ClInclude Include="..\lib_dec\lib_dec.h" /> Loading Workspace_msvc/lib_dec.vcxproj.filters +0 −6 Original line number Diff line number Diff line Loading @@ -415,9 +415,6 @@ <ClCompile Include="..\lib_dec\jbm_pcmdsp_apa.c"> <Filter>decoder_all_c</Filter> </ClCompile> <ClCompile Include="..\lib_dec\jbm_pcmdsp_fifo.c"> <Filter>decoder_all_c</Filter> </ClCompile> <ClCompile Include="..\lib_dec\jbm_pcmdsp_similarityestimation.c"> <Filter>decoder_all_c</Filter> </ClCompile> Loading Loading @@ -532,9 +529,6 @@ <ClInclude Include="..\lib_dec\jbm_jb4sb.h"> <Filter>decoder_h</Filter> </ClInclude> <ClInclude Include="..\lib_dec\jbm_pcmdsp_fifo.h"> <Filter>decoder_h</Filter> </ClInclude> <ClInclude Include="..\lib_dec\jbm_pcmdsp_apa.h"> <Filter>decoder_h</Filter> </ClInclude> Loading apps/decoder.c +95 −0 Original line number Diff line number Diff line Loading @@ -498,6 +498,7 @@ int main( } } #ifndef FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT #ifdef DEBUGGING /*-----------------------------------------------------------------* * Preview bitstream and print config information Loading Loading @@ -587,6 +588,7 @@ int main( fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif #endif /*-------------------------------------------------------------------* Loading Loading @@ -777,6 +779,99 @@ int main( hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; } #ifdef FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT #ifdef DEBUGGING /*-----------------------------------------------------------------* * Preview bitstream and print config information *-----------------------------------------------------------------*/ if ( arg.voipMode ) { if ( ( error = printBitstreamInfoVoip( arg, hBsReader, hIvasDec ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error while previewing VoIP bitstream: %s\n", ivas_error_to_string( error ) ); goto cleanup; } } else { uint16_t bit_stream[IVAS_MAX_BITS_PER_FRAME + 4 * 8]; int16_t num_bits; int16_t bfi = 0; do { if ( BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: input bitstream file %s couldn't be read\n\n", arg.inputBitstreamFilename ); goto cleanup; } } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_5K2 ); BS_Reader_Rewind( hBsReader ); IVAS_DEC_PrintConfigWithBitstream( hIvasDec, arg.quietModeEnabled, bit_stream, num_bits ); #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmEnabled ) { if ( arg.tsmScaleFileEnabled ) { fprintf( stdout, "Variable speed file: %s\n", arg.tsmScaleFileName ); } else { fprintf( stdout, "Variable speed factor: %i\n", arg.tsmScale ); } } #endif } /*-----------------------------------------------------------------* * Open Error pattern file for simulation *-----------------------------------------------------------------*/ if ( arg.FEPatternFileName != NULL ) { if ( ( FEC_pattern = fopen( arg.FEPatternFileName, "rb" ) ) == NULL ) { fprintf( stderr, "Error: Missing or incorrect FEC filename specification\n\n" ); usage_dec(); goto cleanup; } } #ifdef DEBUG_SBA_AUDIO_DUMP ivas_open_sba_decoder_debug_files( arg.output_Fs, 1, 1 ); #endif /*-----------------------------------------------------------------* * Print information about FEC *-----------------------------------------------------------------*/ if ( !arg.voipMode && ( arg.FEPatternFileName != NULL || arg.FER > 0 ) ) { if ( arg.FEPatternFileName != NULL ) { fprintf( stdout, "FEC: %s\n", arg.FEPatternFileName ); } else { fprintf( stdout, "FEC: %.2f %%\n", arg.FER ); } } #else /*-----------------------------------------------------------------* * Print config information *-----------------------------------------------------------------*/ if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif #endif /*------------------------------------------------------------------------------------------* * Allocate output data buffer *------------------------------------------------------------------------------------------*/ Loading lib_com/gs_bitallocation.c +12 −4 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ static void reajust_bits( float *bits_per_bands, const int16_t st_band, const in static Word16 Find_norm_inv( const Word32 ToDivide, Word16 *e_div ); static Word16 Find_bit_alloc_IVAS_int( const Word32 core_brate, const Word16 GSC_IVAS_mode, const Word16 Diff_len, const Word16 nb_tot_bands, const Word16 L_frame, Word16 *bit, Word16 *max_ener_band, float *ener_vec, float *bits_per_bands ); static Word16 Find_bit_alloc_IVAS( const Word32 core_brate, const Word16 GSC_IVAS_mode, const Word16 Diff_len, const Word16 nb_tot_bands, const Word16 L_frame, Word16 *bit, Word16 *max_ener_band, float *ener_vec, float *bits_per_bands ); static Word16 maximum_fx( const Word16 *vec_fx, const Word16 lvec_fx, Word16 *max_fx ); Loading Loading @@ -223,7 +223,7 @@ void bands_and_bit_alloc( { if ( GSC_IVAS_mode > 0 ) { nb_tot_bands = (int16_t) Find_bit_alloc_IVAS_int( (Word32) core_brate, (Word16) GSC_IVAS_mode, (Word16) Diff_len, (Word16) nb_tot_bands, (Word16) L_frame, (Word16 *) bit, (Word16 *) max_ener_band, ener_vec, bits_per_bands ); nb_tot_bands = (int16_t) Find_bit_alloc_IVAS( (Word32) core_brate, (Word16) GSC_IVAS_mode, (Word16) Diff_len, (Word16) nb_tot_bands, (Word16) L_frame, (Word16 *) bit, (Word16 *) max_ener_band, ener_vec, bits_per_bands ); nb_bands = nb_tot_bands; } else if ( GSC_noisy_speech ) Loading Loading @@ -789,13 +789,13 @@ static float Find_bit_frac( /*-------------------------------------------------------------------* * Find_bit_alloc_IVAS_int() * Find_bit_alloc_IVAS() * * *-------------------------------------------------------------------*/ /*! r: Number of bands to encode */ static Word16 Find_bit_alloc_IVAS_int( static Word16 Find_bit_alloc_IVAS( const Word32 core_brate, /* i : core bit rate */ const Word16 GSC_IVAS_mode, /* i : GSC IVAS mode */ const Word16 Diff_len, /* i : Length of the difference signal (before pure spectral)*/ Loading Loading @@ -1022,13 +1022,21 @@ static Word16 Find_bit_alloc_IVAS_int( sum_bit = L_add( sum_bit, L_sub( bits_per_bands[i], Q18_112 ) ); /* bits_per_bands[i] = 112; */ bits_per_bands[i] = Q18_112; #ifndef FIX_2585_BIT_ALLOCATION_DIFF j = add( j, add( i, 1 ) ); #else j = add( i, 1 ); #endif } /* safety check for overage bit reallocation */ /* else if (bits_per_bands[i] + sum_bit / 3 > 112) */ else if ( L_add( bits_per_bands[i], Mpy_32_16_1( sum_bit, Q15_0_33 ) ) > Q18_112 ) { #ifndef FIX_2585_BIT_ALLOCATION_DIFF j = add( j, add( i, 1 ) ); #else j = add( i, 1 ); #endif } } Loading lib_com/ivas_prot.h +2 −0 Original line number Diff line number Diff line Loading @@ -2950,7 +2950,9 @@ ivas_error stereo_memory_enc( CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const int32_t input_Fs, /* i : input sampling rate */ const int16_t max_bwidth, /* i : maximum audio bandwidth */ #ifndef FIX_1594_TDM_LAST_RATIO float *tdm_last_ratio, /* o : TD stereo last ratio */ #endif const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int16_t nchan_transport /* i : number transport chans */ ); Loading Loading
Workspace_msvc/lib_dec.vcxproj +0 −2 Original line number Diff line number Diff line Loading @@ -270,7 +270,6 @@ <ClCompile Include="..\lib_dec\jbm_jb4_inputbuffer.c" /> <ClCompile Include="..\lib_dec\jbm_jb4_jmf.c" /> <ClCompile Include="..\lib_dec\jbm_pcmdsp_apa.c" /> <ClCompile Include="..\lib_dec\jbm_pcmdsp_fifo.c" /> <ClCompile Include="..\lib_dec\jbm_pcmdsp_similarityestimation.c" /> <ClCompile Include="..\lib_dec\jbm_pcmdsp_window.c" /> <ClCompile Include="..\lib_dec\LD_music_post_filter.c" /> Loading Loading @@ -318,7 +317,6 @@ <ClInclude Include="..\lib_dec\jbm_jb4_inputbuffer.h" /> <ClInclude Include="..\lib_dec\jbm_jb4_jmf.h" /> <ClInclude Include="..\lib_dec\jbm_pcmdsp_apa.h" /> <ClInclude Include="..\lib_dec\jbm_pcmdsp_fifo.h" /> <ClInclude Include="..\lib_dec\jbm_pcmdsp_similarityestimation.h" /> <ClInclude Include="..\lib_dec\jbm_pcmdsp_window.h" /> <ClInclude Include="..\lib_dec\lib_dec.h" /> Loading
Workspace_msvc/lib_dec.vcxproj.filters +0 −6 Original line number Diff line number Diff line Loading @@ -415,9 +415,6 @@ <ClCompile Include="..\lib_dec\jbm_pcmdsp_apa.c"> <Filter>decoder_all_c</Filter> </ClCompile> <ClCompile Include="..\lib_dec\jbm_pcmdsp_fifo.c"> <Filter>decoder_all_c</Filter> </ClCompile> <ClCompile Include="..\lib_dec\jbm_pcmdsp_similarityestimation.c"> <Filter>decoder_all_c</Filter> </ClCompile> Loading Loading @@ -532,9 +529,6 @@ <ClInclude Include="..\lib_dec\jbm_jb4sb.h"> <Filter>decoder_h</Filter> </ClInclude> <ClInclude Include="..\lib_dec\jbm_pcmdsp_fifo.h"> <Filter>decoder_h</Filter> </ClInclude> <ClInclude Include="..\lib_dec\jbm_pcmdsp_apa.h"> <Filter>decoder_h</Filter> </ClInclude> Loading
apps/decoder.c +95 −0 Original line number Diff line number Diff line Loading @@ -498,6 +498,7 @@ int main( } } #ifndef FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT #ifdef DEBUGGING /*-----------------------------------------------------------------* * Preview bitstream and print config information Loading Loading @@ -587,6 +588,7 @@ int main( fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif #endif /*-------------------------------------------------------------------* Loading Loading @@ -777,6 +779,99 @@ int main( hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; } #ifdef FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT #ifdef DEBUGGING /*-----------------------------------------------------------------* * Preview bitstream and print config information *-----------------------------------------------------------------*/ if ( arg.voipMode ) { if ( ( error = printBitstreamInfoVoip( arg, hBsReader, hIvasDec ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error while previewing VoIP bitstream: %s\n", ivas_error_to_string( error ) ); goto cleanup; } } else { uint16_t bit_stream[IVAS_MAX_BITS_PER_FRAME + 4 * 8]; int16_t num_bits; int16_t bfi = 0; do { if ( BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: input bitstream file %s couldn't be read\n\n", arg.inputBitstreamFilename ); goto cleanup; } } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_5K2 ); BS_Reader_Rewind( hBsReader ); IVAS_DEC_PrintConfigWithBitstream( hIvasDec, arg.quietModeEnabled, bit_stream, num_bits ); #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmEnabled ) { if ( arg.tsmScaleFileEnabled ) { fprintf( stdout, "Variable speed file: %s\n", arg.tsmScaleFileName ); } else { fprintf( stdout, "Variable speed factor: %i\n", arg.tsmScale ); } } #endif } /*-----------------------------------------------------------------* * Open Error pattern file for simulation *-----------------------------------------------------------------*/ if ( arg.FEPatternFileName != NULL ) { if ( ( FEC_pattern = fopen( arg.FEPatternFileName, "rb" ) ) == NULL ) { fprintf( stderr, "Error: Missing or incorrect FEC filename specification\n\n" ); usage_dec(); goto cleanup; } } #ifdef DEBUG_SBA_AUDIO_DUMP ivas_open_sba_decoder_debug_files( arg.output_Fs, 1, 1 ); #endif /*-----------------------------------------------------------------* * Print information about FEC *-----------------------------------------------------------------*/ if ( !arg.voipMode && ( arg.FEPatternFileName != NULL || arg.FER > 0 ) ) { if ( arg.FEPatternFileName != NULL ) { fprintf( stdout, "FEC: %s\n", arg.FEPatternFileName ); } else { fprintf( stdout, "FEC: %.2f %%\n", arg.FER ); } } #else /*-----------------------------------------------------------------* * Print config information *-----------------------------------------------------------------*/ if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #endif #endif /*------------------------------------------------------------------------------------------* * Allocate output data buffer *------------------------------------------------------------------------------------------*/ Loading
lib_com/gs_bitallocation.c +12 −4 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ static void reajust_bits( float *bits_per_bands, const int16_t st_band, const in static Word16 Find_norm_inv( const Word32 ToDivide, Word16 *e_div ); static Word16 Find_bit_alloc_IVAS_int( const Word32 core_brate, const Word16 GSC_IVAS_mode, const Word16 Diff_len, const Word16 nb_tot_bands, const Word16 L_frame, Word16 *bit, Word16 *max_ener_band, float *ener_vec, float *bits_per_bands ); static Word16 Find_bit_alloc_IVAS( const Word32 core_brate, const Word16 GSC_IVAS_mode, const Word16 Diff_len, const Word16 nb_tot_bands, const Word16 L_frame, Word16 *bit, Word16 *max_ener_band, float *ener_vec, float *bits_per_bands ); static Word16 maximum_fx( const Word16 *vec_fx, const Word16 lvec_fx, Word16 *max_fx ); Loading Loading @@ -223,7 +223,7 @@ void bands_and_bit_alloc( { if ( GSC_IVAS_mode > 0 ) { nb_tot_bands = (int16_t) Find_bit_alloc_IVAS_int( (Word32) core_brate, (Word16) GSC_IVAS_mode, (Word16) Diff_len, (Word16) nb_tot_bands, (Word16) L_frame, (Word16 *) bit, (Word16 *) max_ener_band, ener_vec, bits_per_bands ); nb_tot_bands = (int16_t) Find_bit_alloc_IVAS( (Word32) core_brate, (Word16) GSC_IVAS_mode, (Word16) Diff_len, (Word16) nb_tot_bands, (Word16) L_frame, (Word16 *) bit, (Word16 *) max_ener_band, ener_vec, bits_per_bands ); nb_bands = nb_tot_bands; } else if ( GSC_noisy_speech ) Loading Loading @@ -789,13 +789,13 @@ static float Find_bit_frac( /*-------------------------------------------------------------------* * Find_bit_alloc_IVAS_int() * Find_bit_alloc_IVAS() * * *-------------------------------------------------------------------*/ /*! r: Number of bands to encode */ static Word16 Find_bit_alloc_IVAS_int( static Word16 Find_bit_alloc_IVAS( const Word32 core_brate, /* i : core bit rate */ const Word16 GSC_IVAS_mode, /* i : GSC IVAS mode */ const Word16 Diff_len, /* i : Length of the difference signal (before pure spectral)*/ Loading Loading @@ -1022,13 +1022,21 @@ static Word16 Find_bit_alloc_IVAS_int( sum_bit = L_add( sum_bit, L_sub( bits_per_bands[i], Q18_112 ) ); /* bits_per_bands[i] = 112; */ bits_per_bands[i] = Q18_112; #ifndef FIX_2585_BIT_ALLOCATION_DIFF j = add( j, add( i, 1 ) ); #else j = add( i, 1 ); #endif } /* safety check for overage bit reallocation */ /* else if (bits_per_bands[i] + sum_bit / 3 > 112) */ else if ( L_add( bits_per_bands[i], Mpy_32_16_1( sum_bit, Q15_0_33 ) ) > Q18_112 ) { #ifndef FIX_2585_BIT_ALLOCATION_DIFF j = add( j, add( i, 1 ) ); #else j = add( i, 1 ); #endif } } Loading
lib_com/ivas_prot.h +2 −0 Original line number Diff line number Diff line Loading @@ -2950,7 +2950,9 @@ ivas_error stereo_memory_enc( CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const int32_t input_Fs, /* i : input sampling rate */ const int16_t max_bwidth, /* i : maximum audio bandwidth */ #ifndef FIX_1594_TDM_LAST_RATIO float *tdm_last_ratio, /* o : TD stereo last ratio */ #endif const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int16_t nchan_transport /* i : number transport chans */ ); Loading