Skip to content

Commit 0776286

Browse files
committed
Annotate some more tests that typically would not be encoded, but could be decoded.
- `README.md`: Clarify since the spec does not determine behavior when something is invalid IAMF that a production system may still try to find a robust way to handle "should-fail" cases. - `test_000017`: Document the encoder may have a bug where it is too strict with `num_samples_to_trim_at_end`. - `test_000026`: Encoder refuses to produce it because "Output Channel Count SHALL be set to 2", but the decoder should process it anyway because "Output Channel Count can be ignored ". - `test_000119`: Encoder refuses to produce it because the codec ID is not known, but the decoder can ignore the mix related to that codec. - `test_000502`: Encoder refuses to produce it because `num_submixes` "SHALL NOT be set to 0", but the decoder can process the other mix. - Files based on AOMediaCodec/iamf-tools@468eb9b4
1 parent 1fc6f77 commit 0776286

6 files changed

Lines changed: 25 additions & 14 deletions

File tree

tests/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ Theses file describe metadata about the test vector to encode an
2020
would be understood by a compliant decoder. False when one or more mixes
2121
exercise fields or features which would cause mixes to be ignored.
2222
- `is_valid_to_decode`: True when an IAMF-compliant decoder could decode at
23-
least least one mix of the associated IA Sequence ("should-pass"). False
24-
when all mixes are non-conformant and would fail to be decoded
25-
("should-false").
23+
least one mix of the associated IA Sequence ("should-pass"). False when all
24+
mixes are non-conformant and may fail to be decoded ("should-fail"). The
25+
IAMF spec does not specify what happens when requirements are violated; a
26+
robust system may still attempt to process and create output for
27+
"should-fail" tests.
2628
- `human_readable_descriptions`: A short description of what is being tested
2729
and why.
2830
- `mp4_fixed_timestamp`: The timestamp within the MP4 file. Can be safely

tests/test_000017.textproto

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313

