From: Roman Arzumanyan <r.arzumanyan@visionlabs.ai> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/cuvidddec: Guess pixel format based on probed bit depth Date: Fri, 2 Aug 2024 10:46:50 +0300 Message-ID: <CAJZRZVnNmoJRKtRkyux9Z059xYKS8A8NBQ_PSYMLRaXL0cvEJg@mail.gmail.com> (raw) In-Reply-To: <92df3798-7215-4ddc-9d7c-1cd99befece6@rothenpieler.org> Hi Timo, > Why can't the application simply also look at the probed format? It's certainly possible, but in my opinion it makes sense to improve the codec behavior. All required information is already there, why not return the correct value ? > 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. Thanks, I'll fix and submit v.2 of the patch. чт, 1 авг. 2024 г. в 21:14, Timo Rothenpieler <timo@rothenpieler.org>: > 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". > _______________________________________________ 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".
prev parent reply other threads:[~2024-08-02 7:47 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 2024-08-02 7:46 ` Roman Arzumanyan [this message]
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=CAJZRZVnNmoJRKtRkyux9Z059xYKS8A8NBQ_PSYMLRaXL0cvEJg@mail.gmail.com \ --to=r.arzumanyan@visionlabs.ai \ --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