diff --git a/iamf/cli/parameter_block_partitioner.cc b/iamf/cli/parameter_block_partitioner.cc index 1f86d92..a20a4ae 100644 --- a/iamf/cli/parameter_block_partitioner.cc +++ b/iamf/cli/parameter_block_partitioner.cc @@ -361,10 +361,8 @@ absl::Status ParameterBlockPartitioner::PartitionParameterBlock( // Find the subblocks that overlap this partition. std::list 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)); diff --git a/iamf/cli/testdata/test_000016.textproto b/iamf/cli/testdata/test_000016.textproto index 2d7bba0..19f7c96 100644 --- a/iamf/cli/testdata/test_000016.textproto +++ b/iamf/cli/testdata/test_000016.textproto @@ -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" @@ -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 } } } @@ -95,10 +95,12 @@ 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 } @@ -106,7 +108,7 @@ mix_presentation_metadata { output_mix_gain { param_definition { parameter_id: 100 - parameter_rate: 16000 + parameter_rate: 48000 param_definition_mode: 1 reserved: 0 } @@ -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 @@ -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 {