1414
test_vector_metadata {
1515
human_readable_description:
16-
"A stereo IAMF stream. It is invalid because it has one frame of samples "
17-
"fully trimmed off the end."
16+
"A stereo IAMF stream. It has one frame of samples fully trimmed off the "
17+
"end."
1818
file_name_prefix: "test_000017"
19+
# TODO(b/356905554): Allow encoding fully trimmed frames.
1920
is_valid: false
20-
is_valid_to_decode: false
21+
is_valid_to_decode: true
2122
validate_user_loudness: true
2223
mp4_fixed_timestamp: "2023-04-19 00:00:00"
2324
primary_tested_spec_sections: [

tests/test_000026.textproto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ test_vector_metadata {
1616
"A stereo IAMF stream encoded using Opus, with an incorrect "
1717
"`output_channel_count`."
1818
file_name_prefix: "test_000026"
19+
# The encoder would not normally encode data with invalid
20+
# `output_channel_count`.
1921
is_valid: false
20-
is_valid_to_decode: false
22+
# A compliant decoder should ignore `output_channel_count`.
23+
is_valid_to_decode: true
2124
validate_user_loudness: true
2225
mp4_fixed_timestamp: "2023-05-05 00:00:00"
2326
primary_tested_spec_sections: [

tests/test_000119.textproto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ test_vector_metadata {
1818
"element encoded with an imaginary `codec_id`. For convenience, the "
1919
"imaginary `codec_id` uses the same syntax as LPCM."
2020
file_name_prefix: "test_000119"
21+
# The encoder cannot accurately encode a `coded_id` which is not yet defined.
2122
is_valid: false
22-
is_valid_to_decode: false
23+
# A compliant decoder can decode the mix with `mix_presentation_id` 42.
24+
is_valid_to_decode: true
2325
partition_mix_gain_parameter_blocks: false
2426
validate_user_loudness: true
2527
mp4_fixed_timestamp: "2024-07-17 00:00:00"

tests/test_000502.textproto

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
test_vector_metadata {
1515
human_readable_description:
1616
"An invalid IAMF stream with two Mix Presentation OBUs. The stream is "
17-
"invalid because one of the Mix Presentation OBUs has 0 sub-mixes."
17+
"invalid because one of the Mix Presentation OBUs has zero sub-mixes."
1818
file_name_prefix: "test_000502"
19+
# The encoder should not normally encode a mix presentation with zero
20+
# sub-mixes.
1921
is_valid: false
20-
is_valid_to_decode: false
22+
# A compliant decoder can decode the mix with `mix_presentation_id` 42.
23+
is_valid_to_decode: true
2124
validate_user_loudness: true
2225
mp4_fixed_timestamp: "2023-08-07 00:00:00"
2326
primary_tested_spec_sections: [

tests/test_summary.csv

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test_000014","test_000005","3.9/Audio Frame OBU Syntax and Semantics, 3.11.1/pre_skip",False,False,"A stereo IAMF stream with no trimming encoded using Opus. It is invalid because `pre_skip` is incorrectly set to 0."
1111
"test_000015","test_000005","3.8/parameter_id",True,True,"A stereo IAMF stream that includes an extra parameter block which is not used by any audio element or mix presentation."
1212
"test_000016","test_000005","3.5/num_samples_per_frame, 3.6.1/param_definition_mode, 3.8/duration, 3.8/constant_subblock_duration, 3.9/Audio Frame OBU Syntax and Semantics",False,False,"A stereo IAMF stream. It has a parameter block not aligned with the audio frames, ending 100 samples earlier. This is invalid because parameter blocks should cover the whole duration of the audio frames that use the parameter."
13-
"test_000017","test_000005","3.2/num_samples_to_trim_at_end, 3.5/num_samples_per_frame",False,False,"A stereo IAMF stream. It is invalid because it has one frame of samples fully trimmed off the end."
13+
"test_000017","test_000005","3.2/num_samples_to_trim_at_end, 3.5/num_samples_per_frame",False,True,"A stereo IAMF stream. It has one frame of samples fully trimmed off the end."
1414
"test_000018","test_000005","3.1/obu_type, 3.9/explicit_audio_substream_id",True,True,"A stereo IAMF stream. The substream has an ID larger than 21 which requires the ID to be explicitly listed in the OBU."
1515
"test_000019","test_000005","3.8/Parameter Block OBU Syntax and Semantics",True,True,"A stereo IAMF stream that has two parameter blocks with the same ID occuring one after another."
1616
"test_000020","test_000014","3.5/audio_roll_distance, 3.9/Audio Frame OBU Syntax and Semantics, 3.11.1/OPUS Specific, 3.11.1/num_samples_per_frame, 6.2.2/roll",True,True,"A stereo IAMF stream encoded using 20 ms Opus frames which encodes a 500 ms sine wav with a frequency of 1000 Hz."
@@ -19,7 +19,7 @@
1919
"test_000023","test_000020","3.2/num_samples_to_trim_at_start, 3.9/Audio Frame OBU Syntax and Semantics, 3.11.1/OPUS Specific, 3.11.1/num_samples_per_frame",True,True,"A stereo IAMF stream encoded using 5 ms Opus frames which requires fully trimmed frames at the start."
2020
"test_000024","test_000020","3.5/audio_roll_distance, 3.9/Audio Frame OBU Syntax and Semantics, 3.11.1/OPUS Specific, 3.11.1/num_samples_per_frame",True,True,"A stereo IAMF stream encoded using 60 ms Opus frames."
2121
"test_000025","test_000020","3.9/Audio Frame OBU Syntax and Semantics, 3.11.1/version",False,False,"A stereo IAMF stream encoded using Opus, with an incorrect Opus version."
22-
"test_000026","test_000020","3.9/Audio Frame OBU Syntax and Semantics, 3.11.1/output_channel_count",False,False,"A stereo IAMF stream encoded using Opus, with an incorrect `output_channel_count`."
22+
"test_000026","test_000020","3.9/Audio Frame OBU Syntax and Semantics, 3.11.1/output_channel_count",False,True,"A stereo IAMF stream encoded using Opus, with an incorrect `output_channel_count`."
2323
"test_000027","test_000020","3.9/Audio Frame OBU Syntax and Semantics, 3.11.1/output_gain",False,False,"A stereo IAMF stream encoded using Opus, with an incorrect `output_gain`."
2424
"test_000028","test_000020","3.9/Audio Frame OBU Syntax and Semantics, 3.11.1/channel_mapping_family",False,False,"A stereo IAMF stream encoded using Opus, with an incorrect `channel_mapping_family`."
2525
"test_000029","test_000005","3.11.4/sample_rate",True,True,"A stereo IAMF stream encoded using LPCM with a sample rate of 48 kHz."
@@ -108,7 +108,7 @@
108108
"test_000116","test_000020","3.2/obu_type, 3.5/audio_roll_distance, 3.9/Audio Frame OBU Syntax and Semantics, 3.11.1/OPUS Specific, 3.11.1/num_samples_per_frame, 4/Reserved Descriptor OBU, 4/Reserved Temporal Unit OBU, 6.2.2/roll",True,True,"A stereo Opus IAMF stream which additionally contains several reserved OBUs interlaced between the descriptor OBUs and in the first temporal unit. The spec does not predetermine which reserved OBUs will be descriptor OBUs and which will be temporal unit OBUs."
109109
"test_000117","test_000020","3.2/obu_extension_flag, 3.5/audio_roll_distance, 3.9/Audio Frame OBU Syntax and Semantics, 3.11.1/OPUS Specific, 3.11.1/num_samples_per_frame, 6.2.2/roll",True,True,"A stereo Opus IAMF stream which encodes a 500 ms sine wav with a frequency of 1000 Hz, and where the Audio Element OBU has extension header bytes."
110110
"test_000118","test_000087","3.6.2/loudspeaker_layout == Stereo, 3.6.2/loudspeaker_layout == 5.1, 3.7/num_audio_elements, 3.7.4/default_mix_gain, 3.11.1/OPUS Specific, 4.2/Simple Profile, 4.2/Base Profile, 8.5.1/Loudness Information",True,True,"A two-layer 5.1 + stereo IAMF stream encoded using Opus and with two Mix Presentations. The first Mix Presentation uses both Audio Elements. The second Mix Presentation uses only the stereo Audio Element. The primary profile is set to Simple and the additional profile is set to Base."
111-
"test_000119","test_000002","3.5/codec_id, 4.1/Simple Profile",False,False,"An invalid stereo stream. The first mix uses a single stereo audio element encoded with LPCM. The second mix uses a single stereo audio element encoded with an imaginary `codec_id`. For convenience, the imaginary `codec_id` uses the same syntax as LPCM."
111+
"test_000119","test_000002","3.5/codec_id, 4.1/Simple Profile",False,True,"An invalid stereo stream. The first mix uses a single stereo audio element encoded with LPCM. The second mix uses a single stereo audio element encoded with an imaginary `codec_id`. For convenience, the imaginary `codec_id` uses the same syntax as LPCM."
112112
"test_000120","test_000119","3.6/audio_element_type, 4.1/Simple Profile",False,True,"An invalid IAMF stream. The first mix uses a single stereo audio element. The second mix presentation uses an `audio_element_type` which is reserved in Simple profile."
113113
"test_000121","test_000005","3.6/param_definition_type",True,True,"A Simple profile IAMF stream which uses a reserved parameter type that must be ignored."
114114
"test_000122","test_000119","3.6.2/loudspeaker_layout, 4.1/Simple Profile",False,True,"An invalid IAMF stream. The first mix uses a stereo audio element. The second mix uses a `loudspeaker_layout` which is reserved under Simple profile for the first layer."
@@ -172,5 +172,5 @@
172172
"test_000409","test_000400","7/IAMF Processing, 7.3/Mix Presentation, 7.3.1/Selecting a Mix Presentation",True,True,"A simple example of a stereo + stereo base profile IAMF stream has 2 Mix Presentation OBUs."
173173
"test_000500","test_000074","3.6.3/ambisonics_mono_config, 3.9/Audio Frame OBU Syntax and Semantics, 3.11.3/FLAC Specific",True,True,"A mixed first-order ambisonics IAMF stream encoded using FLAC and `ambisonics_mode` = `MONO`."
174174
"test_000501","test_000005","3.3/Reserved OBU Syntax and Semantics, 4/Profiles",True,True,"An IAMF stream which is backwards compatible with simple profile. It contains a reserved OBU inserted after the IA Sequence Header OBU which should be treated as a descriptor OBU."
175-
"test_000502","test_000409","3.7/num_sub_mixes",False,False,"An invalid IAMF stream with two Mix Presentation OBUs. The stream is invalid because one of the Mix Presentation OBUs has 0 sub-mixes."
175+
"test_000502","test_000409","3.7/num_sub_mixes",False,True,"An invalid IAMF stream with two Mix Presentation OBUs. The stream is invalid because one of the Mix Presentation OBUs has zero sub-mixes."
176176
"test_000503","test_000005","3.7.7/info_type, 3.7.7/info_type_size, 3.7.7/info_type_bytes",True,True,"An IAMF stream which uses a reserved bit in `info_type` which requires the `info_type_size` and `info_type_bytes` fields to be used."

0 commit comments

Comments
 (0)