From patchwork Wed Mar 23 13:54:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 34934 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:ab0:5fda:0:0:0:0:0 with SMTP id g26csp893184uaj; Wed, 23 Mar 2022 06:54:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq+JQs1Ikfa2W1fiTECpV66aw8P4OcVp1xES1HZt+6H0U/PWyuVCSGOIBH1P41SQixe/8x X-Received: by 2002:a17:907:968e:b0:6db:aed5:43c8 with SMTP id hd14-20020a170907968e00b006dbaed543c8mr43032ejc.636.1648043688442; Wed, 23 Mar 2022 06:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648043688; cv=none; d=google.com; s=arc-20160816; b=BekuKuYJ8k/GZDwbB7wGasQLDqNAEfOYFS4f2G42SK9TEM0GnozGjK+KkyYU6rPryC 4sDLB/S84kyCbGQGGyVSnA8hRtgOPIzj/DwfTBkVKVq8OHrHDaGYJQJkznbQgNyi7I1q jWWsjkaZBWklNFr/oF1Ipe2ax4yds+2YSVV5mxcjhRtDAoO3UDo6/Ddy4QlhrHuf3dTu HfMQMJoIvLXb7ZYPund8PziBrFny/Daoe+KUXQRcJuR7L1ehRyvxlbrkAezuj6CjR8wz xib1NMlydnIlpb0tKaHXOFJi2zTStaVniARU/wMdbU87Q1lOYcbPaKffIF6ZzHtVmXSA Bq+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=Mq73EVolaMOD72V/sm2GzyY8Uz1ui/rpWteSCouVYok=; b=l9ox61NdPoBRKJVCIvU5BxTuTwtCcIS6gV01ZvkINpal+xvHHEqUvzhW+6zOFkkAnE 37DVsr9QfrN4uhvlJCjSdNsnEYpky8W1gLsFDk0gzw929EKg/E83ZotEb/O/92FF5e7f GEnLYwxUydOxg4TW1XA2/K+JjhN5RSO5K+ZaOaZ0LKvcRH3pjVrxBeFnyRxMczMArJbN n1okuxOSHWdrbPd0yM12NcYCnqdCnQKJallD5Zp/TbVR0yl2DdFyx7ieg4crLX76bP9W i66woGvDiMgqDZJxtAGWdOWhREuryS59UviIrMC9Hob8WMEl4rcmhPCA6sisLsrozzb1 +Nzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i30-20020a1709067a5e00b006df76385c0fsi10303992ejo.175.2022.03.23.06.54.47; Wed, 23 Mar 2022 06:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DFB8268AB32; Wed, 23 Mar 2022 15:54:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2BBA968067F for ; Wed, 23 Mar 2022 15:54:37 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4KNqbc1b8zz9sRW for ; Wed, 23 Mar 2022 14:54:36 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Wed, 23 Mar 2022 14:54:26 +0100 Message-Id: <20220323135426.32530-1-robux4@ycbcr.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] dxva2_hevc: don't use frames as reference if they are not marked as such X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 6rY05l8L9WFa Similar to how a frame is considered for referencing for the RefPicList array. This will do the same for RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetLtCurr. Fixes playback of http://www.gbbsoft.pl/!download/!/Film1.mp4 Ref. VLC issue https://code.videolan.org/videolan/vlc/-/issues/26738 Signed-off-by: Steve Lhomme --- libavcodec/dxva2_hevc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c index c91bcf3eeb..6b239d9917 100644 --- a/libavcodec/dxva2_hevc.c +++ b/libavcodec/dxva2_hevc.c @@ -184,7 +184,7 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext * const HEVCFrame *frame = NULL; \ while (!frame && j < rpl->nb_refs) \ frame = rpl->ref[j++]; \ - if (frame) \ + if (frame && frame->flags & (HEVC_FRAME_FLAG_LONG_REF | HEVC_FRAME_FLAG_SHORT_REF)) \ pp->ref_list[i] = get_refpic_index(pp, ff_dxva2_get_surface_index(avctx, ctx, frame->frame)); \ else \ pp->ref_list[i] = 0xff; \