Add missing start-trim to Opus testdata to match declared pre_skip - #77
Merged
jwcullen merged 1 commit intoAug 4, 2026
Merged
Conversation
The three Opus files under iamf/cli/testdata/iamf/ declare a non-zero
pre_skip but no audio frame OBU carried num_samples_to_trim_at_start,
violating IAMF v1.1 Section 3.11.1 ("Pre-skip SHALL be the same as the
number of audio samples to be trimmed at the start of coded Audio
Substreams"), as flagged by ComplianceWarden's new IAMF checks.
The existing end-trims show the trim was always intended: 648 = 960 -
312 for tones_100ms_3OA (yielding exactly 4800 samples = 100 ms) and
1920 - 312 - 584 = 1024 for noise_1024samp. This patch sets the
trimming-status flag on each substream's first audio frame and inserts
num_samples_to_trim_at_end = 0 / num_samples_to_trim_at_start =
pre_skip, leaving every other byte unchanged.
After patching, all three files pass ComplianceWarden (-s iamf) with no
errors, and decoding yields exactly the intended durations (1024, 4800,
and 10224 samples per channel).
Fixes AOMediaCodec#76.
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.
Fixes #76.
The three Opus files under
iamf/cli/testdata/iamf/declare a non-zeropre_skip, but no audio frame OBU carries a start-trim, violating IAMF v1.1 §3.11.1. This patch sets the trimming-status flag on each substream's first audio frame and insertsnum_samples_to_trim_at_end = 0/num_samples_to_trim_at_start = pre_skip(120 fornoise_3s_stereo_opus, 312 for the other two). No other bytes change; the files grow by 2–15 bytes.Why patch the trim instead of zeroing
pre_skip:pre_skip == 0on streams with audio frames, so the 2-byte patch would just trade one Rule Example command to convert 5.1 wav directly with ffmpeg throws error #15 error for another.tones_100ms_3OAdelivers 5760 − 312 − 648 = exactly 4800 samples (100 ms),noise_1024samp1920 − 312 − 584 = exactly 1024. The original encode intended the trim; only the field went missing. This restores the filenames' stated durations.Verified: all three patched files pass ComplianceWarden (
-s iamf) with no errors, decode to exactly the intended durations (includingnoise_3s, whose first 120-sample frame is fully trimmed), andbazel test //iamf/...passes on this branch.