Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Koushik Dutta <koushd@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 3/3] scale_qsv frame crop support
Date: Tue, 21 Jan 2025 18:07:13 -0800
Message-ID: <CAO4LPj_hm5auL2m_yJxdjRS96pJjPQg-KrwKL=opWPkR2pmsRw@mail.gmail.com> (raw)
In-Reply-To: <20240910181057.43453-3-koushd@gmail.com>

Is anyone reviewing patches for qsv? I have two pending patches for
the qsv scale/crop filters. I submitted similar patches for cuda,
videotoolbox, and vulkan already, which were committed.

Koush

On Tue, Sep 10, 2024 at 11:11 AM Koushik Dutta <koushd@gmail.com> wrote:
>
> The crop filter has no effect on scale_qsv:
>
> -vf crop=100:100,scale_qsv=300x300
>
> Hardware frames (AV_PIX_FMT_FLAG_HWACCEL) are expected to use the crop_* properties,
> as seen in the implementation vf_crop.c.
>
> This patch is slightly different from the previously submitted patches
> since qsv supports frame crop via the vpp_qsv filter. If no explicit crop
> is detected via that filter, AVFrame.crop_* will be used instead.
> Removal of vpp_qsv's crop argument may be warranted.
> ---
>  libavfilter/qsvvpp.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
> index 0818ada117..05ce387bc3 100644
> --- a/libavfilter/qsvvpp.c
> +++ b/libavfilter/qsvvpp.c
> @@ -467,6 +467,16 @@ static QSVFrame *submit_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *p
>      else if (qsv_frame->frame->repeat_pict == 4)
>          qsv_frame->surface.Info.PicStruct |= MFX_PICSTRUCT_FRAME_TRIPLING;
>
> +    // if crop arguments are not present from the vpp_qsv filter, use the provided AVFrame
> +    // crop_* members instead.
> +    if (!qsv_frame->surface.Info.CropX && !qsv_frame->surface.Info.CropY
> +        && qsv_frame->surface.Info.CropW == picref->width && qsv_frame->surface.Info.CropH == picref->height) {
> +        qsv_frame->surface.Info.CropW = (mfxU16)((picref->width - picref->crop_right) - picref->crop_left);
> +        qsv_frame->surface.Info.CropH = (mfxU16)((picref->height - picref->crop_bottom) - picref->crop_top);
> +        qsv_frame->surface.Info.CropX = (mfxU16)picref->crop_left;
> +        qsv_frame->surface.Info.CropY = (mfxU16)picref->crop_top;
> +    }
> +
>      return qsv_frame;
>  }
>
> --
> 2.39.3 (Apple Git-146)
>
_______________________________________________
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".

       reply	other threads:[~2025-01-22  2:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240910181057.43453-1-koushd@gmail.com>
     [not found] ` <20240910181057.43453-3-koushd@gmail.com>
2025-01-22  2:07   ` Koushik Dutta [this message]
2025-01-22  2:14     ` Soft Works

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='CAO4LPj_hm5auL2m_yJxdjRS96pJjPQg-KrwKL=opWPkR2pmsRw@mail.gmail.com' \
    --to=koushd@gmail.com \
    --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