Skip to content

Commit

Permalink
Fixes decode failure due to MP4 parse failure #74 (#75)
Browse files Browse the repository at this point in the history
Significance:
=============
[x] Changes also contain some a fix in configuration data parsing path.
[x] Minor clean-up in testbench related to frame counter updation.

Tests:
======
[x] x86 build tested for conformance
  • Loading branch information
SakethSathuvalli authored Feb 28, 2024
1 parent b9d18df commit 2a435b5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
4 changes: 0 additions & 4 deletions decoder/ia_core_coder_decode_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,6 @@ IA_ERRORCODE impeghd_format_conv_init(ia_mpegh_dec_api_struct *p_obj_mpegh_dec,

if (pstr_signals_3d->differs_from_ref_layout[i] == 1)
{
if (cicp_idx == 0 || cicp_idx == 8 || cicp_idx > NUM_LS_CFGS)
{
return IA_MPEGH_DEC_INIT_FATAL_INVALID_CICP_SPKR_INDEX;
}
num_chnl_in = impgehd_cicp_get_num_ls[cicp_idx];
ptr_chn_in_name = ia_cicp_idx_ls_set_map_tbl[cicp_idx];
}
Expand Down
7 changes: 4 additions & 3 deletions decoder/ia_core_coder_init_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,10 +1433,11 @@ IA_ERRORCODE ia_core_coder_mpegh_3da_config(ia_bit_buf_struct *it_bit_buff,
}
case 1:
{
for (i = 0; i < speaker_config_3d->num_speakers; i++)
WORD16 s;
for (s = 0; s < speaker_config_3d->num_speakers; s++)
{
speaker_config_3d->cicp_spk_idx[i] = ia_core_coder_read_bits_buf(it_bit_buff, 7);
if (speaker_config_3d->cicp_spk_idx[i] > MAX_CICP_SPK_INDEX)
speaker_config_3d->cicp_spk_idx[s] = ia_core_coder_read_bits_buf(it_bit_buff, 7);
if (speaker_config_3d->cicp_spk_idx[s] > MAX_CICP_SPK_INDEX)
{
return IA_MPEGH_DEC_INIT_FATAL_UNSUPPORTED_CICP_SPK_INDEX;
}
Expand Down
6 changes: 3 additions & 3 deletions decoder/impeghd_ver_number.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
#define IMPEGHD_VER_NUMBER_H

#ifdef _ARM_
#define MPEG_H_3D_AUD_DEC_ITTIAM_VER "_ARM $Rev: 1.3 $"
#define MPEG_H_3D_AUD_DEC_ITTIAM_VER "_ARM $Rev: 1.4 $"
#elif _X86_
#define MPEG_H_3D_AUD_DEC_ITTIAM_VER "_X86 $Rev: 1.3 $"
#define MPEG_H_3D_AUD_DEC_ITTIAM_VER "_X86 $Rev: 1.4 $"
#else
#define MPEG_H_3D_AUD_DEC_ITTIAM_VER "_MSVC $Rev: 1.3 $"
#define MPEG_H_3D_AUD_DEC_ITTIAM_VER "_MSVC $Rev: 1.4 $"
#endif

#endif /* IMPEGHD_VER_NUMBER_H */
7 changes: 5 additions & 2 deletions test/impeghd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,11 @@ IA_ERRORCODE impeghd_main_process(WORD32 argc, pWORD8 argv[])
#endif
}

frame_counter++;
fprintf(stderr, "Frames Processed : [%5d] \r", frame_counter);
if (pstr_out_cfg->num_out_bytes)
{
frame_counter++;
fprintf(stderr, "Frames Processed : [%5d] \r", frame_counter);
}

ARM_PROFILE_HW_CALC_CYCLES(pstr_out_cfg->num_out_bytes, pstr_in_cfg->ui_pcm_wd_sz,
pstr_out_cfg->i_samp_freq, pstr_out_cfg->i_num_chan);
Expand Down
1 change: 1 addition & 0 deletions test/mp4/impeghd_mp4_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ WORD32 impeghd_mp4_read_media_sample(UWORD8 **buf, WORD32 to_write, trak_info *m
current_stco_index = m->stco_cntxt.index - (m->stco_cntxt.total - m->stco_cntxt.read);
}
m->read_stsc_entries++;
m->samples_last_stsc_entry = m->stsc_entries[m->read_stsc_entries - 1].samples_per_chunk;
}
return read_bytes;
}
Expand Down

0 comments on commit 2a435b5

Please sign in to comment.