Loading Workspace_msvc/lib_rend.vcxproj +1 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed> <OmitFramePointers>false</OmitFramePointers> <EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations> <AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <ExceptionHandling /> Loading apps/decoder.c +10 −0 Original line number Diff line number Diff line Loading @@ -1794,6 +1794,15 @@ cleanup: #endif #endif #ifdef MC_JBM #ifdef SUPPORT_JBM_TRACEFILE static ivas_error writeJbmTraceFileFrameWrapper( const void *data, void *writer ) { return JbmTraceFileWriter_writeFrame( data, writer ); } #endif #endif /*---------------------------------------------------------------------* * decodeVoIP() Loading Loading @@ -2042,6 +2051,7 @@ static ivas_error decodeVoIP( if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, pcmBuf, systemTime_ms #ifdef SUPPORT_JBM_TRACEFILE , writeJbmTraceFileFrameWrapper, jbmTraceWriter #endif ) ) != IVAS_ERR_OK ) Loading lib_com/ivas_tools.c +88 −0 Original line number Diff line number Diff line Loading @@ -1007,6 +1007,26 @@ void lls_interp_n( return; } #ifdef FIX_ANGLE_WRAPPING /* helper function for panning_wrap_angles */ static float wrap_azi( const float azi_deg ) { float azi = azi_deg; /* Wrap azimuth value */ while ( azi > 180 ) { azi -= 360.0f; } while ( azi <= -180 ) { azi += 360; } return azi; } /*-------------------------------------------------------------------* * panning_wrap_angles() Loading @@ -1016,7 +1036,74 @@ void lls_interp_n( * elevation = [-90, 90] * Considers direction changes from large elevation values *-------------------------------------------------------------------*/ void panning_wrap_angles( const float azi_deg, /* i : azimuth in degrees for panning direction (positive left) */ const float ele_deg, /* i : elevation in degrees for panning direction (positive up) */ float *azi_wrapped, /* o : wrapped azimuth component */ float *ele_wrapped /* o : wrapped elevation component */ ) { float azi, ele; azi = azi_deg; ele = ele_deg; if ( fabsf( ele ) < 90 ) { *ele_wrapped = ele; *azi_wrapped = wrap_azi( azi ); return; } else { /* Special case when elevation is a multiple of 90; azimuth is irrelevant */ if ( ( fmodf( ele, 90 ) == 0 ) && ( fmodf( ele, 180 ) != 0 ) ) { *azi_wrapped = 0; while ( ele > 90 ) { ele -= 360; } while ( ele < -90 ) { ele += 360; } *ele_wrapped = ele; } else { /* Wrap elevation and adjust azimuth accordingly */ while ( fabsf( ele ) > 90 ) { /* Flip to other hemisphere */ azi += 180; /* Compensate elevation accordingly */ if ( ele > 90 ) { ele = 180 - ele; } else if ( ele < -90 ) { ele = -180 - ele; } } *azi_wrapped = wrap_azi( azi ); *ele_wrapped = ele; } return; } } #else /*-------------------------------------------------------------------* * panning_wrap_angles() * * Wrap angles for amplitude panning to the range: * azimuth = (-180, 180] * elevation = [-90, 90] * Considers direction changes from large elevation values *-------------------------------------------------------------------*/ void panning_wrap_angles( const float azi_deg, /* i : azimuth in degrees for panning direction (positive left) */ const float ele_deg, /* i : elevation in degrees for panning direction (positive up) */ Loading Loading @@ -1080,6 +1167,7 @@ void panning_wrap_angles( return; } #endif /*-------------------------------------------------------------------------* * v_sort_ind() Loading lib_com/options.h 100755 → 100644 +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ #define MC_BITRATE_SWITCHING /* Issue 116: support bitrate switching in MC format */ #define MC_JBM /* FhG: extend JBM beyond mono for running IVAS in VoIP mode (contribution 19) */ #define FIX_265_MC_BRATE_SWITCHING /* Issue 265: fix use-of-uninitialized-value in MC bitrate switching */ #define FIX_ANGLE_WRAPPING /* Issue 244: Problems with angle wrapping*/ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading lib_dec/lib_dec.c +5 −4 Original line number Diff line number Diff line Loading @@ -1383,7 +1383,8 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #ifdef MC_JBM #ifdef SUPPORT_JBM_TRACEFILE , JbmTraceFileWriter *jbmTraceFileWriter JbmTraceFileWriterFn jbmWriterFn, void *jbmWriter #endif #endif ) Loading Loading @@ -1604,12 +1605,12 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #ifdef MC_JBM #ifdef SUPPORT_JBM_TRACEFILE /* jbmTraceFileWriter may be NULL if tracefile writing was not requested on CLI */ if ( jbmTraceFileWriter != NULL ) /* 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 ( ( JbmTraceFileWriter_writeFrame( &hVoIP->JbmTraceData, jbmTraceFileWriter ) ) != IVAS_ERR_OK ) if ( ( jbmWriterFn( &hVoIP->JbmTraceData, jbmWriter ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError writing JBM Trace data to file\n" ); return IVAS_ERR_UNKNOWN; Loading Loading
Workspace_msvc/lib_rend.vcxproj +1 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed> <OmitFramePointers>false</OmitFramePointers> <EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations> <AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <ExceptionHandling /> Loading
apps/decoder.c +10 −0 Original line number Diff line number Diff line Loading @@ -1794,6 +1794,15 @@ cleanup: #endif #endif #ifdef MC_JBM #ifdef SUPPORT_JBM_TRACEFILE static ivas_error writeJbmTraceFileFrameWrapper( const void *data, void *writer ) { return JbmTraceFileWriter_writeFrame( data, writer ); } #endif #endif /*---------------------------------------------------------------------* * decodeVoIP() Loading Loading @@ -2042,6 +2051,7 @@ static ivas_error decodeVoIP( if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, pcmBuf, systemTime_ms #ifdef SUPPORT_JBM_TRACEFILE , writeJbmTraceFileFrameWrapper, jbmTraceWriter #endif ) ) != IVAS_ERR_OK ) Loading
lib_com/ivas_tools.c +88 −0 Original line number Diff line number Diff line Loading @@ -1007,6 +1007,26 @@ void lls_interp_n( return; } #ifdef FIX_ANGLE_WRAPPING /* helper function for panning_wrap_angles */ static float wrap_azi( const float azi_deg ) { float azi = azi_deg; /* Wrap azimuth value */ while ( azi > 180 ) { azi -= 360.0f; } while ( azi <= -180 ) { azi += 360; } return azi; } /*-------------------------------------------------------------------* * panning_wrap_angles() Loading @@ -1016,7 +1036,74 @@ void lls_interp_n( * elevation = [-90, 90] * Considers direction changes from large elevation values *-------------------------------------------------------------------*/ void panning_wrap_angles( const float azi_deg, /* i : azimuth in degrees for panning direction (positive left) */ const float ele_deg, /* i : elevation in degrees for panning direction (positive up) */ float *azi_wrapped, /* o : wrapped azimuth component */ float *ele_wrapped /* o : wrapped elevation component */ ) { float azi, ele; azi = azi_deg; ele = ele_deg; if ( fabsf( ele ) < 90 ) { *ele_wrapped = ele; *azi_wrapped = wrap_azi( azi ); return; } else { /* Special case when elevation is a multiple of 90; azimuth is irrelevant */ if ( ( fmodf( ele, 90 ) == 0 ) && ( fmodf( ele, 180 ) != 0 ) ) { *azi_wrapped = 0; while ( ele > 90 ) { ele -= 360; } while ( ele < -90 ) { ele += 360; } *ele_wrapped = ele; } else { /* Wrap elevation and adjust azimuth accordingly */ while ( fabsf( ele ) > 90 ) { /* Flip to other hemisphere */ azi += 180; /* Compensate elevation accordingly */ if ( ele > 90 ) { ele = 180 - ele; } else if ( ele < -90 ) { ele = -180 - ele; } } *azi_wrapped = wrap_azi( azi ); *ele_wrapped = ele; } return; } } #else /*-------------------------------------------------------------------* * panning_wrap_angles() * * Wrap angles for amplitude panning to the range: * azimuth = (-180, 180] * elevation = [-90, 90] * Considers direction changes from large elevation values *-------------------------------------------------------------------*/ void panning_wrap_angles( const float azi_deg, /* i : azimuth in degrees for panning direction (positive left) */ const float ele_deg, /* i : elevation in degrees for panning direction (positive up) */ Loading Loading @@ -1080,6 +1167,7 @@ void panning_wrap_angles( return; } #endif /*-------------------------------------------------------------------------* * v_sort_ind() Loading
lib_com/options.h 100755 → 100644 +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ #define MC_BITRATE_SWITCHING /* Issue 116: support bitrate switching in MC format */ #define MC_JBM /* FhG: extend JBM beyond mono for running IVAS in VoIP mode (contribution 19) */ #define FIX_265_MC_BRATE_SWITCHING /* Issue 265: fix use-of-uninitialized-value in MC bitrate switching */ #define FIX_ANGLE_WRAPPING /* Issue 244: Problems with angle wrapping*/ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading
lib_dec/lib_dec.c +5 −4 Original line number Diff line number Diff line Loading @@ -1383,7 +1383,8 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #ifdef MC_JBM #ifdef SUPPORT_JBM_TRACEFILE , JbmTraceFileWriter *jbmTraceFileWriter JbmTraceFileWriterFn jbmWriterFn, void *jbmWriter #endif #endif ) Loading Loading @@ -1604,12 +1605,12 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #ifdef MC_JBM #ifdef SUPPORT_JBM_TRACEFILE /* jbmTraceFileWriter may be NULL if tracefile writing was not requested on CLI */ if ( jbmTraceFileWriter != NULL ) /* 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 ( ( JbmTraceFileWriter_writeFrame( &hVoIP->JbmTraceData, jbmTraceFileWriter ) ) != IVAS_ERR_OK ) if ( ( jbmWriterFn( &hVoIP->JbmTraceData, jbmWriter ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError writing JBM Trace data to file\n" ); return IVAS_ERR_UNKNOWN; Loading