diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4f53b30fcd949330bf44268ee8e2e0bf3415c81d..f27836fc82793a351cb2be6b445db592e17a2290 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1844,7 +1844,7 @@ ltv-usan: - ivas-linux-fast artifacts: name: "$CI_JOB_NAME--main--sha-$CI_COMMIT_SHORT_SHA" - expire_in: 2 weeks + expire_in: 4 weeks when: always paths: - ep_015.g192 @@ -2433,8 +2433,25 @@ coverage-test-on-main-scheduled: - unzip artifacts.zip || true # this may fail on first run, when there are no artifacts there and the zip file is actually just "404"-html - ls - public_dir="$CI_JOB_NAME-public" + # if is needed to catch case when no artifact is there (first run), similarly as above - - if [[ -d $public_dir ]]; then mv $public_dir/* wmops/; fi + - if [[ -d $public_dir ]]; then + - mv $public_dir/* wmops/ + # check here if we have the split-by-levels files present - if not, fake them up with the existing global one + # this is needed for the first run with split graphs on a branch where the global version did run previously + # NOTE: checking only for level_1 file here as this should already be sufficient + # NOTE2: also not chechking for RAM for same reason + - wmops_all_global="wmops/log_wmops_all.txt" + - ram_all_global="wmops/log_ram_all.txt" + - if [ -f "${wmops_all_global}" ] && [ ! -f "wmops/log_wmops_all_level_1.txt" ]; then + - declare -a suffixes=("level_1" "level_2" "level_3" "rate_sw") + - for suffix in "${suffixes[@]}"; do + - cp ${wmops_all_global} wmops/log_wmops_all_${suffix}.txt + - cp ${ram_all_global} wmops/log_ram_all_${suffix}.txt + - done + - fi + - fi + - ls wmops - rm artifacts.zip - rm -rf $public_dir @@ -2443,7 +2460,7 @@ coverage-test-on-main-scheduled: &complexity-measurements-prepare-artifacts # prepare artifacts -> move to public directory - public_dir="$CI_JOB_NAME-public" - mkdir $public_dir - - mv -f wmops/log_*_all.txt ./*.js ${public_dir}/ + - mv -f wmops/log_*_all*.txt ./*.js ${public_dir}/ # move logfiles for links - mkdir $public_dir/logs # first move logs diff --git a/apps/decoder.c b/apps/decoder.c index 9f657b5a8c731c3a6df4daa7dc49aa4b2f236d1e..ccc9e77c6b059fdb06773d283e7ba3df3a9bd7a3 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -32,9 +32,7 @@ #include "lib_dec.h" #include -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE #include -#endif #include "cmdl_tools.h" #include "audio_file_writer.h" #include "bitstream_reader.h" @@ -48,9 +46,7 @@ #include "rotation_file_reader.h" #include "aeid_file_reader.h" #include "split_render_file_read_write.h" -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE #include "obj_edit_file_reader.h" -#endif #ifdef VARIABLE_SPEED_DECODING #include "tsm_scale_file_reader.h" #include @@ -157,9 +153,7 @@ typedef struct bool dpidEnabled; uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; bool objEditEnabled; -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE char *objEditFileName; -#endif } DecArguments; @@ -188,24 +182,15 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, IVAS_DEC_HANDLE hIvasDec ); -#else -static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); -static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); -#endif static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); static int16_t app_own_random( int16_t *seed ); static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar ); #endif -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); -#else -static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters ); -#endif /*------------------------------------------------------------------------------------------* * main() @@ -236,9 +221,7 @@ int main( int16_t *pcmBuf = NULL; IVAS_RENDER_FRAMESIZE asked_frame_size; IVAS_DEC_HRTF_BINARY_WRAPPER hHrtfBinary; -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE ObjectEditFileReader *objectEditFileReader = NULL; -#endif #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; @@ -442,7 +425,6 @@ int main( } } -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE /*------------------------------------------------------------------------------------------* * Open object editing instruction file *------------------------------------------------------------------------------------------*/ @@ -455,7 +437,6 @@ int main( goto cleanup; } } -#endif /*------------------------------------------------------------------------------------------* * Configure the decoder @@ -775,19 +756,11 @@ int main( if ( arg.voipMode ) { -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, hIvasDec ); -#else - error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); -#endif } else { -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE error = decodeG192( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, hIvasDec, pcmBuf ); -#else - error = decodeG192( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); -#endif } if ( error == IVAS_ERR_OK || error == IVAS_ERR_END_OF_FILE ) @@ -851,9 +824,7 @@ cleanup: RotationFileReader_close( &refRotReader ); Vector3PairFileReader_close( &referenceVectorReader ); RenderConfigReader_close( &renderConfigReader ); -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE ObjectEditFileReader_close( &objectEditFileReader ); -#endif if ( BS_Reader_Close( &hBsReader ) != IVAS_ERR_OK ) { @@ -1052,9 +1023,7 @@ static bool parseCmdlIVAS_dec( } arg->objEditEnabled = false; -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE arg->objEditFileName = NULL; -#endif /*-----------------------------------------------------------------* * Initialization @@ -1512,7 +1481,6 @@ static bool parseCmdlIVAS_dec( { arg->objEditEnabled = true; i++; -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE if ( argc - i <= 3 || argv[i][0] == '-' ) { fprintf( stderr, "Error: Object editing instruction filename not specified!\n\n" ); @@ -1529,7 +1497,6 @@ static bool parseCmdlIVAS_dec( arg->objEditFileName = argv[i]; /* read edit instructions from this file */ } i++; -#endif } /*-----------------------------------------------------------------* @@ -1732,11 +1699,7 @@ static void usage_dec( void ) fprintf( stdout, "-aeid ID | File : Acoustic environment ID (number > 0)\n" ); fprintf( stdout, " alternatively, it can be a text file where each line contains \"ID duration\"\n" ); fprintf( stdout, " for BINAURAL_ROOM_REVERB output configuration.\n" ); -#ifndef FIX_1217_OBJECT_EDIT_FILE_INTERFACE - fprintf( stdout, "-obj_edit : Enable objects editing\n" ); -#else fprintf( stdout, "-obj_edit File : Object editing instructions file or NULL for built-in example\n" ); -#endif fprintf( stdout, "-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" ); fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" ); fprintf( stdout, "-q : Quiet mode, no frame counter\n" ); @@ -2068,9 +2031,7 @@ static ivas_error decodeG192( RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE ObjectEditFileReader *objectEditFileReader, -#endif ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ) @@ -2468,7 +2429,6 @@ static ivas_error decodeG192( return error; } -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE if ( arg.objEditFileName != NULL ) { if ( ( error = ObjectEditFileReader_readNextFrame( objectEditFileReader ) ) != IVAS_ERR_OK ) @@ -2477,14 +2437,9 @@ static ivas_error decodeG192( return error; } } -#endif /* Do object metadata editing here ... */ -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE do_object_editing( &editableParameters, objectEditFileReader ); -#else - do_object_editing( &editableParameters ); -#endif /* set new object parameters */ if ( ( error = IVAS_DEC_SetEditableParameters( hIvasDec, editableParameters ) ) != IVAS_ERR_OK ) @@ -3007,9 +2962,7 @@ static ivas_error decodeVoIP( RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE ObjectEditFileReader *objectEditFileReader, -#endif IVAS_DEC_HANDLE hIvasDec ) { bool decodingFailed = true; /* Assume failure until cleanup is reached without errors */ @@ -3289,12 +3242,7 @@ static ivas_error decodeVoIP( } } -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE -#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM if ( arg.objEditEnabled && arg.objEditFileName != NULL && vec_pos_update == 0 ) -#else - if ( arg.objEditEnabled && ( arg.objEditFileName != NULL ) ) -#endif { if ( ( error = ObjectEditFileReader_readNextFrame( objectEditFileReader ) ) != IVAS_ERR_OK ) { @@ -3302,7 +3250,6 @@ static ivas_error decodeVoIP( return error; } } -#endif /* read all packets with a receive time smaller than the system time */ while ( nextPacketRcvTime_ms <= systemTime_ms ) @@ -3404,11 +3351,7 @@ static ivas_error decodeVoIP( } /* Do object metadata editing here ... */ -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE do_object_editing( &editableParameters, objectEditFileReader ); -#else - do_object_editing( &editableParameters ); -#endif /* set new object parameters */ if ( ( error = IVAS_DEC_SetEditableParameters( hIvasDec, editableParameters ) ) != IVAS_ERR_OK ) @@ -3536,22 +3479,12 @@ static ivas_error decodeVoIP( } } -#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM - vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; -#else - if ( !arg.quietModeEnabled ) - { - fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); - } vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; - frame++; -#endif if ( vec_pos_update == 0 ) { systemTime_ms += vec_pos_len * systemTimeInc_ms; } -#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM if ( vec_pos_update == 0 ) { frame++; @@ -3560,7 +3493,6 @@ static ivas_error decodeVoIP( fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); } } -#endif #ifdef WMOPS update_mem(); @@ -3723,12 +3655,8 @@ cleanup: *---------------------------------------------------------------------*/ static void do_object_editing( -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ) -#else - IVAS_EDITABLE_PARAMETERS *editableParameters ) -#endif { /* put the objects equally spaced at the horizontal plane */ /* and play a little bit with the gains... */ @@ -3744,7 +3672,6 @@ static void do_object_editing( } } -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE if ( objectEditFileReader != NULL ) { ReadObjectEditInfo *readInfo; @@ -3803,7 +3730,6 @@ static void do_object_editing( } else { -#endif if ( num_nondiegetic_objects ) { float start_angle, angle_inc; @@ -3827,9 +3753,7 @@ static void do_object_editing( } editableParameters->gain_bed = 0.5f; -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE } -#endif return; } diff --git a/ci/complexity_measurements/check_for_changes.py b/ci/complexity_measurements/check_for_changes.py index 2048feb04451f107a63afe02bb1932defb3a6e24..498d0d1a4d3aae4262b529b63d894ebd4833bc23 100644 --- a/ci/complexity_measurements/check_for_changes.py +++ b/ci/complexity_measurements/check_for_changes.py @@ -4,17 +4,20 @@ import sys THRESH = 0.01 -COLS = [ - [3, 5, 7, 9], # wmops_all - [3, 5, 7, 8, 10, 12, 13, 15, 17], # ram_all - [3, 5, 7, 9, 11, 13, 15, 17, 19], # rom_all -] +COLS_WMOPS = [3, 5, 7, 9] +COLS_RAM = [3, 5, 7, 8, 10, 12, 13, 15, 17] +COLS_ROM = [3, 5, 7, 9, 11, 13, 15, 17, 19] def main(args): - linewise_logfiles = [args.wmops_logfile, args.ram_logfile, args.rom_logfile] + linewise_logfiles = [*args.wmops_logfiles, *args.ram_logfiles, args.rom_logfile] + cols = ( + len(args.wmops_logfiles) * [COLS_WMOPS] + + len(args.ram_logfiles) * [COLS_RAM] + + [COLS_ROM] + ) changes_found_linewise = any( - [check_linewise_logfile(f, c) for f, c in zip(linewise_logfiles, COLS)] + [check_linewise_logfile(f, c) for f, c in zip(linewise_logfiles, cols)] ) if changes_found_linewise: @@ -59,9 +62,9 @@ def check_linewise_logfile(filepath, cols): if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument("wmops_logfile") - parser.add_argument("ram_logfile") - parser.add_argument("rom_logfile") + parser.add_argument("--wmops_logfiles", nargs="+") + parser.add_argument("--ram_logfiles", nargs="+") + parser.add_argument("--rom_logfile") args = parser.parse_args() sys.exit(main(args)) diff --git a/ci/complexity_measurements/genWebpageData.py b/ci/complexity_measurements/genWebpageData.py index 89247620e377c9ea46de2489bc8a0390ea2451f1..c3edad36d9972a765bf1ebd159843b343fef00da 100644 --- a/ci/complexity_measurements/genWebpageData.py +++ b/ci/complexity_measurements/genWebpageData.py @@ -90,16 +90,16 @@ RUNS_LINE_IDX = { DISPLAY_IDS = { "wmops": [ - "3xEVS", - "6xEVS", - "10xEVS", + # "3xEVS", + # "6xEVS", + # "10xEVS", "worst case codec", "worst case enc/dec", "worst case enc", "worst case dec", ], "rom": [ - "requirementRom", + # "requirementRom", "TotalRomCodecScore", "maxPROMEncScore", "maxPROMDecScore", @@ -111,7 +111,7 @@ DISPLAY_IDS = { "maxTROMRendScore", ], "ram": [ - "requirementRam", + # "requirementRam", "maxTotalRamCodecScore", "maxTotalRamEncScore", "maxTotalRamDecScore", @@ -129,9 +129,12 @@ DISPLAY_IDS = { } # the -1's are for reference lines DISPLAY_LINE_IDX = { - "wmops": [-1, -1, -1, 9, 3, 5, 7], - "rom": [-1, 3, 5, 7, 9, 11, 13, 15, 17, 19], - "ram": [-1, 3, 5, 7, 8, 10, 12, 13, 15, 17], + # "wmops": [-1, -1, -1, 9, 3, 5, 7], + # "rom": [-1, 3, 5, 7, 9, 11, 13, 15, 17, 19], + # "ram": [-1, 3, 5, 7, 8, 10, 12, 13, 15, 17], + "wmops": [9, 3, 5, 7], + "rom": [3, 5, 7, 9, 11, 13, 15, 17, 19], + "ram": [3, 5, 7, 8, 10, 12, 13, 15, 17], "wmops_per_op": [1, 2], } DISPLAY_LABELS = { @@ -144,16 +147,16 @@ REF_COLOR_FOR_COMP_BARS = dict( ) LINE_COLORS = { "wmops": [ - REF_COLORS[0], - REF_COLORS[1], - REF_COLORS[2], + # REF_COLORS[0], + # REF_COLORS[1], + # REF_COLORS[2], "#0080FF", "#FF8000", "#CF4B4B", "#008040", ], "rom": [ - REF_COLORS[0], + # REF_COLORS[0], "#FF0000", "#FF8000", "#FFFF00", @@ -165,7 +168,7 @@ LINE_COLORS = { "#00FF00", ], "ram": [ - REF_COLORS[0], + # REF_COLORS[0], "#FF0000", "#FF8000", "#FFFF00", @@ -185,7 +188,6 @@ LINE_COLORS = { JS_FILE_TEMPLATE = """var {var_name} = {{ {elem_name}: {{ description: "{description}", - direction: -1, ticks: [ {ticks} ], @@ -199,48 +201,57 @@ JS_FILE_TEMPLATE = """var {var_name} = {{ }}; """ +# static references commented out for now FILE_DATA = { "wmops": { - "var_name": "Graphs_WMOPS", + "var_name": "Graphs_WMOPS{}", "elem_name": "wmops_worstcase", "description": "Worst Case WMOPS", - "filename": "graphs_wmops_flc.js", - "references": { - "3xEVS": REF_WMOPS_3EVS, - "6xEVS": REF_WMOPS_6EVS, - "10xEVS": REF_WMOPS_10EVS, - }, + "filename": "graphs_wmops_flc{}.js", + # "references": { + # "3xEVS": REF_WMOPS_3EVS, + # "6xEVS": REF_WMOPS_6EVS, + # "10xEVS": REF_WMOPS_10EVS, + # }, + "references": {}, }, "rom": { - "var_name": "Graphs_ROM", + "var_name": "Graphs_ROM{}", "elem_name": "rom_worstcase", "description": "ROM", - "filename": "graphs_rom_flc.js", - "references": { - "requirementRom": 0, - }, + "filename": "graphs_rom_flc{}.js", + # "references": { + # "requirementRom": 0, + # }, + "references": {}, }, "ram": { - "var_name": "Graphs_RAM", + "var_name": "Graphs_RAM{}", "elem_name": "ram_worstcase", "description": "Worst Case RAM", - "filename": "graphs_ram_flc.js", - "references": { - "requirementRam": 0, - }, + "filename": "graphs_ram_flc{}.js", + # "references": { + # "requirementRam": 0, + # }, + "references": {}, }, "wmops_per_op": { - "var_name": "Graphs_WMOPS_perOP", + "var_name": "Graphs_WMOPS_perOP{}", "elem_name": "wmops_worstcase_per_op", "description": "Worst Case WMOPS per OP", - "filename": "graphs_wmops_flc_perOP.js", + "filename": "graphs_wmops_flc_perOP{}.js", "references": {}, }, } def main( - wmops_log, wmops_per_op_log, rom_log, ram_log, wmops_per_op_log_for_comparison + wmops_log, + wmops_per_op_log, + rom_log, + ram_log, + wmops_per_op_log_for_comparison, + suffix, ): FILE_DATA["wmops"]["log_file"] = wmops_log FILE_DATA["wmops_per_op"]["log_file"] = wmops_per_op_log @@ -248,6 +259,10 @@ def main( FILE_DATA["ram"]["log_file"] = ram_log for x, data in FILE_DATA.items(): + if data["log_file"] is None: + print(f"Skipping '{x}' because no logfile given") + continue + with open(data["log_file"]) as f: log_lines = f.readlines() @@ -279,14 +294,14 @@ def main( ticks = ",\n".join(ticks) js_string = JS_FILE_TEMPLATE.format( - var_name=data["var_name"], + var_name=data["var_name"].format(suffix), elem_name=data["elem_name"], description=data["description"], runs=runs, displays=displays, ticks=ticks, ) - with open(data["filename"], "w") as f: + with open(data["filename"].format(suffix), "w") as f: print(js_string, file=f) @@ -444,11 +459,12 @@ if __name__ == "__main__": parser = argparse.ArgumentParser( description="Generate Javascript code for the complexity webpage" ) - parser.add_argument("wmops_log") - parser.add_argument("wmops_per_op_log") - parser.add_argument("rom_log") - parser.add_argument("ram_log") + parser.add_argument("--wmops_log", default=None) + parser.add_argument("--wmops_per_op_log", default=None) + parser.add_argument("--rom_log", default=None) + parser.add_argument("--ram_log", default=None) parser.add_argument("--wmops_per_op_log_for_comparison", default=None) + parser.add_argument("--suffix", default="") args = parser.parse_args() @@ -458,4 +474,5 @@ if __name__ == "__main__": args.rom_log, args.ram_log, args.wmops_per_op_log_for_comparison, + args.suffix, ) diff --git a/ci/complexity_measurements/getWmops.sh b/ci/complexity_measurements/getWmops.sh index e38ba3cc234128fbfc62e341ed4c28881b58fd7f..3f49630530fe007fa4f0adefc2a72a2dc3f9a4f1 100755 --- a/ci/complexity_measurements/getWmops.sh +++ b/ci/complexity_measurements/getWmops.sh @@ -28,6 +28,8 @@ # 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. +set -euxo pipefail + function usage { echo "Usage: $0 \"ivas-format(s)\" \"output-format(s)\" \"mode{full(default)|mem_only}\" \"repo{float(default)|basop}\" [wmops_ref_logfile]" exit 1 @@ -94,31 +96,59 @@ fi ./scripts/IvasBuildAndRunChecks.py $mode_arg_script $repo_arg_script -p $config_file --checks COMPLEXITY --create_complexity_tables ${wmopsFilenameFlc} -C $ivas_format $mode_arg -f ${ep} --oc $output_format ret_val=$? -# get the info on worst-case operating point: WMOPS number, enc-operating mode, dec-operating mode -### WMOPS -${scriptDir}/parseNewsletterWmops.py ${wmopsFilenameFlc}_WMOPS.csv ${wmopsFilenameFlcLast}_WMOPS.csv ${commit_sha} ${shortDate} ${fullDate} >>${destDir}/wmops/log_wmops_all.txt +# TODO: only split wmops and ram files +./ci/complexity_measurements/split_by_levels.py $(ls ${wmopsFilenameFlc}*.csv) + +# for wmops and RAM graphs, split by levels +split_suffixes=("_rate_sw" "_level_1" "_level_2" "_level_3") +for suffix in "${split_suffixes[@]}"; do + echo "$suffix" + + wmopsFilenameFlc_split="${wmopsFilenameFlc}_WMOPS${suffix}.csv" + wmopsFilenameFlcLast_split="${wmopsFilenameFlcLast}_WMOPS${suffix}.csv" + log_wmops_all_split="${destDir}/wmops/log_wmops_all${suffix}.txt" + latest_wmops_split="${wmopsFilenameFlcDir}/latest_WMOPS${suffix}.csv" + + heapFilenameFlc_split="${wmopsFilenameFlc}_HEAP${suffix}.csv" + stackFilenameFlc_split="${wmopsFilenameFlc}_STACK${suffix}.csv" + ramFilenameFlc_split="${wmopsFilenameFlc}_RAM${suffix}.csv" + ramFilenameFlcLast_split="${wmopsFilenameFlcLast}_RAM${suffix}.csv" + log_ram_all_split="${destDir}/wmops/log_ram_all${suffix}.txt" + + # get the info on worst-case operating point: WMOPS number, enc-operating mode, dec-operating mode + ### WMOPS + ${scriptDir}/parseNewsletterWmops.py ${wmopsFilenameFlc_split} ${wmopsFilenameFlcLast_split} ${commit_sha} ${shortDate} ${fullDate} >>${log_wmops_all_split} + + # create copy of WMOPS csv file with special name to easily get it from artifacts when comparing BASOP to float numbers + cp ${wmopsFilenameFlc_split} ${latest_wmops_split} + + # get memory info for webpage + ### RAM + ${scriptDir}/mergeNewsletterRam.py ${heapFilenameFlc_split} ${stackFilenameFlc_split} >${ramFilenameFlc_split} + ${scriptDir}/parseNewsletterRam.py ${heapFilenameFlc_split} ${stackFilenameFlc_split} ${ramFilenameFlcLast_split} ${commit_sha} ${shortDate} ${fullDate} >>${log_ram_all_split} -# create copy of WMOPS csv file with special name to easily get it from artifacts when comparing BASOP to float numbers -cp ${wmopsFilenameFlc}_WMOPS.csv ${wmopsFilenameFlcDir}/latest_WMOPS.csv + # generate javascript code from split log files + python3 ci/complexity_measurements/genWebpageData.py --wmops_log ${log_wmops_all_split} --ram_log ${log_ram_all_split} --suffix ${suffix} +done -# get memory info for webpage -### RAM -${scriptDir}/mergeNewsletterRam.py ${wmopsFilenameFlc}_HEAP.csv ${wmopsFilenameFlc}_STACK.csv >${wmopsFilenameFlc}_RAM.csv -${scriptDir}/parseNewsletterRam.py ${wmopsFilenameFlc}_HEAP.csv ${wmopsFilenameFlc}_STACK.csv ${wmopsFilenameFlcLast}_RAM.csv ${commit_sha} ${shortDate} ${fullDate} >>${destDir}/wmops/log_ram_all.txt +# for ROM and wmops_per_op graphs, no split is done +promFilenameFlc="${wmopsFilenameFlc}_PROM.csv" +tromFilenameFlc="${wmopsFilenameFlc}_TROM.csv" +romFilenameFlc="${wmopsFilenameFlc}_ROM.csv" +romFilenameFlcLast="${wmopsFilenameFlcLast}_ROM.csv" +log_rom_all="${destDir}/wmops/log_rom_all.txt" ### ROM -${scriptDir}/mergeNewsletterRom.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameFlc}_TROM.csv >${wmopsFilenameFlc}_ROM.csv -${scriptDir}/parseNewsletterRom.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameFlc}_TROM.csv ${wmopsFilenameFlcLast}_ROM.csv ${commit_sha} ${shortDate} ${fullDate} >>${destDir}/wmops/log_rom_all.txt +${scriptDir}/mergeNewsletterRom.py ${promFilenameFlc} ${tromFilenameFlc} >${romFilenameFlc} +${scriptDir}/parseNewsletterRom.py ${promFilenameFlc} ${tromFilenameFlc} ${romFilenameFlcLast} ${commit_sha} ${shortDate} ${fullDate} >>${log_rom_all} -# generate javascript code from log files -# pass the ref log for comparison only if arg is given if [ "$wmops_ref_logfile" != "" ]; then - python3 ci/complexity_measurements/genWebpageData.py ${destDir}/wmops/log_wmops_all.txt ${wmopsFilenameFlc}_WMOPS.csv ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/log_ram_all.txt --wmops_per_op_log_for_comparison $wmops_ref_logfile + python3 ci/complexity_measurements/genWebpageData.py --wmops_per_op_log ${wmopsFilenameFlc}_WMOPS.csv --rom_log ${log_rom_all} --wmops_per_op_log_for_comparison $wmops_ref_logfile else - python3 ci/complexity_measurements/genWebpageData.py ${destDir}/wmops/log_wmops_all.txt ${wmopsFilenameFlc}_WMOPS.csv ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/log_ram_all.txt + python3 ci/complexity_measurements/genWebpageData.py --wmops_per_op_log ${wmopsFilenameFlc}_WMOPS.csv --rom_log ${log_rom_all} fi -python3 ${scriptDir}/check_for_changes.py ${destDir}/wmops/log_wmops_all.txt ${destDir}/wmops/log_ram_all.txt ${destDir}/wmops/log_rom_all.txt +python3 ${scriptDir}/check_for_changes.py --wmops_logfiles $(ls ${destDir}/wmops/log_wmops_all*.txt) --ram_logfiles $(ls ${destDir}/wmops/log_ram_all*.txt) --rom_logfile ${destDir}/wmops/log_rom_all.txt if [ "$?" != "0" ]; then ret_val=1 fi diff --git a/ci/complexity_measurements/index_complexity.html b/ci/complexity_measurements/index_complexity.html index baa3f531c1b7357d1e67a47c5f4cb3fe859a80ee..7f52cf9f6683a9c634ef7c7aa8f2ca722d6be790 100755 --- a/ci/complexity_measurements/index_complexity.html +++ b/ci/complexity_measurements/index_complexity.html @@ -44,271 +44,158 @@ - - + + + + + - - - + + + + + + - - -

