Skip to content
......@@ -41,7 +41,17 @@ typedef struct SplitFileReadWrite SplitFileReadWrite;
/* Allocates and initializes a a split renderer reader instance */
ivas_error split_rend_reader_open(
SplitFileReadWrite **hhSplitRendFileReadWrite,
char *filename );
char *filename,
ISAR_SPLIT_REND_CODEC *codec,
ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection,
int16_t *codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
int16_t *isar_frame_size_ms,
int32_t *sampling_rate,
int16_t *lc3plus_highres
#endif
);
/* Allocates and initializes a a split renderer writer instance */
......@@ -49,10 +59,21 @@ ivas_error split_rend_writer_open(
SplitFileReadWrite **hhSplitRendFileReadWrite,
char *filename,
const int16_t delayNumSamples,
const int32_t delayTimeScale );
const int32_t delayTimeScale,
ISAR_SPLIT_REND_CODEC codec,
ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection,
int16_t codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
const int16_t isar_frame_size_ms,
const int32_t sampling_rate,
const int16_t lc3plus_highres
#endif
);
/* Closes the split renderer reader/writer and deallocates memory */
ivas_error split_rend_reader_writer_close(
void split_rend_reader_writer_close(
SplitFileReadWrite **hhSplitRendFileReadWrite );
/*write split rend coded bitstream to file */
......@@ -60,20 +81,14 @@ ivas_error split_rend_write_bitstream_to_file(
SplitFileReadWrite *hSplitRendFileReadWrite,
uint8_t *bits,
int32_t *bits_read,
int32_t *bits_written,
IVAS_SPLIT_REND_CODEC codec,
IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection,
int16_t codec_frame_size_ms );
int32_t *bits_written );
/* read split rend coded bits from file */
ivas_error split_rend_read_bits_from_file(
SplitFileReadWrite *hSplitRendFileReadWrite,
uint8_t *bits,
int32_t *bits_read,
int32_t *bits_written,
IVAS_SPLIT_REND_CODEC *codec,
IVAS_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection,
int16_t *codec_frame_size_ms );
int32_t *bits_written );
/* read split pre rend delay */
ivas_error split_rend_read_pre_rend_delay_ns(
......
......@@ -33,11 +33,12 @@
These files represent the 3GPP EVS Codec Extension for Immersive Voice and
Audio Services (IVAS) floating-point C simulation. All code is writtten
in ISO/IEC C99. The system is implemented as three separate programs:
in ISO/IEC C99. The system is implemented as four separate programs:
IVAS_cod Encoder
IVAS_dec Decoder
IVAS_rend Renderer
IVAS_cod IVAS Encoder
IVAS_dec IVAS Decoder
IVAS_rend IVAS External Renderer
ISAR_post_rend ISAR Post Renderer
For encoding using the coder program, the input is a binary
audio file (*.8k, *.16k, *.32k, *.48k) and the output is a binary
......@@ -128,6 +129,8 @@ should have the following structure:
|-- lib_debug
|-- lib_dec
|-- lib_enc
|-- lib_isar
|-- lib_lc3plus
|-- lib_rend
|-- lib_util
|-- readme.txt
......@@ -135,16 +138,16 @@ should have the following structure:
The package includes a Makefile for gcc, which has been verified on
32-bit Linux systems. The code can be compiled by entering the directory
"c-code" and typing the command: make. The resulting encoder/decoder/renderer
executables are named "IVAS_cod", "IVAS_dec", and "IVAS_rend". All reside
in the c-code directory.
"c-code" and typing the command: make. The resulting encoder/decoder/renderer/
ISAR_post_renderer executables are named "IVAS_cod", "IVAS_dec", "IVAS_rend",
and "ISAR_post_rend". All reside in the c-code directory.
The package also includes a solution-file for Microsoft Visual Studio 2017 (x86).
To compile the code, please open "Workspace_msvc\Workspace_msvc.sln" and build
"encoder" for the encoder, "decoder" for the decoder, and "renderer" for the
renderer executable. The resulting encoder/decoder/renderer executables are
"IVAS_cod.exe", "IVAS_dec.exe", and "IVAS_rend.exe". All reside in the c-code
main directory.
renderer executable. The resulting encoder/decoder/renderer/ISAR_post_renderer
executables are "IVAS_cod.exe", "IVAS_dec.exe", "IVAS_rend.exe", and
"ISAR_post_rend.exe". All reside in the c-code main directory.
RUNNING THE SOFTWARE
......@@ -239,7 +242,8 @@ Usage for IVAS: IVAS_dec.exe [Options] OutputConf Fs bitstream_file output_file
Mandatory parameters:
---------------------
OutputConf : Output configuration: MONO, STEREO, 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4, FOA,
HOA2, HOA3, BINAURAL, BINAURAL_ROOM_IR, BINAURAL_ROOM_REVERB, EXT
HOA2, HOA3, BINAURAL, BINAURAL_ROOM_IR, BINAURAL_ROOM_REVERB,
BINAURAL_SPLIT_CODED, BINAURAL_SPLIT_PCM, EXT
By default, channel order and loudspeaker positions are equal to the
encoder. For loudspeaker outputs, OutputConf can be a custom loudspeaker
layout file. See below for details.
......@@ -284,6 +288,7 @@ Options:
specified) for binaural output configuration
-aeid ID : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output config.
-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation.
-om File : Coded metadata File for BINAURAL_SPLIT_PCM OutputConf
Currently, all values default to level 3 (full functionality).
-q : Quiet mode, limit printouts to terminal, default is deactivated
......@@ -314,7 +319,11 @@ Options:
-exof File : External orientation trajectory File for simulation of external orientations
-dpid ID : Directivity pattern ID(s) (space-separated list of up to 4 numbers can be
specified) for binaural output configuration
-aeid ID : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output config.
-aeid ID : Acoustic environment ID (number > 0) or
a sequence thereof in the format [ID1:duration1,ID2:duration2...]
without braces and spaces, with ':' character separating ID from duration and ',' separating
ID and duration pairs, where duration is specified in frames
for BINAURAL_ROOM_REVERB output configuration.
-lp Position : Output LFE position. Comma-delimited triplet of [gain, azimuth, elevation] where gain is linear
(like --gain, -g) and azimuth, elevation are in degrees.
If specified, overrides the default behavior which attempts to map input to output LFE channel(s)
......@@ -325,11 +334,27 @@ Options:
-g : Input gain (linear, not in dB) to be applied to input audio file
-l : List supported audio formats
-smd : Metadata Synchronization Delay in ms, Default is 0. Quantized by 5ms subframes.
-om File : Coded metadata File for BINAURAL_SPLIT_PCM output format
-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation.
Currently, all values default to level 3 (full functionality).
-q : Quiet mode, limit printouts to terminal, default is deactivated
The usage of the "ISAR_post_rend" program:
------------------------------------------
Usage: ISAR_post_rend [options]
Options:
--------
-i File : Input File (input file is bitstream if format is BINAURAL_SPLIT_CODED, or PCM/WAV file if format is BINAURAL_SPLIT_PCM)
-if Format : Input Format of input (BINAURAL_SPLIT_CODED, BINAURAL_SPLIT_PCM)
-im File : Coded metadata File for BINAURAL_SPLIT_PCM input format
-o File : Output Audio File in BINAURAL format
-fs : Input sampling rate in kHz (48)
-prbfi File : BFI File
MULTICHANNEL LOUDSPEAKER INPUT / OUTPUT CONFIGURATIONS
======================================================
The loudspeaker positions for each MC layouts are assumed to have the following azimuth and elevation
......
......@@ -9,6 +9,8 @@ set(IVAS_TRUNK_DEC_PATH ${IVAS_TRUNK_PATH}/lib_dec)
set(IVAS_TRUNK_REND_PATH ${IVAS_TRUNK_PATH}/lib_rend)
set(IVAS_TRUNK_ENC_PATH ${IVAS_TRUNK_PATH}/lib_enc)
set(IVAS_TRUNK_COM_PATH ${IVAS_TRUNK_PATH}/lib_com)
set(IVAS_TRUNK_ISAR_PATH ${IVAS_TRUNK_PATH}/lib_isar)
set(IVAS_TRUNK_LC3_PATH ${IVAS_TRUNK_PATH}/lib_lc3plus)
set(IVAS_TRUNK_DEBUG_PATH ${IVAS_TRUNK_PATH}/lib_debug)
option(USE_MATLAB_ENG "Use matlab engine" OFF) # allows to use sofa file as input to the exe, but on windows requires to register matlab as a com server type in matlab "comserver('register')""
......@@ -27,7 +29,8 @@ message("Matlab_MX_LIBRARY = ${Matlab_MX_LIBRARY}")
message("Matlab_MEX_LIBRARY = ${Matlab_MEX_LIBRARY}")
message("Matlab_ENGINE_LIBRARY = ${Matlab_ENGINE_LIBRARY}")
message("Matlab_DATAARRAY_LIBRARY = ${Matlab_DATAARRAY_LIBRARY}")
include_directories(${Matlab_INCLUDE_DIRS} ${IVAS_TRUNK_UTIL_PATH} ${IVAS_TRUNK_ENC_PATH} ${IVAS_TRUNK_DEC_PATH} ${IVAS_TRUNK_REND_PATH} ${IVAS_TRUNK_COM_PATH} ${IVAS_TRUNK_DEBUG_PATH})
include_directories(${Matlab_INCLUDE_DIRS} ${IVAS_TRUNK_UTIL_PATH} ${IVAS_TRUNK_ENC_PATH} ${IVAS_TRUNK_DEC_PATH} ${IVAS_TRUNK_REND_PATH} ${IVAS_TRUNK_COM_PATH} ${IVAS_TRUNK_ISAR_PATH} ${IVAS_TRUNK_LC3_PATH} ${IVAS_TRUNK_DEBUG_PATH})
if(USE_MATLAB_ENG)
string(REPLACE "mex" "eng" Matlab_ENG_LIBRARY ${Matlab_MEX_LIBRARY})
add_definitions(-DUSE_MATLAB_ENG)
......@@ -71,9 +74,11 @@ add_library(${PROJECT_NAME}_lib STATIC ${SOURCE_FILES_C} ${SOURCE_FILES_H})
add_executable(${PROJECT_NAME} generate_crend_ivas_tables_from_sofa.c)
target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_lib ${Matlab_MAT_LIBRARY} ${Matlab_MX_LIBRARY})
if(UNIX AND NOT APPLE)
target_link_libraries(${PROJECT_NAME} libstdc++.so.6 -lm -ldl)
endif()
if(USE_MATLAB_ENG)
target_link_libraries(${PROJECT_NAME} ${Matlab_ENG_LIBRARY})
endif()
......
......@@ -19,9 +19,10 @@ set(IVAS_ENC_PATH ${IVAS_PATH}/lib_enc)
set(IVAS_COM_PATH ${IVAS_PATH}/lib_com)
set(IVAS_REND_PATH ${IVAS_PATH}/lib_rend)
set(IVAS_DEBUG_PATH ${IVAS_PATH}/lib_debug)
set(IVAS_LC3PLUS_PATH ${IVAS_PATH}/lc3plus)
set(IVAS_LC3PLUS_PATH ${IVAS_PATH}/lib_lc3plus)
set(IVAS_ISAR_PATH ${IVAS_PATH}/lib_isar)
include_directories(${IVAS_UTIL_PATH} ${IVAS_ENC_PATH} ${IVAS_DEC_PATH} ${IVAS_COM_PATH} ${IVAS_REND_PATH} ${IVAS_DEBUG_PATH} ${IVAS_LC3PLUS_PATH})
include_directories(${IVAS_UTIL_PATH} ${IVAS_ENC_PATH} ${IVAS_DEC_PATH} ${IVAS_COM_PATH} ${IVAS_REND_PATH} ${IVAS_DEBUG_PATH} ${IVAS_LC3PLUS_PATH} ${IVAS_ISAR_PATH})
set(SOURCE_FILES_C
${IVAS_REND_PATH}/ivas_rom_binauralRenderer.c
......@@ -40,4 +41,3 @@ add_executable(${PROJECT_NAME} generate_tables_from_rom_to_bin.c)
target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_lib)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:${PROJECT_NAME}>" "${CMAKE_CURRENT_SOURCE_DIR}/")
......@@ -160,7 +160,7 @@ fi
if [ -z "$FILES" ]; then
if [ $ALL ]; then
FILES=$(ls lib_com/*.[c,h] lib_dec/*.[c,h] lib_enc/*.[c,h] lib_rend/*.[c,h] lib_util/*.[c,h] apps/*.[c,h])
FILES=$(ls lib_com/*.[c,h] lib_dec/*.[c,h] lib_enc/*.[c,h] lib_isar/*.[c,h] lib_rend/*.[c,h] lib_util/*.[c,h] apps/*.[c,h])
elif [ -d ".svn" ]; then
if [ ! -x "$(command -v svn)" ]; then
echo "Subversion doesn't seem to be installed. Please ensure svn is in your PATH"
......
#!/usr/bin/env python3
from pathlib import Path
import os
import glob
files = ['Readme_IVAS_JBM_dec.txt','Readme_IVAS_dec.txt','Readme_IVAS_enc.txt','Readme_IVAS_rend.txt', 'Readme_IVAS_ISAR_dec.txt', 'Readme_IVAS_ISAR_post_rend.txt'];
used_files = []
kept = 0
removed = 0
# Input files explicitly listed in scripts
for file in files:
with open(file,"r") as fp:
for line in fp:
for item in line.split():
if "$TESTV_PATH" in item or "$REF_PATH" in item:
used_files.append(Path(item).name)
# All .dat files in testv (binary render config files listed via txt config file)
for file in glob.glob("testvec/testv/*.dat"):
used_files.append(Path(file).name)
# All .met, .csv and .wav files in .txt configuration files
for file in glob.glob("testvec/testv/*.txt"):
with open(file,"r") as fp:
for line in fp:
if any(x in line for x in [".met",".csv",".wav"]):
used_files.append(Path(line).name.strip())
# Remove duplicates
used_files = list(dict.fromkeys(used_files))
for dirpath, subdirs, files in os.walk("testvec"):
for file in files:
if file in used_files:
kept = kept + 1
else:
removed = removed + 1
os.remove(os.path.join(dirpath, file))
print(f"Identified {len(used_files)} files from scripts")
print(f"Removed {removed} files")
print(f"Kept {kept} files")
......@@ -533,7 +533,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
../IVAS_cod -dtx -ism 4 testv/stvISM1.csv NULL NULL testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv4ISM48n.wav bit
../IVAS_dec HOA3 48 bit testv/stv4ISM48n.wav_brate_sw_48-48_DTX_hoa3.tst
// 4 ISM with and without metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL_ROOM_IR out (Model from file)
// 4 ISM w and wo md br switching 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL_ROOM_IR out (Model from file)
../IVAS_cod -dtx -ism 4 testv/stvISM1.csv NULL NULL testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv4ISM48n.wav bit
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL_ROOM_IR 48 bit testv/stv4ISM48n.wav_brate_sw_48-48_DTX_hoa3.tst
......@@ -880,23 +880,23 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out HR
../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit
../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 32 bit testv/stv3OA32c.pcm_SBA_12800032-32_BinauralRoomReverb_Headrot.tst
../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_BinauralRoomReverb_Headrot.tst
// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, HR
../IVAS_cod -sba 3 128000 32 testv/stv3OA32c.wav bit
../IVAS_dec -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/stv3OA32c.pcm_SBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot.tst
../IVAS_dec -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_BinauralRoomReverb_Config_renderer_Headrot.tst
// SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR
../IVAS_cod -sba 2 128000 32 testv/stv2OA32c.wav bit
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 16 bit testv/stv2OA32c.pcm_SBA_12800032-16_BinauralRoomReverb_Headrot_BinauralFile.tst
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 16 bit testv/stv2OA32c.pcm_SBA_128000_32-16_BinauralRoomReverb_Headrot_BinauralFile.tst
// Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR
../IVAS_cod -sba -1 128000 48 testv/stvFOA48c.wav bit
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/stvFOA48c.pcm_planarSBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot_BinauralFile.tst
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/stvFOA48c.pcm_planarSBA_128000_48-32_BinauralRoomReverb_Config_renderer_Headrot_BinauralFile.tst
// SBA 3OA at 128 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB rendconf sel acoustic env
../IVAS_cod -sba 3 128000 48 testv/stv3OA48c.wav bit
../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid 1 BINAURAL_ROOM_REVERB 48 bit testv/stv3OA48c.pcm_SBA_12800048-48_BinauralRoomReverb_Config_renderer_combined_AEID_1.tst
../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid 1 BINAURAL_ROOM_REVERB 48 bit testv/stv3OA48c.pcm_SBA_128000_48-48_BinauralRoomReverb_Config_renderer_combined_AEID_1.tst
// SBA at 256 kbps, 48kHz in, 48kHz out, PCA, BINAURAL out
../IVAS_cod -pca -sba 1 256000 48 testv/stvFOA48c.wav bit
......@@ -1253,7 +1253,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
// Multi-channel 7_1_4 at 160 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM_IR out, HR
../IVAS_cod -max_band FB -mc 7_1_4 160000 48 testv/stv714MC48c.wav bit
../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/stv714MC48c.wav_MC714_160000_48-16_MC_binaural-HR.tst
../IVAS_dec -t testv/headrot.csv BINAURAL 16 bit testv/stv714MC48c.wav_MC714_160000_48-16_MC_binaural-HR.tst
// Multi-channel 7_1_4 at 160 kbps, 48kHz in, 48kHz out, 7_1_4 out
../IVAS_cod -mc 7_1_4 160000 48 testv/stv714MC48c.wav bit
......@@ -1292,6 +1292,18 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit
../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 16 bit testv/stv51MC48c.wav_MC51_512000_48-16_MC_Config_renderer.tst
// Multi-channel 5_1 at 512 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (CREND)
//../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit
//../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid 1:200,0:100,2:500 BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_reverb_sequence.tst
// Multi-channel 5_1 at 64 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (FastConv)
//../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit
//../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid 1:500,2:100,0:300 BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_MC_reverb_sequence.tst
// Multi-channel 5_1 at 32 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (ParamBin)
//../IVAS_cod -mc 5_1 32000 48 testv/stv51MC48c.wav bit
//../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid 0:100,2:500,1:200 BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_32000_48-48_MC_reverb_sequence.tst
// Multi-channel 5_1 at 32 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out Config hospital_patientroom
../IVAS_cod -mc 5_1 32000 48 testv/stv51MC48c.wav bit
../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_32000_48-48_MC_Config_hospital_patientroom.tst
......@@ -1320,7 +1332,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit
../IVAS_dec -render_config testv/rend_config_ER_v2.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_ER_v2.tst
// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out Config early reflections, low complexity, listener origin
// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out Conf early refl, low complexity, listener origin
../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit
../IVAS_dec -render_config testv/rend_config_ER_v3.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_ER_v3.tst
......@@ -1336,6 +1348,10 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/stv51MC48c.wav bit
../IVAS_dec BINAURAL_ROOM_REVERB 16 bit testv/stv51MC48c.wav_sw_48-16_Binaural_room.tst
// Multi-channel 5_1 bitrate switching from 13.2 kbps to 512 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_IR out
../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 32 testv/stv51MC32c.wav bit
../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv51MC32c.wav_sw_32-48_Binaural_room.tst
// Multi-channel 5_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 10%, bandwidth switching
../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -mc 5_1 ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv51MC48c.wav bit
eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error
......@@ -1726,10 +1742,10 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
../IVAS_cod -ism_sba 4 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 32 testv/stvOSBA_4ISM_3OA32c.wav bit
../IVAS_dec EXT 48 bit testv/stvOSBA_4ISM_3OA32c.wav_EXT_sw_13k2_512k_32-48.tst
// OSBA FOA 4ISM at bitrate switching 13.2 to 512 kbps, 48kHz in, 16kHz out, BINAURAL out (Model from file), FER at 5%, bandwidth switching
// OSBA FOA 4ISM at br sw 13.2 to 512 kbps, 48kHz in, 16kHz out, BINAURAL out (Model from file), FER at 5%, bandwidth switching
../IVAS_cod -max_band testv/ivas_bws_20fr_start_FB.txt -ism_sba 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_4ISM_FOA48c.wav bit
eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/stvOSBA_4ISM_FOA48c.wav_BINAURAL_sw_48-48_FER5.tst
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/stvOSBA_4ISM_FOA48c.wav_BINAURAL_sw_48-16_FER5.tst
// OSBA 3ISM 2OA at bitrate switching 13.2 to 512 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10%
../IVAS_cod -ism_sba 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_3ISM_2OA48c.wav bit
......@@ -1755,3 +1771,16 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g
// OSBA planar 2OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM REVERB (Model from file) out
../IVAS_cod -ism_sba 4 -2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stvOSBA_4ISM_2OA48c.wav bit
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL_ROOM_REVERB 48 bit testv/stvOSBA_4ISM_p3OA48c.wav_BINAURAL_ROOM_REVERB_512000_48-48.tst
// SBA FOA bitrate switching from 13.2 kbps to 192 kbps, 32kHz in, 32kHz out, DTX on, EXT out
../IVAS_cod -dtx -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 32 testv/stvFOA32c.wav bit
../IVAS_dec EXT 32 bit testv/stvFOA32c.wav_sw_32-32_DTX_EXT.tst
// SBA 3OA bitrate switching from 13.2 kbps to 128 kbps, 32kHz in, 32kHz out, DTX on, EXT out
../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv3OA32c.wav bit
../IVAS_dec EXT 32 bit testv/stv3OA32c.wav_sw_32-32_DTX_EXT.tst
// SBA 2OA bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, EXT out, random FER at 5%, DTX on
../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/stv3OA48c.wav bit
eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error
../IVAS_dec EXT 48 bit_error testv/stv3OA48c.wav_sw_48-48_EXT_FER5.tst
......@@ -532,7 +532,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
../IVAS_cod -dtx -ism 4 testv/ltvISM1.csv NULL NULL testv/ltvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_4ISM.wav bit
../IVAS_dec HOA3 48 bit testv/ltv48_4ISM.wav_brate_sw_48-48_DTX_hoa3.tst
// 4 ISM with and without metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL_ROOM_IR out (Model from file)
// 4 ISM w and wo md br switching 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL_ROOM_IR out (Model from file)
../IVAS_cod -dtx -ism 4 testv/ltvISM1.csv NULL NULL testv/ltvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_4ISM.wav bit
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL_ROOM_IR 48 bit testv/ltv48_4ISM.wav_brate_sw_48-48_DTX_hoa3.tst
......@@ -879,23 +879,23 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out HR
../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit
../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_SBA_12800032-32_BinauralRoomReverb_Headrot.tst
../IVAS_dec -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_SBA_128000_32-32_BinauralRoomReverb_Headrot.tst
// SBA at 128 kbps, 32kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out, Config renderer, HR
../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit
../IVAS_dec -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_SBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot.tst
../IVAS_dec -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv32_HOA3.pcm_SBA_128000_32-32_BinauralRoomReverb_Config_renderer_Headrot.tst
// SBA at 128 kbps, 32kHZ in, 16kHz out, BINAURAL_ROOM_REVERB out (Model from file), HR
../IVAS_cod -sba 2 128000 32 testv/ltv32_HOA2.wav bit
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 16 bit testv/ltv32_HOA2.pcm_SBA_12800032-16_BinauralRoomReverb_Headrot_BinauralFile.tst
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin -t testv/headrot_case00_3000_q.csv BINAURAL_ROOM_REVERB 16 bit testv/ltv32_HOA2.pcm_SBA_128000_32-16_BinauralRoomReverb_Headrot_BinauralFile.tst
// Planar SBA at 128 kbps, 48kHZ in, 32kHz out, BINAURAL_ROOM_REVERB out (Model from file), Config renderer, HR
../IVAS_cod -sba -1 128000 48 testv/ltv48_FOA.wav bit
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv48_FOA.pcm_planarSBA_12800032-32_BinauralRoomReverb_Config_renderer_Headrot_BinauralFile.tst
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin -t testv/headrot_case00_3000_q.csv -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/ltv48_FOA.pcm_planarSBA_128000_48-32_BinauralRoomReverb_Config_renderer_Headrot_BinauralFile.tst
// SBA 3OA at 128 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB rendconf sel acoustic env
../IVAS_cod -sba 3 128000 48 testv/ltv48_HOA3.wav bit
../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid 1 BINAURAL_ROOM_REVERB 48 bit testv/ltv48_HOA3.pcm_SBA_12800048-48_BinauralRoomReverb_Config_renderer_combined_AEID_1.tst
../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid 1 BINAURAL_ROOM_REVERB 48 bit testv/ltv48_HOA3.pcm_SBA_128000_48-48_BinauralRoomReverb_Config_renderer_combined_AEID_1.tst
// SBA at 256 kbps, 48kHz in, 48kHz out, PCA, BINAURAL out
../IVAS_cod -pca -sba 1 256000 48 testv/ltv48_FOA.wav bit
......@@ -1252,7 +1252,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
// Multi-channel 7_1_4 at 160 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM_IR out, HR
../IVAS_cod -mc 7_1_4 160000 48 testv/ltv48_MC714.wav bit
../IVAS_dec -t testv/headrot.csv BINAURAL 48 bit testv/ltv48_MC714.wav_MC714_160000_48-48_MC_binaural_hrot.tst
../IVAS_dec -t testv/headrot.csv BINAURAL 16 bit testv/ltv48_MC714.wav_MC714_160000_48-16_MC_binaural_hrot.tst
// Multi-channel 7_1_4 at 160 kbps, 48kHz in, 48kHz out, 7_1_4 out
../IVAS_cod -mc 7_1_4 160000 48 testv/ltv48_MC714.wav bit
......@@ -1283,7 +1283,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
../IVAS_cod -mc 7_1 512000 48 testv/ltv48_MC71.wav bit
../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MC71.wav_MC71_512000_48-48_MC_Config_renderer.tst
// Multi-channel 5_1 at 80 kbps, 48kHz in, 32kHz out, BINAURAL_ROOM_REVERB out Config renderer
// Multi-channel 5_1 at 80 kbps, 48kHz in, 32kHz out, BINAURAL_ROOM_REVERB out Config renderer, HR
../IVAS_cod -mc 5_1 80000 48 testv/ltv48_MC51.wav bit
../IVAS_dec -render_config testv/rend_config_renderer.cfg -t ../scripts/trajectories/full-circle-4s.csv BINAURAL_ROOM_REVERB 32 bit testv/ltv48_MC51.wav_MC51_80000_48-32_MC_Config_renderer.tst
......@@ -1291,6 +1291,18 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
../IVAS_cod -mc 5_1 512000 48 testv/ltv48_MC51.wav bit
../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 16 bit testv/ltv48_MC51.wav_MC51_512000_48-16_MC_Config_renderer.tst
// Multi-channel 5_1 at 512 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (CREND)
//../IVAS_cod -mc 5_1 512000 48 testv/ltv51MC48c.wav bit
//../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid 1:500,0:1000,2:500 BINAURAL_ROOM_REVERB 48 bit testv/ltv51MC48c.wav_MC51_512000_48-48_MC_reverb_sequence.tst
// Multi-channel 5_1 at 64 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (FastConv)
//../IVAS_cod -mc 5_1 64000 48 testv/ltv51MC48c.wav bit
//../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid 1:500,2:500,0:500 BINAURAL_ROOM_REVERB 48 bit testv/ltv51MC48c.wav_MC51_64000_48-48_MC_reverb_sequence.tst
// Multi-channel 5_1 at 32 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (ParamBin)
//../IVAS_cod -mc 5_1 32000 48 testv/ltv51MC48c.wav bit
//../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid 0:1000,2:500,1:500 BINAURAL_ROOM_REVERB 48 bit testv/ltv51MC48c.wav_MC51_32000_48-48_MC_reverb_sequence.tst
// Multi-channel 5_1 at 32 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out Config hospital_patientroom
../IVAS_cod -mc 5_1 32000 48 testv/ltv48_MC51.wav bit
../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MC51.wav_MC51_80000_48-48_MC_Config_hospital_patientroom.tst
......@@ -1299,7 +1311,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
../IVAS_cod -mc 5_1 160000 48 testv/ltv48_MC51.wav bit
../IVAS_dec -render_config testv/rend_config_recreation.cfg -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MC51.wav_M714_160000_48-48_MC_Config_recreation.tst
// Multi-channel 5_1_2 64 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out Config renderer, HR
// Multi-channel 5_1_2 at 64 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out Config renderer, HR
../IVAS_cod -mc 5_1_2 64000 48 testv/ltv48_MC512.wav bit
../IVAS_dec -render_config testv/rend_config_renderer.cfg -t testv/headrot_case04_3000_q.csv BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MC512.wav_MC512_64000_48-48_MC_Config_renderer.tst
......@@ -1319,7 +1331,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
../IVAS_cod -mc 7_1_4 512000 48 testv/ltv48_MC714.wav bit
../IVAS_dec -render_config testv/rend_config_ER_v2.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MC714.wav_MC714_512000_48-48_MC_ER_v2.tst
// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out Config early reflections, low complexity, listener origin
// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out Conf early refl, low complexity, listener origin
../IVAS_cod -mc 7_1_4 512000 48 testv/ltv48_MC714.wav bit
../IVAS_dec -render_config testv/rend_config_ER_v3.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MC714.wav_MC714_512000_48-48_MC_ER_v3.tst
......@@ -1725,10 +1737,10 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1
../IVAS_cod -ism_sba 4 3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 32 testv/ltv32_OSBA_4ISM_HOA3.wav bit
../IVAS_dec EXT 48 bit testv/ltv32_OSBA_4ISM_HOA3.wav_EXT_sw_13k2_512k_32-32.tst
// OSBA FOA 4ISM at bitrate switching 13.2 to 512 kbps, 48kHz in, 16kHz out, BINAURAL out (Model from file), FER at 5%, bandwidth switching
// OSBA FOA 4ISM at br sw 13.2 to 512 kbps, 48kHz in, 16kHz out, BINAURAL out (Model from file), FER at 5%, bandwidth switching
../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -ism_sba 4 1 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_OSBA_4ISM_FOA.wav bit
eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/ltv48_OSBA_4ISM_FOA.wav_BINAURAL_sw_48-48_FER5.tst
../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL 16 bit_error testv/ltv48_OSBA_4ISM_FOA.wav_BINAURAL_sw_48-16_FER5.tst
// OSBA 3ISM 2OA at bitrate switching 13.2 to 512 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10%
// ../IVAS_cod -ism_sba 3 2 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_OSBA_3ISM_2OA.wav bit
......
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <CUT_DEC_BIN>"
exit -1
fi
CUT_DEC_BIN=$1
DIFF_BIN="diff"
TESTV_PATH="."
REF_PATH="./testv"
CUT_PATH="./TMP_DEC_ISAR"
LOG_FILE=Readme_IVAS_ISAR_dec_log.txt
rm -rf tmp
rm -rf $CUT_PATH
mkdir -p $CUT_PATH
mkdir -p $CUT_PATH/split_rendering/cut
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <CUT_ISAR_POST_REND_BIN>"
exit -1
fi
CUT_ISAR_POST_REND_BIN=$1
DIFF_BIN="diff"
TESTV_PATH="."
REF_PATH="./testv"
CUT_PATH="./TMP_ISAR_POST_REND"
LOG_FILE=Readme_IVAS_isar_post_rend_log.txt
rm -rf tmp
rm -rf $CUT_PATH
mkdir -p $CUT_PATH/split_rendering/cut
......@@ -2,38 +2,64 @@
# This script shall only be used by automated continuous integration systems
scriptdir=$(dirname "$0")
pushd "$scriptdir" || exit 1
printf "Cleaning old version of LC3plus\n"
rm -rf lib_lc3plus
# Download and unzip LC3plus code
rm -rf ETSI_Release
curl -o ./lc3plus_sources.zip https://www.etsi.org/deliver/etsi_ts/103600_103699/103634/01.04.01_60/ts_103634v010401p0.zip
printf "Downloading LC3plus code\n"
if false; then
# Waiting for official ETSI release.
# TODO: add new URL, remove `if false` when package goes public
curl -o ./lc3plus_sources.zip NEW_URL_HERE
unzip lc3plus_sources.zip -d .
# Modify LC3plus code to be compatible with IVAS tools (e.g. WMC tool)
git apply --ignore-whitespace lc3plus.patch
rm ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c
rm ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/codec_exe.c
rm lc3plus_sources.zip
cp -r "ETSI_Release/<package name here>/src/floating_point" lib_lc3plus
rm -r ETSI_Release
else
# Temp solution for downloading WIP ETSI package
# LC3_ETSI_REPO_URL must be define before running the script
git clone "$LC3_ETSI_REPO_URL"
cp -r lc3_etsi_release/src/floating_point lib_lc3plus
rm -rf lc3_etsi_release
fi
# Remove unneeded files
rm ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/makefile
rm ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h
rm ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywaveout_c.h
rm ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c
rm -r ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc
printf "Removing unneeded files\n"
rm lib_lc3plus/codec_exe.c # Only used for executable
rm lib_lc3plus/makefile # Build handled at IVAS level
rm -r lib_lc3plus/msvc # Build handled at IVAS level
rm lib_lc3plus/plc_noise_substitution0.c # Empty file
rm lib_lc3plus/tinywavein_c.h # Only used for executable
rm lib_lc3plus/tinywaveout_c.h # Only used for executable
# Limit file permissions
find ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point -type f -exec chmod -x {} \;
# Move to output dir
rm -rf ../../lib_lc3plus
mkdir ../../lib_lc3plus
mv ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/* ../../lib_lc3plus
printf "Limiting file permissions\n"
find lib_lc3plus -type f -print0 | \
xargs -0 -I {} \
chmod -x {}
# Create additional files
printf "DisableFormat: true\nSortIncludes: Never\n" > ../../lib_lc3plus/.clang-format
# include options.h in all C files
printf "Including options.h and wmc_auto.h in C files\n"
find lib_lc3plus -name '*.[ch]' -type f -print0 | \
xargs -0 -I {} \
sed -i '
# range: from 1st line to first match
1,/^#include/ {
# insert lines before first match
/^#include/ i\
#include "options.h"\
#include "wmc_auto.h"
}
' {}
# Clean up
rm -rf lc3plus_sources.zip ETSI_Release
# Remove whitespace from preprocessor commands
printf "Removing whitespace from preprocessor commands\n"
find lib_lc3plus -name '*.[ch]' -type f -print0 | \
xargs -0 -I {} \
sed -i 's/^#[[:space:]]\+/#/' {}
popd || exit
# Add .clang-format file to lib_lc3plus to disable formatting there
printf "Disabling clang-format in lib_lc3plus directory\n"
printf '
DisableFormat: true
SortIncludes: Never
' >> lib_lc3plus/.clang-format
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_idx_off, LC3_FLOAT* gain, LC3_INT target, LC3_INT nBits, LC3_INT* gainChange, LC3_INT fs_idx
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "stdint.h"
#include <assert.h>
#include <stdlib.h>
@@ -1010,8 +1011,8 @@
LC3_UINT8 blacklist[FEC_N_MODES];
LC3_INT32 rop;
- rop = 0;
void (*syndr_calc[3])(LC3_UINT8 *, LC3_UINT8 *, LC3_INT32);
+ rop = 0;
/* initialization */
blacklist[0] = 0;
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processApplyGlobalGain_fl(LC3_FLOAT x[], LC3_INT xLen, LC3_INT global_gain_idx, LC3_INT global_gain_off)
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
static void ac_shift_fl(Encoder_State_fl* st);
@@ -620,7 +621,7 @@
if (st.pc_c_bp_side != 0)
{
- nbits_side = total_bits - 8 * (st.pc_b_left) + 8 * (st.pc_bytes - bp_side) - (8 - LC3_LOG2(mask_side));
+ nbits_side = total_bits - 8 * (st.pc_b_left) + 8 * (st.pc_bytes - bp_side) - (8 - LC3_LOGTWO(mask_side));
}
}
@@ -891,7 +892,7 @@
{
LC3_INT bits = 0, mask = 0, val = 0, over1 = 0, high = 0, over2 = 0, c = 0, b = 0;
- bits = 24 - floor(LC3_LOG2(st->range));
+ bits = 24 - floor(LC3_LOGTWO(st->range));
mask = ((LC3_INT)pow(2, 24) - 1) >> bits;
val = st->low + mask;
over1 = val >> 24;
@@ -1078,8 +1079,8 @@
}
/* Residual bits */
- nbits_side = total_bits - (8 * (*(st.bp_side) + 1) + 8 - LC3_LOG2(*(st.mask_side)));
- nbits_ari = (st.bp + 1) * 8 + 25 - floor(LC3_LOG2(st.range));
+ nbits_side = total_bits - (8 * (*(st.bp_side) + 1) + 8 - LC3_LOGTWO(*(st.mask_side)));
+ nbits_ari = (st.bp + 1) * 8 + 25 - floor(LC3_LOGTWO(st.range));
if (st.cache >= 0) {
nbits_ari = nbits_ari + 8;
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void attack_detector_fl(LC3_FLOAT* in, LC3_INT frame_size, LC3_INT fs, LC3_INT* lastAttackPosition, LC3_FLOAT* accNrg, LC3_INT* attackFlag,
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
/* DCT */
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void process_cutoff_bandwidth(LC3_FLOAT *d_fl, LC3_INT len, LC3_INT bw_bin)
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void dct2_init(Dct2* dct, int length)
@@ -27,11 +28,11 @@
void dct2_apply(Dct2* dct, const LC3_FLOAT* input, LC3_FLOAT* output)
{
- assert(input != output);
Complex tmp1[MAX_LEN];
Complex tmp2[MAX_LEN];
int i = 0;
const int len = dct->length;
+ assert(input != output);
for (i = 0; i < len / 2; i++) {
tmp1[i] = cmplx(input[i * 2], 0);
@@ -49,8 +50,8 @@
void dct4_init(Dct4* dct, int length)
{
- assert(length <= MAX_LEN);
int i = 0;
+ assert(length <= MAX_LEN);
dct->length = length;
dct->twid1 = calloc(sizeof(*dct->twid1), length / 2);
dct->twid2 = calloc(sizeof(*dct->twid2), length / 2);
@@ -73,12 +74,12 @@
void dct4_apply(Dct4* dct, const LC3_FLOAT* input, LC3_FLOAT* output)
{
- assert(input != output);
Complex tmp2[MAX_LEN / 2];
int i = 0;
Complex* tmp1 = (Complex*)output;
const int len = dct->length;
const LC3_FLOAT norm = (LC3_FLOAT)1.0 / LC3_SQRT((LC3_FLOAT)(len >> 1));
+ assert(input != output);
for (i = 0; i < len / 2; i++) {
tmp1[i] = cmul(cmplx(input[i * 2], input[len - i * 2 - 1]), dct->twid1[i]);
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
static void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* bit);
@@ -53,7 +54,7 @@
LC3_INT nbbytes = nbbits >> 3;
LC3_INT lastnz;
LC3_INT bw_cutoff_idx;
- LC3_INT nbits = ceil(LC3_LOG2(L_spec / 2));
+ LC3_INT nbits = ceil(LC3_LOGTWO(L_spec / 2));
if (nbits > nbbits)
{
@@ -173,7 +174,7 @@
}
/* Last non-zero tuple */
- read_uint_fl(ceil(LC3_LOG2(N / 2)), ptr, &mask_side_local, &bp_side_local, lastnz);
+ read_uint_fl(ceil(LC3_LOGTWO(N / 2)), ptr, &mask_side_local, &bp_side_local, lastnz);
*lastnz = (*lastnz + 1) * 2;
if (*lastnz > N) {
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
@@ -53,8 +54,8 @@
if (decoder->rframe == 1 && zero_frame == 0 && bfi != 1)
{
- bfi = 2;
LC3_INT32 max_bw_stopband = BW_cutoff_bin_all[bw_cutoff_idx];
+ bfi = 2;
switch (decoder->frame_dms)
{
# ifdef ENABLE_025_DMS_MODE
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h 2023-06-29 12:58:27
@@ -24,13 +24,13 @@
typedef uint32_t LC3_UINT32;
/* Release defines */
-#define ENABLE_2_5MS_MODE
+// #define ENABLE_2_5MS_MODE
#define ENABLE_5MS_MODE
#define ENABLE_10_MS_MODE
#define ENABLE_ADVANCED_PLC_FL
#define ENABLE_ADVANCED_PLC_FL_DEFAULT
#define ENABLE_BW_CONTROLLER
-#define ENABLE_HR_MODE_FL
+//#define ENABLE_HR_MODE_FL
#define ENABLE_PADDING
#define ENABLE_RFRAME_FL
#define ENABLE_PLC
@@ -49,8 +49,8 @@
/* Precision Defines */
#define LC3_FABS(x) (fabsf(x))
#define LC3_POW(x, y) (powf(x, y))
-#define LC3_LOG10(x) (log10f(x))
-#define LC3_LOG2(x) (log2f(x))
+#define LC3_LOGTEN(x) (log10f(x))
+#define LC3_LOGTWO(x) (log2f(x))
# define LC3_COS(x) (cos(x))
# define LC3_SIN(x) (sin(x))
#define LC3_SQRT(x) (sqrtf(x))
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3_INT frame_dms, LC3_INT* bw_idx)
@@ -68,7 +69,7 @@
dist = bw_dist[counter];
for (i = stop; i >= stop - dist; i--) {
- e_diff = 10.0 * LC3_LOG10(d2[i - dist + 1] + FLT_EPSILON) - 10.0 * LC3_LOG10(d2[i + 1] + FLT_EPSILON);
+ e_diff = 10.0 * LC3_LOGTEN(d2[i - dist + 1] + FLT_EPSILON) - 10.0 * LC3_LOGTEN(d2[i + 1] + FLT_EPSILON);
if (e_diff > thr) {
brickwall = 1;
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT numbytes, LC3_INT bw_cutoff_bits,
@@ -33,11 +34,11 @@
/* Last non zero touple */
if (bfi_ext == 1) {
- write_uint_backward_fl(ptr, bp_side, mask_side, lastnzTrigger[fs_idx], ceil(LC3_LOG2(N >> 1)));
+ write_uint_backward_fl(ptr, bp_side, mask_side, lastnzTrigger[fs_idx], ceil(LC3_LOGTWO(N >> 1)));
}
else
{
- write_uint_backward_fl(ptr, bp_side, mask_side, lastnz / 2 - 1, ceil(LC3_LOG2(N / 2)));
+ write_uint_backward_fl(ptr, bp_side, mask_side, lastnz / 2 - 1, ceil(LC3_LOGTWO(N / 2)));
}
/* LSB mode bit */
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s_in, uint8_t* bytes, int bps
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
@@ -60,8 +61,8 @@
} else {
g_min = x_max / (32767 - 0.375);
}
- /* Prevent positive rounding errors from LC3_LOG10 function */
- ind_min = 28.0 * LC3_LOG10(g_min);
+ /* Prevent positive rounding errors from LC3_LOGTEN function */
+ ind_min = 28.0 * LC3_LOGTEN(g_min);
ind_min = ceil(ind_min + LC3_FABS(ind_min) * LC3_EPS);
@@ -76,7 +77,7 @@
tmp += x[i + 1] * x[i + 1];
tmp += x[i + 2] * x[i + 2];
tmp += x[i + 3] * x[i + 3];
- en[j] = (28.0 / 20.0) * (7 + 10.0 * LC3_LOG10(tmp + reg_val));
+ en[j] = (28.0 / 20.0) * (7 + 10.0 * LC3_LOGTEN(tmp + reg_val));
j++;
}
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c 2023-06-29 12:58:27
@@ -8,7 +8,7 @@
******************************************************************************/
-
+#include "options.h"
#include "cfft.h"
#include "iisfft.h" /* for M_PIl */
#include <stdlib.h> /* for abs() */
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c 2023-06-29 12:58:27
@@ -8,14 +8,15 @@
******************************************************************************/
+#include "options.h"
#include <assert.h>
#include <stddef.h>
-#include "iis_fft.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "../structs.h"
+#include <math.h>
+#include "iis_fft.h"
/**************************************************************************************************/
/* AFFT uses two fft implementations
@@ -24,9 +25,6 @@
fast lengths, check the fft_n function.
*/
-#include <math.h>
-#include "cfft.h"
-#include "iisfft.h"
#define FFT_COMPLEX 1
#define FFT_REAL 2
@@ -122,12 +120,13 @@
IIS_FFT_ERROR LC3_IIS_FFT_Apply_CFFT(HANDLE_IIS_FFT handle, const Complex* input, Complex* output)
{
+ LC3_FLOAT* dummy;
if (!handle)
return IIS_FFT_INTERNAL_ERROR;
/* check for inplace operation */
memmove(output, input, sizeof(*input) * handle->len);
- LC3_FLOAT* dummy = (LC3_FLOAT*)output;
+ dummy = (LC3_FLOAT*)output;
if (handle->cfft.len > 0) {
LC3_cfft_apply(&handle->cfft, dummy, dummy + 1, 2);
} else {
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h 2023-06-29 12:58:27
@@ -12,6 +12,7 @@
#define IIS_FFT_H
#include "../structs.h"
+#include "../defines.h"
#include "cfft.h"
#ifdef __cplusplus
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include <assert.h>
#include <string.h> /* for mmove */
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h 2023-06-29 12:58:27
@@ -11,6 +11,7 @@
#ifndef IISFFT_H
#define IISFFT_H
+#include "../defines.h"
#ifndef M_PIl
#define M_PIl 3.1415926535897932384626433832795029L /* pi */
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
/* Function expects already flipped window */
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "lc3.h"
#include "defines.h"
#include "functions.h"
@@ -48,8 +49,9 @@
case 44100: return 1;
case 48000: return 1;
case 96000: return 1;
- default: return 0;
+ default: break;
}
+ return 0;
}
static int lc3plus_plc_mode_supported(LC3PLUS_PlcMode plc_mode)
@@ -58,8 +60,9 @@
{
case LC3PLUS_PLC_ADVANCED: /* fallthru */
return 1;
- default: return 0;
+ default: break;
}
+ return 0;
}
static int lc3plus_frame_size_supported(float frame_ms)
@@ -69,8 +72,9 @@
case 25: /* fallthru */
case 50: /* fallthru */
case 100: return 1;
- default: return 0;
+ default: break;
}
+ return 0;
}
static int null_in_list(void **list, int n)
@@ -97,13 +101,14 @@
/* encoder functions *********************************************************/
LC3PLUS_Error lc3plus_enc_init(LC3PLUS_Enc *encoder, int samplerate, int channels, int hrmode, int32_t lfe_channel_array[])
{
+ int ch = 0;
+
RETURN_IF(encoder == NULL, LC3PLUS_NULL_ERROR);
RETURN_IF((uintptr_t)encoder % 4 != 0, LC3PLUS_ALIGN_ERROR);
RETURN_IF(!lc3plus_samplerate_supported(samplerate), LC3PLUS_SAMPLERATE_ERROR);
RETURN_IF(!lc3plus_channels_supported(channels), LC3PLUS_CHANNELS_ERROR);
RETURN_IF(samplerate==96000 && hrmode == 0, LC3PLUS_HRMODE_ERROR);
- int ch = 0;
for (ch = 0; ch < channels; ch++)
{
RETURN_IF(!lc3_enc_supported_lfe() && lfe_channel_array[ch], LC3PLUS_LFE_MODE_NOT_SUPPORTED);
@@ -142,6 +147,7 @@
int lc3plus_enc_get_real_bitrate(const LC3PLUS_Enc *encoder)
{
int ch = 0, totalBytes = 0;
+ int bitrate;
RETURN_IF(encoder == NULL, 0);
RETURN_IF(!encoder->lc3_br_set, LC3PLUS_BITRATE_UNSET_ERROR);
@@ -150,7 +156,7 @@
totalBytes += encoder->channel_setup[ch]->targetBytes;
}
- int bitrate = (totalBytes * 80000.0 + encoder->frame_dms - 1) / encoder->frame_dms;
+ bitrate = (totalBytes * 80000.0 + encoder->frame_dms - 1) / encoder->frame_dms;
if (encoder->fs_in == 44100)
{
@@ -191,11 +197,13 @@
LC3PLUS_Error lc3plus_enc_set_bandwidth(LC3PLUS_Enc *encoder, int bandwidth)
{
+ LC3_INT effective_fs;
+
RETURN_IF(encoder == NULL, LC3PLUS_NULL_ERROR);
#ifdef ENABLE_HR_MODE_FL_FLAG
RETURN_IF(encoder->hrmode == 1, LC3PLUS_HRMODE_BW_ERROR);
#endif
- LC3_INT effective_fs = encoder->fs_in;
+ effective_fs = encoder->fs_in;
if (encoder->bandwidth != bandwidth) {
if (encoder->fs_in > 40000) {
effective_fs = 40000;
@@ -338,9 +346,9 @@
LC3PLUS_Error lc3plus_free_encoder_structs(LC3PLUS_Enc* encoder)
{
+ int ch = 0;
RETURN_IF(!encoder, LC3PLUS_NULL_ERROR);
- int ch = 0;
for (ch = 0; ch < encoder->channels; ch++) {
mdct_free(&encoder->channel_setup[ch]->mdctStruct);
dct2_free(&encoder->channel_setup[ch]->dct2StructSNS);
@@ -351,9 +359,9 @@
LC3PLUS_Error lc3plus_free_decoder_structs(LC3PLUS_Dec* decoder)
{
+ int ch = 0;
RETURN_IF(!decoder, LC3PLUS_NULL_ERROR);
- int ch = 0;
for (ch = 0; ch < decoder->channels; ch++) {
dct4_free(&decoder->channel_setup[ch]->dct4structImdct);
real_fft_free(&decoder->channel_setup[ch]->PlcAdvSetup->PlcPhEcuSetup.PhEcu_Fft);
@@ -378,11 +386,14 @@
LC3PLUS_Error lc3plus_enc_set_ep_mode(LC3PLUS_Enc *encoder, LC3PLUS_EpMode epmode)
{
+ LC3PLUS_EpMode oldEpmode;
+ LC3PLUS_Error error;
+
RETURN_IF(encoder == NULL, LC3PLUS_NULL_ERROR);
RETURN_IF((unsigned)epmode > LC3PLUS_EP_HIGH, LC3PLUS_EPMODE_ERROR);
- LC3PLUS_EpMode oldEpmode = encoder->epmode;
+ oldEpmode = encoder->epmode;
encoder->epmode = epmode;
- LC3PLUS_Error error = encoder->lc3_br_set ? update_enc_bitrate(encoder, encoder->bitrate) : LC3PLUS_OK;
+ error = encoder->lc3_br_set ? update_enc_bitrate(encoder, encoder->bitrate) : LC3PLUS_OK;
if (error != LC3PLUS_OK)
{
encoder->epmode = oldEpmode; // preserve old epmode in case of failure
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c 1970-01-01 01:00:00
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c 2023-06-29 12:58:27
@@ -0,0 +1,99 @@
+/******************************************************************************
+* ETSI TS 103 634 V1.4.1 *
+* Low Complexity Communication Codec Plus (LC3plus) *
+* *
+* Copyright licence is solely granted through ETSI Intellectual Property *
+* Rights Policy, 3rd April 2019. No patent licence is granted by implication, *
+* estoppel or otherwise. *
+******************************************************************************/
+
+
+#include "options.h"
+#include "functions.h"
+#include "fft/iis_fft.c"
+#include "fft/iisfft.c"
+#include "fft/cfft.c"
+
+void fft_init(Fft* fft, int length)
+{
+ HANDLE_IIS_FFT handle = NULL;
+ IIS_FFT_ERROR error = 0;
+ assert(length % 2 == 0);
+
+ fft->length = length;
+
+ error = LC3_IIS_CFFT_Create(&handle, length, IIS_FFT_FWD);
+
+ assert(error == IIS_FFT_NO_ERROR);
+ fft->handle = handle;
+}
+
+void fft_free(Fft* fft)
+{
+ IIS_FFT_ERROR error = 0;
+
+ if (fft) {
+ error = LC3_IIS_CFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle);
+
+ assert(error == IIS_FFT_NO_ERROR);
+ memset(fft, 0, sizeof(*fft));
+ }
+}
+
+void real_fft_free(Fft* fft)
+{
+ IIS_FFT_ERROR error = 0;
+
+ if (fft) {
+ error = LC3_IIS_RFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle);
+
+ assert(error == IIS_FFT_NO_ERROR);
+ memset(fft, 0, sizeof(*fft));
+ }
+}
+
+void real_fft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle)
+{
+ IIS_FFT_ERROR error = IIS_FFT_NO_ERROR;
+ assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/
+
+ fft->length = length;
+
+ error = LC3_IIS_RFFT_Create(handle, length, IIS_FFT_FWD);
+ assert(error == IIS_FFT_NO_ERROR);
+ fft->handle = *handle;
+}
+
+
+void real_ifft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle)
+{
+ IIS_FFT_ERROR error = IIS_FFT_NO_ERROR;
+ assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/
+
+ fft->length = length;
+
+ error = LC3_IIS_RFFT_Create(handle, length, IIS_FFT_BWD);
+
+ assert(error == IIS_FFT_NO_ERROR);
+ fft->handle = *handle;
+}
+
+void fft_apply(Fft* fft, const Complex* input, Complex* output)
+{
+ IIS_FFT_ERROR error = 0;
+ error = LC3_IIS_FFT_Apply_CFFT(fft->handle, input, output);
+
+ assert(error == IIS_FFT_NO_ERROR);
+}
+
+
+void real_fft_apply(Fft* fft, const LC3_FLOAT* input, LC3_FLOAT* output)
+{
+ IIS_FFT_ERROR error = IIS_FFT_NO_ERROR;
+
+ UNUSED(error);
+
+ error = LC3_IIS_FFT_Apply_RFFT(fft->handle, input, output);
+
+ assert(error == IIS_FFT_NO_ERROR);
+}
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
static LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len);
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT fs, LC3_FLOAT* mem_old_x, LC3_FLOAT* mem_old_y,
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
static const LC3_FLOAT* mdct_window(LC3_INT length, LC3_INT frame_dms, LC3_INT hrmode)
@@ -104,6 +105,7 @@
{
LC3_FLOAT tmp[MAX_LEN * 2] = {0};
LC3_INT i = 0;
+ LC3_INT hlen;
move_float(tmp, mdct->mem, mdct->mem_length);
move_float(tmp + mdct->mem_length, input, mdct->length);
@@ -112,7 +114,7 @@
mult_vec(tmp, mdct->window, mdct->length * 2);
- LC3_INT hlen = mdct->length / 2;
+ hlen = mdct->length / 2;
for (i = 0; i < hlen; i++) {
output[i] = -tmp[hlen * 3 - i - 1] - tmp[hlen * 3 + i];
output[hlen + i] = tmp[i] - tmp[hlen * 2 - i - 1];
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processMdctShaping_fl(LC3_FLOAT x[], LC3_FLOAT scf[], const LC3_INT bands_offset[], LC3_INT fdns_npts)
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/.gitignore mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/.gitignore
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/.gitignore 1970-01-01 01:00:00
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/.gitignore 2023-06-29 12:58:27
@@ -0,0 +1 @@
+Win32/
\ No newline at end of file
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c 2023-06-29 12:58:35
@@ -8,15 +8,16 @@
******************************************************************************/
#include "functions.h"
+#include "options.h"
void processNearNyquistdetector_fl(LC3_INT16* near_nyquist_flag, const LC3_INT fs_idx, const LC3_INT near_nyquist_index,
const LC3_INT bands_number, const LC3_FLOAT* ener)
{
*near_nyquist_flag = 0;
-
+
if (fs_idx < 4)
- {
+ {
LC3_INT i = 0;
LC3_FLOAT ener_low = FLT_EPSILON, ener_high = 0;
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gg, LC3_INT BW_cutoff_idx, LC3_INT frame_dms,
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, LC3_INT bw_stopband, LC3_INT frame_dms, LC3_FLOAT fac_ns_pc, LC3_INT spec_inv_idx)
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
static void filter_olpa(LC3_FLOAT* in, LC3_FLOAT* out, const LC3_FLOAT* buf, LC3_FLOAT len_buf, LC3_INT len_input);
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3_INT16 frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d)
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* decoder, DecSetup* h_DecSetup, LC3_INT bfi,
@@ -56,6 +57,8 @@
{
case 2:
{
+ LC3_FLOAT pitch_fl_c;
+
assert(decoder->fs_idx == floor(decoder->fs / 10000));
// phaseECU supports only 10ms framing
assert(PlcSetup->nbLostCmpt != 0 || decoder->frame_dms == 100);
@@ -69,7 +72,7 @@
}
/* call phaseEcu */
- LC3_FLOAT pitch_fl_c = (LC3_FLOAT)ltpf_pitch_int + (LC3_FLOAT)ltpf_pitch_fr / 4.0; /* use non-rounded pitch indeces */
+ pitch_fl_c = (LC3_FLOAT)ltpf_pitch_int + (LC3_FLOAT)ltpf_pitch_fr / 4.0; /* use non-rounded pitch indeces */
if (prev_bfi_plc2 == 0)
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "defines.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "defines.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "defines.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "defines.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "defines.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "defines.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "defines.h"
#include "functions.h"
@@ -135,13 +136,13 @@
if (max_xfp_abs >= 0.5)
{
- PLC2_Q_flt = (LC3_FLOAT)LC3_FLOOR(LC3_LOG2(32768 / 2 / 2 / max_xfp_abs));
+ PLC2_Q_flt = (LC3_FLOAT)LC3_FLOOR(LC3_LOGTWO(32768 / 2 / 2 / max_xfp_abs));
Q_scale_flt = LC3_POW(2.0, PLC2_Q_flt) / fx_fft_scale / fft_fs_scale; /* basop way using xfp scale */
/* C-Float additional safety limit/verification of the integer xfp based scaling using the available C-float Xabs max value inp_high as well */
{
LC3_FLOAT tmp_scale;
- tmp_scale = LC3_POW(2.0, LC3_FLOOR(LC3_LOG2(32768 / 2 / 2 / inp_high)));
+ tmp_scale = LC3_POW(2.0, LC3_FLOOR(LC3_LOGTWO(32768 / 2 / 2 / inp_high)));
if (Q_scale_flt > tmp_scale) {
Q_scale_flt = tmp_scale;
}
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "defines.h"
#include "functions.h"
#include "constants.h"
@@ -30,6 +31,7 @@
LC3_INT32 segmentLen, e;
LC3_FLOAT Xph;
LC3_FLOAT seed_local;
+ LC3_INT32 binCounter, subInd;
UNUSED(corr_phase_dbg);
UNUSED(X_i_new_re_dbg);
@@ -49,8 +51,8 @@
// EVOLVE PHASE -----------------
- LC3_INT32 binCounter = 1;
- LC3_INT32 subInd = 0;
+ binCounter = 1;
+ subInd = 0;
one_peak_flag_mask = -1;
if (n_plocs < 3 && n_plocs > 0) {
@@ -219,9 +221,10 @@
}
static LC3_INT32 own_rand(LC3_INT32 seed) {
- assert(seed <= 32767 && seed >= -32768);
- LC3_INT32 retSeed = (13849 + (seed + 32768) * 31821) & 65535;
- retSeed -= 32768;
+ LC3_INT32 retSeed;
+ assert(seed <= 32767 && seed >= -32768);
+ retSeed = (13849 + (seed + 32768) * 31821) & 65535;
+ retSeed -= 32768;
assert(retSeed <= 32767 && retSeed >= -32768);
return retSeed;
}
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c 2023-06-29 12:58:35
@@ -6,13 +6,14 @@
* Rights Policy, 3rd April 2019. No patent licence is granted by implication, *
* estoppel or otherwise. *
******************************************************************************/
-
+
+#include "options.h"
#include "defines.h"
#include "functions.h"
-void plc_phEcu_tba_per_band_gain(LC3_INT32 n_grp, LC3_FLOAT *gr_pow_left, LC3_FLOAT *gr_pow_right, LC3_FLOAT *trans, LC3_FLOAT *grp_pow_change)
+void plc_phEcu_tba_per_band_gain(LC3_INT32 n_grp, LC3_FLOAT *gr_pow_left, LC3_FLOAT *gr_pow_right, LC3_FLOAT *trans, LC3_FLOAT *grp_pow_change)
{
LC3_INT32 i;
@@ -34,10 +35,10 @@
trans[i] = 1.0; /* 0/0 no transient , no power change */
}
}
- grp_pow_change[i] = (LC3_FLOAT) 10.0 * LC3_LOG10(trans[i]);
+ grp_pow_change[i] = (LC3_FLOAT) 10.0 * LC3_LOGTEN(trans[i]);
}
- return;
+ return;
}
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "defines.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "defines.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c 2023-06-29 12:58:35
@@ -6,16 +6,17 @@
* Rights Policy, 3rd April 2019. No patent licence is granted by implication, *
* estoppel or otherwise. *
******************************************************************************/
-
+
+#include "options.h"
#include "defines.h"
#include "functions.h"
-void plc_phEcu_trans_burst_ana_sub(LC3_INT32 fs_idx, LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FLOAT *oold_spect_shape,
- LC3_FLOAT *oold_EwPtr, LC3_FLOAT *old_spect_shape,
+void plc_phEcu_trans_burst_ana_sub(LC3_INT32 fs_idx, LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FLOAT *oold_spect_shape,
+ LC3_FLOAT *oold_EwPtr, LC3_FLOAT *old_spect_shape,
LC3_FLOAT *old_EwPtr, LC3_FLOAT *stPhECU_beta_mute,
- LC3_FLOAT *stPhECU_mag_chg_1st, LC3_FLOAT *stPhECU_Xavg, LC3_FLOAT *alpha, LC3_FLOAT *beta, LC3_FLOAT *mag_chg, LC3_INT32 *tr_dec_dbg, LC3_FLOAT *gpc_dbg)
+ LC3_FLOAT *stPhECU_mag_chg_1st, LC3_FLOAT *stPhECU_Xavg, LC3_FLOAT *alpha, LC3_FLOAT *beta, LC3_FLOAT *mag_chg, LC3_INT32 *tr_dec_dbg, LC3_FLOAT *gpc_dbg)
{
LC3_FLOAT gr_pow_left[MAX_LGW];
LC3_FLOAT gr_pow_right[MAX_LGW];
@@ -27,7 +28,7 @@
LC3_INT32 attDegreeFrames;
LC3_FLOAT thresh_dbg;
-
+
UNUSED(tr_dec_dbg);
UNUSED(gpc_dbg);
@@ -39,7 +40,7 @@
}
-
+
plc_phEcu_tba_trans_dect_gains(burst_len, n_grp, grp_pow_change, stPhECU_beta_mute, stPhECU_mag_chg_1st, alpha, beta, mag_chg, ph_dith, tr_dec, att_val, &attDegreeFrames, &thresh_dbg);
return;
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
/***************************************************************************\
* contents/description: Main function for Time domain concealment
\***************************************************************************/
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
#include "functions.h"
+#include "options.h"
void processPlcUpdate_fl(PlcAdvSetup *PlcAdvSetup, LC3_INT32 frame_length, LC3_FLOAT *syntM, LC3_FLOAT *scf_q,
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
static LC3_INT sign(LC3_FLOAT x);
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3_INT mem_in_len, LC3_FLOAT mem_50[], LC3_FLOAT mem_out[],
@@ -17,6 +18,8 @@
LC3_INT len_12k8 = 0, N12k8 = 0, i = 0, k = 0;
LC3_FLOAT mac = 0, buf_out[120 + MAX_LEN] = {0}, bufdown[128] = {0}, buf[120 + MAX_LEN] = {0};
+ LC3_INT32 index_int, index_frac, resamp_upfac, resamp_delay, resamp_off_int, resamp_off_frac;
+ LC3_FLOAT u_11, u_21, u_1, u_2;
const LC3_FLOAT *filter;
const LC3_FLOAT *filt_input, *filt_coeff;
@@ -49,12 +52,12 @@
/* Upsampling & Low-pass Filtering & Downsampling */
- LC3_INT32 index_int = 1;
- LC3_INT32 index_frac = 0;
- LC3_INT32 resamp_upfac = resamp_params[fs_idx][0];
- LC3_INT32 resamp_delay = resamp_params[fs_idx][1];
- LC3_INT32 resamp_off_int = resamp_params[fs_idx][2];
- LC3_INT32 resamp_off_frac = resamp_params[fs_idx][3];
+ index_int = 1;
+ index_frac = 0;
+ resamp_upfac = resamp_params[fs_idx][0];
+ resamp_delay = resamp_params[fs_idx][1];
+ resamp_off_int = resamp_params[fs_idx][2];
+ resamp_off_frac = resamp_params[fs_idx][3];
k = 0;
for (i = 0; i < N12k8; i++) {
@@ -78,9 +81,8 @@
/* 50Hz High-Pass */
- LC3_FLOAT u_11 = mem_50[0];
- LC3_FLOAT u_21 = mem_50[1];
- LC3_FLOAT u_1, u_2;
+ u_11 = mem_50[0];
+ u_21 = mem_50[1];
for (i = 0; i < len_12k8; i++) {
LC3_FLOAT y1 = (highpass50_filt_b[0] * bufdown[i] + u_11);
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_INT L_spec, LC3_INT targetBits, LC3_INT nBits, uint8_t* resBits, LC3_INT* numResBits
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec, uint8_t prm[], LC3_INT resQBits
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
#include "functions.h"
+#include "options.h"
LC3_FLOAT array_max_abs(LC3_FLOAT *in, LC3_INT32 len)
{
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "setup_dec_lc3.h"
#include "functions.h"
#include <stdio.h>
@@ -32,6 +33,7 @@
LC3_FLOAT *sine_table1_phecu, *sine_table2_phecu;
HANDLE_IIS_FFT handle_fft_phaseecu;
HANDLE_IIS_FFT handle_ifft_phaseecu;
+ LC3_FLOAT *q_old_res;
for (ch = 0; ch < channels; ch++) {
DecSetup* setup = balloc(decoder, &size, sizeof(DecSetup));
@@ -56,7 +58,7 @@
sine_table1_phecu = balloc(decoder, &size, sizeof(LC3_FLOAT) * (((CODEC_FS(samplerate) * 16) / 1000) / 2 + 1));
sine_table2_phecu = balloc(decoder, &size, sizeof(LC3_FLOAT) * (((CODEC_FS(samplerate) * 16) / 1000) / 2 + 1));
- LC3_FLOAT *q_old_res = balloc(decoder, &size, sizeof(LC3_FLOAT) * frame_len);
+ q_old_res = balloc(decoder, &size, sizeof(LC3_FLOAT) * frame_len);
if (decoder) {
decoder->channel_setup[ch] = setup;
@@ -346,6 +348,7 @@
LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec* decoder, int ch, int nBytes)
{
int totalBits = 0, bitsTmp = 0, channel_bytes = 0, maxBytes = 0, minBytes = 0;
+ DecSetup* setup;
if (decoder->hrmode)
{
@@ -375,7 +378,7 @@
channel_bytes = nBytes;
- DecSetup* setup = decoder->channel_setup[ch];
+ setup = decoder->channel_setup[ch];
if (channel_bytes < minBytes || channel_bytes > maxBytes)
{
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "setup_enc_lc3.h"
#include "functions.h"
#include <stdio.h>
@@ -33,6 +34,7 @@
, int32_t lfe_channel_array[]
)
{
+ int ch = 0;
memset(encoder, 0, lc3plus_enc_get_size(samplerate, channels));
alloc_encoder(encoder, channels);
@@ -56,7 +58,6 @@
encoder->r12k8_mem_in_len = 2 * 8 * encoder->fs / 12800;
encoder->r12k8_mem_out_len = 24;
- int ch = 0;
for (ch = 0; ch < encoder->channels; ch++)
{
encoder->channel_setup[ch]->lfe = lfe_channel_array[ch] != 0;
@@ -220,6 +221,7 @@
if (encoder->hrmode)
{
+#ifdef ENABLE_HR_MODE_FL
switch (encoder->frame_dms)
{
case 25:
@@ -243,6 +245,7 @@
default:
return LC3PLUS_HRMODE_ERROR;
}
+#endif
}
else
{
@@ -368,7 +371,7 @@
setup->total_bits = setup->targetBytes << 3;
setup->targetBitsInit = setup->total_bits - encoder->envelope_bits - encoder->global_gain_bits -
encoder->noise_fac_bits - encoder->BW_cutoff_bits -
- ceil(LC3_LOG2(encoder->frame_length / 2)) - 2 - 1;
+ ceil(LC3_LOGTWO(encoder->frame_length / 2)) - 2 - 1;
if (setup->total_bits > 1280) {
setup->targetBitsInit = setup->targetBitsInit - 1;
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT tilt, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor)
@@ -109,7 +110,7 @@
/* Log-domain */
for (i = 0; i < 64; i++) {
- xl[i] = LC3_LOG2(x[i]) / 2.0;
+ xl[i] = LC3_LOGTWO(x[i]) / 2.0;
}
/* Downsampling */
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT bands_number, LC3_FLOAT* gains_int)
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
static void pvq_dec(LC3_INT k, LC3_INT m, LC3_INT LS_ind, LC3_INT MPVQ_ind, LC3_INT* pulses);
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h 2023-06-29 12:58:27
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <string.h>
+
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) || defined(__arm__) || \
defined(__aarch64__)
#define __TWI_LE /* _T_iny _W_ave _I_n _L_ittle _E_ndian */
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
static void xcorr(LC3_FLOAT* in, LC3_FLOAT* out, LC3_INT lag, LC3_INT inLen);
diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c
--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c 2023-02-28 20:25:37
+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c 2023-06-29 12:58:27
@@ -8,6 +8,7 @@
******************************************************************************/
+#include "options.h"
#include "functions.h"
void processTnsDecoder_fl(LC3_FLOAT* x, LC3_INT* rc_idx, LC3_INT* order, LC3_INT numfilters, LC3_INT bw_fcbin, LC3_INT N, LC3_INT fs)
......@@ -24,6 +24,7 @@ if __name__ == '__main__':
cmds_enc=[]
cmds_dec=[]
cmds_rend=[]
cmds_isar_post_rend=[]
if path.isdir(input):
......@@ -37,6 +38,45 @@ if __name__ == '__main__':
cmds_enc.extend(re.findall(r"DUT encoder command:\\n\\t(.*?)\\n", line))
cmds_dec.extend(re.findall(r"DUT decoder command:\\n\\t(.*?)\\n", line))
cmds_rend.extend(re.findall(r"Running command\\n(.*?)\\n", line))
cmds_isar_post_rend.extend(re.findall(r"Running ISAR post renderer command\\n(.*?)\\n", line))
# If pytest-html < v4 is used, the parsing will fail and render empty lists. This is a work-around in case that happens.
if all(not x for x in [cmds_enc, cmds_dec, cmds_rend, cmds_isar_post_rend]):
for html_report in input:
with open(html_report,'r') as infile:
enc_cmd = False
dec_cmd = False
rend_cmd = False
isar_post_rend_cmd = False
for line in infile.readlines():
line = line.split("<br/>")[0] # Remove trailing html tags
if enc_cmd:
cmds_enc.append(line)
enc_cmd = False
elif dec_cmd:
cmds_dec.append(line)
dec_cmd = False
elif rend_cmd:
cmds_rend.append(line)
rend_cmd = False
elif isar_post_rend_cmd:
cmds_isar_post_rend.append(line)
isar_post_rend_cmd = False
else:
if "DUT encoder command" in line:
enc_cmd = True
elif "DUT decoder command" in line:
dec_cmd = True
elif "Running command" in line:
rend_cmd = True
elif "Running ISAR post renderer command" in line:
isar_post_rend_cmd = True
# Sort lists to keep deterministic order between runs
cmds_enc.sort()
cmds_dec.sort()
cmds_rend.sort()
cmds_isar_post_rend.sort()
with open(txt_file.replace('.','_enc.'),'w', newline='\n') as outfile:
with open('scripts/enc_header.txt','r') as header:
......@@ -60,11 +100,13 @@ if __name__ == '__main__':
with open('scripts/script_footer.txt','r') as footer:
outfile.write(footer.read())
with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile_dec, open(txt_file.replace('.','_JBM_dec.'),'w', newline='\n') as outfile_jbm:
with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile_dec, open(txt_file.replace('.','_JBM_dec.'),'w', newline='\n') as outfile_jbm, open(txt_file.replace('.','_ISAR_dec.'),'w', newline='\n') as outfile_isar:
with open('scripts/dec_header.txt','r') as header:
outfile_dec.write(header.read())
with open('scripts/jbm_header.txt','r') as header:
outfile_jbm.write(header.read())
with open('scripts/dec_isar_header.txt','r') as header:
outfile_isar.write(header.read())
for cmd in cmds_dec:
absolute_out = re.search(r"\s(([\S]+)(.wav))$", cmd)
......@@ -76,20 +118,29 @@ if __name__ == '__main__':
arg = re.sub('IVAS_dec(.exe)?', '$CUT_DEC_BIN', arg)
arg = re.sub('scripts', TESTV_PATH, arg)
arg = re.sub('tests/ref', REF_PATH + r'/ref', arg) # For .fer cases the bitstream is in ref
arg = re.sub('tests/split_rendering/renderer_configs', REF_PATH + r'/split_rendering/renderer_configs', arg)
if re.search("^tests.*192$",arg):
arg = re.sub('tests/split_rendering/cut', REF_PATH + r'/split_rendering/ref', arg)
if re.search("\.wav$",arg):
arg = re.sub('tests', CUT_PATH, arg) # Output argument for decoder ends with .wav
else:
arg = re.sub('tests/dut', REF_PATH + r'/ref', arg) # Input argument
if re.search("^tests.*bit$",arg):
arg = re.sub('tests', CUT_PATH, arg) # Output argument for decoder ends with .wav
args.append(arg)
cmd = ' '.join(args)
if 'VOIP' in cmd:
outfile = outfile_jbm
elif 'BINAURAL_SPLIT' in cmd:
outfile = outfile_isar
else:
outfile = outfile_dec
outfile.write(cmd+'\n')
out = re.search(r"\s(([\S]+)(.wav))$", cmd)
isar_out = re.search(r"\s(([\S]+)(.bit))$", cmd)
isar_md_out = re.search(r"-om\s(([\S]+)(.bit))", cmd)
if out:
diff_cmds=[]
for output in glob.glob(absolute_out.group(1) + '*'):
......@@ -97,11 +148,19 @@ if __name__ == '__main__':
output = re.sub('tests', CUT_PATH, output)
diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'/dut',REF_PATH + r'/ref')+' '+output+' >> $LOG_FILE 2>&1')
outfile.write(('; ').join(diff_cmds))
if isar_out and "cut" in isar_out.group(1):
outfile.write('$DIFF_BIN '+isar_out.group(1).replace(CUT_PATH + r'/split_rendering/cut',REF_PATH + r'/split_rendering/ref')+' '+isar_out.group(1)+' >> $LOG_FILE 2>&1')
if isar_md_out and "cut" in isar_md_out.group(1):
outfile.write('; $DIFF_BIN '+isar_md_out.group(1).replace(CUT_PATH + r'/split_rendering/cut',REF_PATH + r'/split_rendering/ref')+' '+isar_md_out.group(1)+' >> $LOG_FILE 2>&1\n')
else:
outfile.write('\n')
outfile.write('\n\n')
with open('scripts/script_footer.txt','r') as footer:
outfile_dec.write(footer.read())
footer.seek(0)
outfile_jbm.write(footer.read())
footer.seek(0)
outfile_isar.write(footer.read())
with open(txt_file.replace('.','_rend.'),'w', newline='\n') as outfile:
with open('scripts/rend_header.txt','r') as header:
......@@ -127,3 +186,29 @@ if __name__ == '__main__':
outfile.write('\n')
with open('scripts/script_footer.txt','r') as footer:
outfile.write(footer.read())
with open(txt_file.replace('.','_ISAR_post_rend.'),'w', newline='\n') as outfile:
with open('scripts/isar_post_rend_header.txt','r') as header:
outfile.write(header.read())
for cmd in cmds_isar_post_rend:
args = []
for arg in cmd.split():
# Adjust file arguments, pass other arguments as they are
if path.exists(arg):
arg = path.relpath(arg).replace('\\','/')
arg = re.sub('ISAR_post_rend(.exe)?', '$CUT_ISAR_POST_REND_BIN', arg)
arg = re.sub('scripts', TESTV_PATH, arg)
if re.search("^tests.*bit$",arg):
arg = re.sub('tests/split_rendering/cut', REF_PATH + r'/split_rendering/ref', arg)
arg = re.sub('tests', CUT_PATH, arg)
args.append(arg)
cmd = ' '.join(args)
if "cut" in cmd:
outfile.write(cmd+'\n')
out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd)
if out and "cut" in out.group(1):
outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'/split_rendering/cut',REF_PATH + r'/split_rendering/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n')
outfile.write('\n')
with open('scripts/script_footer.txt','r') as footer:
outfile.write(footer.read())
\ No newline at end of file
#!/usr/bin/env python3
# (C) 2022-2024 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.
"""
parse_complexity_tables.py
A script to parse complexity tables from smoke_test_complexity.sh run
and collecting the results into an Excel and csv files.
Arguments:
-input_tables_base: Paths to input tables base csv files (before the WMOPS etc. tags), separated by ';'. E.g., path/to/file1.csv;path/to/file_xyz_ (where the actual files are file_xyz_WMOPS.csv or file_xyz_TROM.csv, for example)
Optional. If not present, use the default paths inside this script.
-output_table: Path to output table csv file, a complementary .xlsx file is also created. E.g., path/to/output_file.csv
Optional. If not present, use the default output path inside this script (default output directory is complexity_tables/).
-input_limiters: List of input format limiters, separated by ';'. Optional, accepted values:
mono
foa
hoa2
hoa3
planar foa
planar hoa2
planar hoa3
masa 1tc
masa 2tc
mc 5_1
mc 5_1_2
mc 5_1_4
mc 7_1
mc 7_1_4
stereo
stereodmxevs
omasa ism1 1tc
omasa ism1 2tc
omasa ism2 1tc
omasa ism2 2tc
omasa ism3 1tc
omasa ism3 2tc
omasa ism4 1tc
omasa ism4 2tc
osba ism1 foa
osba ism1 hoa2
osba ism1 hoa3
osba ism2 foa
osba ism2 hoa2
osba ism2 hoa3
osba ism3 foa
osba ism3 hoa2
osba ism3 hoa3
osba ism4 foa
osba ism4 hoa2
osba ism4 hoa3
ism1
ism2
ism3
ism4
ism+1
ism+2
ism+3
ism+4
-bitrate_limiters: List of bitrate limiters, separated by ';'. Optional, accepted values:
EVS only:
5.9
6.6
7.2
8.0
8.8
9.6
12.6
14.2
15.8
18.2
19.8
23.0
IVAS (and some EVS):
13.2
16.4
24.4
32
48
64
80
96
128
160
192
256
384
512
-codec_mode_limiters: List of codec mode limiters, separated by ';'. Optional, accepted values:
EVS only:
amr
rf lo2
rf lo3
rf lo5
rf lo7
rf hi2
rf hi3
rf hi5
rf hi7
IVAS and EVS:
dtx
non-dtx
rs
Note: if 'non-dtx' is selected, all the dtx modes are discarded.
-bandwidth_limiters: List of bandwidth limiters, separated by ';'. Optional, accepted values:
nb (EVS only)
wb
swb
fb
-output_limiters: List of output format limiters, separated by ';'. Optional, accepted values:
mono
stereo
binaural
binaural_room_ir
binaural_room_reverb
foa
hoa2
hoa3
5_1
5_1_2
5_1_4
7_1
7_1_4
ext
-profiler_limiters: Limit the included profiler analysis (e.g. WMOPS), separated by ';'. Optional, accepted values:
HEAP_INTRA
HEAP
PROM
RAM
STACK
TROM
WMOPS
Output (as per default output table names):
combined_table_PROFILE.xlsx / .csv - contains all data in one file (PROFILE indicates the used profiler_limiters or ALL for all profiles included)
combined_table_INPUT_FORMAT.xlsx / .csv - contains all data for a single input format
heatmap_table_OUTPUT_FORMAT.xlsx - contains heatmap data for a single output format
max_input_PROFILE.xlsx / .csv - contains maximum complexity (and the respective codec configurations) per input format
combined_table_PROFILE.json - contains all data in one json file
Note: the limiter arguments are used to narrow down the output table. For example, <-input_limiters "mono;stereo">
would include only table values with mono and stereo input formats in the output table.
"""
import argparse
import csv
import os
import openpyxl
import json
import copy
def parse_configuration(row, profile):
# Parse e.g. <ISM+1@13.2 kbps DTX WB to 7_1_4;45.586;35.954;81.54>
split_at = row.split("@")
input_mode = split_at[0].strip()
split_kbps = split_at[1].split("kbps")
bitrate = split_kbps[0].strip()
split_to = split_kbps[1].split("to")
codec_mode_bandwidth = split_to[0].strip().split(" ")
bandwidth = codec_mode_bandwidth[-1].strip()
separator = " "
codec_mode_list = codec_mode_bandwidth[0:-1]
codec_mode = separator.join(codec_mode_list)
split_dots = split_to[1].split(";")
output_mode = split_dots[0].strip()
# Profile specific values
if profile.upper() == "HEAP_INTRA":
encoder_heap_intra = split_dots[1].strip()
decoder_heap_intra = split_dots[2].strip()
total_heap_intra = split_dots[3].strip()
return [input_mode, bitrate, bandwidth, codec_mode, output_mode, encoder_heap_intra, decoder_heap_intra, total_heap_intra]
elif profile.upper() == "HEAP":
encoder_heap = split_dots[1].strip()
decoder_heap = split_dots[2].strip()
total_heap = split_dots[3].strip()
return [input_mode, bitrate, bandwidth, codec_mode, output_mode, encoder_heap, decoder_heap, total_heap]
elif profile.upper() == "PROM":
encoder_prom = split_dots[1].strip()
decoder_prom = split_dots[2].strip()
com_prom = split_dots[3].strip()
rend_prom = split_dots[4].strip()
total_prom = split_dots[5].strip()
return [input_mode, bitrate, bandwidth, codec_mode, output_mode, encoder_prom, decoder_prom, com_prom, rend_prom, total_prom]
elif profile.upper() == "RAM":
encoder_ram = split_dots[1].strip()
decoder_ram = split_dots[2].strip()
total_ram = split_dots[3].strip()
return [input_mode, bitrate, bandwidth, codec_mode, output_mode, encoder_ram, decoder_ram, total_ram]
elif profile.upper() == "STACK":
encoder_stack = split_dots[1].strip()
decoder_stack = split_dots[2].strip()
max_stack = split_dots[3].strip()
return [input_mode, bitrate, bandwidth, codec_mode, output_mode, encoder_stack, decoder_stack, max_stack]
elif profile.upper() == "TROM":
encoder_trom = split_dots[1].strip()
decoder_trom = split_dots[2].strip()
com_trom = split_dots[3].strip()
rend_trom = split_dots[4].strip()
total_trom = split_dots[5].strip()
return [input_mode, bitrate, bandwidth, codec_mode, output_mode, encoder_trom, decoder_trom, com_trom, rend_trom, total_trom]
elif profile.upper() == "WMOPS":
encoder_complexity = split_dots[1].strip()
decoder_complexity = split_dots[2].strip()
total_complexity = split_dots[3].strip()
return [input_mode, bitrate, bandwidth, codec_mode, output_mode, encoder_complexity, decoder_complexity, total_complexity]
else:
return []
def sanity_check_configurations(input_mode, bitrate, bandwidth, codec_mode, output_mode, profile_row_values):
if input_mode != profile_row_values[0]:
print("Input mode mismatch: " + input_mode + " != " + profile_row_values[0])
return -1
if bitrate != profile_row_values[1]:
print("Bitrate mismatch: " + bitrate + " != " + profile_row_values[1])
return -1
if bandwidth != profile_row_values[2]:
print("Bandwidth mismatch: " + bandwidth + " != " + profile_row_values[2])
return -1
if codec_mode != profile_row_values[3]:
print("Codec mode mismatch: " + codec_mode + " != " + profile_row_values[3])
return -1
if output_mode != profile_row_values[4]:
print("Output mode mismatch: " + output_mode + " != " + profile_row_values[4])
return -1
return 0
if __name__ == "__main__":
# Parse arguments
parser = argparse.ArgumentParser(description='Argument parser')
parser.add_argument('-input_tables_base',type=str,help='Paths to base input tables csv files, separated by ;')
parser.add_argument('-output_table',type=str,help='Path to output table csv file')
parser.add_argument('-combined_max_output_table',type=str,help='Path to output table which contains the max wmops entry for each input format csv file')
parser.add_argument('-input_limiters',type=str,help='Limit the output table based on input formats, separated by ;')
parser.add_argument('-bitrate_limiters',type=str,help='Limit the output table based on bitrates, separated by ;')
parser.add_argument('-codec_mode_limiters',type=str,help='Limit the output table based on codec modes, separated by ;')
parser.add_argument('-bandwidth_limiters',type=str,help='Limit the output table based on bandwidths, separated by ;')
parser.add_argument('-output_limiters',type=str,help='Limit the output table based on output formats, separated by ;')
parser.add_argument('-profiler_limiters',type=str,help='Limit the included profiler analysis (e.g. WMOPS), separated by ;')
args = parser.parse_args()
input_tables_base = args.input_tables_base
output_table = args.output_table
combined_max_output_table = args.combined_max_output_table
input_limiters = args.input_limiters
bitrate_limiters = args.bitrate_limiters
codec_mode_limiters = args.codec_mode_limiters
bandwidth_limiters = args.bandwidth_limiters
output_limiters = args.output_limiters
profiler_limiters = args.profiler_limiters
single_input_format_output_table_base = None
# Complexity levels
clevel_base = 128.86
clevel1 = 3 * clevel_base
clevel2 = 6 * clevel_base
clevel3 = 10 * clevel_base
# Limit the output table values
limiters = {
"input": [],
"bitrate": [],
"codec_mode": [],
"bandwidth": [],
"output": [],
}
input_modes = [
"mono"
,"stereodmxevs"
,"stereo"
,"masa 1tc"
,"masa 2tc"
,"ism1"
,"ism2"
,"ism3"
,"ism4"
,"ism+1"
,"ism+2"
,"ism+3"
,"ism+4"
,"omasa ism1 1tc"
,"omasa ism1 2tc"
,"omasa ism2 1tc"
,"omasa ism2 2tc"
,"omasa ism3 1tc"
,"omasa ism3 2tc"
,"omasa ism4 1tc"
,"omasa ism4 2tc"
,"mc 5_1"
,"mc 5_1_2"
,"mc 5_1_4"
,"mc 7_1"
,"mc 7_1_4"
,"foa"
,"hoa2"
,"hoa3"
,"planar foa"
,"planar hoa2"
,"planar hoa3"
,"osba ism1 foa"
,"osba ism1 hoa2"
,"osba ism1 hoa3"
,"osba ism2 foa"
,"osba ism2 hoa2"
,"osba ism2 hoa3"
,"osba ism3 foa"
,"osba ism3 hoa2"
,"osba ism3 hoa3"
,"osba ism4 foa"
,"osba ism4 hoa2"
,"osba ism4 hoa3"]
if input_limiters is not None:
input_modes = []
input_limiters_list = input_limiters.split(";")
for in_limiter in input_limiters_list:
limiters["input"].append(in_limiter.lower())
input_modes.append(in_limiter.lower())
ivas_bitrates = ['13.2','16.4','24.4','32','48','64','80','96','128','160','192','256','384','512']
if bitrate_limiters is not None:
ivas_bitrates = []
bitrate_limiters_list = bitrate_limiters.split(";")
for br_limiter in bitrate_limiters_list:
limiters["bitrate"].append(br_limiter.lower())
ivas_bitrates.append(br_limiter.lower())
if codec_mode_limiters is not None:
codec_mode_limiters_list = codec_mode_limiters.split(";")
for cm_limiter in codec_mode_limiters_list:
limiters["codec_mode"].append(cm_limiter.lower())
if bandwidth_limiters is not None:
bandwidth_limiters_list = bandwidth_limiters.split(";")
for bw_limiter in bandwidth_limiters_list:
limiters["bandwidth"].append(bw_limiter.lower())
output_modes = ["mono","stereo","binaural","binaural_room_ir","binaural_room_reverb","foa","hoa2","hoa3","5_1","5_1_2","5_1_4","7_1","7_1_4","ext"]
if output_limiters is not None:
output_modes = []
output_limiters_list = output_limiters.split(";")
for out_limiter in output_limiters_list:
limiters["output"].append(out_limiter.lower())
output_modes.append(out_limiter.lower())
# Read table file base paths from arguments or use default ones
if input_tables_base is None:
path_to_files_str = "./"
file_path = os.path.abspath(path_to_files_str)
input_tables_base_list = [
os.path.join(file_path, "ltv_complexity_mono_no_fec_"),
os.path.join(file_path, "ltv_complexity_FOA_no_fec_"),
os.path.join(file_path, "ltv_complexity_HOA2_no_fec_"),
os.path.join(file_path, "ltv_complexity_HOA3_no_fec_"),
os.path.join(file_path, "ltv_complexity_PlanarFOA_no_fec_"),
os.path.join(file_path, "ltv_complexity_PlanarHOA2_no_fec_"),
os.path.join(file_path, "ltv_complexity_PlanarHOA3_no_fec_"),
os.path.join(file_path, "ltv_complexity_MASA_no_fec_"),
os.path.join(file_path, "ltv_complexity_MC_no_fec_"),
os.path.join(file_path, "ltv_complexity_stereo_no_fec_"),
os.path.join(file_path, "ltv_complexity_stereoDmx_no_fec_"),
os.path.join(file_path, "ltv_complexity_OMASA_no_fec_"),
os.path.join(file_path, "ltv_complexity_OSBA_ISM1_no_fec_"),
os.path.join(file_path, "ltv_complexity_OSBA_ISM2_no_fec_"),
os.path.join(file_path, "ltv_complexity_OSBA_ISM3_no_fec_"),
os.path.join(file_path, "ltv_complexity_OSBA_ISM4_no_fec_"),
os.path.join(file_path, "ltv_complexity_ISM1_no_fec_"),
os.path.join(file_path, "ltv_complexity_ISM2_no_fec_"),
os.path.join(file_path, "ltv_complexity_ISM3_no_fec_"),
os.path.join(file_path, "ltv_complexity_ISM4_no_fec_"),
os.path.join(file_path, "ltv_complexity_ISM_plus1_no_fec_"),
os.path.join(file_path, "ltv_complexity_ISM_plus2_no_fec_"),
os.path.join(file_path, "ltv_complexity_ISM_plus3_no_fec_"),
os.path.join(file_path, "ltv_complexity_ISM_plus4_no_fec_")]
else:
input_tables_base_list = input_tables_base.split(";")
# Create input table paths from the base path and profiler limiters
profile_table_lists = {}
all_profiles_included = False
if profiler_limiters is None:
included_profiles = ["HEAP_INTRA", "HEAP", "PROM", "RAM", "STACK", "TROM", "WMOPS"]
all_profiles_included = True
else:
included_profiles = profiler_limiters.split(";")
for profile in included_profiles:
profile_table_lists[profile] = []
for input_file in input_tables_base_list:
profile_table_lists[profile].append(input_file + profile + ".csv")
# Output table paths
output_profile_suffix = ""
if all_profiles_included:
output_profile_suffix = "_ALL"
else:
for profile in included_profiles:
output_profile_suffix += "_" + profile
if output_table is None:
out_dir = "complexity_tables"
if not os.path.exists(out_dir):
os.makedirs(out_dir)
output_table = os.path.join(out_dir, "combined_table" + output_profile_suffix +".csv")
temp_output_path_parent = os.path.abspath(os.path.join(os.path.abspath(output_table), os.pardir))
single_input_format_output_table_base = os.path.join(temp_output_path_parent, "combined_table_")
heatmap_table_base = os.path.join(temp_output_path_parent, "heatmap_table_")
if combined_max_output_table is None:
combined_max_output_table = os.path.join(temp_output_path_parent, "max_input" + output_profile_suffix +".csv")
# JSON output
json_output = output_table.replace(".csv", ".json")
# Header fields in the output table
fields = ['Input', 'Bitrate', 'Codec mode', 'Bandwidth', 'Output']
for profile in included_profiles:
if "HEAP_INTRA" in profile.upper():
fields.append('ENC HEAP INTRA')
fields.append('DEC HEAP INTRA')
fields.append('Total HEAP INTRA')
elif "HEAP" in profile.upper():
fields.append('ENC HEAP')
fields.append('DEC HEAP')
fields.append('Total HEAP')
elif "PROM" in profile.upper():
fields.append('ENC PROM')
fields.append('DEC PROM')
fields.append('COM PROM')
fields.append('REND PROM')
fields.append('Total PROM')
elif "RAM" in profile.upper():
fields.append('ENC RAM')
fields.append('DEC RAM')
fields.append('Total RAM')
elif "STACK" in profile.upper():
fields.append('ENC STACK')
fields.append('DEC STACK')
fields.append('MAX STACK')
elif "TROM" in profile.upper():
fields.append('ENC TROM')
fields.append('DEC TROM')
fields.append('COM TROM')
fields.append('REND TROM')
fields.append('Total TROM')
elif "WMOPS" in profile.upper():
fields.append('ENC WMOPS')
fields.append('DEC WMOPS')
fields.append('Total WMOPS')
# Dict for input format specific data: 0: max WMOPS, 1: data row for max WMOPS, 2: all data rows
input_formats_maxWmops_maxRow_dataRows = {
"FOA" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"HOA2" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"HOA3" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"ISM+1" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"ISM+2" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"ISM+3" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"ISM+4" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"ISM1" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"ISM2" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"ISM3" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"ISM4" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"MASA 1TC" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"MASA 2TC" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"MC 5_1" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"MC 5_1_2" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"MC 5_1_4" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"MC 7_1" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"MC 7_1_4" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"MONO" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OMASA ISM1 1TC" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OMASA ISM1 2TC" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OMASA ISM2 1TC" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OMASA ISM2 2TC" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OMASA ISM3 1TC" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OMASA ISM3 2TC" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OMASA ISM4 1TC" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OMASA ISM4 2TC" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM1 FOA" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM1 HOA2" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM1 HOA3" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM2 FOA" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM2 HOA2" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM2 HOA3" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM3 FOA" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM3 HOA2" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM3 HOA3" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM4 FOA" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM4 HOA2" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"OSBA ISM4 HOA3" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"PLANAR FOA" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"PLANAR HOA2" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"PLANAR HOA3" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"STEREO" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
"STEREODMXEVS" : {"MaxWMOPS" : 0, "MaxDataRow" : {}, "DataRows" : []},
}
# Profile specific dicts (filled during run)
profile_table_files = {}
profile_csv_reader = {}
profile_row = {}
profile_row_values = {}
# Excel stuff
output_table_xlsx = output_table.replace(".csv", ".xlsx")
combined_max_output_table_xlsx = combined_max_output_table.replace(".csv", ".xlsx")
wb_output_table = openpyxl.Workbook()
ws_output_table = wb_output_table.active
ws_output_table.append(fields)
wb_combined_max_output_table = openpyxl.Workbook()
ws_combined_max_output_table = wb_combined_max_output_table.active
ws_combined_max_output_table.append(fields)
os.makedirs(os.path.dirname(output_table), exist_ok=True)
whiteFill = openpyxl.styles.PatternFill(start_color='ffffff', end_color='ffffff', fill_type='solid')
blueFill = openpyxl.styles.PatternFill(start_color='00ffff', end_color='00ffff', fill_type='solid')
greenFill = openpyxl.styles.PatternFill(start_color='03fc73', end_color='03fc73', fill_type='solid')
redFill = openpyxl.styles.PatternFill(start_color='FFFF0000', end_color='FFFF0000', fill_type='solid')
# Heatmap
fields_heatmap = ['Input','13.2','16.4','24.4','32','48','64','80','96','128','160','192','256','384','512']
input_formats_heatmap = {
"MONO" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"FOA" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"HOA2" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"HOA3" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"ISM+1" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"ISM+2" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"ISM+3" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"ISM+4" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"ISM1" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"ISM2" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"ISM3" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"ISM4" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"MASA 1TC" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"MASA 2TC" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"MC 5_1" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"MC 5_1_2" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"MC 5_1_4" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"MC 7_1" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"MC 7_1_4" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OMASA ISM1 1TC" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OMASA ISM1 2TC" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OMASA ISM2 1TC" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OMASA ISM2 2TC" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OMASA ISM3 1TC" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OMASA ISM3 2TC" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OMASA ISM4 1TC" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OMASA ISM4 2TC" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM1 FOA" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM1 HOA2" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM1 HOA3" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM2 FOA" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM2 HOA2" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM2 HOA3" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM3 FOA" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM3 HOA2" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM3 HOA3" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM4 FOA" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM4 HOA2" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"OSBA ISM4 HOA3" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"PLANAR FOA" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"PLANAR HOA2" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"PLANAR HOA3" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"STEREO" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
"STEREODMXEVS" : {"13.2" : [0, whiteFill], "16.4" : [0, whiteFill], "24.4" : [0, whiteFill], "32" : [0, whiteFill], "48" : [0, whiteFill], "64" : [0, whiteFill], "80" : [0, whiteFill], "96" : [0, whiteFill], "128" : [0, whiteFill], "160" : [0, whiteFill], "192" : [0, whiteFill], "256" : [0, whiteFill], "384" : [0, whiteFill], "512" : [0, whiteFill]},
}
heatmap_outputs = {
"mono" : copy.deepcopy(input_formats_heatmap),
"stereo" : copy.deepcopy(input_formats_heatmap),
"binaural" : copy.deepcopy(input_formats_heatmap),
"binaural_room_ir" : copy.deepcopy(input_formats_heatmap),
"binaural_room_reverb" : copy.deepcopy(input_formats_heatmap),
"foa" : copy.deepcopy(input_formats_heatmap),
"hoa2" : copy.deepcopy(input_formats_heatmap),
"hoa3" : copy.deepcopy(input_formats_heatmap),
"5_1" : copy.deepcopy(input_formats_heatmap),
"5_1_2" : copy.deepcopy(input_formats_heatmap),
"5_1_4" : copy.deepcopy(input_formats_heatmap),
"7_1" : copy.deepcopy(input_formats_heatmap),
"7_1_4" : copy.deepcopy(input_formats_heatmap),
"ext" : copy.deepcopy(input_formats_heatmap),
}
with open(output_table, 'w') as output_file:
writer = csv.writer(output_file, delimiter=";")
writer.writerow(fields)
num_tables = len(profile_table_lists[next(iter(profile_table_lists))])
for file_num in range(0, num_tables):
total_complexity = "0"
# Open files and create csv readers
for profile in included_profiles:
profile_table_files[profile] = open(profile_table_lists[profile][file_num], 'r')
profile_csv_reader[profile] = csv.reader(profile_table_files[profile])
# Loop over rows
row_count = sum(1 for row in profile_csv_reader[next(iter(profile_csv_reader))])
profile_table_files[next(iter(profile_table_files))].seek(0)
for i in range(0, row_count):
# Get rows
for profile in included_profiles:
profile_row[profile] = next(profile_csv_reader[profile])[0]
if "kbps" in profile_row[next(iter(profile_row))]:
# Parse rows
for profile in included_profiles:
profile_row_values[profile] = parse_configuration(profile_row[profile], profile)
# Codec configuration from first profile and sanity check
input_mode = profile_row_values[next(iter(profile_row_values))][0]
bitrate = profile_row_values[next(iter(profile_row_values))][1]
bandwidth = profile_row_values[next(iter(profile_row_values))][2]
codec_mode = profile_row_values[next(iter(profile_row_values))][3]
output_mode = profile_row_values[next(iter(profile_row_values))][4]
for profile in included_profiles:
if sanity_check_configurations(input_mode, bitrate, bandwidth, codec_mode, output_mode, profile_row_values[profile]) < 0:
continue
# Check limiters
if limiters["input"] != [] and input_mode.lower() not in limiters["input"]:
continue
if limiters["bitrate"] != [] and bitrate.lower() not in limiters["bitrate"]:
continue
if limiters["codec_mode"] != []:
if "non-dtx" in limiters["codec_mode"]:
if "dtx" in codec_mode.lower():
continue
else:
if len(limiters["codec_mode"]) > 1:
mode_included = False
for mode in limiters["codec_mode"]:
if mode.lower() in codec_mode.lower():
mode_included = True
if not mode_included:
continue
else:
mode_included = False
for mode in limiters["codec_mode"]:
if mode.lower() in codec_mode.lower():
mode_included = True
if not mode_included:
continue
if limiters["bandwidth"] != [] and bandwidth.lower() not in limiters["bandwidth"]:
continue
if limiters["output"] != [] and output_mode.lower() not in limiters["output"]:
continue
# Form data row
data_row = [input_mode, bitrate, codec_mode, bandwidth, output_mode]
for profile in included_profiles:
for i in range (5, len(profile_row_values[profile])):
data_row.append(float(profile_row_values[profile][i]))
if "WMOPS" in profile.upper():
total_complexity = profile_row_values[profile][7]
writer.writerow(data_row)
ws_output_table.append(data_row)
# Dict data
dict_data = {}
for fn in range(0, len(fields)):
dict_data[fields[fn]] = data_row[fn]
input_formats_maxWmops_maxRow_dataRows[input_mode.upper()]["DataRows"].append(dict_data)
# Save max complexity data row
if float(total_complexity) > input_formats_maxWmops_maxRow_dataRows[input_mode.upper()]["MaxWMOPS"]:
input_formats_maxWmops_maxRow_dataRows[input_mode.upper()]["MaxWMOPS"] = float(total_complexity)
input_formats_maxWmops_maxRow_dataRows[input_mode.upper()]["MaxDataRow"] = dict_data
# Heatmap
if codec_mode == "" and bitrate in ivas_bitrates:
if float(total_complexity) > heatmap_outputs[output_mode.lower()][input_mode.upper()][bitrate][0]:
heatmap_outputs[output_mode.lower()][input_mode.upper()][bitrate][0] = float(total_complexity)
if float(total_complexity) > clevel2:
heatmap_outputs[output_mode.lower()][input_mode.upper()][bitrate][1] = redFill
elif float(total_complexity) > clevel1:
heatmap_outputs[output_mode.lower()][input_mode.upper()][bitrate][1] = greenFill
else:
heatmap_outputs[output_mode.lower()][input_mode.upper()][bitrate][1] = blueFill
# Close files
for profile in included_profiles:
profile_table_files[profile].close()
# Write tables for individual input formats
if single_input_format_output_table_base != None:
for key in input_formats_maxWmops_maxRow_dataRows:
sinle_input_format_output = single_input_format_output_table_base + key.replace(" ", "_") + output_profile_suffix + ".csv"
sinle_input_format_output_xlsx = sinle_input_format_output.replace(".csv", ".xlsx")
wb_single_input_format_output_table = openpyxl.Workbook()
ws_single_input_format_output_table = wb_single_input_format_output_table.active
ws_single_input_format_output_table.append(fields)
with open(sinle_input_format_output, 'w') as single_input_format_output_file:
single_writer = csv.writer(single_input_format_output_file, delimiter=";")
single_writer.writerow(fields)
for row in input_formats_maxWmops_maxRow_dataRows[key]["DataRows"]:
data_row = []
for data_key in row:
data_row.append(row[data_key])
single_writer.writerow(data_row)
ws_single_input_format_output_table.append(data_row)
wb_single_input_format_output_table.save(sinle_input_format_output_xlsx)
# Dump to json
with open(json_output, "w") as json_file:
json.dump(input_formats_maxWmops_maxRow_dataRows, json_file)
# Write the max wmops rows
with open(combined_max_output_table, 'w') as combine_max_output_file:
max_writer = csv.writer(combine_max_output_file, delimiter=";")
max_writer.writerow(fields)
for key in input_formats_maxWmops_maxRow_dataRows:
max_data_row = []
for data_key in input_formats_maxWmops_maxRow_dataRows[key]["MaxDataRow"]:
max_data_row.append(input_formats_maxWmops_maxRow_dataRows[key]["MaxDataRow"][data_key])
max_writer.writerow(max_data_row)
ws_combined_max_output_table.append(max_data_row)
# Heatmap
if heatmap_table_base != None:
for output_mode in output_modes:
heatmap_output_table = heatmap_table_base + output_mode + ".xlsx"
wb_heatmap_table = openpyxl.Workbook()
ws_heatmap_table = wb_heatmap_table.active
ws_heatmap_table.append(fields_heatmap)
row = 1
for input_mode in input_modes:
row += 1
col = 1
ws_heatmap_table.cell(row, col).value = input_mode
col +=1
for bitrate in ivas_bitrates:
ws_heatmap_table.cell(row, col).value = heatmap_outputs[output_mode][input_mode.upper()][bitrate][0]
ws_heatmap_table.cell(row, col).fill = heatmap_outputs[output_mode][input_mode.upper()][bitrate][1]
col += 1
wb_heatmap_table.save(heatmap_output_table)
# Save Excel file
wb_output_table.save(output_table_xlsx)
wb_combined_max_output_table.save(combined_max_output_table_xlsx)