[FFmpeg-devel] [PATCH 2/2] avcodec/apedec: Implement interim mode detection

Michael Niedermayer michael at niedermayer.cc
Mon Aug 28 02:29:07 EEST 2023


On Sat, Aug 26, 2023 at 06:53:50PM +0200, Michael Niedermayer wrote:
> Fixes: NoLegacy.ape
> Found-by: Matt Ashland <mail at monkeysaudio.com>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavcodec/apedec.c | 106 +++++++++++++++++++++++++++++++++++---------
>  1 file changed, 84 insertions(+), 22 deletions(-)

Also, the same issue should exists in the mono codepath. I have
no testcase for mono, so left this unchanged for now, as i cannot
test it.
But if someone has a testcase, tell me

It also may be needed to wait till one of the CRCs to distinguish
between the 2 decoding forms. (this is how the SDK does it)

Waiting for some CRC is a bit inconvenient as we return data before
currently. And this quicker variant here works for all files i have

We also differ from the SDK by decoding both forms in parallel until
one fails. The advantage here is that if only one is decoded then
a random failure cannot be distinguished from "interim mode" which
would result in a bitstream error causing a switch to the wrong
mode.

Above is how its done ATM in git master. As more issues get submitted
that may change

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20230828/bb2995a0/attachment.sig>


More information about the ffmpeg-devel mailing list