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 BB0CF43E2B for ; Mon, 15 Aug 2022 23:07:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5AD9268B934; Tue, 16 Aug 2022 02:07:06 +0300 (EEST) Received: from mail.overt.org (mail.overt.org [157.230.92.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C270D68B5A4 for ; Tue, 16 Aug 2022 02:06:59 +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 B47C53F1DD; Mon, 15 Aug 2022 18:06:57 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1660604817; bh=g0SOcgn6/mwc8oj18s3aWOu1V08UKwdiTM1beRQyB5E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qXQsHSAQnRM8xQoNUUjgb+Accvj7gdzyLbrwVPEm67VoLx2ufCE+v93E+aVUGV53R vgyqXXI/kWnt2loXPfE3blFQqCECw4Ft9tsSxFPgCprzhvo4Ez1PsptZ7cR4Thy5L+ QMq9PKYTgShiNmcyrXOXTPyZ2zWXeqlTt9Lo2Hus+bpmuHasuXGvR4DjgjYB/EEeeo vZH2HtTrUZlK86cE/cDA3oQS8SmmE5+OiSHf18G+Rn7ho7KLMx8M9+SnQj4rsieUA1 q0RyasE2hV9KOaomrxX+qFn+yizWWM1o/uBoI4hmklqSX8upY5ogxhczMjyBDZI+34 E0qFbUNYmScYA== Date: Mon, 15 Aug 2022 16:06:55 -0700 From: Philip Langdale To: "Xiang, Haihao" Message-ID: <20220815160655.6476444d@app.nyansa.com> In-Reply-To: <20220815104211.573ed7ef@app.nyansa.com> References: <20220814213313.37948-1-philipl@overt.org> <20220814213313.37948-2-philipl@overt.org> <6df4920e8a38198bf293429b95d0fd30746f16d9.camel@intel.com> <20220815104211.573ed7ef@app.nyansa.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 1/3] lavu/pixfmt: Add Y216, Y410, and Y416 formats 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: FFmpeg development discussions and patches 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 Mon, 15 Aug 2022 10:42:11 -0700 Philip Langdale wrote: > On Mon, 15 Aug 2022 06:12:20 +0000 > "Xiang, Haihao" wrote: > > > > > Hi Philip, > > > > May we add new formats P012, Y212 and Y412 for 12bit contents ? I > > agree with Mark's comment in > > https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200619015248.21873-1-fei.w.wang@intel.com/ > > > > > > " > > Tracking it separately does not seem fun - it looks to me like it > > would require adding a new bit depth field to AVFrame. > > > > FFmpeg has always used pixfmt as defining both the memory layout and > > which bits are used in that (so, for example, ARGB and 0RGB are not > > the same thing), unlike most of the graphics APIs which tend to > > define those two separately. > > " > > I went through this same conversation a few years ago around the > behaviour of nvdec, which uses p016 and yuv444p16 for 12bit content. > All the same arguments were made about not introducing new pixel > formats to just indicate stream depth and how we could add a new > attribute but it would be a bunch of work, and to avoid bogging down > and doing nothing, I just had nvdec/nvenc work with P016 (and > honestly, nvidia don't even use P010 internally, it's P016 for >= > 10bit) and it was fine. On the decoder side, there's no real problem, > and on the encoder side, I think the key insight is that the encoder > doesn't encoder to the frame's pixel format depth, it encodes to the > depth _specified by the profile_. So even if you give it real 16bit > frames in P016, if you are encoding Main12, you are going to get > 12bit. Same for any future Main14. I'd argue this is the most correct > way to handle it anyway. If the default profile we guess based on > format isn't right, specify the one you actually want. Hi Hai Hao, So, Mark has pointed out to me that this isn't the same situation as nvidia, because the driver is actually exposing support for specific P012, Y212, Y412 formats. I didn't realise this, which is why I took the approach I did. With this new information, I will redo it to add those formats instead of the 16bit ones (which don't have a reason to exist in ffmpeg for now). Thanks! --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".