From a7fb48e77d3e63bffe08fc478623542dbdd5cd5f Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 24 Nov 2023 09:33:05 +0100 Subject: [PATCH 1/3] Fix i prepare_delivery.sh to clean out all development switches --- Makefile | 2 +- scripts/makefile_noSR.patch | 2 +- scripts/prepare_delivery.sh | 78 +++++++++++++++++++------------- scripts/strip_split_rendering.py | 2 - scripts/strip_split_rendering.sh | 2 - 5 files changed, 48 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index 811d38b684..f725772496 100644 --- a/Makefile +++ b/Makefile @@ -120,7 +120,7 @@ VPATH = $(SRC_DIRS) # Split rendering files SRCS_SPLIT_REND = ivas_CQMFDecoder.c ivas_CQMFEncoder.c ivas_PerceptualModel.c ivas_PredDecoder.c \ ivas_PredEncoder.c ivas_RMSEnvGrouping.c ivas_MSPred.c ivas_NoiseGen.c \ - ivas_cldfb_codec_bitstream.c ivas_splitRend_lcld_dec.c ivas_splitRend_lcld_enc.c \ + ivas_splitRend_lcld_dec.c ivas_splitRend_lcld_enc.c \ ivas_splitRendererPLC.c ivas_splitRendererPost.c ivas_splitRendererPre.c \ ivas_splitRenderer_utils.c split_rend_bfi_file_reader.c split_render_file_read_write.c \ ivas_lcld_tables.c diff --git a/scripts/makefile_noSR.patch b/scripts/makefile_noSR.patch index c1ca25819e..beab6c9689 100644 --- a/scripts/makefile_noSR.patch +++ b/scripts/makefile_noSR.patch @@ -35,7 +35,7 @@ -# Split rendering files -SRCS_SPLIT_REND = ivas_CQMFDecoder.c ivas_CQMFEncoder.c ivas_PerceptualModel.c ivas_PredDecoder.c \ - ivas_PredEncoder.c ivas_RMSEnvGrouping.c ivas_MSPred.c ivas_NoiseGen.c \ -- ivas_cldfb_codec_bitstream.c ivas_splitRend_lcld_dec.c ivas_splitRend_lcld_enc.c \ +- ivas_splitRend_lcld_dec.c ivas_splitRend_lcld_enc.c \ - ivas_splitRendererPLC.c ivas_splitRendererPost.c ivas_splitRendererPre.c \ - ivas_splitRenderer_utils.c split_rend_bfi_file_reader.c split_render_file_read_write.c \ - ivas_lcld_tables.c diff --git a/scripts/prepare_delivery.sh b/scripts/prepare_delivery.sh index dd9634a0fb..e7e3a1f1c5 100755 --- a/scripts/prepare_delivery.sh +++ b/scripts/prepare_delivery.sh @@ -36,6 +36,7 @@ OUTDIR=c-code TMPCLEANDIR=clean-c-code ROOT=$(dirname $0)/.. STRIP_SPLITREND=0 +PREPARE_ZIP=1 # check, whether coan exists coan_exists () { @@ -58,6 +59,9 @@ while getopts "$ALL_OPTS" OPTION; do strip_sr) STRIP_SPLITREND=1 ;; + no_zip) + PREPARE_ZIP=0 + ;; *) if [ "$OPTERR" = 1 ] && [ "${ALL_OPTS:0:1}" != ":" ]; then echo "Unknown option --${OPTARG}" >&2 @@ -65,7 +69,7 @@ while getopts "$ALL_OPTS" OPTION; do ;; esac;; h) - echo "usage: $0 [--strip_sr]" >&2 + echo "usage: $0 [--strip_sr] [--no_zip]" >&2 exit -1 ;; *) @@ -304,6 +308,14 @@ if coan_exists; then echo "-USPLIT_POSE_CORRECTION_DEBUG" >> $COAN_LIST echo "-USPLIT_MD_CODING_DEBUG" >> $COAN_LIST + # Remove current development switches from the code by parsing options.h + tmpfile=`mktemp` + rm -f $tmpfile + touch $tmpfile + cat $OUTDIR/lib_com/options.h | sed -n '/Start BE switches/,/End DEVELOPMENT switches/p' >> $tmpfile + ${ROOT}/scripts/parse_options_h.sh -c $tmpfile >> $COAN_LIST + rm -f $tmpfile + # apply coan coan source --replace --no-transients -K --file $COAN_LIST $OUTDIR/lib_{com,dec,enc,util,rend}/*.[hc] coan source --replace --no-transients -K --file $COAN_LIST $OUTDIR/apps/*.[hc] @@ -336,36 +348,36 @@ fi # # ########################## -# rename switches from CR_ to NONBE_ -tmpfile=`mktemp` -rm -f $tmpfile -touch $tmpfile +# # rename switches from CR_ to NONBE_ +# tmpfile=`mktemp` +# rm -f $tmpfile +# touch $tmpfile -cat $OUTDIR/lib_com/options.h | sed -n '/Start NON-BE CR switches/,/End NON-BE CR switches/p' >> $tmpfile -sed -i.bak "s/^-D//g" $tmpfile +# cat $OUTDIR/lib_com/options.h | sed -n '/Start BE switches/,/End DEVELOPMENT switches/p' >> $tmpfile +# sed -i.bak "s/^-D//g" $tmpfile -nonbe_list=nonbe_list_delivery.txt -rm -f $nonbe_list -touch $nonbe_list +# nonbe_list=nonbe_list_delivery.txt +# rm -f $nonbe_list +# touch $nonbe_list -${ROOT}/scripts/parse_options_h.sh -c $tmpfile >> $nonbe_list +# ${ROOT}/scripts/parse_options_h.sh -c $tmpfile >> $nonbe_list -# rename switches -while read line -do - macro=`echo $line | grep '\-D' | sed -e "s/\-D//g"` - if [[ ! $macro =~ [^[:space:]] ]] ; then - continue - fi - macro_new=${macro/CR_/NONBE_} - find $OUTDIR -name "*.[ch]" -exec sed -i.bak -e "s/${macro}/${macro_new}/g" \{\} \; -done < $nonbe_list +# # rename switches +# while read line +# do + # macro=`echo $line | grep '\-D' | sed -e "s/\-D//g"` + # if [[ ! $macro =~ [^[:space:]] ]] ; then + # continue + # fi + # macro_new=${macro/CR_/NONBE_} + # find $OUTDIR -name "*.[ch]" -exec sed -i.bak -e "s/${macro}/${macro_new}/g" \{\} \; +# done < $nonbe_list -rm -f $nonbe_list -rm -f $tmpfile +# rm -f $nonbe_list +# rm -f $tmpfile -sed -i.bak -e "s/NON-BE CR switches/NON-BE switches/g" $OUTDIR/lib_com/options.h -sed -i.bak -e "/all switches in this category should start with \"CR_\"/d" $OUTDIR/lib_com/options.h +# sed -i.bak -e "s/NON-BE CR switches/NON-BE switches/g" $OUTDIR/lib_com/options.h +# sed -i.bak -e "/all switches in this category should start with \"CR_\"/d" $OUTDIR/lib_com/options.h @@ -407,7 +419,7 @@ fi # END skip block sed -i.bak "/keep as part of options.h/d" $OUTDIR/lib_com/options.h sed -i.bak "s/\(\/\*\ #define\ *\CR[a-zA-Z0-9_]*\ *\*\/\)\(.*\)/\1/g" $OUTDIR/lib_com/options.h sed -i.bak "s/\(\#define\ *\CR[a-zA-Z0-9_]*\ *\)\(\/\*.*\)/\1/g" $OUTDIR/lib_com/options.h -sed -i.bak "/Start BE DEVELOPMENT switches/,/End BE DEVELOPMENT switches/d" $OUTDIR/lib_com/options.h +sed -i.bak "/Start BE switches/,/End DEVELOPMENT switches/d" $OUTDIR/lib_com/options.h # clean-up *.bak-files find $OUTDIR -name "*.bak" -exec rm \{\} \; @@ -420,12 +432,14 @@ find $OUTDIR -name "coan_*" -exec rm \{\} \; # # ########################## -zip -r9 IVAS_Float_C__rev${REV}_${DATE}.zip $OUTDIR - +if [ $PREPARE_ZIP -eq 1 ]; then -echo done - -echo now build the Windows executable manually and insert it to the zip with the following commands: -echo zip -r9 IVAS_Float_C__rev${REV}_${DATE}.zip $OUTDIR c-code/IVAS_cod.exe c-code/IVAS_dec.exe c-code/IVAS_rend.exe + zip -r9 IVAS_Float_C__rev${REV}_${DATE}.zip $OUTDIR + echo done + echo now build the Windows executable manually and insert it to the zip with the following commands: + echo zip -r9 IVAS_Float_C__rev${REV}_${DATE}.zip $OUTDIR c-code/IVAS_cod.exe c-code/IVAS_dec.exe c-code/IVAS_rend.exe +else + echo done +fi diff --git a/scripts/strip_split_rendering.py b/scripts/strip_split_rendering.py index 556e955315..790507d690 100644 --- a/scripts/strip_split_rendering.py +++ b/scripts/strip_split_rendering.py @@ -43,8 +43,6 @@ sr_files_rend=[ "lib_rend\\ivas_PredDecoder.c", "lib_rend\\ivas_PredEncoder.c", "lib_rend\\ivas_RMSEnvGrouping.c", - "lib_rend\\ivas_cldfb_codec_bitstream.c", - "lib_rend\\ivas_cldfb_codec_bitstream.h", "lib_rend\\ivas_lc3plus_common.c", "lib_rend\\ivas_lc3plus_common.h", "lib_rend\\ivas_lc3plus_dec.c", diff --git a/scripts/strip_split_rendering.sh b/scripts/strip_split_rendering.sh index fb645c912f..beb1963520 100755 --- a/scripts/strip_split_rendering.sh +++ b/scripts/strip_split_rendering.sh @@ -46,8 +46,6 @@ declare -a sr_files_rend=( "lib_rend/ivas_PredDecoder.c" "lib_rend/ivas_PredEncoder.c" "lib_rend/ivas_RMSEnvGrouping.c" - "lib_rend/ivas_cldfb_codec_bitstream.c" - "lib_rend/ivas_cldfb_codec_bitstream.h" "lib_rend/ivas_lc3plus_common.c" "lib_rend/ivas_lc3plus_common.h" "lib_rend/ivas_lc3plus_dec.c" -- GitLab From 57072643341edf96f2081154f6149f74146670bb Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 24 Nov 2023 13:55:12 +0100 Subject: [PATCH 2/3] also include lib_rend/ivas_lcld_prot.h --- scripts/strip_split_rendering.py | 5 +++-- scripts/strip_split_rendering.sh | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/strip_split_rendering.py b/scripts/strip_split_rendering.py index 790507d690..64db5d610e 100644 --- a/scripts/strip_split_rendering.py +++ b/scripts/strip_split_rendering.py @@ -35,8 +35,6 @@ import glob # remove other split rendering files sr_files_rend=[ - "lib_rend\\ivas_lcld_decoder.c", - "lib_rend\\ivas_lcld_encoder.c", "lib_rend\\ivas_MSPred.c", "lib_rend\\ivas_NoiseGen.c", "lib_rend\\ivas_PerceptualModel.c", @@ -49,6 +47,9 @@ sr_files_rend=[ "lib_rend\\ivas_lc3plus_dec.h", "lib_rend\\ivas_lc3plus_enc.c", "lib_rend\\ivas_lc3plus_enc.h", + "lib_rend\\ivas_lcld_decoder.c", + "lib_rend\\ivas_lcld_encoder.c", + "lib_rend\\ivas_lcld_prot.h", "lib_rend\\ivas_lcld_rom_tables.c" "lib_rend\\ivas_lcld_rom_tables.h" "lib_rend\\ivas_splitRend_lcld_dec.c", diff --git a/scripts/strip_split_rendering.sh b/scripts/strip_split_rendering.sh index beb1963520..4346afb296 100755 --- a/scripts/strip_split_rendering.sh +++ b/scripts/strip_split_rendering.sh @@ -38,8 +38,6 @@ rm -R $OUTDIR/lib_lc3plus # remove other split rendering files declare -a sr_files_rend=( - "lib_rend/ivas_lcld_decoder.c" - "lib_rend/ivas_lcld_encoder.c" "lib_rend/ivas_MSPred.c" "lib_rend/ivas_NoiseGen.c" "lib_rend/ivas_PerceptualModel.c" @@ -52,6 +50,9 @@ declare -a sr_files_rend=( "lib_rend/ivas_lc3plus_dec.h" "lib_rend/ivas_lc3plus_enc.c" "lib_rend/ivas_lc3plus_enc.h" + "lib_rend/ivas_lcld_decoder.c" + "lib_rend/ivas_lcld_encoder.c" + "lib_rend/ivas_lcld_prot.h" "lib_rend/ivas_lcld_rom_tables.c" "lib_rend/ivas_lcld_rom_tables.h" "lib_rend/ivas_splitRend_lcld_dec.c" @@ -87,4 +88,4 @@ rm ${OUTDIR}/Workspace_msvc/lib_lc3plus.vcxproj # patch project/solution files sed -i.bak "/lib_lc3plus.vcxproj/,+1d" ${OUTDIR}/Workspace_msvc/Workspace_msvc.sln find ${OUTDIR}/Workspace_msvc -name "*.vcxproj" -exec sed -i.bak -e "s/..\\lib_lc3plus\;//g" \{\} \; -sed -i.bak "/lib_lc3plus.vcxproj/,+3d" ${OUTDIR}/Workspace_msvc/lib_rend.vcxproj # patch dependency \ No newline at end of file +sed -i.bak "/lib_lc3plus.vcxproj/,+3d" ${OUTDIR}/Workspace_msvc/lib_rend.vcxproj # patch dependency -- GitLab From 4bd4a381b8dd4af5dcc6e750d82273d9a48af940 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 24 Nov 2023 13:57:20 +0100 Subject: [PATCH 3/3] add section 'Start DEVELOPMENT switches' to options.h, clean up prepare delivery script --- lib_com/options.h | 1 + scripts/prepare_delivery.sh | 56 ++----------------------------------- 2 files changed, 3 insertions(+), 54 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 870006c6fb..e3c6ba8057 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -143,6 +143,7 @@ /* keep as part of options.h */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ +/* ################## Start DEVELOPMENT switches ######################### */ /* ################### Start BE switches ################################# */ /* only BE switches wrt selection floating point code */ diff --git a/scripts/prepare_delivery.sh b/scripts/prepare_delivery.sh index e7e3a1f1c5..60de113050 100755 --- a/scripts/prepare_delivery.sh +++ b/scripts/prepare_delivery.sh @@ -150,11 +150,6 @@ if [ $STRIP_SPLITREND -ne 0 ]; then # strip macros declare -a sr_macros=( "SPLIT_REND_WITH_HEAD_ROT" - "SPLIT_REND_PRED_QUANT_63_PNTS" - "SPLIT_REND_WITH_HEAD_ROT_PARAMBIN" - "FIX_658_SPLIT_REND_MASA" - "FIX_658_SPLIT_REND_MASA" - "OSBA_SPLIT_RENDERING" ) if coan_exists; then @@ -200,7 +195,7 @@ tmpfile=`mktemp` rm -f $tmpfile touch $tmpfile -cat $OUTDIR/lib_com/options.h | sed -n '/Start BE DEVELOPMENT switches/,/End BE DEVELOPMENT switches/p' >> $tmpfile +cat $OUTDIR/lib_com/options.h | sed -n '/Start DEVELOPMENT switches/,/End DEVELOPMENT switches/p' >> $tmpfile if coan_exists; then @@ -210,12 +205,6 @@ if coan_exists; then ${ROOT}/scripts/parse_options_h.sh -c $tmpfile >> $COAN_LIST - # sanity check, whether any CR_ switches were parsed - numCRs=`grep -c CR_ $COAN_LIST` - if [ $numCRs -lt 0 ]; then - echo "Warning: CR_-switches within DEVELOPMENT section!" - fi - # apply coan coan source --replace --no-transients -K --file $COAN_LIST $OUTDIR/lib_{com,dec,enc,util,rend}/*.[hc] coan source --replace --no-transients -K --file $COAN_LIST $OUTDIR/apps/*.[hc] @@ -340,47 +329,6 @@ else fi - -########################## -# # -# CR Switches for 1st # -# delivery # -# # -########################## - -# # rename switches from CR_ to NONBE_ -# tmpfile=`mktemp` -# rm -f $tmpfile -# touch $tmpfile - -# cat $OUTDIR/lib_com/options.h | sed -n '/Start BE switches/,/End DEVELOPMENT switches/p' >> $tmpfile -# sed -i.bak "s/^-D//g" $tmpfile - -# nonbe_list=nonbe_list_delivery.txt -# rm -f $nonbe_list -# touch $nonbe_list - -# ${ROOT}/scripts/parse_options_h.sh -c $tmpfile >> $nonbe_list - -# # rename switches -# while read line -# do - # macro=`echo $line | grep '\-D' | sed -e "s/\-D//g"` - # if [[ ! $macro =~ [^[:space:]] ]] ; then - # continue - # fi - # macro_new=${macro/CR_/NONBE_} - # find $OUTDIR -name "*.[ch]" -exec sed -i.bak -e "s/${macro}/${macro_new}/g" \{\} \; -# done < $nonbe_list - -# rm -f $nonbe_list -# rm -f $tmpfile - -# sed -i.bak -e "s/NON-BE CR switches/NON-BE switches/g" $OUTDIR/lib_com/options.h -# sed -i.bak -e "/all switches in this category should start with \"CR_\"/d" $OUTDIR/lib_com/options.h - - - ########################## # # # Patch code # @@ -419,7 +367,7 @@ fi # END skip block sed -i.bak "/keep as part of options.h/d" $OUTDIR/lib_com/options.h sed -i.bak "s/\(\/\*\ #define\ *\CR[a-zA-Z0-9_]*\ *\*\/\)\(.*\)/\1/g" $OUTDIR/lib_com/options.h sed -i.bak "s/\(\#define\ *\CR[a-zA-Z0-9_]*\ *\)\(\/\*.*\)/\1/g" $OUTDIR/lib_com/options.h -sed -i.bak "/Start BE switches/,/End DEVELOPMENT switches/d" $OUTDIR/lib_com/options.h +sed -i.bak "/Start DEVELOPMENT switches/,/End DEVELOPMENT switches/d" $OUTDIR/lib_com/options.h # clean-up *.bak-files find $OUTDIR -name "*.bak" -exec rm \{\} \; -- GitLab