Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/dep_external/src/oar
Submodule oar updated 73 files
+1 −1 .bazelversion
+1 −0 MODULE.bazel
+25 −5 include/oar.h
+42 −9 src/common/cdeque.c
+4 −0 src/common/cdeque.h
+0 −1 src/common/clog.h
+40 −3 src/common/cqueue.c
+8 −0 src/common/cqueue.h
+8 −8 src/limiter/audio_effect_peak_limiter.c
+3 −3 src/limiter/oar_limiter.c
+71 −59 src/oar.c
+54 −39 src/renderer/audio_element_renderer.c
+72 −48 src/renderer/audio_elements_renderer.c
+160 −52 src/renderer/audio_renderer_base.c
+45 −2 src/renderer/audio_renderer_base.h
+12 −2 src/renderer/downmix/downmix.c
+5 −3 src/renderer/downmix/downmix_renderer.c
+7 −1 src/renderer/downmix/downmix_renderer.h
+1 −6 src/renderer/ear/h2m_rdr.c
+10 −11 src/renderer/obr/obr.c
+0 −4 src/renderer/obr/obr_capi/obr/.bazelrc
+1 −1 src/renderer/obr/obr_capi/obr/.bazelversion
+6 −0 src/renderer/obr/obr_capi/obr/CMakeLists.txt
+1 −1 src/renderer/obr/obr_capi/obr/docs/building.md
+2 −2 src/renderer/obr/obr_capi/obr/extensions.bzl
+73 −64 src/renderer/obr/obr_capi/obr/obr/ambisonic_encoder/ambisonic_encoder.cc
+13 −0 src/renderer/obr/obr_capi/obr/obr/ambisonic_encoder/ambisonic_encoder.h
+10 −1 src/renderer/obr/obr_capi/obr/obr/ambisonic_encoder/associated_legendre_polynomials_generator.cc
+9 −0 src/renderer/obr/obr_capi/obr/obr/ambisonic_encoder/associated_legendre_polynomials_generator.h
+19 −2 src/renderer/obr/obr_capi/obr/obr/audio_buffer/simd_macros.h
+18 −18 src/renderer/obr/obr_capi/obr/obr/audio_buffer/simd_utils.cc
+1 −0 src/renderer/obr/obr_capi/obr/obr/common/BUILD
+116 −0 src/renderer/obr/obr_capi/obr/obr/common/atomic_rotation.h
+9 −0 src/renderer/obr/obr_capi/obr/obr/common/tests/BUILD
+131 −0 src/renderer/obr/obr_capi/obr/obr/common/tests/atomic_rotation_test.cc
+13 −17 src/renderer/obr/obr_capi/obr/obr/peak_limiter/peak_limiter.cc
+66 −26 src/renderer/obr/obr_capi/obr/obr/renderer/obr_impl.cc
+67 −4 src/renderer/obr/obr_capi/obr/obr/renderer/obr_impl.h
+56 −53 src/renderer/obr/obr_capi/obr/obr/renderer/processing_group.cc
+47 −10 src/renderer/obr/obr_capi/obr/obr/renderer/processing_group.h
+148 −0 src/renderer/obr/obr_capi/obr/obr/renderer/tests/obr_impl_test.cc
+0 −0 src/renderer/obr/obr_capi/obr/third_party/BUILD
+0 −0 src/renderer/obr/obr_capi/obr/third_party/pffft.BUILD
+3 −25 src/renderer/obr/obr_capi/obr_capi.cpp
+5 −0 src/renderer/olr/object_audio_renderer/BUILD.bazel
+56 −28 src/renderer/olr/object_audio_renderer/block_processor/block_processing_channel.c
+3 −1 src/renderer/olr/object_audio_renderer/block_processor/block_processing_channel.h
+27 −7 src/renderer/olr/object_audio_renderer/block_processor/interpret_object_metadata.c
+7 −1 src/renderer/olr/object_audio_renderer/block_processor/interpret_object_metadata.h
+108 −14 src/renderer/olr/object_audio_renderer/block_processor/processing_block.c
+20 −0 src/renderer/olr/object_audio_renderer/block_processor/processing_block.h
+43 −83 src/renderer/olr/object_audio_renderer/gain_calculator/custom_gain_calculator.c
+4 −17 src/renderer/olr/object_audio_renderer/gain_calculator/dbap_panner_2d.c
+4 −5 src/renderer/olr/object_audio_renderer/gain_calculator/vbap_panner_2d.c
+10 −3 src/renderer/olr/object_audio_renderer/numc.c
+9 −2 src/renderer/olr/object_audio_renderer/object_based_audio_renderer.c
+16 −1 src/renderer/olr/object_audio_renderer/object_based_audio_renderer.h
+45 −20 src/renderer/olr/object_audio_renderer/renderer.c
+5 −1 src/renderer/olr/object_audio_renderer/renderer.h
+27 −11 src/renderer/olr/olr.c
+92 −0 tests/examples/BUILD.bazel
+16 −0 tests/examples/CMakeLists.txt
+198 −0 tests/examples/test_binaural_add_remove.c
+153 −0 tests/examples/test_binaural_mixed_lock.c
+556 −0 tests/examples/test_downmix_mode_metadata.c
+17 −4 tests/examples/test_framework.c
+19 −1 tests/examples/test_framework.h
+178 −0 tests/examples/test_hoa_sound_system_h.c
+310 −0 tests/examples/test_metadata_reuse.c
+155 −0 tests/examples/test_object_position_gap.c
+246 −0 tests/examples/test_olr_block_storage.c
+193 −0 tests/examples/test_olr_render_offsets.c
+228 −0 tests/examples/test_render_scratch.c
5 changes: 2 additions & 3 deletions code/src/iamf_dec/codec/aac/aac_multistream_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ static int aac_multistream_decode_native(
if (info) {
fs = info->frameSize;
if (fs > def_max_aac_frame_size) {
warning("frame size %d , is larger than %u", fs,
def_max_aac_frame_size);
warn("frame size %d , is larger than %u", fs, def_max_aac_frame_size);
fs = def_max_aac_frame_size;
}

Expand All @@ -140,7 +139,7 @@ static int aac_multistream_decode_native(
(*copy_channel_out)(out, st->buffer, fs, info->numChannels);
out += (fs * info->numChannels);
} else {
warning("Can not get stream info.");
warn("Can not get stream info.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion code/src/iamf_dec/codec/flac/flac_multistream_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static int flac_multistream_decode_native(flac_ms_decoder_t *st,
}

if (handle->fs != frame_size)
warning("Different frame size %d vs %d", frame_size, handle->fs);
warn("Different frame size %d vs %d", frame_size, handle->fs);

ss = handle->fs * handle->stream_info.channels * 4;
memcpy(out, handle->buffer, ss);
Expand Down
2 changes: 1 addition & 1 deletion code/src/iamf_dec/codec/opus/opus_multistream2_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ int opus_multistream2_decode(Opus_Ms2_Decoder_t *st, uint8_t *buffer[],
return opus_multistream2_decoder_decode_native(
st, buffer, (opus_int32 *)size, pcm, frame_size,
opus_copy_channel_out_short_plane);
warning("flag is 0x%x, is not implemented.", st->flags);
warn("flag is 0x%x, is not implemented.", st->flags);
return IAMF_ERR_UNIMPLEMENTED;
}

Expand Down
4 changes: 2 additions & 2 deletions code/src/iamf_dec/codec/pcm/iamf_pcm_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ static int iamf_pcm_decode(iamf_codec_context_t *ths, uint8_t *buf[],
ths->streams, frame_size, samples);

if (samples != frame_size)
warning("real samples and frame size are different: %d vs %d", samples,
frame_size);
warn("real samples and frame size are different: %d vs %d", samples,
frame_size);

c = 0;
for (; c < ths->coupled_streams; ++c) {
Expand Down
4 changes: 2 additions & 2 deletions code/src/iamf_dec/iamf_audio_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ int iamf_audio_block_channels_concat(iamf_audio_block_t* dst,
num_samples = src[0]->num_samples_per_channel;

if (num_samples > dst->capacity_per_channel) {
warning("iamf_audio_block_channels_concat: capacity exceeded!");
warn("iamf_audio_block_channels_concat: capacity exceeded!");
return -22;
}

for (int i = 1; i < n; ++i) {
if (!src[i] || src[i]->num_samples_per_channel != num_samples
// || dst->interleaved != src[i]->interleaved
) {
warning("iamf_audio_block_channels_concat error!");
warn("iamf_audio_block_channels_concat error!");
return -22;
}
}
Expand Down
25 changes: 12 additions & 13 deletions code/src/iamf_dec/iamf_database.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static int _iadb_descriptors_codec_config_obu_check_profile(
if ((n >= def_max_codec_configs) ||
(n && !descriptors->num_lpcm_codec &&
cco->codec_id != ck_iamf_codec_id_lpcm)) {
warning("Too many codec configs or no LPCM codec config.");
warn("Too many codec configs or no LPCM codec config.");
ret = def_error;
}

Expand Down Expand Up @@ -567,8 +567,8 @@ static int _iadb_descriptors_mix_presentation_obu_check_profile(
def_value_wrap_instance_u32(first_aec->element_id),
_iadb_audio_element_obu_find, &v);
if (idx < 0) {
warning("Audio element %u not found for Mix Presentation %u.",
first_aec->element_id, mpo->mix_presentation_id);
warn("Audio element %u not found for Mix Presentation %u.",
first_aec->element_id, mpo->mix_presentation_id);
} else {
iamf_audio_element_obu_t *first_aeo =
def_value_wrap_type_ptr(iamf_audio_element_obu_t, &v);
Expand All @@ -583,8 +583,8 @@ static int _iadb_descriptors_mix_presentation_obu_check_profile(
def_value_wrap_instance_u32(aec->element_id),
_iadb_audio_element_obu_find, &v);
if (idx < 0) {
warning("Audio element %u not found for Mix Presentation %u.",
aec->element_id, mpo->mix_presentation_id);
warn("Audio element %u not found for Mix Presentation %u.",
aec->element_id, mpo->mix_presentation_id);
continue;
}

Expand Down Expand Up @@ -628,8 +628,8 @@ static int _iadb_descriptors_mix_presentation_obu_check_profile(
def_value_wrap_instance_u32(aec->element_id),
_iadb_audio_element_obu_find, &v);
if (idx < 0) {
warning("Audio element %u not found for Mix Presentation %u.",
aec->element_id, mpo->mix_presentation_id);
warn("Audio element %u not found for Mix Presentation %u.",
aec->element_id, mpo->mix_presentation_id);
continue;
}
iamf_audio_element_obu_t *aeo =
Expand All @@ -654,7 +654,7 @@ static int _iadb_descriptors_mix_presentation_obu_check_profile(
}

if (ret != def_pass)
warning(
warn(
"Mix Presentation OBU %u, element flags 0x%x(b01-obj, "
"b10-chn), mix count %u",
mpo->mix_presentation_id, element_flags, m);
Expand Down Expand Up @@ -747,8 +747,8 @@ static int _iadb_audio_element_obu_add(iamf_database_t *database,
if (vector_find(database->codec_configs,
def_value_wrap_instance_u32(obu->codec_config_id),
_iadb_codec_config_find, &v) < 0) {
warning("Can not find codec config with id %u for audio element %u",
obu->codec_config_id, obu->audio_element_id);
warn("Can not find codec config with id %u for audio element %u",
obu->codec_config_id, obu->audio_element_id);
return IAMF_ERR_BAD_ARG;
}
cc = v.ptr;
Expand Down Expand Up @@ -958,7 +958,7 @@ int iamf_database_add_obu(iamf_database_t *database, iamf_obu_t *obu) {
database->profile = sho->additional_profile;

if (database->descriptors.ia_sequence_header_obu) {
warning("WARNING : Receive IAMF Sequence Header OBU again !!!");
warn("WARNING : Receive IAMF Sequence Header OBU again !!!");
iamf_sequence_header_obu_free(
database->descriptors.ia_sequence_header_obu);
}
Expand Down Expand Up @@ -1287,8 +1287,7 @@ int iamf_database_get_subblocks(iamf_database_t *database, uint32_t pid,

// for gaps in delay case.
if (pbk->elapsed > 0 && pbk->elapsed + converted_count > pbk->duration) {
warning("required subblocks exceed the duration of parameter block %u.",
pid);
warn("required subblocks exceed the duration of parameter block %u.", pid);
return IAMF_ERR_BUFFER_TOO_SMALL;
}

Expand Down
29 changes: 14 additions & 15 deletions code/src/iamf_dec/iamf_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,9 @@ static int iamf_decoder_priv_decode(iamf_decoder_t *self, const uint8_t *data,
frame_duration.numerator -= audio_block->second_skip;
frame_duration.numerator -= audio_block->second_padding;
} else {
warning(
"Trimming values exceed frame size: skip=%u, padding=%u, frame=%u",
audio_block->second_skip, audio_block->second_padding,
frame_duration.numerator);
warn("Trimming values exceed frame size: skip=%u, padding=%u, frame=%u",
audio_block->second_skip, audio_block->second_padding,
frame_duration.numerator);
frame_duration.numerator = 0;
}
iamf_database_time_elapse(&self->ctx.database, frame_duration);
Expand Down Expand Up @@ -379,7 +378,7 @@ int iamf_decoder_priv_update_frame_info(iamf_decoder_t *self) {
audio_element = iamf_database_get_audio_element(
database, audio_element_config->element_id);
if (!audio_element || !audio_element->codec_config) {
warning(
warn(
"Audio element %u or its codec config not found in database, "
"skipping.",
audio_element_config->element_id);
Expand All @@ -393,7 +392,7 @@ int iamf_decoder_priv_update_frame_info(iamf_decoder_t *self) {
} else if (sample_rate != codec_config->codec_param.sample_rate ||
num_samples_per_frame !=
codec_config->codec_param.frame_size) {
warning("Different sample rate or frame size found.");
warn("Different sample rate or frame size found.");
ret = IAMF_ERR_UNIMPLEMENTED;
}
}
Expand Down Expand Up @@ -457,8 +456,8 @@ int iamf_decoder_priv_configure(iamf_decoder_t *self, const uint8_t *data,
if (ctx->configure_flags & def_iamf_decoder_config_mix_presentation) {
if (!iamf_database_get_mix_presentation_obu(database,
ctx->mix_presentation_id)) {
warning("Invalid mix presentation id %" PRId64 ".",
ctx->mix_presentation_id);
warn("Invalid mix presentation id %" PRId64 ".",
ctx->mix_presentation_id);
return IAMF_ERR_INTERNAL;
}
}
Expand Down Expand Up @@ -510,7 +509,7 @@ int iamf_decoder_priv_configure(iamf_decoder_t *self, const uint8_t *data,
"Applied gain offset %f to element %u in presentation %u",
gain_offset, element_id, mpo->mix_presentation_id);
} else {
warning(
warn(
"Failed to apply gain offset %f to element %u in "
"presentation %u: %d",
gain_offset, element_id, mpo->mix_presentation_id, ret);
Expand Down Expand Up @@ -549,10 +548,10 @@ int iamf_decoder_priv_configure(iamf_decoder_t *self, const uint8_t *data,
} else {
ret = IAMF_ERR_INTERNAL;
if (ctx->mix_presentation_id != def_i64_id_none)
warning("Fail to find the mix presentation %u obu.",
ctx->mix_presentation_id);
warn("Fail to find the mix presentation %u obu.",
ctx->mix_presentation_id);
else
warning("Fail to find the valid mix presentation obu, try again.");
warn("Fail to find the valid mix presentation obu, try again.");
}
}

Expand Down Expand Up @@ -702,7 +701,7 @@ static iamf_parser_state_t iamf_decoder_priv_process_data_obus(
iamf_database_time_elapse(&self->ctx.database, frame_duration);
}
} else {
warning("No audio block available.");
warn("No audio block available.");
}
}
} break;
Expand Down Expand Up @@ -730,7 +729,7 @@ static iamf_parser_state_t iamf_decoder_priv_process_obus(iamf_obu_t *obu,
else if (ctx->status == ck_iamf_decoder_status_parse_2)
return iamf_decoder_priv_process_data_obus(self, obu);

warning("Unexpected state %d of decoder.", ctx->status);
warn("Unexpected state %d of decoder.", ctx->status);
return ck_iamf_parser_state_stop;
}

Expand Down Expand Up @@ -1129,7 +1128,7 @@ int IAMF_decoder_set_head_rotation(IAMF_DecoderHandle handle, float w, float x,
// Validate quaternion (should be approximately unit length)
float quaternion_length = sqrtf(w * w + x * x + y * y + z * z);
if (quaternion_length < 0.001f) {
warning("Head rotation quaternion is too close to zero, ignoring");
warn("Head rotation quaternion is too close to zero, ignoring");
return IAMF_ERR_BAD_ARG;
}

Expand Down
12 changes: 6 additions & 6 deletions code/src/iamf_dec/iamf_element_reconstructor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ int iamf_element_reconstructor_add_element(
break;
}
default: {
warning("Unsupported audio element type %d.", aeo->audio_element_type);
warn("Unsupported audio element type %d.", aeo->audio_element_type);
return IAMF_ERR_UNIMPLEMENTED;
}
}
Expand Down Expand Up @@ -1134,24 +1134,24 @@ int iamf_element_reconstructor_add_audio_frame_obu(

val = hash_map_get(self->reconstructor_map, eid);
if (!val) {
warning("Reconstructor not found for audio element ID %u.", eid);
warn("Reconstructor not found for audio element ID %u.", eid);
iamf_audio_frame_obu_free(obu);
return IAMF_ERR_INTERNAL;
}
recon = def_value_wrap_ptr(val);

val = hash_map_get(recon->audio_frames_map, obu->audio_substream_id);
if (!val) {
warning("Audio frame node not found for substream ID %u in self.",
obu->audio_substream_id);
warn("Audio frame node not found for substream ID %u in self.",
obu->audio_substream_id);
iamf_audio_frame_obu_free(obu);
return IAMF_ERR_INTERNAL;
}
afo = def_value_wrap_ptr(val);

if (*afo) {
warning("Substream ID %u already has an audio frame OBU.",
obu->audio_substream_id);
warn("Substream ID %u already has an audio frame OBU.",
obu->audio_substream_id);
iamf_element_reconstructor_priv_delete_all_audio_frame_obus(self);
ret = IAMF_ERR_INVALID_PACKET;
}
Expand Down
4 changes: 2 additions & 2 deletions code/src/iamf_dec/iamf_post_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static iamf_audio_block_t *iamf_post_processor_priv_resample(
iamf_audio_block_copy(out, resampler->buffer[1],
ck_sample_format_f32_planar);
} else {
warning("no samples to resample.");
warn("no samples to resample.");
}

return out;
Expand Down Expand Up @@ -191,7 +191,7 @@ static iamf_audio_block_t *iamf_post_processor_priv_limit(
}

if (num_samples < 0) {
warning("limiter process failed: %d", num_samples);
warn("limiter process failed: %d", num_samples);
iamf_audio_block_delete(out);
return 0;
}
Expand Down
Loading
Loading