feat(sv56): WAV I/O integration with multi-bit-depth support#7
Open
ludomal wants to merge 53 commits into
Open
feat(sv56): WAV I/O integration with multi-bit-depth support#7ludomal wants to merge 53 commits into
ludomal wants to merge 53 commits into
Conversation
The random tool was developed to have pseudo-random selection of entries from a list based on a master seed as required by the EVS processing scripts.
Document the random tool from PR openitu#182 (3GPP S4-121078) in the unsup.tex appendix with algorithm description, usage examples, options reference, and test information.
Re-integrate wav_io library into sv56demo, supporting 8/16/24/32-bit PCM and 32-bit IEEE float WAV files transparently. Key design: - File bit depth auto-detected from WAV header (raw PCM defaults to 16-bit) - Sample rate auto-detected from WAV header - -bits flag sets A/D resolution for P.56 algorithm (must be <= file depth) - Full backward compatibility: raw 16-bit files behave identically WAV I/O fixes (endian-safe): - Route all WAV reads through byte-extraction path (LE->native) - Write WAV samples as explicit little-endian bytes - Fix LP64 bug: 24/32-bit samples into sizeof(long)==8 slots - Keep direct fread only for raw (native-endian) files Equalization precision: - 24/32-bit: apply gain in double precision directly on integers - Float input: convert to 32-bit PCM output - 16-bit: preserve original float round-trip for bit-exact compat Tests (25 total): - Binary output comparison for 24-bit, 32-bit, float, very-quiet - Text statistics verification via -log - Very quiet (-91 dBov) file demonstrates 32-bit advantage: 32-bit resolution detects speech (90% activity), 16-bit ADC simulation reports zero activity
# Conflicts: # src/sv56/CMakeLists.txt # src/utl/wav_io.c
8b82776 to
559b282
Compare
LaTeX build fixes for random tool documentation
Add sv56demo4 test that exercises bitno=12 (sub-16-bit resolution), verifying both binary output and log output against references. This covers a code path not previously tested.
Remove sv56-util.h, sv56test.c, and sv56-convert.c — their functionality is superseded by wav_io.h which handles variable bit-depth I/O at the file abstraction layer. Update actlevel.c to use AUDIO_FILE/audio_open_read/audio_read/audio_close consistent with sv56demo.c.
# Conflicts: # src/sv56/CMakeLists.txt
# Conflicts: # doc/manual/unsup.tex
The eid-amr tool was integrated into src/eid/ but the root CMakeLists.txt still referenced the old standalone directory.
# Conflicts: # CMakeLists.txt
- CMakeLists.txt: project name STL2023 -> STL2026 - STLmanual.tex: title, header, copyright updated to 2026 - intro.tex: add 'In 2026' section, STL2026 acknowledgements, acronym entry - g191.md: update summary to STL2026 with new feature list - g191_Annex_A.md: add dlyerr_2_errpat, eid-amr, random entries and SHQ2/SHQ3/HP50 filter functions
Add GitHub Actions CI workflow (replace Travis CI)
Same ±1 LSB cross-platform FP rounding as other IIR/FIR filter tests.
Guard Python-dependent wmc_tool tests with if(Python3_FOUND) so they are cleanly skipped on platforms without Python3 (e.g. i386 container).
Better use of bitno and WAV integration
reltol was used uninitialized when -reltol flag not provided, causing a crash in MSVC debug builds on Windows.
±1 LSB cross-platform FP rounding at clipping boundary (seen on WSL).
Catches bugs like the reltol issue at compile time rather than relying on Debug-mode runtime checks that cause dialog popups.
cf (compfile) does not support -equiv flag; signal-diff does.
- item_type: could be used uninitialized if no region type matched - ps: could be used uninitialized if keyword had no delimiter Detected by clang -Wconditional-uninitialized and MSVC /we4700.
95bdd97 to
2f6150e
Compare
/we4700 on C++ causes wmc_tool runtime test failures on MSVC due to optimizer behavior differences, even with the uninit vars fixed. Keep it for C only where it catches real bugs (like compfile reltol).
Same pattern as sv56demo: auto-detect bit depth from WAV header, use -bits flag for A/D resolution override. Demonstrates 32-bit detecting speech at -91 dBov while 16-bit reports zero activity. Tests: 24-bit normal, 32-bit vquiet, 16-bit ADC simulation, multi-file.
feat(sv56): WAV I/O integration with multi-bit-depth support
…r2804/STL into feature/p56-bitdepth-extension
- src/eid/bs-stats.c: initialize out_file to "-" (default stdout) - src/g728/g728fixed/g728fpdec.c: initialize gaindb to 0 - src/is54/lag.c: initialize E to 0.0 - src/mnru/p50fbmnru.c: initialize dcFilterMode to 0 - src/mnru/snr.c: initialize total_snr_dB in reset block - src/wmc_tool/c_parser.cpp: use calloc instead of malloc for Insert Table allocation (zeroes padding bytes) Remaining: test_precision.c is a consequence of basop W_round issue (openitu#189)
- src/eid/bs-stats.c: initialize out_file to "-" (default stdout) - src/g728/g728fixed/g728fpdec.c: initialize d->ogaindb in decoder state - src/is54/g_quant.c: initialize Rpc0, Rcc00, Rcc01, Rcc02, savePtr - src/is54/init.c: calloc all global arrays (prevents tainted data) - src/mnru/p50fbmnru.c: initialize dcFilterMode to 0 - src/mnru/snr.c: initialize total_snr_dB in reset block - src/wmc_tool/c_parser.cpp: memset Insert record, use calloc for table - src/wmc_tool/wmc_tool.cpp: memset ParseContext to zero Verified with Clang Memory Sanitizer: all uninitialized reads resolved except test_precision.c (consequence of basop W_round bug, issue openitu#189).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-integrate wav_io into sv56demo with support for 8/16/24/32-bit PCM and 32-bit IEEE float WAV files.
Changes
-bitsflag sets A/D resolution for P.56 algorithm (simulates lower-res ADC)Tests (25 total)
-logBackward compatibility
sv56demo file.src file.prcbehaves identically to before