From: Timo Rothenpieler <timo@rothenpieler.org>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/cuvidddec: Guess pixel format based on probed bit depth
Date: Thu, 1 Aug 2024 20:14:22 +0200
Message-ID: <92df3798-7215-4ddc-9d7c-1cd99befece6@rothenpieler.org> (raw)
In-Reply-To: <CAJZRZVnDwe2-DS_TxYEEvLqXEBdsK=zhoyva2ZHZQRVXKj97PA@mail.gmail.com>
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".
next prev parent reply other threads:[~2024-08-01 18:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 13:54 Roman Arzumanyan
2024-08-01 18:14 ` Timo Rothenpieler [this message]
2024-08-02 7:46 ` Roman Arzumanyan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=92df3798-7215-4ddc-9d7c-1cd99befece6@rothenpieler.org \
--to=timo@rothenpieler.org \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git