[FFmpeg-devel] [RFC]] swscale modernization proposal
Niklas Haas
ffmpeg at haasn.xyz
Sat Jul 6 15:32:32 EEST 2024
On Sat, 06 Jul 2024 02:11:30 +0200 Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> On Fri, Jul 5, 2024 at 11:34 PM Michael Niedermayer
> <michael at niedermayer.cc> wrote:
> > > /**
> > > * The exact interpretation of these quality presets depends on the backend
> > > * used, but the backend-invariant common settings are derived as follows:
> > > */
> > > enum AVScaleQuality {
> > > AV_SCALE_ULTRAFAST = 1, /* no dither, nearest+nearest */
> > > AV_SCALE_SUPERFAST = 2, /* no dither, bilinear+nearest */
> > > AV_SCALE_VERYFAST = 3, /* no dither, bilinear+bilinear */
> > > AV_SCALE_FASTER = 4, /* bayer dither, bilinear+bilinear */
> > > AV_SCALE_FAST = 5, /* bayer dither, bicubic+bilinear */
> > > AV_SCALE_MEDIUM = 6, /* bayer dither, bicubic+bicubic */
> > > AV_SCALE_SLOW = 7, /* bayer dither, lanczos+bicubic */
> > > AV_SCALE_SLOWER = 8, /* full dither, lanczos+bicubic */
> > > AV_SCALE_VERYSLOW = 9, /* full dither, lanczos+lanczos */
> > > AV_SCALE_PLACEBO = 10, /* full dither, lanczos+lanczos */
> >
> > I dont think its a good idea to hardcode dither and the "FIR" filter to the quality level in the API
> >
>
> The entire point of presets is to have them provide a predefined set
> of parameters, easy for users to pick one value, rather than a bunch.
> And what a preset actually means should be documented.
> How do you define "presets" if they don't hardcode a list of choices
> for all the relevant options?
>
> Advanced settings exist for a user to select any particular detail, if
> they so desire.
One thought I had is to make the presets mechanism something separate,
e.g.
/* Explicitly defaults all options left as AVSCALE_*_AUTO */
avscale_default_options(AVScaleContext *ctx, int preset);
But I think this would just represent an extra burden on the typical API
user, who now needs to manually define this "int preset" with all
available options, and call this function at init time, rather than
getting it for free as part of the AVOptions exposed by AVScaleContext.
>
> - Hendrik
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-devel
mailing list