Commit 1d1a53e4 authored by multrus's avatar multrus
Browse files

Merge branch '1429-fixes-to-delivery-scripts' into 'main'

Resolve "Fixes to delivery scripts"

See merge request !2344
parents 05cecedb 41028c4f
Loading
Loading
Loading
Loading
Loading
+39 −5
Original line number Diff line number Diff line
@@ -56,14 +56,31 @@ if [ $help -ne 0 ]; then
fi


date="May 14, 2024"
version="IVAS-FL-2.0"
#date="Nov 11, 2025"
date=`date "+%b %d, %Y"`
version="IVAS-FL-3.0"

##########################
#                        #
# BASOP or Float?        #
#                        #
##########################

BASOP=0
if [ -d ${WORKDIR}/lib_basop ]; then
    BASOP=1
fi

if [ $BASOP -eq 1 ]; then
    version="IVAS-FX-3.0"
fi

#
# C-Code
#

if [ $BASOP -ne 1 ]; then

c_header_new=\
"/*====================================================================================
    3GPP TS26.258 $date. IVAS Codec Version $version
@@ -74,6 +91,19 @@ matlab_header_new=\
%     3GPP TS26.258 $date. IVAS Codec Version $version
% ===================================================================================="

else

c_header_new=\
"/*====================================================================================
    3GPP TS26.251 $date. IVAS Codec Version $version
  ====================================================================================*/"

matlab_header_new=\
"% ====================================================================================
%     3GPP TS26.251 $date. IVAS Codec Version $version
% ===================================================================================="

fi

####
c_header_patch=\
@@ -165,6 +195,8 @@ find $WORKDIR -name "*.m" -exec sed -i.bak -e "1 e cat $tmpfile" \{\} \;
rm -f $tmpfile


if [ $BASOP -ne 1 ]; then

#
# Patch Output of Matlab Scripts
#
@@ -199,14 +231,14 @@ rm -f $tmpfile

# C-style header
sed -i.bak -e "1,/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\//d" $WORKDIR/scripts/binauralRenderer_interface/Table_Format_Converter/tables_format_converter_readme.txt
sed -i.bak -e "1,/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\//d" $WORKDIR/scripts/binauralRenderer_interface/mixer_conv_sofa_to_rom_table_converter_readme.txt
sed -i.bak -e "1,/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\//d" $WORKDIR/scripts/binauralRenderer_interface/ivas_crend_sofa_to_rom_table_converter_readme.txt
# add new header
tmpfile=`mktemp`
rm -f $tmpfile
touch $tmpfile
echo "$c_header_new" >> $tmpfile
sed -i.bak -e "1 e cat $tmpfile" $WORKDIR/scripts/binauralRenderer_interface/Table_Format_Converter/tables_format_converter_readme.txt
sed -i.bak -e "1 e cat $tmpfile" $WORKDIR/scripts/binauralRenderer_interface/mixer_conv_sofa_to_rom_table_converter_readme.txt
sed -i.bak -e "1 e cat $tmpfile" $WORKDIR/scripts/binauralRenderer_interface/ivas_crend_sofa_to_rom_table_converter_readme.txt
rm -f $tmpfile

# *.md-style header
@@ -223,11 +255,13 @@ sed -i.bak -e "1 e cat $tmpfile" $WORKDIR/scripts/binauralRenderer_interface/REA
sed -i.bak -e "1 e cat $tmpfile" $WORKDIR/scripts/td_object_renderer/modeling_tool/README.md
rm -f $tmpfile

fi

#
# Remove License file
#

rm $WORKDIR/LICENSE.md
rm -f $WORKDIR/LICENSE.md

#
# Cleanup
+47 −11
Original line number Diff line number Diff line
@@ -77,6 +77,20 @@ while getopts "$ALL_OPTS" OPTION; do
done


##########################
#                        #
# BASOP or Float?        #
#                        #
##########################

BASOP=0
package="Float"
if [ -d ${ROOT}/lib_basop ]; then
    BASOP=1
    package="BASOP"
#    basop_dir="$targetdir/lib_basop/*.c"
fi

##########################
#                        #
# Prepare dirs and copy  #
@@ -96,6 +110,9 @@ cp -R ${ROOT}/lib_util $OUTDIR
cp -R ${ROOT}/lib_rend $OUTDIR
cp -R ${ROOT}/lib_isar $OUTDIR
cp -R ${ROOT}/lib_lc3plus $OUTDIR
if [ $BASOP -eq 1 ]; then
    cp -R ${ROOT}/lib_basop $OUTDIR
fi
cp -R ${ROOT}/apps $OUTDIR
mkdir $OUTDIR/lib_debug
cp ${ROOT}/lib_debug/wmc_auto.[ch] $OUTDIR/lib_debug
@@ -113,21 +130,19 @@ rm -f ${OUTDIR}/lib_util/tsm_scale_file_reader.[ch]
sed -i.bak -e "/lib_util\\\tsm_scale_file_reader.[ch]/d" ${OUTDIR}/Workspace_msvc/lib_util.vcxproj

