Skip to content

Commit 129d2ce

Browse files
committed
Merge branch 'main' of https://github.com/yilun-zhangs/libiamf into main
2 parents 6ca47c2 + e348c8d commit 129d2ce

314 files changed

Lines changed: 6296 additions & 1322 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

code/dep_external/include/resonance/iamf_resonance_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ EXPORT_API void* CreateResonanceAudioApi2(size_t num_channels,
153153
// // class construction.
154154
// static const SourceId kInvalidSourceId = -1;
155155

156-
EXPORT_API void DestoryResonanceAudioApi2(void* pv_thiz);
156+
EXPORT_API void DestroyResonanceAudioApi2(void* pv_thiz);
157157

158158
// Renders and outputs an interleaved output buffer in float format.
159159
//
4 KB
Binary file not shown.

code/dep_external/src/binaural/iamf2resonance/iamf2resonance.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace vraudio {
3838
// class construction.
3939
//static const SourceId ` = -1;
4040

41-
extern "C" EXPORT_API void DestoryResonanceAudioApi2(void* pv_thiz)
41+
extern "C" EXPORT_API void DestroyResonanceAudioApi2(void* pv_thiz)
4242
{
4343
ResonanceAudioApi* thiz = (ResonanceAudioApi*)pv_thiz;
4444
delete thiz;

code/dep_external/src/binaural/iamf2resonance/iamf_resonance_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ EXPORT_API void* CreateResonanceAudioApi2(size_t num_channels,
153153
// // class construction.
154154
// static const SourceId kInvalidSourceId = -1;
155155

156-
EXPORT_API void DestoryResonanceAudioApi2(void* pv_thiz);
156+
EXPORT_API void DestroyResonanceAudioApi2(void* pv_thiz);
157157

158158
// Renders and outputs an interleaved output buffer in float format.
159159
//

code/src/iamf_dec/h2b_rdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void IAMF_element_renderer_deinit_H2B(binaural_filter_t* binaural_f,
8585
}
8686
}
8787
if (i == N_SOURCE_ELM) {
88-
DestoryResonanceAudioApi2(binaural_f->h2b_api);
88+
DestroyResonanceAudioApi2(binaural_f->h2b_api);
8989
binaural_f->h2b_init = 0;
9090
}
9191
}

code/src/iamf_dec/opus/opus_multistream2_decoder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int opus_multistream2_decode(OpusMS2Decoder *st, uint8_t *buffer[],
5050
uint32_t len[], void *pcm, uint32_t frame_size);
5151

5252
/**
53-
* @brief Destory an opus decoder.
53+
* @brief Destroy an opus decoder.
5454
* @param [in] st : opus decoder handle.
5555
*/
5656
void opus_multistream2_decoder_destroy(OpusMS2Decoder *st);

proto/arbitrary_obu.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,23 @@ enum InsertionHook {
5454
INSERTION_HOOK_INVALID = 0;
5555
INSERTION_HOOK_BEFORE_DESCRIPTORS = 1;
5656
INSERTION_HOOK_AFTER_DESCRIPTORS = 2;
57+
INSERTION_HOOK_AFTER_IA_SEQUENCE_HEADER = 3;
58+
INSERTION_HOOK_AFTER_CODEC_CONFIGS = 4;
59+
INSERTION_HOOK_AFTER_AUDIO_ELEMENTS = 5;
60+
INSERTION_HOOK_AFTER_MIX_PRESENTATIONS = 6;
61+
INSERTION_HOOK_BEFORE_PARAMETER_BLOCKS_AT_TICK = 7;
62+
INSERTION_HOOK_AFTER_PARAMETER_BLOCKS_AT_TICK = 8;
63+
INSERTION_HOOK_AFTER_AUDIO_FRAMES_AT_TICK = 9;
5764
}
5865

5966
message ArbitraryObuMetadata {
6067
optional InsertionHook insertion_hook = 1;
6168
optional ArbitraryObuType obu_type = 4;
6269
optional ObuHeaderMetadata obu_header = 2;
6370
optional bytes payload = 3;
71+
// Used to force the bitstream to be invalid when this OBU is inserted.
72+
optional bool invalidates_bitstream = 5;
73+
// Used to control the temporal unit when using the *_AT_TICK insertion hooks.
74+
// Ignored otherwise.
75+
optional int64 insertion_tick = 6;
6476
}

proto/audio_element.proto

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,36 @@ message ParamDefinitionExtension {
2727
}
2828

2929
message AudioElementParam {
30-
optional uint32 param_definition_type = 1;
30+
optional uint32 deprecated_param_definition_type = 1 [deprecated = true];
31+
optional ParamDefinitionType param_definition_type = 5;
3132
oneof param_definition {
3233
DemixingParamDefinition demixing_param = 2;
3334
ReconGainParamDefinition recon_gain_param = 3;
3435
ParamDefinitionExtension param_definition_extension = 4;
3536
}
3637
}
3738

39+
// Valid proto enums start at index 1, which are different from the
40+
// corresponding enums in C++, e.g. kLayoutMono = 0.
41+
enum LoudspeakerLayout {
42+
LOUDSPEAKER_LAYOUT_INVALID = 0;
43+
LOUDSPEAKER_LAYOUT_MONO = 1;
44+
LOUDSPEAKER_LAYOUT_STEREO = 2;
45+
LOUDSPEAKER_LAYOUT_5_1_CH = 3;
46+
LOUDSPEAKER_LAYOUT_5_1_2_CH = 4;
47+
LOUDSPEAKER_LAYOUT_5_1_4_CH = 5;
48+
LOUDSPEAKER_LAYOUT_7_1_CH = 6;
49+
LOUDSPEAKER_LAYOUT_7_1_2_CH = 7;
50+
LOUDSPEAKER_LAYOUT_7_1_4_CH = 8;
51+
LOUDSPEAKER_LAYOUT_3_1_2_CH = 9;
52+
LOUDSPEAKER_LAYOUT_BINAURAL = 10;
53+
LOUDSPEAKER_LAYOUT_RESERVED_BEGIN = 11;
54+
LOUDSPEAKER_LAYOUT_RESERVED_END = 16;
55+
}
56+
3857
message ChannelAudioLayerConfig {
39-
optional uint32 loudspeaker_layout = 1;
58+
optional uint32 deprecated_loudspeaker_layout = 1 [deprecated = true];
59+
optional LoudspeakerLayout loudspeaker_layout = 10;
4060
optional uint32 output_gain_is_present_flag = 2;
4161
optional uint32 recon_gain_is_present_flag = 3;
4262
optional uint32 reserved_a = 4;

proto/codec_config.proto

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ package libiamf_proto;
1515
import "obu_header.proto";
1616

1717
// Valid proto enums start at index 1, which are different from the
18-
// corresponding enums in C, e.g. kLpcmBigEndian = 0.
18+
// corresponding enums in C++, e.g. kLpcmBigEndian = 0.
1919
enum LpcmFormatFlags {
2020
LPCM_INVALID = 0;
2121
LPCM_BIG_ENDIAN = 1;
@@ -39,19 +39,21 @@ enum OpusApplicationFlag {
3939
message OpusEncoderMetadata {
4040
optional int32 target_bitrate_per_channel = 1;
4141
optional OpusApplicationFlag application = 2;
42+
optional bool use_float_api = 3 [default = true];
43+
optional float coupling_rate_adjustment = 4 [default = 1.0];
4244
}
4345

4446
message OpusDecoderConfig {
4547
optional uint32 version = 1;
46-
optional uint32 output_channel_count = 2;
48+
optional uint32 output_channel_count = 2 [default = 2];
4749
optional uint32 pre_skip = 3;
4850
optional uint32 input_sample_rate = 4;
49-
optional int32 output_gain = 5;
50-
optional uint32 mapping_family = 6;
51+
optional int32 output_gain = 5 [default = 0];
52+
optional uint32 mapping_family = 6 [default = 0];
5153
optional OpusEncoderMetadata opus_encoder_metadata = 7;
5254
}
5355

54-
enum AacSampleFrequencyIndex {
56+
enum SampleFrequencyIndex {
5557
AAC_SAMPLE_FREQUENCY_INDEX_INVALID = 0;
5658
AAC_SAMPLE_FREQUENCY_INDEX_96000 = 1;
5759
AAC_SAMPLE_FREQUENCY_INDEX_88200 = 2;
@@ -80,23 +82,23 @@ message AacEncoderMetadata {
8082

8183
message AacDecoderSpecificInfo {
8284
optional uint32 decoder_specific_info_descriptor_tag = 5 [default = 0x05];
83-
optional uint32 audio_object_type = 1;
84-
optional AacSampleFrequencyIndex sample_frequency_index = 2;
85+
optional uint32 audio_object_type = 1 [default = 2];
86+
optional SampleFrequencyIndex sample_frequency_index = 2;
8587
optional uint32 sampling_frequency = 3;
86-
optional uint32 channel_configuration = 4;
88+
optional uint32 channel_configuration = 4 [default = 2];
8789
}
8890

8991
message AacGaSpecificConfig {
90-
optional bool frame_length_flag = 1;
91-
optional bool depends_on_core_coder = 2;
92-
optional bool extension_flag = 3;
92+
optional bool frame_length_flag = 1 [default = false];
93+
optional bool depends_on_core_coder = 2 [default = false];
94+
optional bool extension_flag = 3 [default = false];
9395
}
9496

9597
message AacDecoderConfig {
9698
optional uint32 decoder_config_descriptor_tag = 11 [default = 0x04];
97-
optional uint32 object_type_indication = 1;
98-
optional uint32 stream_type = 2;
99-
optional bool upstream = 3;
99+
optional uint32 object_type_indication = 1 [default = 0x40];
100+
optional uint32 stream_type = 2 [default = 5];
101+
optional bool upstream = 3 [default = false];
100102
optional bool reserved = 4;
101103
optional uint32 buffer_size_db = 5;
102104
optional uint32 max_bitrate = 6;
@@ -126,13 +128,15 @@ message FlacMetaBlockHeader {
126128
message FlacMetaBlockStreamInfo {
127129
optional uint32 minimum_block_size = 1;
128130
optional uint32 maximum_block_size = 2;
129-
optional uint32 minimum_frame_size = 3;
130-
optional uint32 maximum_frame_size = 4;
131+
optional uint32 minimum_frame_size = 3 [default = 0];
132+
optional uint32 maximum_frame_size = 4 [default = 0];
131133
optional uint32 sample_rate = 5;
132-
optional uint32 number_of_channels = 6;
134+
optional uint32 number_of_channels = 6 [default = 1];
133135
optional uint32 bits_per_sample = 7;
134136
optional uint64 total_samples_in_stream = 8;
135-
optional bytes md5_signature = 9;
137+
optional bytes md5_signature = 9
138+
[default =
139+
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"];
136140
}
137141

138142
// Settings to configure `libflac`.
@@ -153,10 +157,19 @@ message FlacDecoderConfig {
153157
optional FlacEncoderMetadata flac_encoder_metadata = 4;
154158
}
155159

160+
enum CodecId {
161+
CODEC_ID_INVALID = 0;
162+
CODEC_ID_OPUS = 0x4f707573; // "Opus"
163+
CODEC_ID_LPCM = 0x6970636d; // "ipcm"
164+
CODEC_ID_AAC_LC = 0x6d703461; // "mp4a"
165+
CODEC_ID_FLAC = 0x664c6143; // "fLaC"
166+
}
167+
156168
message CodecConfig {
157-
optional uint32 codec_id = 1;
169+
optional uint32 deprecated_codec_id = 1 [deprecated = true];
170+
optional CodecId codec_id = 10;
158171
optional uint32 num_samples_per_frame = 2;
159-
reserved 3;
172+
reserved 3, 4;
160173
optional int32 audio_roll_distance = 9;
161174
oneof decoder_config {
162175
LpcmDecoderConfig decoder_config_lpcm = 5;

proto/ia_sequence_header.proto

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ package libiamf_proto;
1414

1515
import "obu_header.proto";
1616

17-
enum ProfileVerson {
17+
enum ProfileVersion {
1818
PROFILE_VERSION_INVALID = 0;
1919
PROFILE_VERSION_SIMPLE = 1;
2020
PROFILE_VERSION_BASE = 2;
21+
PROFILE_VERSION_BASE_ENHANCED = 3;
2122
}
2223

2324
message IASequenceHeaderObuMetadata {
24-
optional uint32 ia_code = 1;
25-
optional ProfileVerson primary_profile = 2;
26-
optional ProfileVerson additional_profile = 3;
25+
optional uint32 ia_code = 1 [default = 0x69616d66 /* "iamf" */];
26+
optional ProfileVersion primary_profile = 2;
27+
optional ProfileVersion additional_profile = 3;
2728
optional ObuHeaderMetadata obu_header = 4;
2829
}

0 commit comments

Comments
 (0)