IVAS FORMAT - Worst Case WMOPS Performance

-
-
-
- -
-
    -
  • Worst case encoder + decoder performance: Encoder and decoder mode might be different.
  • -
  • Worst case codec performance: Encoder and decoder modes are identical.
  • -
  • Worst case encoder performance
  • -
  • Worst case decoder performance
  • -
  • 3xEVS Reference
  • -
  • 6xEVS Reference
  • -
  • 10xEVS Reference
  • -
-
+
+

Level 1 (13.2 - 80 kbps)

+
+
+ +
+

Level 2 (96 - 192 kbps)

+
+
+ +
+

Level 3 (256 - 512 kbps)

+
+
+ +
+

Rate switching (level-independent)

+
+
+ +
+
    +
  • Worst case encoder + decoder performance: Encoder and decoder mode might be different.
  • +
  • Worst case codec performance: Encoder and decoder modes are identical.
  • +
  • Worst case encoder performance
  • +
  • Worst case decoder performance
  • + + + +
+

-

IVAS FORMAT - Worst Case WMOPS Performance per Operating Point

+

IVAS FORMAT - Worst Case WMOPS Performance per Operating Point

Encoder

-
-
-
+
+
+

Decoder

-
-
-
- -
-
-
- -
- - - +
+

Rate switching (level-independent)

