summaryrefslogtreecommitdiff
path: root/libavfilter/vf_lut.c
Commit message (Collapse)AuthorAge
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-16
| | | | | | | | 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: split negate filter from lut filterPaul B Mahol2021-10-27
| | | | | | Using luts for negating is suboptimal. FATE test changes because filter no longer clips values into limited color range.
* avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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_lut: Remove empty init functionAndreas Rheinhardt2021-09-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_lut: Deduplicate AVClassesAndreas Rheinhardt2021-09-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilterAndreas Rheinhardt2021-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-15
| | | | | | | 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-13
| | | | | | | | | | | 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-27
| | | | | | | 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_lut: add support for commandsPaul B Mahol2021-02-08
| | | | While here remove excessive log and uninit() call in negate_init().
* avfilter/vf_lut: fix regression with >8bit planar filteringPaul B Mahol2019-07-05
|
* lavfi/lut: Add slice threading supportJun Zhao2019-06-03
| | | | | | | | | | | | | | | | | Used the command for 1080p h264 clip as follow: a). ffmpeg -i input -vf lutyuv="u=128:v=128" -f null /dev/null b). ffmpeg -i input -vf lutrgb="g=0:b=0" -f null /dev/null after enabled the slice threading, the fps change from: a). 144fps to 258fps (lutyuv) b). 94fps to 153fps (lutrgb) in Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avfilter: add support for gray14 formatPaul B Mahol2018-09-09
|
* avfilter/vf_lut: add support for gray formatsPaul B Mahol2017-12-22
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: add support for GRAY9 and GBRAP10Paul B Mahol2017-08-07
|
* avfilter/vf_lut: make it possible to clip pixel values that are out of valid ↵Paul B Mahol2017-02-13
| | | | | | | | range Previous behavior was not useful at all as such pixels where all mapped to 0. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_lut: do not always explicitly clip pixelsPaul B Mahol2017-02-13
| | | | | | | Old behaviour was not useful at all. New behaviour only emulate old behaviour with default options. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_lut: unbreak planar rgb suppot on big-endianPaul B Mahol2016-08-31
|
* avfilter/vf_lut: add planar RGB supportPaul B Mahol2016-08-24
|
* avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPATDerek Buitenhuis2016-01-27
| | | | | | | | | | Libav, for some reason, merged this as a public API function. This will aid in future merges. A define is left for backwards compat, just in case some person used it, since it is in a public header. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* vf_lut: Add support for RGB48 and RGBA64.Steven Robertson2015-10-30
| | | | | | Signed-off-by: Steven Robertson <steven@strobe.cc> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* all: remove some casts of function pointer to void *Ganesh Ajjanagadde2015-10-24
| | | | | | | | | | These casts are unnecessary, and may safely be removed. Found by enabling -Wpedantic on clang 3.7. Tested with FATE. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* avfilter/vf_lut: use AV_OPT_TYPE_BOOL for negate_alpha optionPaul B Mahol2015-09-09
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* Replace all remaining occurances of step/depth_minus1 and offset_plus1Hendrik Leppkes2015-09-08
|
* avfilter/vf_lut: fix oversightPaul B Mahol2015-07-03
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avutil: add missing bswap includeMichael Niedermayer2015-07-03
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_lut: >8 bit depth planar yuv supportPaul B Mahol2015-07-03
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: handle error in query_formats() of a bunch of random video filtersClément Bœsch2015-03-16
|
* lavfi/lut: apply minor compute_gammaval709() doxy fixStefano Sabatini2015-01-27
|
* avfilter/lut: reduce dereference in the inner loopYayoi2014-12-18
| | | | | | | | | For rgb, with a 1080p source, 69 to 74fps on core i5(2 core, 1.8GHz), and 136 to 160 fps on an core i7(4770R, 3.2Ghz) Changed the yuv code for consistency, even though the performance increase is not as obvious as rgb Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_lut: gammaval709()Peter Ross2014-11-14
| | | | | | | | See http://www.itu.int/rec/R-REC-BT.709 Item 1.2, overall opto-electronic transfer characteristics at source Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '58400ac133bcfb6bf8196b4e5208bc178307739b'Michael Niedermayer2014-04-19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '58400ac133bcfb6bf8196b4e5208bc178307739b': lavfi: name anonymous structs Conflicts: libavfilter/buffersink.c libavfilter/f_select.c libavfilter/src_movie.c libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c libavfilter/vf_overlay.c libavfilter/vf_showinfo.c libavfilter/vf_unsharp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: name anonymous structsVittorio Giovara2014-04-19
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: lavfi: do not export the filters from shared objects Conflicts: libavfilter/af_amix.c libavfilter/af_anull.c libavfilter/asrc_anullsrc.c libavfilter/f_select.c libavfilter/f_settb.c libavfilter/split.c libavfilter/src_movie.c libavfilter/vf_aspect.c libavfilter/vf_blackframe.c libavfilter/vf_colorbalance.c libavfilter/vf_copy.c libavfilter/vf_crop.c libavfilter/vf_cropdetect.c libavfilter/vf_drawbox.c libavfilter/vf_format.c libavfilter/vf_framestep.c libavfilter/vf_frei0r.c libavfilter/vf_hflip.c libavfilter/vf_libopencv.c libavfilter/vf_lut.c libavfilter/vf_null.c libavfilter/vf_overlay.c libavfilter/vf_scale.c libavfilter/vf_transpose.c libavfilter/vf_unsharp.c libavfilter/vf_vflip.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: do not export the filters from shared objectsAnton Khirnov2013-10-28
| |
* | avfilter: various cosmeticsPaul B Mahol2013-09-12
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit 'faa8245bd45c1a6dd220ba9407ea1c82132aa1ce'Michael Niedermayer2013-09-01
|\| | | | | | | | | | | | | | | | | | | | | * commit 'faa8245bd45c1a6dd220ba9407ea1c82132aa1ce': vf_lut: Constantize Conflicts: libavfilter/vf_lut.c See: d7e95ccd9ff3e55e194582a105421fa308a83ef1 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_lut: ConstantizeDiego Elio Pettenò2013-08-31
| | | | | | | | | | | | | | The pixel format tables are never modified, mark them as constant. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avfilter: fix plane validity checksMichael Niedermayer2013-08-03
| | | | | | | | | | | | Fixes out of array accesses Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'd371c3c2e2830d9783465ecfe1ab7d93351083b7'Michael Niedermayer2013-05-17
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'd371c3c2e2830d9783465ecfe1ab7d93351083b7': vf_frei0r: make config_props work properly when called multiple times. vf_gradfun: make config_props work properly when called multiple times. vf_lut: make config_props work properly when called multiple times. Conflicts: libavfilter/vf_lut.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_lut: make config_props work properly when called multiple times.Anton Khirnov2013-05-17
| | | | | | | | Do not leak the expressions.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-05-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: vf_pad: use the name 's' for the pointer to the private context vf_overlay: use the name 's' for the pointer to the private context vf_lut: use the name 's' for the pointer to the private context Conflicts: libavfilter/vf_lut.c libavfilter/vf_overlay.c libavfilter/vf_pad.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_lut: use the name 's' for the pointer to the private contextAnton Khirnov2013-05-16
| | | | | | | | This is shorter and consistent across filters.
* | lavfi: replace passthrough_filter_frame with a flag.Clément Bœsch2013-05-12
| | | | | | | | | | | | | | | | | | | | With the introduction of AVFilterContext->is_disabled, we can simplify the custom passthrough mode in filters. This commit is technically a small compat break, but the timeline was introduced very recently. Doxy by Stefano Sabatini.
* | lavfi/lut: use FF_CEIL_RSHIFT for chroma w/h rounding.Clément Bœsch2013-05-12
| |
* | lavfi/lut: add support for YUVA422P and YUVA444PPaul B Mahol2013-05-08
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '093804a93cc5da3f95f98265a5df116912443cec'Michael Niedermayer2013-05-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '093804a93cc5da3f95f98265a5df116912443cec': avfilter: Add av_cold attributes to init/uninit functions Conflicts: libavfilter/af_ashowinfo.c libavfilter/af_volume.c libavfilter/src_movie.c libavfilter/vf_lut.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avfilter: Add av_cold attributes to init/uninit functionsDiego Biurrun2013-05-04
| |
| * lavfi: remove now unused args parameter from AVFilter.initAnton Khirnov2013-04-09
| |
* | lavfi/negate: unbreak negate alphaPaul B Mahol2013-04-26
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>