Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
amiartus opened this issue May 23, 2023 · 12 comments
Closed

Comments

@amiartus
Copy link
Contributor

amiartus commented May 23, 2023

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
Copy link
Member

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
Copy link
Contributor Author

amiartus commented Jun 5, 2023

@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
Copy link
Member

SakethSathuvalli commented Jun 5, 2023

@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
Copy link
Member

@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
Copy link
Contributor Author

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

@SakethSathuvalli
Copy link
Member

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
Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Member

Hi @benjamin-weiss,

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

Thanks!

SakethSathuvalli added a commit that referenced this issue Oct 10, 2023
[x] Fix to handle streams with DRC as well as ASI data.
[x] Also includes fixes related to applying DRC.

Testing:
[x] Conformance tested.
SakethSathuvalli added a commit that referenced this issue Oct 10, 2023
[x] Fix to handle streams with DRC as well as ASI data.
[x] Also includes fixes related to applying DRC.

Testing:
[x] Conformance tested.
SakethSathuvalli added a commit that referenced this issue Oct 10, 2023
[x] Fix to handle streams with DRC as well as ASI data.
[x] Also includes fixes related to applying DRC.

Testing:
[x] Conformance tested.
SakethSathuvalli added a commit that referenced this issue Oct 11, 2023
* Add support for parsing btrt box

[x] Added parsing logic for fields of btrt box
[x] Fix to handle streams with DRC data and ASI data - #54 (#71)
[x] Also includes fixes related to applying DRC.

Testing:
[x] Conformance tested.
@SakethSathuvalli
Copy link
Member

Hi @benjamin-weiss,

The fix is now available on main.

Thanks!

@benjamin-weiss
Copy link
Contributor

benjamin-weiss commented Oct 12, 2023

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

@SakethSathuvalli
Copy link
Member

Hi @benjamin-weiss ,

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants