From: "Wang, Fei W" <fei.w.wang-at-intel.com@ffmpeg.org>
To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>,
"ruijing.dong@amd.com" <ruijing.dong@amd.com>
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/av1: fixed an vaapi decoding corruption issue
Date: Tue, 1 Nov 2022 01:50:15 +0000
Message-ID: <bf7896952a6f3b2b1b88c54fe8bf95cda8655a8d.camel@intel.com> (raw)
In-Reply-To: <20221031154652.101396-1-ruijing.dong@amd.com>
On Mon, 2022-10-31 at 11:46 -0400, Ruijing Dong wrote:
The title should be "avcodec/av1_vaapi: xxxx".
> [problem]
> When decoding an av1 bitstream, it shows image corruption
> in the middle of the bitstream around key frames.
>
> [analysis]
> In av1_spec.pdf page 38/669, there is a sentence below:
>
> if ( frame_type == KEY_FRAME && show_frame ) {
> for ( i = 0; i < NUM_REF_FRAMES; i++) {
> RefValid[ i ] = 0
> ......
> }
> ......
> }
>
> This shows that the condition of invalidating current
> DPB frames should be the coming frame_type is KEY_FRAME plus
> show_frame is equal to 1. Otherwise, some of the frames
> in sequence after KEY_FRAME still refer to the reference frames
> before KEY_FRAME, and if these before KEY_FRAME reference
> frames were invalidated, these frames could not find their
> reference frames, and it could cause image corruption.
[problem] and [solution] part and title "[analysis]" can be removed in
the commit message. Content after [analysis] is clear enough.
Thanks
Fei
>
> [solution]
> Add show_frame flag as another condition to co-determine
> when to invalidate DPB reference frames.
>
> Mesa fix is in
> https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19386
>
> cc: Fei Wang <fei.w.wang@intel.com>
> Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
> ---
> libavcodec/vaapi_av1.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/vaapi_av1.c b/libavcodec/vaapi_av1.c
> index 63374c31c9..d0339b2705 100644
> --- a/libavcodec/vaapi_av1.c
> +++ b/libavcodec/vaapi_av1.c
> @@ -274,7 +274,7 @@ static int vaapi_av1_start_frame(AVCodecContext
> *avctx,
> };
>
> for (int i = 0; i < AV1_NUM_REF_FRAMES; i++) {
> - if (pic_param.pic_info_fields.bits.frame_type ==
> AV1_FRAME_KEY)
> + if (pic_param.pic_info_fields.bits.frame_type ==
> AV1_FRAME_KEY && frame_header->show_frame)
> pic_param.ref_frame_map[i] = VA_INVALID_ID;
> else
> pic_param.ref_frame_map[i] = ctx->ref_tab[i].valid ?
_______________________________________________
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".
prev parent reply other threads:[~2022-11-01 1:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-31 15:46 Ruijing Dong
2022-11-01 1:50 ` Wang, Fei W [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bf7896952a6f3b2b1b88c54fe8bf95cda8655a8d.camel@intel.com \
--to=fei.w.wang-at-intel.com@ffmpeg.org \
--cc=ffmpeg-devel@ffmpeg.org \
--cc=ruijing.dong@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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