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 1E5EC47375 for ; Thu, 1 Aug 2024 18:14:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A9C7B68D8D6; Thu, 1 Aug 2024 21:14:31 +0300 (EEST) Received: from btbn.de (btbn.de [144.76.60.213]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 013C468D789 for ; Thu, 1 Aug 2024 21:14:24 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id 92131281912B7 for ; Thu, 1 Aug 2024 20:14:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1722536063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0zqUrt+7p2BcF5EMRBIBEheBuYyMBTOemDvU4WfRBwQ=; b=PXXkEogEG5u//IZsI/CA4rz+29KzWfprS3RfiPeiltwNa+KVNr9/t9wFtA5n7cDNLwjBxv XJMM4Do5TgJDQKoujSi4Ka68KzqjFFF/qh6QrOWrB9IJV5MAmMsfSeXM2I258K//YRAEWm hE2NKNqLzWfRlIe97I9ZPKdwbadgiXefweHk75dU1/6kPZtChyiMnKcIGHRFHpL8gfpmDR dO4KruOfC6RHnKI5FSKnsaV8efi7BimVWrd/vNUNKUWB27gVwfnm6u295ZPwxFyoRMox9W rFh+P41GVMrTSZveVYVu4KHOMLsOYU9uqvNKNlR1A9DofEfuChLLzQ9xCqM44A== Message-ID: <92df3798-7215-4ddc-9d7c-1cd99befece6@rothenpieler.org> Date: Thu, 1 Aug 2024 20:14:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: Content-Language: en-US From: Timo Rothenpieler In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avcodec/cuvidddec: Guess pixel format based on probed bit depth 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 01.08.2024 15:54, Roman Arzumanyan wrote: > Hello world, > > This patch adds a pixel format guess based on probed bit depth. > With current FFMpeg ToT, when the cuvid codec is opened, input sw_pix_fmt > is AV_PIX_FMT_NV12 until the first frame is decoded. Even if input has 10 > or 12 bit depth, the format will be NV12 for some time. > > What's the need for this patch ? > Applications that rely on libavcodec will have a chance to calculate the > proper amount of vRAM required to store a reconstructed video frame before > decoding begins. The 12 bit format should be AV_PIX_FMT_P016. Also, might as well take probe_desc->log2_chroma_w/log2_chroma_h into account. If they're 0, it's 444, and the formats change to AV_PIX_FMT_YUV444P(16). Akin to the switch() on format->bit_depth_luma_minus8 in the probe function. Patch looks fine on first glance, though relying on a rather arbitrary second field there does not seem like a good idea to me. Why can't the application simply also look at the probed format? _______________________________________________ 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".