Remaining non-BE Debug vs. Release stereo panning functions in decoder
As continuation of conformance work verifications, there are still minor non-BE differences when comparing Release build enc-dec to Debug build enc-dec on Linux (using, e.g., Clang 18). The list is this this
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-2 ISM with metadata at 80 kbps, 48 kHz in, 48 kHz out, DTX on, stereo out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 1)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-MASA 1dir 2TC at 80 kbps, 32kHz in, 16kHz out, STEREO out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 1)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-MASA 1dir 1TC at 64 kbps, 48kHz in, 48kHz out, STEREO out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 1)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-MASA 1dir 2TC at 24.4 kbps, 48kHz in, 48kHz out, STEREO out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 1)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-2 ISM with metadata at 16.4 kbps, 48 kHz in, 48 kHz out, STEREO out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 1)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-MASA 1dir 1TC bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, STEREO out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 3)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-4 ISM with metadata at 160 kbps, 48 kHz in, 48 kHz out, STEREO out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 1)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-Multi-channel 5_1 at 24.4 kbps, 48kHz in, 48kHz out, STEREO out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 8)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-Multi-channel 7_1_4 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 32kHz out, STEREO out, FER at 5%] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 3)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-OMASA 2Dir1TC 3ISM at br sw techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 32kHz out, STEREO out, JBM Prof 5] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 4)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-OMASA 2Dir1TC 3ISM at br sw techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10%] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 2)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-OMASA 2Dir2TC 2ISM at 32 kbps, 48kHz in, 48kHz out, STEREO out, FER at 5%] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 3)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-OMASA 2Dir2TC 4ISM at 192 kbps, 48kHz in, 48kHz out, STEREO out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 1)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-Multi-channel 5_1_2 at 32 kbps, 48kHz in, 48kHz out, STEREO out, random FER at 5%] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 8)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-OMASA 1Dir2TC 3ISM at 32 kbps, 48kHz in, 16kHz out, STEREO out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 2)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-OMASA 2Dir1TC 4ISM at 24.4 kbps, 48kHz in, 48kHz out, STEREO out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 3)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-OSBA 3ISM 2OA at bitrate switching 13.2 to 512 kbps, 48kHz in, 32kHz out, STEREO out, FER at 10%] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 1)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-MASA 1dir 1TC bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, STEREO out, JBM Prof 5] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 3)
FAILED tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-OSBA FOA 4ISM at 512 kbps, 32kHz in, 48kHz out, STEREO out] - Failed: Difference between ref and dut in output only (Non-BE - MAX_ABS_DIFF: 1)
As this all points to STEREO output with quite minimal diff so likely cause was decoder. As the stereo panning gains were a problem on the encoder side, I tested inserting a bunch of (probably more than required) volatile keywords into the remaining functions which are
lib_dec/ivas_ism_renderer.c::ivas_ism_get_stereo_gains()
lib_dec/ivas_sba_dirac_stereo_dec.c::get_panning()
lib_rend/ivas_dirac_dec_binaural_functions.c::getDirectPartGains
and the end result is that Debug vs. Release becomes completely BE for STV test vector run. Thus, it might make sense to also improve these remaining stereo panning functions to improve our Debug vs. Release state. However, we would have two options how to go:
- Add the minimal
volatilekeywords. This may hamper some optimization but should not change output for Debug. - Harmonize the three above panning functions use the existing table approach present in
lib_com/ivas_omasa_com.c::ivas_get_stereo_panning_gains