Skip to content

Commit

Permalink
1,fix bug for invalid mapping value in amb mono. 2,skip invalid layou…
Browse files Browse the repository at this point in the history
…t verification log
  • Loading branch information
yilun-zhangs committed Jul 15, 2024
1 parent 2ff5479 commit b80777b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions code/src/iamf_dec/IAMF_core_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ static int iamf_core_decoder_convert_mono(IAMF_CoreDecoder *ths, float *out,

memset(out, 0, sizeof(float) * frame_size * ths->ctx->channels);
for (int i = 0; i < ths->ctx->channels; ++i) {
memcpy(&out[frame_size * i], &in[frame_size * map[i]],
frame_size * sizeof(float));
if (map[i] != 255)
memcpy(&out[frame_size * i], &in[frame_size * map[i]],
frame_size * sizeof(float));
else
memset(&out[frame_size * i], 0, frame_size * sizeof(float));
}
return IAMF_OK;
}
Expand Down Expand Up @@ -261,10 +264,9 @@ int iamf_core_decoder_decode(IAMF_CoreDecoder *ths, uint8_t *buffer[],
return ths->cdec->decode(ctx, buffer, size, count, out, frame_size);

if (!ths->buffer) {
int c = ctx->coupled_streams + ctx->streams;
float *block = 0;

block = IAMF_MALLOC(float, c *frame_size);
block = IAMF_MALLOC(float, ctx->channels *frame_size);
if (!block) return IAMF_ERR_ALLOC_FAIL;
ths->buffer = block;
}
Expand Down
3 changes: 2 additions & 1 deletion code/src/iamf_dec/vlogging_tool_sr.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <fcntl.h>
#include <io.h>
#else
#include <unistd.h>
#include <unistd.h>
#endif
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -738,6 +738,7 @@ static void write_mix_presentation_log(uint64_t idx, void* obu, char* log) {

log += write_yaml_form(log, 2, "layouts:");
for (uint64_t j = 0; j < submix->num_layouts; ++j) {
if (!submix->layouts[j]) continue;
// layout
log += write_yaml_form(log, 2, "- loudness_layout:");

Expand Down

0 comments on commit b80777b

Please sign in to comment.