+
+
-

IVAS FORMAT - Worst Case RAM Demand

-
-
-
- -
-
    -
  • Max. total RAM Codec: +
    +
      +
    • Max. total RAM Codec: Encoder + Decoder
    • -
    • Max. total RAM Encoder: +
    • Max. total RAM Encoder: Encoder only
    • -
    • Max. total RAM Decoder: +
    • Max. total RAM Decoder: Decoder only
    • - -
    • Max. HEAP Codec: + +
    • Max. HEAP Codec: Encoder + Decoder
    • -
    • Max. HEAP Encoder +
    • Max. HEAP Encoder Encoder only
    • -
    • Max. HEAP Decoder +
    • Max. HEAP Decoder Decoder only
    • - -
    • Max. STACK Codec: + +
    • Max. STACK Codec: max(Encoder, Decoder)
    • -
    • Max. STACK Encoder: +
    • Max. STACK Encoder: Encoder only
    • -
    • Max. STACK Decoder: +
    • Max. STACK Decoder: Decoder only
    • -
    -
    +
+
-
+
- +
+
    +
  • Max. total ROM Codec: Encoder + Decoder
  • -

    IVAS FORMAT - Worst Case ROM Demand

    - -
    -
    -
    - -
    -
      -
    • Max. total ROM Codec: Encoder + Decoder
    • - -
    • Max. Program ROM Encoder Library: lib_enc only
    • -
    • Max. Program ROM Decoder Library: lib_dec only
    • -
    • Max. Program ROM Common Library: lib_com only
    • -
    • Max. Program ROM Ext Renderer Library: lib_rend only
    • - -
    • Max. Table ROM Encoder Library: lib_enc only
    • -
    • Max. Table ROM Decoder Library: lib_dec only
    • -
    • Max. Table ROM Common Library: lib_com only
    • -
    • Max. Table ROM Ext Renderer Library: lib_rend only
    • -
    -
    - - +
  • Max. Program ROM Encoder Library: lib_enc only
  • +
  • Max. Program ROM Decoder Library: lib_dec only
  • +
  • Max. Program ROM Common Library: lib_com only
  • +
  • Max. Program ROM Ext Renderer Library: lib_rend only
  • + +
  • Max. Table ROM Encoder Library: lib_enc only
  • +
  • Max. Table ROM Decoder Library: lib_dec only
  • +
  • Max. Table ROM Common Library: lib_com only
  • +
  • Max. Table ROM Ext Renderer Library: lib_rend only
  • +
+
+ +

FAQ

