summaryrefslogtreecommitdiff
path: root/libavfilter/vf_lut3d.c
Commit message (Collapse)AuthorAgeFilesLines
* avutil/internal: Move avpriv-file API to a header of its ownAndreas Rheinhardt2022-09-031-3/+1
| | | | | | | It is not used by the large majority of files that include lavu/internal.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* all: Replace if (ARCH_FOO) checks by #if ARCH_FOOAndreas Rheinhardt2022-06-151-3/+3
| | | | | | | | | | | | | | | | | | This is more spec-compliant because it does not rely on dead-code elimination by the compiler. Especially MSVC has problems with this, as can be seen in https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html or https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html This commit does not eliminate every instance where we rely on dead code elimination: It only tackles branching to the initialization of arch-specific dsp code, not e.g. all uses of CONFIG_ and HAVE_ checks. But maybe it is already enough to compile FFmpeg with MSVC with whole-programm-optimizations enabled (if one does not disable too many components). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Switch uses of av_fopen_utf8 to avpriv_fopen_utf8Martin Storsjö2022-05-231-2/+2
| | | | | | The former has been deprecated. Signed-off-by: Martin Storsjö <martin@martin.st>
* avfilter/vf_lut3d: allow to control when to upload CLUT for haldclutPaul B Mahol2022-04-261-6/+14
|
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-161-0/+2
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
* avfilter/vf_lut3d: add x86-optimized tetrahedral interpolationMark Reid2021-10-101-56/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I spotted an interesting pattern that I didn't see before that leads to the implementation being faster. The bit shifting table I was using before is no longer needed, and was able to remove quite a few lines.  I also add use of FMA on the AVX2 version. f32 1920x1080 1 thread with prelut c impl 1434012700 UNITS in lut3d->interp,       1 runs,      0 skips 1434035335 UNITS in lut3d->interp,       2 runs,      0 skips 1423615347 UNITS in lut3d->interp,       4 runs,      0 skips 1426268863 UNITS in lut3d->interp,       8 runs,      0 skips sse2 905484420 UNITS in lut3d->interp,       1 runs,      0 skips 905659010 UNITS in lut3d->interp,       2 runs,      0 skips 915167140 UNITS in lut3d->interp,       4 runs,      0 skips 915834222 UNITS in lut3d->interp,       8 runs,      0 skips avx 574794860 UNITS in lut3d->interp,       1 runs,      0 skips 581035090 UNITS in lut3d->interp,       2 runs,      0 skips 584116720 UNITS in lut3d->interp,       4 runs,      0 skips 581460290 UNITS in lut3d->interp,       8 runs,      0 skips avx2 301698880 UNITS in lut3d->interp,       1 runs,      0 skips 301982880 UNITS in lut3d->interp,       2 runs,      0 skips 306962430 UNITS in lut3d->interp,       4 runs,      0 skips 305472025 UNITS in lut3d->interp,       8 runs,      0 skips gbrap16 1920x1080 1 thread with prelut c impl 1480894840 UNITS in lut3d->interp,       1 runs,      0 skips 1502922990 UNITS in lut3d->interp,       2 runs,      0 skips 1496114307 UNITS in lut3d->interp,       4 runs,      0 skips 1492554551 UNITS in lut3d->interp,       8 runs,      0 skips sse2 980777180 UNITS in lut3d->interp,       1 runs,      0 skips 986121520 UNITS in lut3d->interp,       2 runs,      0 skips 986489840 UNITS in lut3d->interp,       4 runs,      0 skips 998832248 UNITS in lut3d->interp,       8 runs,      0 skips avx 622212360 UNITS in lut3d->interp,       1 runs,      0 skips 622981160 UNITS in lut3d->interp,       2 runs,      0 skips 645396315 UNITS in lut3d->interp,       4 runs,      0 skips 641057075 UNITS in lut3d->interp,       8 runs,      0 skips avx2 321336400 UNITS in lut3d->interp,       1 runs,      0 skips 321268920 UNITS in lut3d->interp,       2 runs,      0 skips 323459895 UNITS in lut3d->interp,       4 runs,      0 skips 324949967 UNITS in lut3d->interp,       8 runs,      0 skips
* avfilter: Reindentation after query_formats changesAndreas Rheinhardt2021-10-051-17/+17
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_lut3d: Use formats list instead of query functionAndreas Rheinhardt2021-10-051-7/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one looks at the many query_formats callbacks in existence, one will immediately recognize that there is one type of default callback for video and a slightly different default callback for audio: It is "return ff_set_common_formats_from_list(ctx, pix_fmts);" for video with a filter-specific pix_fmts list. For audio, it is the same with a filter-specific sample_fmts list together with ff_set_common_all_samplerates() and ff_set_common_all_channel_counts(). This commit allows to remove the boilerplate query_formats callbacks by replacing said callback with a union consisting the old callback and pointers for pixel and sample format arrays. For the not uncommon case in which these lists only contain a single entry (besides the sentinel) enum AVPixelFormat and enum AVSampleFormat fields are also added to the union to store them directly in the AVFilter, thereby avoiding a relocation. The state of said union will be contained in a new, dedicated AVFilter field (the nb_inputs and nb_outputs fields have been shrunk to uint8_t in order to create a hole for this new field; this is no problem, as the maximum of all the nb_inputs is four; for nb_outputs it is only two). The state's default value coincides with the earlier default of query_formats being unset, namely that the filter accepts all formats (and also sample rates and channel counts/layouts for audio) provided that these properties agree coincide for all inputs and outputs. By using different union members for audio and video filters the type-unsafety of using the same functions for audio and video lists will furthermore be more confined to formats.c than before. When the new fields are used, they will also avoid allocations: Currently something nearly equivalent to ff_default_query_formats() is called after every successful call to a query_formats callback; yet in the common case that the newly allocated AVFilterFormats are not used at all (namely if there are no free links) these newly allocated AVFilterFormats are freed again without ever being used. Filters no longer using the callback will not exhibit this any more. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_lut3d: Deduplicate optionsAndreas Rheinhardt2021-09-231-7/+15
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilterAndreas Rheinhardt2021-08-201-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, an AVFilter's lists of input and output AVFilterPads were terminated by a sentinel and the only way to get the length of these lists was by using avfilter_pad_count(). This has two drawbacks: first, sizeof(AVFilterPad) is not negligible (i.e. 64B on 64bit systems); second, getting the size involves a function call instead of just reading the data. This commit therefore changes this. The sentinels are removed and new private fields nb_inputs and nb_outputs are added to AVFilter that contain the number of elements of the respective AVFilterPad array. Given that AVFilter.(in|out)puts are the only arrays of zero-terminated AVFilterPads an API user has access to (AVFilterContext.(in|out)put_pads are not zero-terminated and they already have a size field) the argument to avfilter_pad_count() is always one of these lists, so it just has to find the filter the list belongs to and read said number. This is slower than before, but a replacement function that just reads the internal numbers that users are expected to switch to will be added soon; and furthermore, avfilter_pad_count() is probably never called in hot loops anyway. This saves about 49KiB from the binary; notice that these sentinels are not in .bss despite being zeroed: they are in .data.rel.ro due to the non-sentinels. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/internal: Factor out executing a filter's execute_funcAndreas Rheinhardt2021-08-151-2/+4
| | | | | | | The current way of doing it involves writing the ctx parameter twice. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Factor common function combinations outAndreas Rheinhardt2021-08-131-4/+1
| | | | | | | | | | | Several combinations of functions happen quite often in query_format functions; e.g. ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)) is very common. This commit therefore adds functions that are equivalent to commonly used function combinations in order to reduce code duplication. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Constify all AVFiltersAndreas Rheinhardt2021-04-271-3/+3
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_lut3d: lut3d, haldclut: add support for commandsPaul B Mahol2021-02-081-6/+20
|
* avfilter/vf_lut3d: lut1d: add support for commandsPaul B Mahol2021-02-061-7/+27
|
* avfilter/vf_lut3d: add prism interpolationPaul B Mahol2021-01-291-0/+57
|
* avfilter/vf_lut3d: add pyramid interpolationPaul B Mahol2021-01-291-0/+62
|
* avfilter/vf_lut3d: fix sanitizef INF handlingMark Reid2020-11-201-2/+2
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avfilter/vf_lut3d: support remaping negative values in the prelutMark Reid2020-09-071-5/+3
|
* avfilter/vf_lut3d: Fix mixed declaration and codeAndreas Rheinhardt2020-06-011-6/+6
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_lut3d: prelut support for 3d cinespace lutsMark Reid2020-05-311-55/+317
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_lut3d: initial float pixel format supportMark Reid2020-05-231-6/+201
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_lut3d: use av_fopen_utf8()Paul B Mahol2020-02-141-2/+2
|
* avfilter/vf_lut3d: simplify codeLimin Wang2019-11-011-48/+6
| | | | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_lut3d: increase max level to upper limit defined by cube format ↵Paul B Mahol2019-10-261-1/+1
| | | | specification
* avfilter/vf_lut3d: allocate 3d lut dynamicallyPaul B Mahol2019-10-261-59/+111
|
* avfilter/vf_lut3d: increase MAX_LEVELPaul B Mahol2019-04-281-1/+1
|
* avfilter/vf_lut3d: fix range domain processing for .cube formatPaul B Mahol2019-04-281-22/+51
| | | | The ranges are for input, not for output.
* avfilter/vf_lut3d: add cineSpace 3D lut supportPaul B Mahol2019-04-201-0/+91
|
* avfilter/vf_lut3d: add cineSpace 1D lut parsingPaul B Mahol2019-04-201-0/+77
|
* avfilter/vf_lut3d: use av_sscanfPaul B Mahol2018-11-161-8/+8
|
* avfilter/vf_lut3d: ignore last whitespace when comparing LUT size stringPaul B Mahol2018-11-111-2/+2
| | | | In some situations it might be tab character and in others normal space.
* avfilter/vf_lut3d: add spline 1D interpolationPaul B Mahol2018-11-101-0/+32
|
* avfilter/vf_lut3d: add cosine 1D interpolationPaul B Mahol2018-11-101-0/+24
|
* avfilter/vf_lut3d: do not error out if TITLE is after other linesPaul B Mahol2018-10-251-0/+4
|
* avfilter: add lut1d filterPaul B Mahol2018-09-071-0/+448
|
* avfilter/vf_lut3d: unbreak haldclut with planar rgb formatsPaul B Mahol2018-06-021-13/+59
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_lut3d: fix typoPaul B Mahol2018-05-041-1/+1
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_lut3d: add planar rgb supportPaul B Mahol2018-05-041-4/+112
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi: Rename local variables "main" as "master".Carl Eugen Hoyos2017-10-071-4/+4
| | | | | Silences several warnings: main is usually a function
* lavfi: rename framesync2 to framesync.Nicolas George2017-09-121-6/+6
|
* lavfi/vf_lut3d: convert to framesync2.Nicolas George2017-08-291-23/+26
|
* avfilter/vf_lut3d: actually skip lines when encountering DOMAIN_ stringPaul B Mahol2017-03-131-1/+2
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: make use of ff_filter_get_nb_threadsPaul B Mahol2016-08-291-1/+1
|
* avfilter/haldclut: use AV_OPT_TYPE_BOOL for shortest and repeatlast optionsClément Bœsch2015-09-091-2/+2
|
* avfilter/lut3d: assert on pixel format descriptorClément Bœsch2015-06-131-0/+2
| | | | inlink->format is supposed to be set to a valid format controlled by query_formats().
* avfilter: fix a few 5 spaces indentClément Bœsch2015-06-071-5/+5
|
* avfilter/vf_lut3d: Change enum to int, which is accessed via AVOption as intMichael Niedermayer2015-03-181-1/+1
| | | | | | This fixes depending on implementation defined behavior Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter: handle error in query_formats() of a bunch of random video filtersClément Bœsch2015-03-161-2/+4
|