From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id BFA4242385 for ; Mon, 14 Mar 2022 23:39:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 21E5668B199; Tue, 15 Mar 2022 01:39:10 +0200 (EET) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D5B2568B0B9 for ; Tue, 15 Mar 2022 01:39:03 +0200 (EET) Received: by mail-wr1-f46.google.com with SMTP id h15so26425100wrc.6 for ; Mon, 14 Mar 2022 16:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=+aGPuC0M1ZqIZZdFQB6LLpNJEHHRt2zKhOTJ8QiAzIk=; b=7SMKxD9OYvLWcprwipYioi1Iysgj3ekpjNqsSd8OoMrQ4OLvhPJ9M4xha+/K9vAYfG /10GkuFkYaA86nu8NTCMMoL0Xbe1YgMC2UQ3FLlR1dan3Bh6qHX5NM3S7uc1f3+U7aE5 b80XYA4Dq2J4zsLF9i/j0/4gRdTwX6GT+CBYNx/5dUVjkDSLHusUp2s1VZb9JgwO/408 UqbTx4xWz5Q/dneSY37nN5tNwsgzNZMfS702Owa3zVU8SyLLmU8azo02FRYWXJiJB5Dq hgphOmB0GfIrZB+UjP8hDaplcS2cm/nmy2tDH4dx/6CF18jdfmHUMuhC02CezQrxoNov fPtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=+aGPuC0M1ZqIZZdFQB6LLpNJEHHRt2zKhOTJ8QiAzIk=; b=PICknLgkwej2Y91XXSVRh98Y6OWYJNrN8Rs2d0/RLoLWPqRw4VqPJQoFRjBS76PQF+ RB5j2Fpj9nFYoxF0dHXFVY5go4Mrn+rkgu1SdXqfy6q/iuh1XVYhZuZjrHMTMJQJN8SO KlY7aCDyWsHSpNH4YN24+rq46ckk2Mk4X3wtEn50oDUnWevdQKedwT+Kyfv0tODZE/aj BDFdaccPYNgBLzbwIRC8bASwWRIsMplK7S5jQ3OwbtsIyJP0VJvU/awBzavzPQaLWvRr 7JBye1VTM+QRrPXHqWxQzvsndg6ZExt+dg/kKyAI6DBYJKMVR06k2Vw5z6aTlxKMZf/K oeUA== X-Gm-Message-State: AOAM533fvDFxC95PGHsN+DsfuExuyOuQjGN34+0zDvV0jNgmuMVCEY4K ed/DzY2q1riekaZuvtg11FFlFOBNXcWvzQ== X-Google-Smtp-Source: ABdhPJz22mkTwnc+KLpjdQV9v/ZTNUpVmYgm2yJTGsvELLrtyeKOLj0333kaywIUtuAvQ/9yd+lmHw== X-Received: by 2002:a05:6000:2cf:b0:203:7326:cae5 with SMTP id o15-20020a05600002cf00b002037326cae5mr18362926wry.198.1647301143029; Mon, 14 Mar 2022 16:39:03 -0700 (PDT) Received: from [192.168.0.11] (cpc91222-cmbg18-2-0-cust46.5-4.cable.virginm.net. [81.106.30.47]) by smtp.gmail.com with ESMTPSA id bl20-20020adfe254000000b001f1fa450a3asm23655481wrb.72.2022.03.14.16.39.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Mar 2022 16:39:02 -0700 (PDT) Message-ID: Date: Mon, 14 Mar 2022 23:38:59 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220311090046.262777-1-fei.w.wang@intel.com> From: Mark Thompson In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v4 1/4] lavc/vaapi_encode_h265: Add GPB frame support for hevc_vaapi 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 14/03/2022 02:15, Xiang, Haihao wrote: > On Sun, 2022-03-13 at 20:45 +0000, Mark Thompson wrote: >> On 11/03/2022 09:00, Fei Wang wrote: >>> From: Linjie Fu >>> >>> Use GPB frames to replace regular P/B frames if backend driver does not >>> support it. >>> >>> - GPB: >>> Generalized P and B picture. Regular P/B frames replaced by B >>> frames with previous-predict only, L0 == L1. Normal B frames >>> still have 2 different ref_lists and allow bi-prediction >>> >>> Signed-off-by: Linjie Fu >>> Signed-off-by: Fei Wang >>> --- >>> update: >>> 1. Add b to gpb. >>> 2. Optimise debug message. >>> >>> libavcodec/vaapi_encode.c | 74 +++++++++++++++++++++++++++++++--- >>> libavcodec/vaapi_encode.h | 2 + >>> libavcodec/vaapi_encode_h265.c | 24 ++++++++++- >>> 3 files changed, 93 insertions(+), 7 deletions(-) >>> >>> diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c >>> index 3bf379b1a0..bdba9726b2 100644 >>> --- a/libavcodec/vaapi_encode.c >>> +++ b/libavcodec/vaapi_encode.c >>> @@ -848,9 +848,13 @@ static void vaapi_encode_set_b_pictures(AVCodecContext >>> *avctx, >>> pic->b_depth = current_depth; >>> >>> vaapi_encode_add_ref(avctx, pic, start, 1, 1, 0); >>> - vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); >>> vaapi_encode_add_ref(avctx, pic, prev, 0, 0, 1); >>> >>> + if (!ctx->b_to_gpb) >>> + vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); >>> + else >>> + vaapi_encode_add_ref(avctx, pic, end, 0, 1, 0); >> >> This is doing something extremely dubious. If b-to-gpb is set, then don't use >> the future reference? > > According to > https://github.com/intel/media-driver/blob/master/media_driver/agnostic/common/codec/hal/codechal_vdenc_hevc.cpp#L3072-L3087 > , L0 and L1 should be the same for vdenc hevc on some platforms, Right, so this is actually a different constraint which isn't indicated so far. It's not just the BI_NOT_EMPTY constraint that P slices cannot be used, it's also that in B slices RefPicList1 has to be identical to RefPicList0. Perhaps this should be added to libva? > so user can't > use past and future reference together, Where is this coming from? I don't see how past vs. future references are relevant at all (since the driver can't see that anyway), only the matching content of the lists. Maybe in this case the right behaviour would be to concatenate what would normally be in the two lists and then put that in both of them (assuming it supports the necessary reference counts, but this particular hardware appears to allow 3/3 so it would). > which is why you experienced the failure > after applying version 2 Yep - and is also why the P-frame only case works, since that puts the same single entry in both lists. - Mark _______________________________________________ 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".