Loading .gitignore 0 → 100644 +1 −0 Original line number Diff line number Diff line No newline at end of file .gitlab-ci.yml +1 −1 Original line number Diff line number Diff line Loading @@ -596,7 +596,7 @@ clang-format-check: extends: - .test-job-linux rules: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "ivas-float-update") - if: $CI_PIPELINE_SOURCE == 'push' when: never - if: $CI_PIPELINE_SOURCE == 'schedule' Loading LICENSE.md +1 −1 Original line number Diff line number Diff line /****************************************************************************************************** (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, (C) 2022-2025 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 Loading apps/decoder.c +59 −62 Original line number Diff line number Diff line /****************************************************************************************************** (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, (C) 2022-2025 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 Loading Loading @@ -278,8 +278,7 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { fprintf( stderr, "\nError: Head-rotation file file cannot be used in this output configuration.\n\n" ); goto cleanup; Loading Loading @@ -379,8 +378,7 @@ int main( if ( arg.renderConfigEnabled ) { /* sanity check */ if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { fprintf( stderr, "\nError: Renderer configuration file cannot be used in this output configuration.\n\n" ); goto cleanup; Loading Loading @@ -2697,8 +2695,7 @@ static ivas_error decodeVoIP( for ( i = 0; i < num_subframes; i++ ) { if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading apps/encoder.c +159 −3 Original line number Diff line number Diff line /****************************************************************************************************** (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, (C) 2022-2025 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 Loading Loading @@ -43,6 +43,19 @@ #endif #include "wmc_auto.h" #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. We have to define _CRT_INTERNAL_NONSTDC_NAMES 1 before #including sys/stat.h in order for Microsoft's stat.h to define names like S_IFMT, S_IFREG, and S_IFDIR, rather than just defining _S_IFMT, _S_IFREG, and _S_IFDIR as it normally does. */ #include <sys/stat.h> #if !defined( S_ISREG ) && defined( S_IFMT ) && defined( S_IFREG ) #define S_ISREG( m ) ( ( (m) &S_IFMT ) == S_IFREG ) #endif #if !defined( S_ISDIR ) && defined( S_IFMT ) && defined( S_IFDIR ) #define S_ISDIR( m ) ( ( (m) &S_IFMT ) == S_IFDIR ) #endif #endif #define WMC_TOOL_SKIP Loading Loading @@ -134,6 +147,9 @@ typedef struct #ifdef DEBUGGING IVAS_ENC_FORCED_MODE forcedMode; const char *forcedModeFile; #ifdef DEBUG_FORCE_DIR const char *forcedModeDir; #endif #ifdef DEBUG_AGC_ENCODER_CMD_OPTION IVAS_ENC_AGC agc; #endif Loading Loading @@ -368,6 +384,15 @@ int main( goto cleanup; } #ifdef SUPPORT_FORCE_TCX10_TCX20 #ifdef DEBUGGING if ( arg.forcedMode == IVAS_ENC_FORCE_TCX10 && totalBitrate < 48000 ) { fprintf( stderr, "Warning: Enforcing the TCX10 mode is only supported for bitrates higher or equal than 48 kbps!\n\n" ); } #endif #endif /*------------------------------------------------------------------------------------------* * Configure and initialize (allocate memory for static variables) the encoder *------------------------------------------------------------------------------------------*/ Loading Loading @@ -710,7 +735,12 @@ int main( /* Force mode not set when configuring, set in first frame even if not reading from file */ if ( f_forcedModeProfile || frame == 0 ) { if ( ( error = IVAS_ENC_SetForcedMode( hIvasEnc, forcedMode ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_ENC_SetForcedMode( hIvasEnc, forcedMode #ifdef DEBUG_FORCE_DIR , arg.forcedModeDir #endif ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_ENC_SetForcedMode failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; Loading Loading @@ -899,6 +929,9 @@ static void initArgStruct( EncArguments *arg ) #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; #ifdef DEBUG_FORCE_DIR arg->forcedModeDir = NULL; #endif #ifdef DEBUG_AGC_ENCODER_CMD_OPTION arg->agc = IVAS_ENC_AGC_UNDEFINED; #endif Loading Loading @@ -1049,6 +1082,28 @@ static bool parseCmdlIVAS_enc( arg->forcedMode = parseForcedMode( stmp ); #ifdef DEBUG_FORCE_DIR if ( arg->forcedMode < IVAS_ENC_FORCE_FILE ) { fprintf( stdout, "Forcing codec to: %s\n", argv[i + 1] ); } else if ( arg->forcedMode == IVAS_ENC_FORCE_FILE ) { arg->forcedModeFile = argv[i + 1]; fprintf( stdout, "Force switching file: %s\n", argv[i + 1] ); } else if ( arg->forcedMode == IVAS_ENC_FORCE_DIR ) { arg->forcedModeDir = argv[i + 1]; fprintf( stdout, "Forcing switching directory: %s\n", argv[i + 1] ); } else { fprintf( stderr, "\nError: The force switching profile file/dir %s does not exist or could not be opened!\n\n", argv[i + 1] ); usage_enc(); return false; } #else if ( arg->forcedMode == IVAS_ENC_FORCE_UNDEFINED ) { arg->forcedModeFile = argv[i + 1]; Loading @@ -1056,8 +1111,26 @@ static bool parseCmdlIVAS_enc( } else { #ifdef SUPPORT_FORCE_TCX10_TCX20 if ( arg->forcedMode == IVAS_ENC_FORCE_TCX10 ) { strcpy( stmp, "TCX10" ); } else if ( arg->forcedMode == IVAS_ENC_FORCE_TCX20 ) { strcpy( stmp, "TCX20" ); } else { strncpy( stmp, argv[i + 1], sizeof( stmp ) ); } fprintf( stdout, "Forcing codec to: %s\n", stmp ); #else fprintf( stdout, "Forcing codec to: %s\n", argv[i + 1] ); #endif } #endif i += 2; } Loading Loading @@ -1897,6 +1970,9 @@ static void usage_enc( void ) #ifdef DEBUGGING fprintf( stdout, "-force T : Force specific mode, T = (speech, music, ACELP, GSC, TCX, HQ),\n" ); fprintf( stdout, " alternatively, T can be a text file where each line contains \"nb_frames T\"\n" ); #ifdef DEBUG_FORCE_DIR fprintf( stdout, " or T can be a directory containing external binary files for modes/parameters enforcement\n" ); #endif #ifdef DEBUG_SBA fprintf( stdout, "-tag : Tag name for intermediate debug files\n" ); #endif Loading Loading @@ -2014,8 +2090,73 @@ static bool readBitrate( static IVAS_ENC_FORCED_MODE parseForcedMode( char *forcedModeChar ) { #ifdef DEBUG_FORCE_DIR struct stat path_stat; #endif to_upper( forcedModeChar ); #ifdef DEBUG_FORCE_DIR if ( ( strcmp( forcedModeChar, "SPEECH" ) == 0 ) || ( strcmp( forcedModeChar, "'SPEECH'" ) == 0 ) || ( strcmp( forcedModeChar, "0" ) == 0 ) ) { return IVAS_ENC_FORCE_SPEECH; } else if ( ( strcmp( forcedModeChar, "MUSIC" ) == 0 ) || ( strcmp( forcedModeChar, "'MUSIC'" ) == 0 ) || ( strcmp( forcedModeChar, "AUDIO" ) == 0 ) || ( strcmp( forcedModeChar, "'AUDIO'" ) == 0 ) || ( strcmp( forcedModeChar, "1" ) == 0 ) ) { return IVAS_ENC_FORCE_MUSIC; } else if ( ( strcmp( forcedModeChar, "ACELP" ) == 0 ) || ( strcmp( forcedModeChar, "'ACELP'" ) == 0 ) ) { return IVAS_ENC_FORCE_ACELP; } else if ( ( strcmp( forcedModeChar, "GSC" ) == 0 ) || ( strcmp( forcedModeChar, "'GSC'" ) == 0 ) ) { return IVAS_ENC_FORCE_GSC; } if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 ) #ifdef SUPPORT_FORCE_TCX10_TCX20 || ( strcmp( forcedModeChar, "TCX20" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX20'" ) == 0 ) #endif ) { #ifdef SUPPORT_FORCE_TCX10_TCX20 return IVAS_ENC_FORCE_TCX20; #else return IVAS_ENC_FORCE_TCX; #endif } #ifdef SUPPORT_FORCE_TCX10_TCX20 if ( ( strcmp( forcedModeChar, "TCX10" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX10'" ) == 0 ) ) { return IVAS_ENC_FORCE_TCX10; } #endif else if ( ( strcmp( forcedModeChar, "HQ" ) == 0 ) || ( strcmp( forcedModeChar, "'HQ'" ) == 0 ) ) { return IVAS_ENC_FORCE_HQ; } else { if ( stat( forcedModeChar, &path_stat ) != 0 ) { return IVAS_ENC_FORCE_UNDEFINED; } /* check if the argument represents an existing file or directory */ if ( S_ISDIR( path_stat.st_mode ) ) { /* it's a directory */ return IVAS_ENC_FORCE_DIR; } else { /* it's a file */ return IVAS_ENC_FORCE_FILE; } } #else if ( ( strcmp( forcedModeChar, "SPEECH" ) == 0 ) || ( strcmp( forcedModeChar, "'SPEECH'" ) == 0 ) || ( strcmp( forcedModeChar, "0" ) == 0 ) ) { Loading @@ -2033,16 +2174,31 @@ static IVAS_ENC_FORCED_MODE parseForcedMode( { return IVAS_ENC_FORCE_GSC; } if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 ) ) if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 ) #ifdef SUPPORT_FORCE_TCX10_TCX20 || ( strcmp( forcedModeChar, "TCX20" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX20'" ) == 0 ) #endif ) { #ifdef SUPPORT_FORCE_TCX10_TCX20 return IVAS_ENC_FORCE_TCX20; #else return IVAS_ENC_FORCE_TCX; #endif } #ifdef SUPPORT_FORCE_TCX10_TCX20 if ( ( strcmp( forcedModeChar, "TCX10" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX10'" ) == 0 ) ) { return IVAS_ENC_FORCE_TCX10; } #endif if ( ( strcmp( forcedModeChar, "HQ" ) == 0 ) || ( strcmp( forcedModeChar, "'HQ'" ) == 0 ) ) { return IVAS_ENC_FORCE_HQ; } return IVAS_ENC_FORCE_UNDEFINED; #endif } Loading Loading
.gitignore 0 → 100644 +1 −0 Original line number Diff line number Diff line No newline at end of file
.gitlab-ci.yml +1 −1 Original line number Diff line number Diff line Loading @@ -596,7 +596,7 @@ clang-format-check: extends: - .test-job-linux rules: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "ivas-float-update") - if: $CI_PIPELINE_SOURCE == 'push' when: never - if: $CI_PIPELINE_SOURCE == 'schedule' Loading
LICENSE.md +1 −1 Original line number Diff line number Diff line /****************************************************************************************************** (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, (C) 2022-2025 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 Loading
apps/decoder.c +59 −62 Original line number Diff line number Diff line /****************************************************************************************************** (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, (C) 2022-2025 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 Loading Loading @@ -278,8 +278,7 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { fprintf( stderr, "\nError: Head-rotation file file cannot be used in this output configuration.\n\n" ); goto cleanup; Loading Loading @@ -379,8 +378,7 @@ int main( if ( arg.renderConfigEnabled ) { /* sanity check */ if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { fprintf( stderr, "\nError: Renderer configuration file cannot be used in this output configuration.\n\n" ); goto cleanup; Loading Loading @@ -2697,8 +2695,7 @@ static ivas_error decodeVoIP( for ( i = 0; i < num_subframes; i++ ) { if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions[i], Pos[i], i ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; Loading
apps/encoder.c +159 −3 Original line number Diff line number Diff line /****************************************************************************************************** (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, (C) 2022-2025 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 Loading Loading @@ -43,6 +43,19 @@ #endif #include "wmc_auto.h" #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. We have to define _CRT_INTERNAL_NONSTDC_NAMES 1 before #including sys/stat.h in order for Microsoft's stat.h to define names like S_IFMT, S_IFREG, and S_IFDIR, rather than just defining _S_IFMT, _S_IFREG, and _S_IFDIR as it normally does. */ #include <sys/stat.h> #if !defined( S_ISREG ) && defined( S_IFMT ) && defined( S_IFREG ) #define S_ISREG( m ) ( ( (m) &S_IFMT ) == S_IFREG ) #endif #if !defined( S_ISDIR ) && defined( S_IFMT ) && defined( S_IFDIR ) #define S_ISDIR( m ) ( ( (m) &S_IFMT ) == S_IFDIR ) #endif #endif #define WMC_TOOL_SKIP Loading Loading @@ -134,6 +147,9 @@ typedef struct #ifdef DEBUGGING IVAS_ENC_FORCED_MODE forcedMode; const char *forcedModeFile; #ifdef DEBUG_FORCE_DIR const char *forcedModeDir; #endif #ifdef DEBUG_AGC_ENCODER_CMD_OPTION IVAS_ENC_AGC agc; #endif Loading Loading @@ -368,6 +384,15 @@ int main( goto cleanup; } #ifdef SUPPORT_FORCE_TCX10_TCX20 #ifdef DEBUGGING if ( arg.forcedMode == IVAS_ENC_FORCE_TCX10 && totalBitrate < 48000 ) { fprintf( stderr, "Warning: Enforcing the TCX10 mode is only supported for bitrates higher or equal than 48 kbps!\n\n" ); } #endif #endif /*------------------------------------------------------------------------------------------* * Configure and initialize (allocate memory for static variables) the encoder *------------------------------------------------------------------------------------------*/ Loading Loading @@ -710,7 +735,12 @@ int main( /* Force mode not set when configuring, set in first frame even if not reading from file */ if ( f_forcedModeProfile || frame == 0 ) { if ( ( error = IVAS_ENC_SetForcedMode( hIvasEnc, forcedMode ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_ENC_SetForcedMode( hIvasEnc, forcedMode #ifdef DEBUG_FORCE_DIR , arg.forcedModeDir #endif ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_ENC_SetForcedMode failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; Loading Loading @@ -899,6 +929,9 @@ static void initArgStruct( EncArguments *arg ) #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; #ifdef DEBUG_FORCE_DIR arg->forcedModeDir = NULL; #endif #ifdef DEBUG_AGC_ENCODER_CMD_OPTION arg->agc = IVAS_ENC_AGC_UNDEFINED; #endif Loading Loading @@ -1049,6 +1082,28 @@ static bool parseCmdlIVAS_enc( arg->forcedMode = parseForcedMode( stmp ); #ifdef DEBUG_FORCE_DIR if ( arg->forcedMode < IVAS_ENC_FORCE_FILE ) { fprintf( stdout, "Forcing codec to: %s\n", argv[i + 1] ); } else if ( arg->forcedMode == IVAS_ENC_FORCE_FILE ) { arg->forcedModeFile = argv[i + 1]; fprintf( stdout, "Force switching file: %s\n", argv[i + 1] ); } else if ( arg->forcedMode == IVAS_ENC_FORCE_DIR ) { arg->forcedModeDir = argv[i + 1]; fprintf( stdout, "Forcing switching directory: %s\n", argv[i + 1] ); } else { fprintf( stderr, "\nError: The force switching profile file/dir %s does not exist or could not be opened!\n\n", argv[i + 1] ); usage_enc(); return false; } #else if ( arg->forcedMode == IVAS_ENC_FORCE_UNDEFINED ) { arg->forcedModeFile = argv[i + 1]; Loading @@ -1056,8 +1111,26 @@ static bool parseCmdlIVAS_enc( } else { #ifdef SUPPORT_FORCE_TCX10_TCX20 if ( arg->forcedMode == IVAS_ENC_FORCE_TCX10 ) { strcpy( stmp, "TCX10" ); } else if ( arg->forcedMode == IVAS_ENC_FORCE_TCX20 ) { strcpy( stmp, "TCX20" ); } else { strncpy( stmp, argv[i + 1], sizeof( stmp ) ); } fprintf( stdout, "Forcing codec to: %s\n", stmp ); #else fprintf( stdout, "Forcing codec to: %s\n", argv[i + 1] ); #endif } #endif i += 2; } Loading Loading @@ -1897,6 +1970,9 @@ static void usage_enc( void ) #ifdef DEBUGGING fprintf( stdout, "-force T : Force specific mode, T = (speech, music, ACELP, GSC, TCX, HQ),\n" ); fprintf( stdout, " alternatively, T can be a text file where each line contains \"nb_frames T\"\n" ); #ifdef DEBUG_FORCE_DIR fprintf( stdout, " or T can be a directory containing external binary files for modes/parameters enforcement\n" ); #endif #ifdef DEBUG_SBA fprintf( stdout, "-tag : Tag name for intermediate debug files\n" ); #endif Loading Loading @@ -2014,8 +2090,73 @@ static bool readBitrate( static IVAS_ENC_FORCED_MODE parseForcedMode( char *forcedModeChar ) { #ifdef DEBUG_FORCE_DIR struct stat path_stat; #endif to_upper( forcedModeChar ); #ifdef DEBUG_FORCE_DIR if ( ( strcmp( forcedModeChar, "SPEECH" ) == 0 ) || ( strcmp( forcedModeChar, "'SPEECH'" ) == 0 ) || ( strcmp( forcedModeChar, "0" ) == 0 ) ) { return IVAS_ENC_FORCE_SPEECH; } else if ( ( strcmp( forcedModeChar, "MUSIC" ) == 0 ) || ( strcmp( forcedModeChar, "'MUSIC'" ) == 0 ) || ( strcmp( forcedModeChar, "AUDIO" ) == 0 ) || ( strcmp( forcedModeChar, "'AUDIO'" ) == 0 ) || ( strcmp( forcedModeChar, "1" ) == 0 ) ) { return IVAS_ENC_FORCE_MUSIC; } else if ( ( strcmp( forcedModeChar, "ACELP" ) == 0 ) || ( strcmp( forcedModeChar, "'ACELP'" ) == 0 ) ) { return IVAS_ENC_FORCE_ACELP; } else if ( ( strcmp( forcedModeChar, "GSC" ) == 0 ) || ( strcmp( forcedModeChar, "'GSC'" ) == 0 ) ) { return IVAS_ENC_FORCE_GSC; } if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 ) #ifdef SUPPORT_FORCE_TCX10_TCX20 || ( strcmp( forcedModeChar, "TCX20" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX20'" ) == 0 ) #endif ) { #ifdef SUPPORT_FORCE_TCX10_TCX20 return IVAS_ENC_FORCE_TCX20; #else return IVAS_ENC_FORCE_TCX; #endif } #ifdef SUPPORT_FORCE_TCX10_TCX20 if ( ( strcmp( forcedModeChar, "TCX10" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX10'" ) == 0 ) ) { return IVAS_ENC_FORCE_TCX10; } #endif else if ( ( strcmp( forcedModeChar, "HQ" ) == 0 ) || ( strcmp( forcedModeChar, "'HQ'" ) == 0 ) ) { return IVAS_ENC_FORCE_HQ; } else { if ( stat( forcedModeChar, &path_stat ) != 0 ) { return IVAS_ENC_FORCE_UNDEFINED; } /* check if the argument represents an existing file or directory */ if ( S_ISDIR( path_stat.st_mode ) ) { /* it's a directory */ return IVAS_ENC_FORCE_DIR; } else { /* it's a file */ return IVAS_ENC_FORCE_FILE; } } #else if ( ( strcmp( forcedModeChar, "SPEECH" ) == 0 ) || ( strcmp( forcedModeChar, "'SPEECH'" ) == 0 ) || ( strcmp( forcedModeChar, "0" ) == 0 ) ) { Loading @@ -2033,16 +2174,31 @@ static IVAS_ENC_FORCED_MODE parseForcedMode( { return IVAS_ENC_FORCE_GSC; } if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 ) ) if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 ) #ifdef SUPPORT_FORCE_TCX10_TCX20 || ( strcmp( forcedModeChar, "TCX20" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX20'" ) == 0 ) #endif ) { #ifdef SUPPORT_FORCE_TCX10_TCX20 return IVAS_ENC_FORCE_TCX20; #else return IVAS_ENC_FORCE_TCX; #endif } #ifdef SUPPORT_FORCE_TCX10_TCX20 if ( ( strcmp( forcedModeChar, "TCX10" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX10'" ) == 0 ) ) { return IVAS_ENC_FORCE_TCX10; } #endif if ( ( strcmp( forcedModeChar, "HQ" ) == 0 ) || ( strcmp( forcedModeChar, "'HQ'" ) == 0 ) ) { return IVAS_ENC_FORCE_HQ; } return IVAS_ENC_FORCE_UNDEFINED; #endif } Loading