* [FFmpeg-devel] [PATCH 0/1] avcodec/dolby_e: Add error recovery when parse_mantissas run out of bits
@ 2024-03-11 14:01 Nicolas Gaullier
2024-03-11 14:01 ` [FFmpeg-devel] [PATCH 1/1] " Nicolas Gaullier
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Gaullier @ 2024-03-11 14:01 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Nicolas Gaullier
A new ping for this same old topic. Previously with no feedback at all:
https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=7482
I just "rebased"-retested it.
Updates: wrapped lines of commit msg
The samples (source/before patch/after patch) are still available on https://0x0.st/oOvv.zip
Nicolas Gaullier (1):
avcodec/dolby_e: Add error recovery when parse_mantissas run out of
bits
libavcodec/dolby_e.c | 8 ++++++++
1 file changed, 8 insertions(+)
--
2.30.2
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* [FFmpeg-devel] [PATCH 1/1] avcodec/dolby_e: Add error recovery when parse_mantissas run out of bits
2024-03-11 14:01 [FFmpeg-devel] [PATCH 0/1] avcodec/dolby_e: Add error recovery when parse_mantissas run out of bits Nicolas Gaullier
@ 2024-03-11 14:01 ` Nicolas Gaullier
2024-03-26 16:16 ` Nicolas Gaullier
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Gaullier @ 2024-03-11 14:01 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Nicolas Gaullier
Mantissas are the last data in the channel subsegment and it appears it
is sometimes missing a very few bits for the parsing to complete.
This must not be confused with data corruption.
In standard conditions with certified products, it has been observed
that the occurence of this issue is pretty steady and about once every 2
hours. The truncation is at about 950 out of the 1024 values (923 is the
minimum I have seen so far).
The current code raises a severe 'Read past end' error and all data is
lost resulting in 20ms(@25fps) of silence for the affected channel.
This patch introduces a tolerance: if 800 out of the 1024 mantissas have
been parsed, a simple warning is raised and the data is preserved.
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
---
libavcodec/dolby_e.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libavcodec/dolby_e.c b/libavcodec/dolby_e.c
index 9c3f6006c2..1f8442e2e9 100644
--- a/libavcodec/dolby_e.c
+++ b/libavcodec/dolby_e.c
@@ -845,6 +845,7 @@ static int parse_indices(DBEContext *s, DBEChannel *c)
return 0;
}
+#define MIN_MANTISSAS 800
static int parse_mantissas(DBEContext *s, DBEChannel *c)
{
DBEGroup *g;
@@ -885,6 +886,13 @@ static int parse_mantissas(DBEContext *s, DBEChannel *c)
}
}
} else {
+ if (i == c->nb_groups - 1
+ && count * size1 > get_bits_left(&s->gb)
+ && get_bits_left(&s->gb) >= 0
+ && (int)(mnt - c->mantissas) >= MIN_MANTISSAS) {
+ av_log(s->avctx, AV_LOG_WARNING, "Truncated mantissas @%d, highest frequencies not recoverable\n", (int)(mnt - c->mantissas));
+ break;
+ }
for (k = 0; k < count; k++)
mnt[k] = get_sbits(&s->gb, size1) * scale;
}
--
2.30.2
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/1] avcodec/dolby_e: Add error recovery when parse_mantissas run out of bits
2024-03-11 14:01 ` [FFmpeg-devel] [PATCH 1/1] " Nicolas Gaullier
@ 2024-03-26 16:16 ` Nicolas Gaullier
0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Gaullier @ 2024-03-26 16:16 UTC (permalink / raw)
To: ffmpeg-devel
>De : Nicolas Gaullier <nicolas.gaullier@cji.paris>
>Envoyé : lundi 11 mars 2024 15:01
>
>Mantissas are the last data in the channel subsegment and it appears it is sometimes missing a very few bits for the parsing to complete.
>This must not be confused with data corruption.
>In standard conditions with certified products, it has been observed that the occurence of this issue is pretty steady and about once every 2 hours. The truncation is at about 950 out of the 1024 values (923 is the minimum I have seen so far).
>The current code raises a severe 'Read past end' error and all data is lost resulting in 20ms(@25fps) of silence for the affected channel.
>This patch introduces a tolerance: if 800 out of the 1024 mantissas have been parsed, a simple warning is raised and the data is preserved.
Ping ?
still applies
last posted here: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=11090
Samples (source/before patch/after patch) here: https://0x0.st/oOvv.zip
Nicolas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* [FFmpeg-devel] [PATCH 0/1] avcodec/dolby_e: Add error recovery when parse_mantissas run out of bits
@ 2023-03-10 9:17 Nicolas Gaullier
0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Gaullier @ 2023-03-10 9:17 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Nicolas Gaullier
Follow up of
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220913213127.1756-1-nicolas.gaullier@cji.paris/
The only modification since this initial patch is a cosmetic line split
to prevent an overly long line and the "Please wrap lines" warning.
I did not get any message, I don't know what to do to get a review ?
If I missed something obvious, tell me.
The fact is the official maintainer disappeared, so it does not make this easy.
The darkness of the official proprietary implementation is certainly an "issue",
but the technology behind the dolby_e codec seems very similar to all other audio codecs,
so it does not seem that critical for simple maintenance.
Nicolas Gaullier (1):
avcodec/dolby_e: Add error recovery when parse_mantissas run out of
bits
libavcodec/dolby_e.c | 9 +++++++++
1 file changed, 9 insertions(+)
--
2.30.2
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-26 16:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-11 14:01 [FFmpeg-devel] [PATCH 0/1] avcodec/dolby_e: Add error recovery when parse_mantissas run out of bits Nicolas Gaullier
2024-03-11 14:01 ` [FFmpeg-devel] [PATCH 1/1] " Nicolas Gaullier
2024-03-26 16:16 ` Nicolas Gaullier
-- strict thread matches above, loose matches on Subject: below --
2023-03-10 9:17 [FFmpeg-devel] [PATCH 0/1] " Nicolas Gaullier
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git