-
Notifications
You must be signed in to change notification settings - Fork 30
feat(sv56): variable bit-width support (8-32 bit) for speech voltmeter #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jr2804
wants to merge
22
commits into
openitu:dev
Choose a base branch
from
jr2804:feature/p56-bitdepth-extension
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d5a49c7
feat(p56): extend speech voltmeter to support arbitrary bit depths
5aa41cb
chore(build): update CMake minimum version and clean up .gitignore
447610c
🔧 chore(build): enforce 32-bit build configuration
9a466a0
🔧 chore: add /build to .gitignore
44a86e0
feat(sv56): enhance speech voltmeter for arbitrary bit depths
827065c
🧪 test(sv56): update test configurations and working directories
dafb0df
🛠️ chore(cmake): update minimum version and remove 32-bit enforcement
9782426
feat(sv56): add variable bit-width support and new utilities
0c7aa82
🔥 chore(sv56): remove test data files from .gitignore
353558a
feat(sv56): add reference and source files for 16, 24, and 32 bit audio
a454ec9
doc(sv56): update manual for arbitrary bit depth support
3351935
feat(sv56): re-integrate WAV I/O with multi-bit-depth support
1dd843d
fix(test): use CRLF-tolerant text comparison for log verify tests
cb2301d
doc(sv56): update README with WAV support and bit-depth comparison
c1bfec2
test(sv56): add 12-bit test cases for bitno backward compatibility
4a1c219
refactor(sv56): remove sv56-util.h, use wav_io.h in actlevel.c
3352078
Merge pull request #1 from ludomal/sv56_wavio
jr2804 f5e49bd
✨ feat(wav_io): add support for 8/16/24/32-bit PCM and 32-bit float WAV
1e1056a
🐛 fix(wav_io): correct bps check for 8-bit samples (not 1-bit!)
545c35e
feat(sv56): update actlev for 24/32-bit WAV support
b2cbeca
Merge pull request #2 from ludomal/sv56_wavio
jr2804 9b48cb6
Merge branch 'feature/p56-bitdepth-extension' of https://github.com/j…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
|
jr2804 marked this conversation as resolved.
|
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # cmake/CompareTextFiles.cmake | ||
| # Compare two text files, ignoring line-ending differences (CRLF vs LF). | ||
| # | ||
| # Usage (from a -P script): | ||
| # include(/path/to/CompareTextFiles.cmake) | ||
| # compare_text_files(GOT <file> EXPECTED <file> [LABEL <name>]) | ||
|
|
||
| function(compare_text_files) | ||
| cmake_parse_arguments(_CTF "" "GOT;EXPECTED;LABEL" "" ${ARGN}) | ||
|
|
||
| file(READ "${_CTF_GOT}" _got) | ||
| string(REPLACE "\r\n" "\n" _got "${_got}") | ||
|
|
||
| file(READ "${_CTF_EXPECTED}" _want) | ||
| string(REPLACE "\r\n" "\n" _want "${_want}") | ||
|
|
||
| if(NOT _got STREQUAL _want) | ||
| message(FATAL_ERROR "Text file mismatch: ${_CTF_LABEL}\n--- got ---\n${_got}\n--- expected ---\n${_want}") | ||
| endif() | ||
| endfunction() | ||
|
|
||
| # Auto-invoke when called via cmake -P with -D variables | ||
| if(DEFINED GOT AND DEFINED EXPECTED) | ||
| compare_text_files(GOT "${GOT}" EXPECTED "${EXPECTED}" LABEL "${LABEL}") | ||
| endif() |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| **/*.out | ||
| test_data/voice.prc | ||
| test_data/voice.rms |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,105 @@ | ||
| include_directories(../g711) | ||
| include_directories(../utl) | ||
|
|
||
| add_executable(sv56demo sv56demo.c sv-p56.c ../utl/ugst-utl.c) | ||
| add_executable(sv56demo sv56demo.c sv-p56.c ../utl/ugst-utl.c ../utl/wav_io.c) | ||
| target_link_libraries(sv56demo ${M_LIBRARY}) | ||
|
|
||
| add_executable(actlev actlevel.c sv-p56.c ../utl/ugst-utl.c) | ||
| add_executable(actlev actlevel.c sv-p56.c ../utl/ugst-utl.c ../utl/wav_io.c) | ||
| target_link_libraries(actlev ${M_LIBRARY}) | ||
|
|
||
| add_test(sv56demo1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q test_data/voice.src test_data/voice.prc 256 1 0 -30) | ||
| add_test(sv56demo1-verify ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cf -q test_data/voice.nrm test_data/voice.prc) | ||
| set_tests_properties(sv56demo1 PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo1-verify ${CMAKE_COMMAND} -E compare_files test_data/voice.nrm test_data/voice.prc) | ||
| set_tests_properties(sv56demo1-verify PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q -rms test_data/voice.src test_data/voice.rms 256 1 0 -30) | ||
| add_test(sv56demo2-verify ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cf -q test_data/voice.ltl test_data/voice.rms) | ||
| set_tests_properties(sv56demo2 PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo2-verify ${CMAKE_COMMAND} -E compare_files test_data/voice.ltl test_data/voice.rms) | ||
| set_tests_properties(sv56demo2-verify PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo3 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/actlev -q test_data/voice.src test_data/voice.nrm test_data/voice.prc test_data/voice.ltl test_data/voice.rms) | ||
| set_tests_properties(sv56demo3 PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| # 12-bit backward compatibility test | ||
| add_test(sv56demo4 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q -log test_data/voice_12bit.log test_data/voice.src test_data/voice_12bit.prc 256 1 0 -30 16000 12) | ||
| set_tests_properties(sv56demo4 PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| add_test(sv56demo4-verify ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cf -q test_data/voice_12bit.nrm test_data/voice_12bit.prc) | ||
| set_tests_properties(sv56demo4-verify PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS sv56demo4) | ||
| add_test(sv56demo4-log-verify ${CMAKE_COMMAND} -E compare_files test_data/voice_12bit.log.ref test_data/voice_12bit.log) | ||
| set_tests_properties(sv56demo4-log-verify PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS sv56demo4) | ||
|
|
||
| # WAV integration tests | ||
| add_test(sv56demo-wav-24bit-normal ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q test_data/speech_normal_24bit.wav test_data/speech_normal_24bit.out) | ||
| set_tests_properties(sv56demo-wav-24bit-normal PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-24bit-normal-verify ${CMAKE_COMMAND} -E compare_files test_data/speech_normal_24bit.ref test_data/speech_normal_24bit.out) | ||
| set_tests_properties(sv56demo-wav-24bit-normal-verify PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-32bit ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q test_data/speech_normal_32bit.wav test_data/speech_normal_32bit.out) | ||
| set_tests_properties(sv56demo-wav-32bit PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-32bit-verify ${CMAKE_COMMAND} -E compare_files test_data/speech_normal_32bit.ref test_data/speech_normal_32bit.out) | ||
| set_tests_properties(sv56demo-wav-32bit-verify PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-24bit ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q test_data/speech_quiet_24bit.wav test_data/speech_quiet_24bit.out) | ||
| set_tests_properties(sv56demo-wav-24bit PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-24bit-verify ${CMAKE_COMMAND} -E compare_files test_data/speech_quiet_24bit.ref test_data/speech_quiet_24bit.out) | ||
| set_tests_properties(sv56demo-wav-24bit-verify PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-float ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q test_data/speech_quiet_32bit_float.wav test_data/speech_quiet_32bit_float.out) | ||
| set_tests_properties(sv56demo-wav-float PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-float-verify ${CMAKE_COMMAND} -E compare_files test_data/speech_quiet_32bit_float.ref test_data/speech_quiet_32bit_float.out) | ||
| set_tests_properties(sv56demo-wav-float-verify PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-vquiet-32bit ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q test_data/speech_vquiet_32bit.wav test_data/speech_vquiet_32bit.out) | ||
| set_tests_properties(sv56demo-wav-vquiet-32bit PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-vquiet-32bit-verify ${CMAKE_COMMAND} -E compare_files test_data/speech_vquiet_32bit.ref test_data/speech_vquiet_32bit.out) | ||
| set_tests_properties(sv56demo-wav-vquiet-32bit-verify PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-vquiet-16bit-adc ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q -bits 16 test_data/speech_vquiet_32bit.wav test_data/speech_vquiet_32bit_16bit.out) | ||
| set_tests_properties(sv56demo-wav-vquiet-16bit-adc PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-vquiet-16bit-adc-verify ${CMAKE_COMMAND} -E compare_files test_data/speech_vquiet_32bit_16bit.ref test_data/speech_vquiet_32bit_16bit.out) | ||
| set_tests_properties(sv56demo-wav-vquiet-16bit-adc-verify PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| # WAV text output (statistics) verification tests | ||
| add_test(sv56demo-wav-24bit-normal-log ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q -log test_data/speech_normal_24bit.log test_data/speech_normal_24bit.wav test_data/speech_normal_24bit.out) | ||
| set_tests_properties(sv56demo-wav-24bit-normal-log PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-24bit-normal-log-verify ${CMAKE_COMMAND} | ||
| -DGOT=${CMAKE_CURRENT_SOURCE_DIR}/test_data/speech_normal_24bit.log | ||
| -DEXPECTED=${CMAKE_CURRENT_SOURCE_DIR}/test_data/speech_normal_24bit.log.ref | ||
| -DLABEL=sv56demo-wav-24bit-normal-log | ||
| -P ${CMAKE_SOURCE_DIR}/cmake/CompareTextFiles.cmake) | ||
|
|
||
| add_test(sv56demo-wav-32bit-log ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q -log test_data/speech_normal_32bit.log test_data/speech_normal_32bit.wav test_data/speech_normal_32bit.out) | ||
| set_tests_properties(sv56demo-wav-32bit-log PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-32bit-log-verify ${CMAKE_COMMAND} | ||
| -DGOT=${CMAKE_CURRENT_SOURCE_DIR}/test_data/speech_normal_32bit.log | ||
| -DEXPECTED=${CMAKE_CURRENT_SOURCE_DIR}/test_data/speech_normal_32bit.log.ref | ||
| -DLABEL=sv56demo-wav-32bit-log | ||
| -P ${CMAKE_SOURCE_DIR}/cmake/CompareTextFiles.cmake) | ||
|
|
||
| add_test(sv56demo-wav-vquiet-32bit-log ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q -log test_data/speech_vquiet_32bit.log test_data/speech_vquiet_32bit.wav test_data/speech_vquiet_32bit.out) | ||
| set_tests_properties(sv56demo-wav-vquiet-32bit-log PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-vquiet-32bit-log-verify ${CMAKE_COMMAND} | ||
| -DGOT=${CMAKE_CURRENT_SOURCE_DIR}/test_data/speech_vquiet_32bit.log | ||
| -DEXPECTED=${CMAKE_CURRENT_SOURCE_DIR}/test_data/speech_vquiet_32bit.log.ref | ||
| -DLABEL=sv56demo-wav-vquiet-32bit-log | ||
| -P ${CMAKE_SOURCE_DIR}/cmake/CompareTextFiles.cmake) | ||
|
|
||
| add_test(sv56demo-wav-vquiet-16bit-adc-log ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sv56demo -q -log test_data/speech_vquiet_32bit_16bit.log -bits 16 test_data/speech_vquiet_32bit.wav test_data/speech_vquiet_32bit_16bit.out) | ||
| set_tests_properties(sv56demo-wav-vquiet-16bit-adc-log PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_test(sv56demo-wav-vquiet-16bit-adc-log-verify ${CMAKE_COMMAND} | ||
| -DGOT=${CMAKE_CURRENT_SOURCE_DIR}/test_data/speech_vquiet_32bit_16bit.log | ||
| -DEXPECTED=${CMAKE_CURRENT_SOURCE_DIR}/test_data/speech_vquiet_32bit_16bit.log.ref | ||
| -DLABEL=sv56demo-wav-vquiet-16bit-adc-log | ||
| -P ${CMAKE_SOURCE_DIR}/cmake/CompareTextFiles.cmake) |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.