ws-audio2: Musepack / AC-3 bench lines, docs/guide/audio.md section (+ tools/fixtures/docs_lossy.py inputs), AVI AC-3 track test

This commit is contained in:
4DBug committed 2026-10-31 14:48:22 -05:00
1 parent 41b72d9b8a
commit 2d99b9924a
5 files changed
+95 -5

No files matched your search

+3 -2
View File
@@ -3,7 +3,7 @@
# References: ffmpeg's float decode with -drc_scale 0 (dynamic range off, our default), except for block-switched
# streams: ffmpeg (as packaged) mis-decodes the first of the two short transforms, so those use liba52's a52dec
# (-r -a: no dynamic range, no level adjustment; float for stereo, 16-bit wav6 for more channels), which agrees with
# the A/52 transform equations. AC-3 tracks in Matroska / MP4 / MPEG-TS (remuxed by ffmpeg) for the api's audio hook.
# the A/52 transform equations. AC-3 tracks in Matroska / MP4 / MPEG-TS / AVI (remuxed by ffmpeg) for the api's audio hook.
#
# Both encoders set dithflag, and decoders draw their own random dither for the zero-bit mantissas, so two correct
# decoders differ by about the coding noise. The reference streams therefore have their dithflags cleared (the bit
@@ -214,7 +214,8 @@ def generate(ctx):
with open(os.path.join(d, "t.raw"), "wb") as f:
f.write(raw(sig))
for name, video, layout in (("ac3.mkv", "-c:v mjpeg -pix_fmt yuvj420p", "5.1(side)"),
("ac3.mp4", "-c:v mjpeg -pix_fmt yuvj420p", "stereo"), ("ac3.ts", "-c:v mpeg1video", "stereo")):
("ac3.mp4", "-c:v mjpeg -pix_fmt yuvj420p", "stereo"), ("ac3.ts", "-c:v mpeg1video", "stereo"),
("ac3.avi", "-c:v mjpeg -pix_fmt yuvj420p", "stereo")):
run("ffmpeg -v error -y -f f32le -ar 48000 -ch_layout '5.1(side)' -i t.raw -af aformat=channel_layouts='%s' "
"-c:a ac3 -b:a 192k t.ac3" % layout)
with open(os.path.join(d, "t.ac3"), "rb") as f: