Skip to content

Commit

Permalink
test_000016: Port to use an ArbitraryObu.
Browse files Browse the repository at this point in the history
  - b/278865608: Typically moving away from supporting buggy bitstreams.
  - IAMF only permits parameter blocks when they cover whole bitstream.
  - Drop an obsolete usage of `MAYBE_RETURN_IF_NOT_OK`.
  - `test_000016`:
    - Minimize to an eight sample substream with four samples per frame.
    - Insert a parameter block to cover one frame, this leaves a gap in the second frame and results in a non-compliant bitstream.

PiperOrigin-RevId: 707639060
  • Loading branch information
jwcullen committed Dec 18, 2024
1 parent 26db920 commit b2d4aa0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
4 changes: 1 addition & 3 deletions iamf/cli/parameter_block_partitioner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,8 @@ absl::Status ParameterBlockPartitioner::PartitionParameterBlock(
// Find the subblocks that overlap this partition.
std::list<iamf_tools_cli_proto::ParameterSubblock> partitioned_subblocks;

// TODO(b/382536303): Convert `test_000016` to rely on an arbitrary OBU
// instead of this `MAYBE_RETURN_IF_NOT_OK`.
uint32_t constant_subblock_duration;
MAYBE_RETURN_IF_NOT_OK(GetPartitionedSubblocks(
RETURN_IF_NOT_OK(GetPartitionedSubblocks(
full_parameter_block, partitioned_start_time, partitioned_end_time,
partitioned_subblocks, constant_subblock_duration));

Expand Down
63 changes: 34 additions & 29 deletions iamf/cli/testdata/test_000016.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
test_vector_metadata {
human_readable_description:
"A stereo IAMF stream. It has a parameter block not aligned with the audio "
"frames, ending 100 samples earlier. This is invalid because parameter "
"frames, ending one frame earlier. This is invalid because parameter "
"blocks should cover the whole duration of the audio frames that use the "
"parameter."
file_name_prefix: "test_000016"
is_valid: false
is_valid_to_decode: false
validate_user_loudness: true
mp4_fixed_timestamp: "2023-04-19 00:00:00"
mp4_fixed_timestamp: "2024-12-17 00:00:00"
test_repository_tags: [
"github/aomediacodec/libiamf/main",
"github/aomediacodec/libiamf/v1.0.0-errata"
Expand All @@ -45,12 +45,12 @@ codec_config_metadata {
codec_config_id: 200
codec_config {
codec_id: CODEC_ID_LPCM
num_samples_per_frame: 64
num_samples_per_frame: 4
audio_roll_distance: 0
decoder_config_lpcm {
sample_format_flags: LPCM_LITTLE_ENDIAN
sample_size: 16
sample_rate: 16000
sample_rate: 48000
}
}
}
Expand Down Expand Up @@ -95,18 +95,20 @@ mix_presentation_metadata {
}
element_mix_gain {
param_definition {
parameter_id: 100
parameter_rate: 16000
param_definition_mode: 1
parameter_id: 127
parameter_rate: 48000
param_definition_mode: 0
reserved: 0
duration: 4
constant_subblock_duration: 4
}
default_mix_gain: 0
}
}
output_mix_gain {
param_definition {
parameter_id: 100
parameter_rate: 16000
parameter_rate: 48000
param_definition_mode: 1
reserved: 0
}
Expand All @@ -123,15 +125,15 @@ mix_presentation_metadata {
}
loudness {
info_type_bit_masks: []
integrated_loudness: -13733
digital_peak: -12879
integrated_loudness: -32768
digital_peak: -32768
}
}
}
}

audio_frame_metadata {
wav_filename: "sawtooth_100_stereo.wav"
wav_filename: "stereo_8_samples_48khz_s16le.wav"
samples_to_trim_at_end: 0
samples_to_trim_at_start: 0
audio_element_id: 300
Expand All @@ -141,24 +143,27 @@ audio_frame_metadata {
]
}
parameter_block_metadata {
parameter_id: 100
start_timestamp: 0
duration: 7900
num_subblocks: 1
constant_subblock_duration: 7900
subblocks: [
{
mix_gain_parameter_data {
animation_type: ANIMATE_STEP
param_data {
step {
start_point_value: 0
}
}
}
}
]
arbitrary_obu_metadata {
# There are two frames of audio, but only one parameter block. Normally,
# a given `parameter_id` cover the whole duration of the audio frames or be
# entirely absent.
invalidates_bitstream: true
insertion_hook: INSERTION_HOOK_AFTER_PARAMETER_BLOCKS_AT_TICK
insertion_tick: 0
obu_type: OBU_IA_PARAMETER_BLOCK
obu_header {
obu_redundant_copy: false
obu_trimming_status_flag: false
obu_extension_flag: false
}
payload:
# `parameter_id` (127)`.
"\x7f"
# `animation_type` = `ANIMATE_STEP`.
"\x00"
# `start_point_value`
"\xbb\xcc"
}
temporal_delimiter_metadata {
Expand Down

0 comments on commit b2d4aa0

Please sign in to comment.