Q:
Which input files are used for audio-input? What error pattern is used?
A:
The input files can be found here. The error pattern is here
. -
Q:
The legend lists some References, but I can't see them in the plot?
-
A:
The plot Axes are scaled to fit the measured numbers. The reference values might be too high to fit into the plot. Put differently: if you can't see the references, you are probably below them (all is well).
. -
Q:
What is the meaning of these funny symbols in the navigation box, in the left upper corner of this page?
-
A:
- 1) Traffic light , or : !!!CURRENTLY NOT WORKING CORRECTLY AS NO REQUIREMENTS DEFINED YET!!! The traffic light symbols show, whether the last datapoint matches the requirement (green) or not (red). A yellow traffic light means that the requirement is matched, but the score is very close (within a 3% margin) to the requirement.
- 2) Arrow , , : The arrow indicates the trend of the last datapoint, compared to the last but one. An upwards arrow means that the score got higher (i.e. worse), downwards arrow arrow means that the score got lower (i.e. better), and a rightwards arrow means that the score was kept constant (within a 1% margin). -
@@ -433,8 +320,11 @@ return max; } + function wmopsFormatter(v, axis) { + return v + " WMOPS"; + } + function WMOPS() { - var previousPoint = null; function drawGraph(elt, graph, max_val) { @@ -442,12 +332,7 @@ yaxis: { min: 0, max: max_val, - tickFormatter: function (v, axis) { - if (graph.direction == -1) - return v + " WMOPS"; - return v; - }, - invert: graph.direction == 1 + tickFormatter: wmopsFormatter, }, xaxis: { tickFormatter: function (v, axis) { @@ -488,11 +373,7 @@ var y = item.datapoint[1]; var text = "" + item.series.id + "
" - text += 'Score: ' + y; - - if (graph.direction == -1) - text += " WMOPS"; - text += "
"; + text += 'Score: ' + y + " WMOPS" + "
"; // add more info only if not a reference line if ( !item.series.id.includes("EVS") ) @@ -503,8 +384,7 @@ var diff = Math.round((thisValue - prevValue) * 100) / 100; var pdiff = calcPercentDiff(thisValue, prevValue); var better; - if ((pdiff < 0 && graph.direction == -1) || - (pdiff > 0 && graph.direction == 1)) { + if (pdiff < 0) { better = "worse"; } else { better = "better"; @@ -512,44 +392,28 @@ pdiff = Math.abs(pdiff); if (diff === diff) { text += String.fromCharCode(916) + ": " + diff; - if (graph.direction == -1) - text += " WMOPS"; + text += " WMOPS"; text += " (" + pdiff + "% " + better + ")
"; } } if( item.series.id == "worst case enc/dec" ){ - text += "Worst case enc: " + graph.runs[x].worstCaseEnc + "
"; - text += "Worst case dec: " + graph.runs[x].worstCaseDec + "
"; + text += "Encoder OP: " + graph.runs[x].worstCaseEnc + "
"; + text += "Decoder OP: " + graph.runs[x].worstCaseDec + "
"; } if( item.series.id == "worst case codec" ){ - text += "Worst case codec: " + graph.runs[x].worstCaseCodec + "
"; + text += "OP: " + graph.runs[x].worstCaseCodec + "
"; } if( item.series.id == "worst case enc" ){ - text += "Worst case enc: " + graph.runs[x].worstCaseEnc + "
"; + text += "OP: " + graph.runs[x].worstCaseEnc + "
"; } if( item.series.id == "worst case dec" ){ - text += "Worst case dec: " + graph.runs[x].worstCaseDec + "
"; - } - if( item.series.id == "worst case enc/dec rs" ){ - text += "Worst case enc rateswitching: " + graph.runs[x].worstCaseEncRs + "
"; - text += "Worst case dec rateswitching: " + graph.runs[x].worstCaseDecRs + "
"; - } - if( item.series.id == "worst case codec rs" ){ - text += "Worst case codec rateswitching: " + graph.runs[x].worstCaseCodecRs + "
"; - } - if( item.series.id == "worst case enc rs" ){ - text += "Worst case enc rateswitching: " + graph.runs[x].worstCaseEncRs + "
"; + text += "OP: " + graph.runs[x].worstCaseDec + "
"; } - if( item.series.id == "worst case dec rs" ){ - text += "Worst case dec rateswitching: " + graph.runs[x].worstCaseDecRs + "
"; - } - text += "
" text += "Revision: " + graph.runs[x].revision + "
"; text += "Date: " + graph.runs[x].fullDate + "
"; - text += "Fixpoint scal. fac. to reach 138 WMOPS: " + graph.runs[x].fixpointScalingFac + "

"; text += "Logfile
"; } @@ -559,44 +423,25 @@ } $(document).ready(function () { - var max = get_max_y_val_for_plotting(Graphs_WMOPS.wmops_worstcase.displays, 50); - drawGraph($("#wmops-graph"), Graphs_WMOPS.wmops_worstcase, max); + var max = get_max_y_val_for_plotting(Graphs_WMOPS_level_1.wmops_worstcase.displays, 50); + drawGraph($("#wmops-graph-level_1"), Graphs_WMOPS_level_1.wmops_worstcase, max); + }); + $(document).ready(function () { + var max = get_max_y_val_for_plotting(Graphs_WMOPS_level_2.wmops_worstcase.displays, 50); + drawGraph($("#wmops-graph-level_2"), Graphs_WMOPS_level_2.wmops_worstcase, max); + }); + $(document).ready(function () { + var max = get_max_y_val_for_plotting(Graphs_WMOPS_level_3.wmops_worstcase.displays, 50); + drawGraph($("#wmops-graph-level_3"), Graphs_WMOPS_level_3.wmops_worstcase, max); + }); + $(document).ready(function () { + var max = get_max_y_val_for_plotting(Graphs_WMOPS_rate_sw.wmops_worstcase.displays, 50); + drawGraph($("#wmops-graph-rate_sw"), Graphs_WMOPS_rate_sw.wmops_worstcase, max); }); - - var refData = Graphs_WMOPS.wmops_worstcase.displays[0]; - var testData = Graphs_WMOPS.wmops_worstcase.displays[2]; - var testDataRs = Graphs_WMOPS.wmops_worstcase.displays[6]; - var nEntries = testData.data.length; - - if( testDataRs.data[nEntries-1][1] > testData.data[nEntries-1][1] ) { - testData = testDataRs; - } - - if(testData.data[nEntries-1][1] > refData.data[nEntries-1][1] ) { - document.getElementById("wmops_tl_l").style.color="#FF0000"; - } else if(testData.data[nEntries-1][1] > 0.97 * refData.data[nEntries-1][1] ) { - document.getElementById("wmops_tl_c").style.color="#FFFF00"; - } else { - document.getElementById("wmops_tl_r").style.color="#00FF00"; - } - - if(nEntries > 1) { - if( testData.data[nEntries-1][1] > 1.01 * testData.data[nEntries-2][1] ) { - document.getElementById("wmops_trend").innerHTML="↑"; - document.getElementById("wmops_trend").style.color="#FF0000"; - } else if(testData.data[nEntries-1][1] < 0.99 * testData.data[nEntries-2][1] ) { - document.getElementById("wmops_trend").innerHTML="↓"; - document.getElementById("wmops_trend").style.color="#00FF00"; - } else { - document.getElementById("wmops_trend").innerHTML="→"; - document.getElementById("wmops_trend").style.color="#FFFFFF"; - } } -} function WMOPS_perOP() { - var previousPoint = null; function drawGraph(elt, graph, max_val) { @@ -604,12 +449,7 @@ function WMOPS_perOP() { yaxis: { min: 0, max: max_val, - tickFormatter: function (v, axis) { - if (graph.direction == -1) - return v + " WMOPS"; - return v; - }, - invert: graph.direction == 1 + tickFormatter: wmopsFormatter, }, xaxis: { ticks: graph.ticks @@ -710,20 +550,35 @@ function WMOPS_perOP() { drawGraph($("#wmops_per_op-graph-dec"), graph_dec, max_dec); }); - var nEntriesWmopsGraph = Graphs_WMOPS.wmops_worstcase.runs.length - 1; + var nEntriesWmopsGraph = Graphs_WMOPS_level_1.wmops_worstcase.runs.length - 1; var legend = "

Numbers derived from revision " + - Graphs_WMOPS.wmops_worstcase.runs[nEntriesWmopsGraph].revision + + Graphs_WMOPS_level_1.wmops_worstcase.runs[nEntriesWmopsGraph].revision + ", " + - Graphs_WMOPS.wmops_worstcase.runs[nEntriesWmopsGraph].fullDate + + Graphs_WMOPS_level_1.wmops_worstcase.runs[nEntriesWmopsGraph].fullDate + "

"; document.getElementById("wmops_per_op-legend-enc").innerHTML = legend; } + function memTickFormatter(v, axis) { + var decimals = axis.tickDecimals; + var str_val = ""; + if (v > 1000000) { + str_val = (v / 1000000).toFixed(decimals) + " MB"; + } + else if (v > 1000) { + str_val = (v / 1000).toFixed(decimals) + " kB"; + } + else { + str_val = v.toFixed(decimals) + " B"; + } + return str_val; + } + function RAM() { - + var previousPoint = null; function drawGraph(elt, graph, max_val) { @@ -731,12 +586,7 @@ function RAM() { yaxis: { min: 0, max: max_val, - tickFormatter: function (v, axis) { - if (graph.direction == -1) - return v + " bytes"; - return v; - }, - invert: graph.direction == 1 + tickFormatter: memTickFormatter, }, xaxis: { tickFormatter: function (v, axis) { @@ -781,8 +631,7 @@ function RAM() { var text = "" + item.series.id + "
" text += 'Score: ' + y; - if (graph.direction == -1) - text += " bytes"; + text += " bytes"; text += "
"; if (x > 0) { @@ -791,8 +640,7 @@ function RAM() { var diff = Math.round((thisValue - prevValue) * 100) / 100; var pdiff = calcPercentDiff(thisValue, prevValue); var better; - if ((pdiff < 0 && graph.direction == -1) || - (pdiff > 0 && graph.direction == 1)) { + if (pdiff < 0) { better = "worse"; } else { better = "better"; @@ -800,8 +648,7 @@ function RAM() { pdiff = Math.abs(pdiff); if (diff === diff) { text += String.fromCharCode(916) + ": " + diff; - if (graph.direction == -1) - text += " bytes"; + text += " bytes"; text += " (" + pdiff + "% " + better + ")
"; } } @@ -852,40 +699,26 @@ function RAM() { } $(document).ready(function () { - var max = get_max_y_val_for_plotting(Graphs_RAM.ram_worstcase.displays, 50000); - drawGraph($("#ram-graph"), Graphs_RAM.ram_worstcase, max); + var max = get_max_y_val_for_plotting(Graphs_RAM_level_1.ram_worstcase.displays, 50000); + drawGraph($("#ram-graph-level_1"), Graphs_RAM_level_1.ram_worstcase, max); + }); + $(document).ready(function () { + var max = get_max_y_val_for_plotting(Graphs_RAM_level_2.ram_worstcase.displays, 50000); + drawGraph($("#ram-graph-level_2"), Graphs_RAM_level_2.ram_worstcase, max); + }); + $(document).ready(function () { + var max = get_max_y_val_for_plotting(Graphs_RAM_level_3.ram_worstcase.displays, 50000); + drawGraph($("#ram-graph-level_3"), Graphs_RAM_level_3.ram_worstcase, max); + }); + $(document).ready(function () { + var max = get_max_y_val_for_plotting(Graphs_RAM_rate_sw.ram_worstcase.displays, 50000); + drawGraph($("#ram-graph-rate_sw"), Graphs_RAM_rate_sw.ram_worstcase, max); }); - - var testData = Graphs_RAM.ram_worstcase.displays[1]; - var refData = Graphs_RAM.ram_worstcase.displays[0]; - var nEntries = testData.data.length; - - if( testData.data[nEntries-1][1] > refData.data[nEntries-1][1] ) { - document.getElementById("ram_tl_l").style.color="#FF0000"; - } else if( testData.data[nEntries-1][1] > 0.97 * refData.data[nEntries-1][1] ) { - document.getElementById("ram_tl_c").style.color="#FFFF00"; - } else { - document.getElementById("ram_tl_r").style.color="#00FF00"; - } - - if(nEntries > 1) { - if( testData.data[nEntries-1][1] > 1.01 * testData.data[nEntries-2][1] ) { - document.getElementById("ram_trend").innerHTML="↑"; - document.getElementById("ram_trend").style.color="#FF0000"; - } else if( testData.data[nEntries-1][1] < 0.99 * testData.data[nEntries-2][1] ) { - document.getElementById("ram_trend").innerHTML="↓"; - document.getElementById("ram_trend").style.color="#00FF00"; - } else { - document.getElementById("ram_trend").innerHTML="→"; - document.getElementById("ram_trend").style.color="#FFFFFF"; - } - } } function ROM() { - var previousPoint = null; function drawGraph(elt, graph, max_val) { @@ -893,12 +726,7 @@ function ROM() { yaxis: { min: 0, max: max_val, - tickFormatter: function (v, axis) { - if (graph.direction == -1) - return v + " bytes"; - return v; - }, - invert: graph.direction == 1 + tickFormatter: memTickFormatter, }, xaxis: { tickFormatter: function (v, axis) { @@ -943,8 +771,7 @@ function ROM() { var text = "" + item.series.id + "
" text += 'Score: ' + y; - if (graph.direction == -1) - text += " bytes"; + text += " bytes"; text += "
"; if (x > 0) { @@ -953,8 +780,7 @@ function ROM() { var diff = Math.round((thisValue - prevValue) * 100) / 100; var pdiff = calcPercentDiff(thisValue, prevValue); var better; - if ((pdiff < 0 && graph.direction == -1) || - (pdiff > 0 && graph.direction == 1)) { + if (pdiff < 0) { better = "worse"; } else { better = "better"; @@ -962,62 +788,16 @@ function ROM() { pdiff = Math.abs(pdiff); if (diff === diff) { text += String.fromCharCode(916) + ": " + diff; - if (graph.direction == -1) - text += " bytes"; + text += " bytes"; text += " (" + pdiff + "% " + better + ")
"; } } -/* - if( item.series.id == "TotalRomCodecScore" ){ - text += "Worst case enc: " + graph.runs[x].TotalRomEnc + "
"; - text += "Worst case dec: " + graph.runs[x].TotalRomDec + "
"; - } - if( item.series.id == "TotalRomEncScore" ){ - text += "Worst case enc: " + graph.runs[x].TotalRomEnc + "
"; - } - if( item.series.id == "TotalRomDecScore" ){ - text += "Worst case dec: " + graph.runs[x].TotalRomDec + "
"; - } - if( item.series.id == "PROMCodecScore" ){ - text += "Worst case enc: " + graph.runs[x].PromEnc + "
"; - text += "Worst case dec: " + graph.runs[x].PromDec + "
"; - } - if( item.series.id == "PROMEncScore" ){ - text += "Worst case enc: " + graph.runs[x].PromEnc + "
"; - } - if( item.series.id == "PROMDecScore" ){ - text += "Worst case dec: " + graph.runs[x].PromDec + "
"; - } - if( item.series.id == "TROMCodecScore" ){ - text += "Worst case enc: " + graph.runs[x].TromEnc + "
"; - text += "Worst case dec: " + graph.runs[x].TromDec + "
"; - } - if( item.series.id == "TROMEncScore" ){ - text += "Worst case enc: " + graph.runs[x].TromEnc + "
"; - } - if( item.series.id == "TROMDecScore" ){ - text += "Worst case dec: " + graph.runs[x].TromDec + "
"; - } -*/ - text += "
" text += "Revision: " + graph.runs[x].revision + "
"; text += "Date: " + graph.runs[x].fullDate + "

"; text += "Logfile
"; - /* - if( item.series.id == "maxRomFlc" ){ - text += "Logfile
"; - } - */ - - /* - if( item.series.id == "maxRomBasop" ){ - text += "Logfile
"; - } - */ - } else { text = "ROM requirement: 800000 bytes"; } @@ -1032,66 +812,10 @@ function ROM() { drawGraph($("#rom-graph"), Graphs_ROM.rom_worstcase, max); }); - - /* FLC */ - var testData = Graphs_ROM.rom_worstcase.displays[1]; - var refData = Graphs_ROM.rom_worstcase.displays[0]; - var nEntries = testData.data.length; - - if( testData.data[nEntries-1][1] > refData.data[nEntries-1][1] ) { - document.getElementById("rom_tl_l").style.color="#FF0000"; - } else if( testData.data[nEntries-1][1] > 0.97 * refData.data[nEntries-1][1] ) { - document.getElementById("rom_tl_c").style.color="#FFFF00"; - } else { - document.getElementById("rom_tl_r").style.color="#00FF00"; - } - - if(nEntries > 1) { - if( testData.data[nEntries-1][1] > 1.01 * testData.data[nEntries-2][1] ) { - document.getElementById("rom_trend").innerHTML="↑"; - document.getElementById("rom_trend").style.color="#FF0000"; - } else if( testData.data[nEntries-1][1] < 0.99 * testData.data[nEntries-2][1] ) { - document.getElementById("rom_trend").innerHTML="↓"; - document.getElementById("rom_trend").style.color="#00FF00"; - } else { - document.getElementById("rom_trend").innerHTML="→"; - document.getElementById("rom_trend").style.color="#FFFFFF"; - } - } - - - /* BASOP */ - /* - var testData = Graphs_ROM_BASOP.rom_worstcase.displays[2]; - var refData = Graphs_ROM.rom_worstcase.displays[0]; - var nEntries = testData.data.length; - - if( testData.data[nEntries-1][1] > refData.data[nEntries-1][1] ) { - document.getElementById("rom_basop_tl_l").style.color="#FF0000"; - } else if( testData.data[nEntries-1][1] > 0.97 * refData.data[nEntries-1][1] ) { - document.getElementById("rom_basop_tl_c").style.color="#FFFF00"; - } else { - document.getElementById("rom_basop_tl_r").style.color="#00FF00"; - } - - if(nEntries > 1) { - if( testData.data[nEntries-1][1] > 1.01 * testData.data[nEntries-2][1] ) { - document.getElementById("rom_basop_trend").innerHTML="↑"; - document.getElementById("rom_basop_trend").style.color="#FF0000"; - } else if( testData.data[nEntries-1][1] < 0.99 * testData.data[nEntries-2][1] ) { - document.getElementById("rom_basop_trend").innerHTML="↓"; - document.getElementById("rom_basop_trend").style.color="#00FF00"; - } else { - document.getElementById("rom_basop_trend").innerHTML="→"; - document.getElementById("rom_basop_trend").style.color="#FFFFFF"; - } - } - */ } WMOPS(); WMOPS_perOP(); - RAM(); ROM(); diff --git a/ci/complexity_measurements/split_by_levels.py b/ci/complexity_measurements/split_by_levels.py new file mode 100755 index 0000000000000000000000000000000000000000..3b4320abefa46ee309f080193a088553b3a990bf --- /dev/null +++ b/ci/complexity_measurements/split_by_levels.py @@ -0,0 +1,83 @@ +#! /usr/bin/env python3 + +# (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 +# 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. + +import pandas as pd +import numpy as np +import argparse +import pathlib + +LEVELS_2_MAX_BR = { + "_level_1": (0, 80), + "_level_2": (96, 192), + "_level_3": (256, 512), +} + + +def main(csv_files: list): + for csv_file in csv_files: + df = pd.read_csv(csv_file, delimiter=";") + + mask_vbr = df["conf"].str.contains("RS") + df_vbr = df[mask_vbr] + filename_vbr = str(csv_file.with_suffix("")) + "_rate_sw" + csv_file.suffix + df_vbr.to_csv( + filename_vbr, + index=False, + sep=";", + ) + + df_cbr = df[np.logical_not(mask_vbr)] + columns = df_cbr.columns + df_cbr["bitrate"] = df_cbr["conf"].str.extract(r"@(.*) kbps").astype("float") + + for lvl_suffix, (min_br, max_br) in LEVELS_2_MAX_BR.items(): + mask_lvl = np.logical_and( + df_cbr["bitrate"] >= min_br, df_cbr["bitrate"] <= max_br + ) + df_lvl = df_cbr[mask_lvl] + filename_lvl = str(csv_file.with_suffix("")) + lvl_suffix + csv_file.suffix + df_lvl[columns].to_csv( + filename_lvl, + index=False, + sep=";", + ) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument( + "csv_files", + nargs="+", + help="CSV files to split by complexity levels.", + type=pathlib.Path, + ) + + args = parser.parse_args() + main(args.csv_files) diff --git a/ci/complexity_measurements/style.css b/ci/complexity_measurements/style.css index 5450bf1e8656b174862459d3306c09e9080d1f08..4e4d0fa9da5a92371f558735c45f50f9748b3e4d 100755 --- a/ci/complexity_measurements/style.css +++ b/ci/complexity_measurements/style.css @@ -49,7 +49,22 @@ hr { background-color: #FF8000; border-radius: 20px; } -#wmops-graph { +#wmops-graph-level_1 { + height:500px; + width:1600px; + float:left; +} +#wmops-graph-level_2 { + height:500px; + width:1600px; + float:left; +} +#wmops-graph-level_3 { + height:500px; + width:1600px; + float:left; +} +#wmops-graph-rate_sw { height:500px; width:1600px; float:left; @@ -89,7 +104,22 @@ hr { width:1600px; float:left; } -#ram-graph { +#ram-graph-level_1 { + height:500px; + width:1600px; + float:left; +} +#ram-graph-level_2 { + height:500px; + width:1600px; + float:left; +} +#ram-graph-level_3 { + height:500px; + width:1600px; + float:left; +} +#ram-graph-rate_sw { height:500px; width:1600px; float:left; diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index 11fd91e587166f49c349b9d41b5c63432343c90d..5793a35f805ddd7a6926393005f16aceee1c4904 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -531,17 +531,20 @@ static ivas_error acelp_FCB_allocator( *--------------------------------------------------------------------*/ ivas_error config_acelp1( - const int16_t enc_dec, /* i : encoder/decoder flag */ - const int32_t total_brate, /* i : total bitrate */ - const int32_t core_brate_inp, /* i : core bitrate */ - const int16_t core, /* i : core */ - const int16_t extl, /* i : extension layer */ - const int32_t extl_brate, /* i : extension layer bitrate */ - const int16_t L_frame, /* i : frame length at internal Fs */ - const int16_t GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ - ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ - const int16_t signaling_bits, /* i : number of signaling bits */ - const int16_t coder_type, /* i : coder type */ + const int16_t enc_dec, /* i : encoder/decoder flag */ + const int32_t total_brate, /* i : total bitrate */ + const int32_t core_brate_inp, /* i : core bitrate */ + const int16_t core, /* i : core */ + const int16_t extl, /* i : extension layer */ + const int32_t extl_brate, /* i : extension layer bitrate */ + const int16_t L_frame, /* i : frame length at internal Fs */ + const int16_t GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ + ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ + const int16_t signaling_bits, /* i : number of signaling bits */ + const int16_t coder_type, /* i : coder type */ +#ifdef NONBE_FIX_GSC_BSTR + const int16_t inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ +#endif const int16_t tc_subfr, /* i : TC subfr ID */ const int16_t tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ int16_t *nBits_es_Pred, /* o : number of bits for Es_pred Q */ @@ -774,8 +777,14 @@ ivas_error config_acelp1( bits -= TDM_IC_LSF_PRED_BITS; } - /* gain Q bit-budget - part 1 */ + /* gain Q bit-budget - part 1: 'Es_pred' of memory-less gain Q */ +#ifdef NONBE_FIX_GSC_BSTR + if ( ( coder_type != UNVOICED && coder_type != AUDIO && coder_type != INACTIVE && !( core_brate <= ACELP_8k00 && coder_type != TRANSITION ) ) /* mid bitrates in GC and VC, low+mid bitrates in TC */ || + ( coder_type == INACTIVE && !inactive_coder_type_flag ) /* AVQ inactive */ + ) +#else if ( ( coder_type != UNVOICED && coder_type != AUDIO && coder_type != INACTIVE && !( core_brate <= ACELP_8k00 && coder_type != TRANSITION ) ) || ( coder_type == INACTIVE && total_brate > MAX_GSC_INACTIVE_BRATE ) ) +#endif { *nBits_es_Pred = Es_pred_bits_tbl[BIT_ALLOC_IDX( core_brate, coder_type, -1, -1 )]; bits -= *nBits_es_Pred; @@ -868,7 +877,11 @@ ivas_error config_acelp1( } else if ( core_brate >= ACELP_11k60 && ( coder_type != AUDIO && !( coder_type == INACTIVE && L_frame == L_FRAME ) ) ) { +#ifdef NONBE_FIX_GSC_BSTR + if ( coder_type == INACTIVE && L_frame == L_FRAME16k && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ +#else if ( coder_type == INACTIVE && L_frame == L_FRAME16k && total_brate <= MAX_GSC_INACTIVE_BRATE ) /* GSC Inactive @16kHz */ +#endif { acelp_cfg->ltf_mode = FULL_BAND; } @@ -1052,7 +1065,13 @@ ivas_error config_acelp1( acelp_cfg->fixed_cdk_index[2] = -1; acelp_cfg->fixed_cdk_index[3] = -1; } +#ifdef NONBE_FIX_GSC_BSTR + else if ( ( coder_type != INACTIVE && nb_subfr == NB_SUBFR && coder_type != AUDIO ) || /* @12.8kHz core except of GSC */ + ( nb_subfr == NB_SUBFR16k && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) /* @16kHz core GC, TC, AVQ inactive */ + || core == HQ_CORE /* ACELP -> HQ switching in EVS */ ) +#else else if ( ( coder_type != INACTIVE && nb_subfr == NB_SUBFR && coder_type != AUDIO ) || ( nb_subfr == NB_SUBFR16k && ( total_brate > MAX_GSC_INACTIVE_BRATE || coder_type != INACTIVE ) ) || core == HQ_CORE ) +#endif { /* pitch Q & gain Q bit-budget - part 2*/ for ( i = 0; i < nb_subfr; i++ ) @@ -1100,7 +1119,13 @@ ivas_error config_acelp1( } /* algebraic codebook bit-budget */ +#ifdef NONBE_FIX_GSC_BSTR + if ( flag_hardcoded || /* EVS */ + ( core_brate_inp >= MIN_BRATE_AVQ_EXC && coder_type != INACTIVE ) /* high-birate ACELP except IC */ || + ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ ) +#else if ( flag_hardcoded || ( core_brate_inp >= MIN_BRATE_AVQ_EXC && coder_type != INACTIVE ) || ( total_brate > MAX_GSC_INACTIVE_BRATE && coder_type == INACTIVE ) ) +#endif { for ( i = 0; i < nb_subfr; i++ ) { @@ -1187,7 +1212,12 @@ ivas_error config_acelp1( } /* AVQ codebook */ +#ifdef NONBE_FIX_GSC_BSTR + if ( ( core_brate_inp >= MIN_BRATE_AVQ_EXC && coder_type != INACTIVE ) /* high-birate ACELP except IC */ || + ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ ) +#else if ( ( core_brate_inp >= MIN_BRATE_AVQ_EXC && coder_type != INACTIVE ) || ( total_brate > MAX_GSC_INACTIVE_BRATE && coder_type == INACTIVE ) ) +#endif { for ( i = 0; i < nb_subfr; i++ ) { @@ -1222,7 +1252,13 @@ ivas_error config_acelp1( } } } +#ifdef NONBE_FIX_GSC_BSTR + else if ( ( coder_type == UNVOICED && tdm_low_rate_mode == 1 && element_mode == IVAS_CPE_TD ) /* LBR secondary channel in TD stereo */ || + ( ( coder_type == INACTIVE || coder_type == AUDIO ) && nb_subfr == NB_SUBFR ) /* GSC @12.8kHz */ || + ( coder_type == INACTIVE && inactive_coder_type_flag ) /* AVQ inactive */ ) +#else else if ( ( coder_type == UNVOICED && tdm_low_rate_mode == 1 && element_mode == IVAS_CPE_TD ) || ( ( coder_type == INACTIVE || coder_type == AUDIO ) && nb_subfr == NB_SUBFR ) || ( coder_type == INACTIVE && total_brate <= MAX_GSC_INACTIVE_BRATE ) ) +#endif { int32_t Local_BR, Pitch_BR; int16_t Pitch_CT; @@ -1315,7 +1351,12 @@ ivas_error config_acelp1( /* sanity check */ if ( ( coder_type != INACTIVE && nb_subfr == NB_SUBFR && coder_type != AUDIO ) || nb_subfr == NB_SUBFR16k ) { +#ifdef NONBE_FIX_GSC_BSTR + if ( ( L_frame == L_FRAME16k && coder_type == INACTIVE && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ || + ( GSC_IVAS_mode > 0 && L_frame == L_FRAME16k ) ) /* IVAS GSC @16kHz */ +#else if ( ( L_frame == L_FRAME16k && coder_type == INACTIVE && total_brate <= MAX_GSC_INACTIVE_BRATE ) || ( GSC_IVAS_mode > 0 && L_frame == L_FRAME16k ) ) /* GSC Inactive @16kHz */ +#endif { acelp_cfg->ubits = 0; } diff --git a/lib_com/gs_inact_switching.c b/lib_com/gs_inact_switching.c index fd50f1ec8036bb5466a82cc825f49f07f54e8747..b449d24e9799258911d6bf27403b513ecea3c289 100644 --- a/lib_com/gs_inact_switching.c +++ b/lib_com/gs_inact_switching.c @@ -59,12 +59,17 @@ *-------------------------------------------------------------------*/ void inact_switch_ematch( - float exc2[], /* i/o: CELP/GSC excitation buffer */ - float dct_exc_tmp[], /* i : GSC excitation in DCT domain */ - float lt_ener_per_band[], /* i/o: Long term energy per band */ - const int16_t coder_type, /* i : Coder type */ - const int16_t L_frame, /* i : Frame length */ - const int32_t total_brate, /* i : Total bitrate */ + float exc2[], /* i/o: CELP/GSC excitation buffer */ + float dct_exc_tmp[], /* i : GSC excitation in DCT domain */ + float lt_ener_per_band[], /* i/o: Long term energy per band */ + const int16_t coder_type, /* i : Coder type */ +#ifdef NONBE_FIX_GSC_BSTR + const int16_t inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ +#endif + const int16_t L_frame, /* i : Frame length */ +#ifndef NONBE_FIX_GSC_BSTR + const int32_t total_brate, /* i : Total bitrate */ +#endif const int16_t bfi, /* i : frame lost indicator */ const int16_t last_core, /* i : Last core used */ const int16_t last_codec_mode, /* i : Last codec mode */ @@ -105,7 +110,11 @@ void inact_switch_ematch( lt_ener_per_band[i] = Ener_per_bd[i]; } } +#ifdef NONBE_FIX_GSC_BSTR + else if ( coder_type == INACTIVE && inactive_coder_type_flag ) +#else else if ( coder_type == INACTIVE && total_brate <= MAX_GSC_INACTIVE_BRATE ) +#endif { /* Find spectrum and energy per band for inactive frames */ edct( exc2, dct_exc_tmp, L_frame, element_mode ); diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 6648d0783d37f52a553f6e21e31abeba41b8bbcf..d0930a073377c789ef420d93ed1b7e8e67e4dcd8 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -78,9 +78,7 @@ typedef enum IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED, IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED, -#endif IVAS_ERR_INVALID_HRTF, IVAS_ERR_INVALID_HRTF_SAMPLING_RATE, IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA, @@ -261,10 +259,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Acoustic environment not supported"; case IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED: return "Objects editing not supported"; -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE case IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED: return "Wrong use of both Object editing and Non-diegetic panning"; -#endif case IVAS_ERR_INVALID_HRTF: return "Unsupported HRTF filter set"; case IVAS_ERR_INVALID_HRTF_SAMPLING_RATE: diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 987455ea7ca8444e81ae82064a047c17a7c50d77..08dba288eca6067742e1d8a016f72c1bfc022d52 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5592,9 +5592,6 @@ void ivas_osba_stereo_add_channels( const float gain, /* i : gain bed value */ const int16_t nchan_out, /* i : number of output channels */ const int16_t nchan_ism, /* i : number of ISM channels */ -#ifndef NONBE_FIX_1262_OSBA_STEREO - const int16_t ism_mode, /* i : ISM mode */ -#endif const int16_t n_samples_to_render /* i : output frame length per channel */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 959eecf6ab9d47d933e2a896e56ec169d8120f0b..c4e5186e5a06105a99b5a7d3e16453a1aefca926 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_1217_OBJECT_EDIT_FILE_INTERFACE /* Nokia: issue #1217: add decoder functionality to read object edit instructions from a file */ /* #################### End BE switches ################################## */ @@ -169,9 +168,7 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_1217_OBJ_EDIT_FOA /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */ -#define NONBE_FIX_1255_OBJ_EDIT_JBM /* VA: issue 1255: restore object editing in JBM */ -#define NONBE_FIX_1262_OSBA_STEREO /* FhG: issue 1262: Fix missing scaling factor for OSBA stereo output */ +#define NONBE_FIX_GSC_BSTR /* VA: issue 1264: Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 04afc8cc4e8a5c80bb474755fa0fcf1f88be45f0..82d9b90d9c3be5798a33f53eb0f6d857ca7c207f 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -3564,12 +3564,17 @@ void highband_exc_dct_in( ); void inact_switch_ematch( - float exc2[], /* i/o: CELP/GSC excitation buffer */ - float dct_exc_tmp[], /* i : GSC excitation in DCT domain */ - float lt_ener_per_band[], /* i/o: long-term energy per band */ - const int16_t coder_type, /* i : coder type */ - const int16_t L_frame, /* i : frame length */ - const int32_t total_brate, /* i : Total bitrate */ + float exc2[], /* i/o: CELP/GSC excitation buffer */ + float dct_exc_tmp[], /* i : GSC excitation in DCT domain */ + float lt_ener_per_band[], /* i/o: long-term energy per band */ + const int16_t coder_type, /* i : coder type */ +#ifdef NONBE_FIX_GSC_BSTR + const int16_t inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ +#endif + const int16_t L_frame, /* i : frame length */ +#ifndef NONBE_FIX_GSC_BSTR + const int32_t total_brate, /* i : Total bitrate */ +#endif const int16_t bfi, /* i : frame lost indicator */ const int16_t last_core, /* i : Last core used */ const int16_t last_codec_mode, /* i : Last codec mode */ @@ -9093,17 +9098,20 @@ int16_t BITS_ALLOC_config_acelp( ); ivas_error config_acelp1( - const int16_t enc_dec, /* i : encoder/decoder flag */ - const int32_t total_brate, /* i : total bitrate */ - const int32_t core_brate_inp, /* i : core bitrate */ - const int16_t core, /* i : core */ - const int16_t extl, /* i : extension layer */ - const int32_t extl_brate, /* i : extension layer bitrate */ - const int16_t L_frame, /* i : frame length at internal Fs */ - const int16_t GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ - ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ - const int16_t signaling_bits, /* i : number of signaling bits */ - const int16_t coder_type, /* i : coder type */ + const int16_t enc_dec, /* i : encoder/decoder flag */ + const int32_t total_brate, /* i : total bitrate */ + const int32_t core_brate_inp, /* i : core bitrate */ + const int16_t core, /* i : core */ + const int16_t extl, /* i : extension layer */ + const int32_t extl_brate, /* i : extension layer bitrate */ + const int16_t L_frame, /* i : frame length at internal Fs */ + const int16_t GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ + ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ + const int16_t signaling_bits, /* i : number of signaling bits */ + const int16_t coder_type, /* i : coder type */ +#ifdef NONBE_FIX_GSC_BSTR + const int16_t inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ +#endif const int16_t tc_subfr, /* i : TC subfr ID */ const int16_t tc_call, /* i : TC call number (0,1,2) */ int16_t *nBits_es_Pred, /* o : number of bits for Es_pred Q */ diff --git a/lib_dec/FEC.c b/lib_dec/FEC.c index 3d43af895d4adb4590326f08f8d758d0896a7585..e3856f290fc7acaea8baf8992c339db908d4d7cc 100644 --- a/lib_dec/FEC.c +++ b/lib_dec/FEC.c @@ -332,7 +332,11 @@ void FEC_exc_estim( * Replicate the last spectrum in case the last good frame was coded by GSC *-----------------------------------------------------------------*/ +#ifdef NONBE_FIX_GSC_BSTR + if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->inactive_coder_type_flag && !st->Opt_AMR_WB ) +#else if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= MAX_GSC_INACTIVE_BRATE && !st->Opt_AMR_WB ) +#endif { /* Replication of the last spectrum, with a slight downscaling of its dynamic */ st->GSC_noisy_speech = st->Last_GSC_noisy_speech_flag; @@ -405,7 +409,11 @@ void FEC_exc_estim( * Total excitation *-----------------------------------------------------------------*/ +#ifdef NONBE_FIX_GSC_BSTR + if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->inactive_coder_type_flag && !st->Opt_AMR_WB ) +#else if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= MAX_GSC_INACTIVE_BRATE && !st->Opt_AMR_WB ) +#endif { /* For GSC - the excitation is already computed */ mvr2r( exc, exc2, st->L_frame ); diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index b83c105064ada3e5e7e27f7885ad29ceccdcabd4..66cedb206806c19c63f031bf4e3385a41facfceb 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -613,11 +613,19 @@ ivas_error acelp_core_dec( nb_bits = -1; } +#ifdef NONBE_FIX_GSC_BSTR + config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif if ( st->coder_type == TRANSITION && tc_subfr < L_SUBFR && st->L_frame == L_FRAME ) { +#ifdef NONBE_FIX_GSC_BSTR + config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, TRANSITION, -1, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif } } @@ -839,7 +847,11 @@ ivas_error acelp_core_dec( * Apply energy matching when switching to inactive frames *-----------------------------------------------------------------*/ +#ifdef NONBE_FIX_GSC_BSTR + inact_switch_ematch( exc2, dct_exc_tmp, st->hGSCDec->lt_ener_per_band, st->coder_type, st->inactive_coder_type_flag, st->L_frame, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); +#else inact_switch_ematch( exc2, dct_exc_tmp, st->hGSCDec->lt_ener_per_band, st->coder_type, st->L_frame, st->total_brate, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); +#endif /*------------------------------------------------------------* * Decode information and modify the excitation signal of stationary unvoiced frames @@ -975,8 +987,11 @@ ivas_error acelp_core_dec( } /* Apply energy matching when switching to inactive frames */ +#ifdef NONBE_FIX_GSC_BSTR + inact_switch_ematch( exc2, dct_exc_tmp, st->hGSCDec->lt_ener_per_band, st->coder_type, st->inactive_coder_type_flag, st->L_frame, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); +#else inact_switch_ematch( exc2, dct_exc_tmp, st->hGSCDec->lt_ener_per_band, st->coder_type, st->L_frame, st->total_brate, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); - +#endif /* update past excitation signals for LD music post-filter */ if ( st->hMusicPF != NULL ) { diff --git a/lib_dec/acelp_core_switch_dec.c b/lib_dec/acelp_core_switch_dec.c index 881cd0f6aa7d44208d631bd5805210a33c212087..b0848f32fd8eb4b4a313e615f4816fd823848337 100644 --- a/lib_dec/acelp_core_switch_dec.c +++ b/lib_dec/acelp_core_switch_dec.c @@ -158,7 +158,11 @@ ivas_error acelp_core_switch_dec( * Excitation decoding *----------------------------------------------------------------*/ +#ifdef NONBE_FIX_GSC_BSTR + config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, st->inactive_coder_type_flag, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, st->active_cnt, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); +#else config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, st->active_cnt, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); +#endif decod_gen_voic_core_switch( st, L_frame_for_cs, 0, Aq, exc, cbrate ); diff --git a/lib_dec/dec_gen_voic.c b/lib_dec/dec_gen_voic.c index 8ee1ae425a9194ed6421689ae607039d8305a552..a3a9fd49612938e7fd65eb36fee128600e56959b 100644 --- a/lib_dec/dec_gen_voic.c +++ b/lib_dec/dec_gen_voic.c @@ -174,7 +174,11 @@ ivas_error decod_gen_voic( * Transform-domain contribution decoding (inactive frames) *-----------------------------------------------------------------*/ +#ifdef NONBE_FIX_GSC_BSTR + if ( !st->inactive_coder_type_flag && st->coder_type == INACTIVE ) +#else if ( st->total_brate >= MAX_GSC_INACTIVE_BRATE && st->coder_type == INACTIVE ) +#endif { transf_cdbk_dec( st, 0, i_subfr, Es_pred, gain_code, &gain_preQ, &norm_gain_preQ, code_preQ, unbits ); } @@ -196,7 +200,6 @@ ivas_error decod_gen_voic( * Add the ACELP pre-quantizer contribution *-----------------------------------------------------------------*/ - /* if( (coder_type == GENERIC && st->core_brate >= MIN_BRATE_AVQ_EXC) || (coder_type == INACTIVE && st->total_brate > MAX_GSC_INACTIVE_BRATE) ) */ if ( gain_preQ != 0 ) { for ( i = 0; i < L_SUBFR; i++ ) diff --git a/lib_dec/gs_dec.c b/lib_dec/gs_dec.c index 5debe3c5629cfe5caa2cd67bf01e841d64822582..73a1cca369b41e3a4cb92262627930eecb6d38c3 100644 --- a/lib_dec/gs_dec.c +++ b/lib_dec/gs_dec.c @@ -111,7 +111,11 @@ void decod_audio( } /* set bit-allocation */ +#ifdef NONBE_FIX_GSC_BSTR + config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif /*---------------------------------------------------------------* * Decode energy dynamics diff --git a/lib_dec/ivas_decision_matrix_dec.c b/lib_dec/ivas_decision_matrix_dec.c index 4a27a07e2e01d82e57e83159de1d35e3a1e9a0a6..e9bc1c96de57b287444d86b026b78f925e79a0fb 100644 --- a/lib_dec/ivas_decision_matrix_dec.c +++ b/lib_dec/ivas_decision_matrix_dec.c @@ -438,6 +438,7 @@ void ivas_decision_matrix_dec( *-----------------------------------------------------------------*/ st->inactive_coder_type_flag = 0; /* AVQ by default */ + if ( st->total_brate <= MAX_GSC_INACTIVE_BRATE ) { st->inactive_coder_type_flag = 1; /* GSC */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 1e683cac688a5d23f06cfdc33a4bf8c6fed0681a..03e0667674c6b08c48df9197f38a3a833b575cc4 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -3227,12 +3227,10 @@ static ivas_error doSanityChecks_IVAS( } } -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE if ( st_ivas->hDecoderConfig->Opt_ObjEdit_on & st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) { return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED, "Wrong set-up: Only object editing or Non-diegetic panning can be used." ); } -#endif #ifdef DEBUGGING if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != IVAS_AUDIO_CONFIG_BINAURAL && output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index f986791d97e364b9dff1d0617969955379aae0df..165d2917d237c2a3ec146850ffd5d32c1e90e863 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1096,11 +1096,7 @@ ivas_error ivas_jbm_dec_render( ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); /* add already rendered SBA part */ -#ifdef NONBE_FIX_1262_OSBA_STEREO ivas_osba_stereo_add_channels( p_tc, p_output, st_ivas->hSbaIsmData->gain_bed, nchan_out, st_ivas->nchan_ism, *nSamplesRendered ); -#else - ivas_osba_stereo_add_channels( p_tc, p_output, st_ivas->hSbaIsmData->gain_bed, nchan_out, st_ivas->nchan_ism, st_ivas->ism_mode, *nSamplesRendered ); -#endif } else if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 473d82dee2ed0d45cb97bbbabe9bf240e6217800..369064214bebb5880bc8929267ad1444f166ea5b 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -309,42 +309,26 @@ ivas_error ivas_osba_render_sf( *-------------------------------------------------------------------------*/ void ivas_osba_stereo_add_channels( - float *tc_f[], /* i : transport channels */ - float *output_f[], /* i/o: output channels */ - const float gain, /* i : gain bed value */ - const int16_t nchan_out, /* i : number of output channels */ - const int16_t nchan_ism, /* i : number of ISM channels */ -#ifndef NONBE_FIX_1262_OSBA_STEREO - const int16_t ism_mode, /* i : ISM mode */ -#endif + float *tc_f[], /* i : transport channels */ + float *output_f[], /* i/o: output channels */ + const float gain, /* i : gain bed value */ + const int16_t nchan_out, /* i : number of output channels */ + const int16_t nchan_ism, /* i : number of ISM channels */ const int16_t n_samples_to_render /* i : output frame length per channel */ ) { int16_t n; -#ifndef NONBE_FIX_1262_OSBA_STEREO - if ( ism_mode == ISM_SBA_MODE_DISC ) + if ( gain != 1.0f && gain >= 0.0f ) { -#endif - if ( gain != 1.0f && gain >= 0.0f ) - { - int16_t i; - for ( n = 0; n < nchan_out; n++ ) - { - for ( i = 0; i < n_samples_to_render; i++ ) - { - output_f[n][i] += tc_f[n + nchan_ism][i] * gain; - } - } - } - else + int16_t i; + for ( n = 0; n < nchan_out; n++ ) { - for ( n = 0; n < nchan_out; n++ ) + for ( i = 0; i < n_samples_to_render; i++ ) { - v_add( output_f[n], tc_f[n + nchan_ism], output_f[n], n_samples_to_render ); + output_f[n][i] += tc_f[n + nchan_ism][i] * gain; } } -#ifndef NONBE_FIX_1262_OSBA_STEREO } else { @@ -353,14 +337,11 @@ void ivas_osba_stereo_add_channels( v_add( output_f[n], tc_f[n + nchan_ism], output_f[n], n_samples_to_render ); } } -#endif -#ifdef NONBE_FIX_1262_OSBA_STEREO for ( n = 0; n < nchan_out; n++ ) { v_multc( output_f[n], 0.5f, output_f[n], n_samples_to_render ); } -#endif return; } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 3ac7f16b2685783247344d891db7bc637c0a084f..e45df5f0807f2c1f1d5f0500020f28d3adb0e1db 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1410,10 +1410,8 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hParamIsmDec->edited_azimuth_values[obj] = hIvasEditableParameters.ism_metadata[obj].azimuth; st_ivas->hParamIsmDec->edited_elevation_values[obj] = hIvasEditableParameters.ism_metadata[obj].elevation; -#ifdef NONBE_1217_OBJ_EDIT_FOA if ( st_ivas->hMasaIsmData != NULL ) { -#endif st_ivas->hMasaIsmData->gain_ism_edited[obj] = hIvasEditableParameters.ism_metadata[obj].gain; /* Detect direction editing in Param-ISM mode */ @@ -1436,20 +1434,14 @@ ivas_error IVAS_DEC_SetEditableParameters( { st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 0u; } -#ifdef NONBE_1217_OBJ_EDIT_FOA } -#endif } -#ifdef NONBE_1217_OBJ_EDIT_FOA if ( st_ivas->hMasaIsmData != NULL ) { -#endif /* MASA is not present with the ISM format */ st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; -#ifdef NONBE_1217_OBJ_EDIT_FOA } -#endif } else if ( ism_mode == ISM_MODE_NONE ) { @@ -3628,13 +3620,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; hIvasDec->nSamplesRendered = 0; } -#ifndef NONBE_FIX_1255_OBJ_EDIT_JBM - if ( hIvasDec->hasBeenFedFirstGoodFrame ) - { - *parametersAvailableForEditing = true; - return IVAS_ERR_OK; - } -#endif } /* decode */ @@ -3670,12 +3655,8 @@ ivas_error IVAS_DEC_VoIP_GetSamples( hIvasDec->nSamplesFlushed = nSamplesFlushed_ref; *bitstreamReadDone = false; -#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM *parametersAvailableForEditing = true; return IVAS_ERR_OK; -#else - -#endif } } diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index e305e0ce8067a529f4772209cb4ffc7bce373a89..b12783d1c84b55fc5c190ad655af34844f9e4afd 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -372,7 +372,11 @@ ivas_error acelp_core_enc( if ( !nelp_mode && !ppp_mode ) { +#ifdef NONBE_FIX_GSC_BSTR + config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif } /*-----------------------------------------------------------------* @@ -492,7 +496,11 @@ ivas_error acelp_core_enc( { tc_classif_enc( st->L_frame, &tc_subfr, &position, attack_flag, st->pitch[0], res ); +#ifdef NONBE_FIX_GSC_BSTR + config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif } /*---------------------------------------------------------------* @@ -550,7 +558,11 @@ ivas_error acelp_core_enc( lsf_syn_mem_restore( st, tilt_code_bck, gc_threshold_bck, clip_var_bck, next_force_sf_bck, lsp_new, lsp_mid, clip_var, mem_AR, mem_MA, lsp_new_bck, lsp_mid_bck, Bin_E, Bin_E_old, mem_syn_bck, mem_w0_bck, streaklimit, pstreaklen ); /* Configure ACELP bit allocation */ +#ifdef NONBE_FIX_GSC_BSTR + config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif /* redo LSF quantization */ lsf_enc( st, lsf_new, lsp_new, lsp_mid, Aq, tdm_low_rate_mode, 0, NULL ); diff --git a/lib_enc/acelp_core_switch_enc.c b/lib_enc/acelp_core_switch_enc.c index 0af33003c12cac03b81e49ecb24c30d894f4cc76..4bccaa8076caab2ab201e6225420927689dc9a49 100644 --- a/lib_enc/acelp_core_switch_enc.c +++ b/lib_enc/acelp_core_switch_enc.c @@ -153,7 +153,11 @@ void acelp_core_switch_enc( * Excitation encoding *----------------------------------------------------------------*/ +#ifdef NONBE_FIX_GSC_BSTR + config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, st->inactive_coder_type_flag, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); +#else config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); +#endif encod_gen_voic_core_switch( st, st->last_L_frame, inp, Aq, A, T_op, st->voicing, exc, cbrate ); diff --git a/lib_enc/enc_gen_voic.c b/lib_enc/enc_gen_voic.c index 2416b26afeb0d5b07ff5b2f570ded642e20a343d..f4a6e7dea6f4ac609956521de70bd9716bcde57d 100644 --- a/lib_enc/enc_gen_voic.c +++ b/lib_enc/enc_gen_voic.c @@ -255,7 +255,11 @@ void encod_gen_voic( * Transform-domain contribution (inactive frames) *-----------------------------------------------------------------*/ +#ifdef NONBE_FIX_GSC_BSTR + if ( !st->inactive_coder_type_flag && st->coder_type == INACTIVE ) +#else if ( st->total_brate >= MAX_GSC_INACTIVE_BRATE && st->coder_type == INACTIVE ) +#endif { transf_cdbk_enc( st, 0, i_subfr, cn, exc, p_Aq, p_Aw, h1, xn, xn2, y1, y2, Es_pred, &gain_pit, gain_code, g_corr, clip_gain, &gain_preQ, code_preQ, unbits ); } diff --git a/lib_enc/ivas_core_pre_proc.c b/lib_enc/ivas_core_pre_proc.c index f199579d13d12498faf5ab6801ba04b627696939..f60b0850ae528736c55215d2d0413b709f6eb806 100644 --- a/lib_enc/ivas_core_pre_proc.c +++ b/lib_enc/ivas_core_pre_proc.c @@ -209,7 +209,11 @@ ivas_error pre_proc_ivas( } else if ( st->total_brate > MAX_GSC_INACTIVE_BRATE && ( ( st->vad_flag == 0 && st->bwidth >= SWB && st->max_bwidth >= SWB ) || ( st->localVAD == 0 && ( st->bwidth <= WB || st->max_bwidth <= WB ) ) ) ) { +#ifdef NONBE_FIX_GSC_BSTR + /* inactive frames will be coded by AVQ technology (exceptionally it can be later rewritten to GSC technology in ivas_combined_format_brate_sanity()) */ +#else /* inactive frames will be coded by AVQ technology */ +#endif st->coder_type = INACTIVE; } diff --git a/lib_enc/transition_enc.c b/lib_enc/transition_enc.c index 281a5e919ed232e7345844df3be76b5a8b75f325..77b142be307dbeca68dce76fcb44c47865d7dd0f 100644 --- a/lib_enc/transition_enc.c +++ b/lib_enc/transition_enc.c @@ -178,7 +178,11 @@ void transition_enc( if ( *tc_subfr == TC_0_0 ) { /* this is called only to compute unused bits */ +#ifdef NONBE_FIX_GSC_BSTR + config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); +#else config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); +#endif } *clip_gain = gp_clip( st->element_mode, st->core_brate, st->voicing, i_subfr, TRANSITION, xn, gp_cl ); @@ -274,7 +278,11 @@ void transition_enc( if ( i_subfr - *tc_subfr <= L_SUBFR ) { +#ifdef NONBE_FIX_GSC_BSTR + config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); +#else config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); +#endif } /*-----------------------------------------------------------------* diff --git a/lib_util/obj_edit_file_reader.c b/lib_util/obj_edit_file_reader.c index 945645569fcdd9a0df43004d35fa2a74c5c3ebad..16634aa48fd3d6cbfaf386aa43dac8ab1bd64ace 100644 --- a/lib_util/obj_edit_file_reader.c +++ b/lib_util/obj_edit_file_reader.c @@ -36,7 +36,6 @@ the United Nations Convention on Contracts on the International Sales of Goods. #include "prot.h" -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE /*-----------------------------------------------------------------------* * ObjectEditFileReader_open() * @@ -275,4 +274,3 @@ void ObjectEditFileReader_close( return; } -#endif diff --git a/lib_util/obj_edit_file_reader.h b/lib_util/obj_edit_file_reader.h index bd4d0011dc06e46112c7f6184a7e135f035ee7ea..d57ec390a632e59c54b17e100c506002d0954eac 100644 --- a/lib_util/obj_edit_file_reader.h +++ b/lib_util/obj_edit_file_reader.h @@ -37,7 +37,6 @@ the United Nations Convention on Contracts on the International Sales of Goods. #include "common_api_types.h" -#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE /*---------------------------------------------------------------------* * Constants ans structures *---------------------------------------------------------------------*/ @@ -108,5 +107,4 @@ void ObjectEditFileReader_close( ObjectEditFileReader **objEditReader /* i/o: pointer to ObjectEditFileReader handle */ ); -#endif #endif /* OBJ_EDIT_FILE_READER_H */