ittiam-systems / libmpegh

MPEG-H 3D Audio Low Complexity Profile Decoder. Encoder: https://github.com/ittiam-systems/libmpeghe
http://www.ittiam.com/
BSD 3-Clause Clear License
86 stars 19 forks source link

File encoded with 'Fraunhofer Encoding and Muxing Tool' fails to decode #54

Closed amiartus closed 8 months ago

amiartus commented 1 year ago

Hello,

file encoded with 'Fraunhofer Encoding and Muxing Tool' in modes 'Baseline' and 'LC (Baseline compatible)' fails to decode using ittiam testbench program.

source file:

sine_1khz.wav

File Type                       : WAV
File Type Extension             : wav
MIME Type                       : audio/x-wav
Encoding                        : Microsoft IEEE float
Num Channels                    : 1
Sample Rate                     : 48000
Avg Bytes Per Sec               : 192000
Bits Per Sample                 : 32
Number Of Samples               : 480000
Duration                        : 10.00 s

encoded files: https://github.com/ittiam-systems/libmpegh/assets/2679418/c7b4b3e7-a19a-4cd0-b041-837cb029bfec https://github.com/ittiam-systems/libmpegh/assets/2679418/2c2c4001-15df-419a-9fed-92f21911426f

Running the command line: ./ia_mpeghd_testbench -ifile:sine_1khz_48000_mpeg_h_low_complexity_profile.mp4 -ofile:test.wav

first error in decoder is in:

libmpegh/decoder/impd_drc_dynamic_payload.c:368

if (time_off >= (2 * AUDIO_CODEC_FRAME_SIZE_MAX - drc_frame_size))
  return IA_MPEGD_DRC_INIT_NONFATAL_UNEXPECTED_ERROR;

// time_off = 2047
// AUDIO_CODEC_FRAME_SIZE_MAX = 1024
// drc_frame_size = 1024

callstack:

impd_drc_decode_times
impd_drc_read_spline_nodes
impd_drc_read_drc_gain_sequence
impd_drc_read_uni_drc_gain
impeghd_uni_drc_dec_process

After recovery of above nonfatal error there is a second fatal error in:

libmpegh/decoder/ia_core_coder_ext_ch_ele.c:863

if (td_config->fscale > FSCALE_MAX)
{
  return IA_MPEGH_DEC_EXE_FATAL_INVALID_FSCALE;
}

// td_config->fscale = 48000
// FSCALE_MAX = 32000

Could you please have a look and see if this is expected or is an error in the decoder?

best regards,

Adam

SakethSathuvalli commented 1 year ago

Hi @miartad - We tried decoding these streams with the reference decoder that comes from ISO. The reference decoder also throws up the error on the lines of sampling frequency (for the file https://github.com/ittiam-systems/libmpegh/assets/2679418/c7b4b3e7-a19a-4cd0-b041-837cb029bfec).

if (td_config->fscale > FSCALE_MAX)
{
  return IA_MPEGH_DEC_EXE_FATAL_INVALID_FSCALE;
}

This error comes up when TD/switched mode is used in LC profile for streams with sampling frequency greater than 32000 Hz.(restriction put by the specification for LC profile).

We will give a try with mhas files extracted from the mp4 files once.

amiartus commented 1 year ago

@SakethSathuvalli thanks for your reply. If I understand correctly, this sounds to me like the encoder was breaking the specification for LC profile, is that correct?

SakethSathuvalli commented 1 year ago

@SakethSathuvalli thanks for your reply. If I understand correctly, this sounds to me like the encoder was breaking the specification for LC profile, is that correct?

Yes, that was our first inference based on the initial debugging.

However, when we tried decoding the files with DRC processing disabled and with a fix (currently available only internally) for handling configuration packets, We see that the whole file gets decoded fine.

We are currently debugging the bit-streaming parsing path in the DRC module since enabling this is resulting in decode failure.

SakethSathuvalli commented 1 year ago

@SakethSathuvalli thanks for your reply. If I understand correctly, this sounds to me like the encoder was breaking the specification for LC profile, is that correct?

Yes, that was our first inference based on the initial debugging.

However, when we tried decoding the files with DRC processing disabled and with a fix (currently available only internally) for handling configuration packets, We see that the whole file gets decoded fine.

We are currently debugging the bit-streaming parsing path in the DRC module since enabling this is resulting in decode failure.

[Update]

The files You shared are decoding fine with the reference software. We were not using the correct reference executable for decoding when we faced the decode failure. We will check the issue with our decoder and share a fix at the earliest.

Thanks, Saketh

amiartus commented 1 year ago

Hi @SakethSathuvalli, thank you for clarification, do you have a plan for releasing a fix for this issue?

SakethSathuvalli commented 1 year ago

Hi @miartad,

Yes, We will be uploading the same. We are currently working on it. We will be uploading it after testing it on all platforms.

Can You let us know the tool You have used to generate these files ?

Thanks, Saketh

amiartus commented 1 year ago

the tool is part of 'Fraunhofer MPEG-H Authoring Suite' https://www.iis.fraunhofer.de/en/ff/amm/dl/software/mas.html

the tool used to create the audio files is called 'MPEG-H Encoding and Muxing Too'

benjamin-weiss commented 9 months ago

Hi @SakethSathuvalli,

it sounds like you were already working on a fix, but it was never released. Do you have any news when this fix will be available? Thanks! Benjamin

SakethSathuvalli commented 9 months ago

Hi @benjamin-weiss,

Sorry for the delay! We will have this fix uploaded by early next week.

Thanks!

SakethSathuvalli commented 8 months ago

Hi @benjamin-weiss,

The fix is now available on main.

Thanks!

benjamin-weiss commented 8 months ago

I just confirmed that the files are now decodable. So feel free to close this issue. Thanks!

SakethSathuvalli commented 8 months ago

Hi @benjamin-weiss ,

Can You please comment on this issue as well #60 ?