diff mbox series

[FFmpeg-devel,V1] libavcodec/aacdec: fix HE-AAC decoder dirty date (for sbr) when flush

Message ID 1577856879-17708-1-git-send-email-mypopydev@gmail.com
State New
Headers show
Series [FFmpeg-devel,V1] libavcodec/aacdec: fix HE-AAC decoder dirty date (for sbr) when flush
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Jun Zhao Jan. 1, 2020, 5:34 a.m. UTC
From: qoroliang <qoroliang@tencent.com>

aac decoder only do the window overlapping data buffer flush but
without sbr related buffer flush, that will cause dirty data in
the first output frame after flush.

Signed-off-by: qoroliang <qoroliang@tencent.com>
---
 libavcodec/aacdec_template.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Comments

Carl Eugen Hoyos Jan. 22, 2020, 12:41 a.m. UTC | #1
Am Mi., 1. Jan. 2020 um 06:34 Uhr schrieb Jun Zhao <mypopydev@gmail.com>:
>
> From: qoroliang <qoroliang@tencent.com>
>
> aac decoder only do the window overlapping data buffer flush but
> without sbr related buffer flush, that will cause dirty data in
> the first output frame after flush.
>
> Signed-off-by: qoroliang <qoroliang@tencent.com>
> ---
>  libavcodec/aacdec_template.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
> index bb11de3..8f8dc24 100644
> --- a/libavcodec/aacdec_template.c
> +++ b/libavcodec/aacdec_template.c
> @@ -507,7 +507,13 @@ static void flush(AVCodecContext *avctx)
>              ChannelElement *che = ac->che[type][i];
>              if (che) {
>                  for (j = 0; j <= 1; j++) {
> +                    // LTP buffer related data buffer
> +                    // or windowing overlapping
>                      memset(che->ch[j].saved, 0, sizeof(che->ch[j].saved));
> +                    memset(che->ch[j].coeffs, 0, sizeof(che->ch[j].coeffs));
> +                    // sbr context should be reseted and function pointers should be applied too
> +                    memset(&che->sbr, 0, sizeof(che->sbr));
> +                    AAC_RENAME(ff_aac_sbr_ctx_init)(ac, &che->sbr, type);

What happened with this patch?

Carl Eugen
diff mbox series

Patch

diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index bb11de3..8f8dc24 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -507,7 +507,13 @@  static void flush(AVCodecContext *avctx)
             ChannelElement *che = ac->che[type][i];
             if (che) {
                 for (j = 0; j <= 1; j++) {
+                    // LTP buffer related data buffer
+                    // or windowing overlapping
                     memset(che->ch[j].saved, 0, sizeof(che->ch[j].saved));
+                    memset(che->ch[j].coeffs, 0, sizeof(che->ch[j].coeffs));
+                    // sbr context should be reseted and function pointers should be applied too
+                    memset(&che->sbr, 0, sizeof(che->sbr));
+                    AAC_RENAME(ff_aac_sbr_ctx_init)(ac, &che->sbr, type);
                 }
             }
         }