# scripts for custom HRIR/BRIR ROM table/file generation
if [ $BASOP -ne 1 ]; then
    mkdir $OUTDIR/scripts
    cp -R ${ROOT}/scripts/binauralRenderer_interface $OUTDIR/scripts
    cp -R ${ROOT}/scripts/td_object_renderer $OUTDIR/scripts
fi

# readme
cp ${ROOT}/readme.txt ${OUTDIR}
recode lat1..ibmpc ${OUTDIR}/readme.txt # unix2dos ...

# LICENSE.md
# license
cp ${ROOT}/LICENSE.md ${OUTDIR}
recode lat1..ibmpc ${OUTDIR}/LICENSE.md # unix2dos ...

# enable split rendering againg by default
# in case we strip it later, it will be explicitly disabled again below
sed -i.bak -e "s/\/\*\ *\(#define\ *SPLIT_REND_WITH_HEAD_ROT\ *\)\*\//\1/g" ${OUTDIR}/lib_com/options.h
recode lat1..ibmpc ${OUTDIR}/readme.txt # unix2dos ...

##########################
#                        #
@@ -141,6 +156,8 @@ rm -f $tmpfile
touch $tmpfile

cat $OUTDIR/lib_com/options.h  | sed -n '/Start DEVELOPMENT switches/,/End DEVELOPMENT switches/p' >> $tmpfile
cat $OUTDIR/lib_com/options.h  | sed -n '/Start FIXES switches/,/End FIXES switches/p' >> $tmpfile
cat $OUTDIR/lib_com/options.h  | sed -n '/Start BASOP porting switches/,/End BASOP porting switches/p' >> $tmpfile

if coan_exists; then

@@ -153,6 +170,9 @@ if coan_exists; then
  # apply coan
  coan source --replace --no-transients -K --file $COAN_LIST $OUTDIR/lib_{com,dec,enc,util,rend,isar}/*.[hc]
  coan source --replace --no-transients -K --file $COAN_LIST $OUTDIR/apps/*.[hc]
  if [ $BASOP -eq 1 ]; then
      coan source --replace --no-transients -K --file $COAN_LIST $OUTDIR/lib_basop/*.[hc]
  fi

  # remove rejected switches from options.h
  while read line
@@ -242,18 +262,32 @@ if coan_exists; then
  echo "-USPLIT_REND_WITH_HEAD_ROT_DEBUG"      >> $COAN_LIST
  echo "-USPLIT_POSE_CORRECTION_DEBUG"         >> $COAN_LIST
  echo "-USPLIT_MD_CODING_DEBUG"               >> $COAN_LIST
  echo "-UFLP_EXCEPTION_TRAP"                  >> $COAN_LIST
  echo "-UDEBUG_APA_SILENCE_NON_SCALED"        >> $COAN_LIST
  echo "-UDEBUG_MCT"                           >> $COAN_LIST
  echo "-UDEBUG_SPAR_DIRAC_WRITE_OUT_PRED_PARS">> $COAN_LIST
  echo "-UDEBUG_FORCE_DIR"                     >> $COAN_LIST
  echo "-UDEBUG_MODE_DFT_BITS"                 >> $COAN_LIST
  echo "-USUPPORT_FORCE_TCX10_TCX20"           >> $COAN_LIST
  echo "-UBITSTERAM_ANALYSIS"                  >> $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
  cat $OUTDIR/lib_com/options.h  | sed -n '/Start FIXES switches/,/End FIXES switches/p' >> $tmpfile
  cat $OUTDIR/lib_com/options.h  | sed -n '/Start BASOP porting switches/,/End BASOP porting 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,isar}/*.[hc]
  coan source --replace --no-transients -K --file $COAN_LIST $OUTDIR/apps/*.[hc]
  if [ $BASOP -eq 1 ]; then
      coan source --replace --no-transients -K --file $COAN_LIST $OUTDIR/lib_basop/*.[hc]
  fi

  # remove rejected switches from options.h
  while read line
@@ -314,6 +348,8 @@ 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 DEVELOPMENT switches/,/End DEVELOPMENT switches/d" $OUTDIR/lib_com/options.h
sed -i.bak "/Start FIXES switches/,/End FIXES switches/d" $OUTDIR/lib_com/options.h
sed -i.bak "/Start BASOP porting switches/,/End BASOP porting switches/d" $OUTDIR/lib_com/options.h

# clean-up *.bak-files
find $OUTDIR -name "*.bak" -exec rm \{\} \;
@@ -328,12 +364,12 @@ find $OUTDIR -name "coan_*" -exec rm \{\} \;

if [ $PREPARE_ZIP -eq 1 ]; then

    zip -r9 IVAS_Float_C__rev${REV}_${DATE}.zip $OUTDIR 
    zip -r9 IVAS_${package}_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
    echo zip -r9 IVAS_${package}_C__rev${REV}_${DATE}.zip $OUTDIR c-code/IVAS_cod.exe c-code/IVAS_dec.exe c-code/IVAS_rend.exe c-code/ISAR_post_rend.exe c-code/ambi_convert.exe
else
    echo done
fi