Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/2] avfilter/vf_perspective: factor the interpolation code out so that it's usable by other filters
Date: Thu, 12 Jun 2025 14:08:21 +0200
Message-ID: <20250612120821.GA29660@pb2> (raw)
In-Reply-To: <01F29F47-C4D1-4AD3-90A9-6C41C12567C8@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3291 bytes --]

On Thu, Jun 12, 2025 at 11:38:59AM +0200, Quentin RENARD wrote:
> As mentioned here (https://ffmpeg.org/pipermail/ffmpeg-devel/2025-June/344593.html), this is the first step of a 2 steps patch: move the interpolation code out of the vf_perspective filter so that we can use it in a new zoompan filter and apply scale/crop floating point precision there.
> 
> Signed-off-by: Quentin Renard <contact-github@asticode.com>
> ---
>  libavfilter/Makefile         |   2 +-
>  libavfilter/perspective.c    | 404 +++++++++++++++++++++++++++++++++++
>  libavfilter/perspective.h    |  67 ++++++
>  libavfilter/vf_perspective.c | 372 +++-----------------------------
>  4 files changed, 497 insertions(+), 348 deletions(-)
>  create mode 100644 libavfilter/perspective.c
>  create mode 100644 libavfilter/perspective.h
> 
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 97f8f17272..7c6dfcf4bf 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -426,7 +426,7 @@ OBJS-$(CONFIG_PAD_OPENCL_FILTER)             += vf_pad_opencl.o opencl.o opencl/
>  OBJS-$(CONFIG_PALETTEGEN_FILTER)             += vf_palettegen.o palette.o
>  OBJS-$(CONFIG_PALETTEUSE_FILTER)             += vf_paletteuse.o framesync.o palette.o
>  OBJS-$(CONFIG_PERMS_FILTER)                  += f_perms.o
> -OBJS-$(CONFIG_PERSPECTIVE_FILTER)            += vf_perspective.o
> +OBJS-$(CONFIG_PERSPECTIVE_FILTER)            += vf_perspective.o perspective.o
>  OBJS-$(CONFIG_PHASE_FILTER)                  += vf_phase.o
>  OBJS-$(CONFIG_PHOTOSENSITIVITY_FILTER)       += vf_photosensitivity.o
>  OBJS-$(CONFIG_PIXDESCTEST_FILTER)            += vf_pixdesctest.o
> diff --git a/libavfilter/perspective.c b/libavfilter/perspective.c
> new file mode 100644
> index 0000000000..ab200f8532
> --- /dev/null
> +++ b/libavfilter/perspective.c
[...]
> +static int perspective_resample_cubic(AVFilterContext *ctx, void *arg,
> +                          int job, int nb_jobs)
> +{
[...]
> +static int perspective_resample_linear(AVFilterContext *ctx, void *arg,
> +                           int job, int nb_jobs)
> +{
[...]
> +static int calc_luts(PerspectiveResampleContext *s, int w, int h, double ref[4][2])
> +{
[...]
> diff --git a/libavfilter/vf_perspective.c b/libavfilter/vf_perspective.c
> index 58510f6f13..f5766eed7a 100644
> --- a/libavfilter/vf_perspective.c
> +++ b/libavfilter/vf_perspective.c
[...]
> -static int calc_persp_luts(AVFilterContext *ctx, AVFilterLink *inlink)
[...]
> -static int resample_cubic(AVFilterContext *ctx, void *arg,
> -                          int job, int nb_jobs)
> -{
[...]
> -static int resample_linear(AVFilterContext *ctx, void *arg,
> -                           int job, int nb_jobs)
> -{

please keep the functions in the same order so that a diff between
new libavfilter/perspective.c
and
old libavfilter/vf_perspective.c

is easy readable

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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-06-12 12:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12  9:38 Quentin RENARD
2025-06-12 12:08 ` Michael Niedermayer [this message]
2025-06-12 13:27   ` Quentin RENARD

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=20250612120821.GA29660@pb2 \
    --to=michael@niedermayer.cc \
    --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