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 3A58942DA9 for ; Tue, 6 Sep 2022 16:01:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 16BF768B82F; Tue, 6 Sep 2022 19:01:48 +0300 (EEST) Received: from mail.overt.org (mail.overt.org [157.230.92.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 24F6468A42A for ; Tue, 6 Sep 2022 19:01:41 +0300 (EEST) Received: from authenticated-user (mail.overt.org [157.230.92.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mail.overt.org (Postfix) with ESMTPSA id 5B26D3F418; Tue, 6 Sep 2022 11:01:39 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1662480099; bh=55KpV19XzZjvhCHKad/CZ7BtgAGx4T0K/bTY6EZ0KZo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HibAZwwTppxCUaVfEJwkz+AvHe0fkUskz8FN+YqZ4LeR6lBCh67knVbbKDj02R8Ej Qloz4GeMQ/Kz/qm2xmNg5iNVeJpoN8q7s0gc0KhdPTvT6o9+84C+gIZaXAUviwQj9s jtl4IrLz3JrnB8ix/m1IGkmI/L94JcVMxw2z6wQ7p3crW8m1NeqLbQG+yeuhyadxaS jX8L4bFIs4/xLjKm8qnlxszpMqA1dtRvGTz/OGcpG7RvWZuyzEypRv1KE0Bi4DdtZt wZjrBZipZEgyP7DlL7FpgCR7daGxA1KJ/KsSZ17lZJU7z8zICsqIJjPWZYnVYnkzSD DzGsQTDHAkoyw== Date: Tue, 6 Sep 2022 09:01:34 -0700 From: Philip Langdale To: FFmpeg development discussions and patches Message-ID: <20220906090134.609f3964@fido7> In-Reply-To: <20220906045338.20683-1-haihao.xiang@intel.com> References: <20220906045338.20683-1-haihao.xiang@intel.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v2 1/2] lavu/hwcontext_qsv: add support for AV_PIX_FMT_VUYX on Linux 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 Cc: Haihao Xiang Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, 6 Sep 2022 12:53:37 +0800 "Xiang, Haihao" wrote: > From: Haihao Xiang > > AV_PIX_FMT_VUYX is used for 8bit 4:4:4 content in FFmpeg VAAPI, so > AV_PIX_FMT_VUYX should be used for 8bit 4:4:4 content in FFmpeg QSV > too because QSV is based on VAAPI on Linux. However the SDK only > declares support for AYUV and does nothing with the alpha, so this > commit fudged a mapping between AV_PIX_FMT_VUYX and MFX_FOURCC_AYUV. > --- > libavutil/hwcontext_qsv.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c > index 510f422562..9fa0dfa1c0 100644 > --- a/libavutil/hwcontext_qsv.c > +++ b/libavutil/hwcontext_qsv.c > @@ -119,6 +119,10 @@ static const struct { > MFX_FOURCC_YUY2 }, > { AV_PIX_FMT_Y210, > MFX_FOURCC_Y210 }, > + // VUYX is used for VAAPI child device, > + // the SDK only delares support for AYUV > + { AV_PIX_FMT_VUYX, > + MFX_FOURCC_AYUV }, > #endif > }; > > @@ -1502,6 +1506,14 @@ static int map_frame_to_surface(const AVFrame > *frame, mfxFrameSurface1 *surface) surface->Data.U16 = (mfxU16 > *)frame->data[0] + 1; surface->Data.V16 = (mfxU16 *)frame->data[0] + > 3; break; > + case AV_PIX_FMT_VUYX: > + surface->Data.V = frame->data[0]; > + surface->Data.U = frame->data[0] + 1; > + surface->Data.Y = frame->data[0] + 2; > + // Only set Data.A to a valid address, the SDK doesn't > + // use the value from the frame. > + surface->Data.A = frame->data[0] + 3; > + break; > #endif > default: > return MFX_ERR_UNSUPPORTED; Patch series LGTM. --phil _______________________________________________ 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".