summaryrefslogtreecommitdiff
path: root/libavfilter/vf_extractplanes.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/vf_extractplanes: switch to activate()Paul B Mahol2022-03-07
| | | | | | | Fixes hang at end of input with this command: ffmpeg -f lavfi -i testsrc2=d=50,format=yuv444p -lavfi \ "extractplanes=y+u+v[y][u][v];[y]tpad=start=0[y];[u]tpad=start=0[u];[v]negate[v];[y][u][v]vstack=3" -f null -
* avfilter/vf_extractplanes: unbreak "extracting" >8 depth gray formatsPaul B Mahol2022-02-17
|
* 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_extractplanes: fix regressionPaul B Mahol2021-09-12
| | | | Report & solution provided by Andreas Rheinhardt.
* avfilter/vf_extractplanes: stop marking alphaextract filter as dynamic outputsPaul B Mahol2021-09-12
|
* avfilter/vf_extractplanes: Free outpads' names genericallyAndreas Rheinhardt2021-08-22
| | | | | Reviewed-by: Nicolas George <george@nsup.org> 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/avfilter: Remove unused feature to add pads in the middleAndreas Rheinhardt2021-08-17
| | | | | 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_extractplanes: add float formats supportPaul B Mahol2021-02-07
|
* lavfi: regroup formats lists in a single structure.Nicolas George2020-09-08
| | | | | | | | | | | | | | | It will allow to refernce it as a whole without clunky macros. Most of the changes have been automatically made with sed: sed -i ' s/-> *in_formats/->incfg.formats/g; s/-> *out_formats/->outcfg.formats/g; s/-> *in_channel_layouts/->incfg.channel_layouts/g; s/-> *out_channel_layouts/->outcfg.channel_layouts/g; s/-> *in_samplerates/->incfg.samplerates/g; s/-> *out_samplerates/->outcfg.samplerates/g; ' src/libavfilter/*(.)
* avfilter/extractplanes: add support for 12-bit YUVA formatsGyan Doshi2019-01-17
| | | | | At present, 16-bit auto-scaled format results in incorrect alpha extraction.
* avfilter/vf_extractplanes: use ff_outlink_get_status()Paul B Mahol2018-11-03
|
* avfilter/vf_extractplanes: define higher depth formats with macroPaul B Mahol2018-09-09
|
* avfilter/vf_extractplanes: define common 8-bit pixel formatsPaul B Mahol2018-09-09
|
* avfilter/vf_extractplanes: fix 14bit format extractionPaul B Mahol2018-09-09
|
* avfilter/vf_extractplanes: add support for extracting planes with 14 depthPaul B Mahol2018-05-05
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_extractplanes: check ff_insert_outpad() for failurePaul B Mahol2017-08-25
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_extractplanes: add 9 bitdepth supportPaul B Mahol2017-08-07
|
* avfilter: don't anonymously typedef structsPaul B Mahol2017-05-13
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi: make filter_frame non-recursive.Nicolas George2016-12-18
| | | | | | | | | | | | | | | | | | | | | | | | A lot of changes happen at the same time: - Add a framequeue fifo to AVFilterLink. - split AVFilterLink.status into status_in and status_out: requires changes to the few filters and programs that use it directly (f_interleave, split, filtfmts). - Add a field ready to AVFilterContext, marking when the filter is ready and its activation priority. - Add flags to mark blocked links. - Change ff_filter_frame() to enqueue the frame. - Change all filtering functions to update the ready field and the blocked flags. - Update ff_filter_graph_run_once() to use the ready field. - buffersrc: always push the frame immediately.
* avfilter/vf_extractplanes: add extract support for 10bit and 12bit formatsPaul B Mahol2016-11-29
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi/extractplanes: Add RGB0 and friends as supported pix_fmts.Carl Eugen Hoyos2016-03-07
|
* lavfi/extractplanes: Fix in_pixfmts.Carl Eugen Hoyos2016-03-07
| | | | | | | If the original pix_fmt was >8 bit and not supported by the filter, the filter system could choose a pix_fmt with different endianness as input for extractplanes which broke the output because the output always used the endianness of the original pix_fmt.
* lavfi/extractplanes: Move endianness calculation up.Carl Eugen Hoyos2016-03-07
| | | | Needed for next commit.
* 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>
* lavfi: replace link.closed by link.status.Nicolas George2015-12-22
| | | | | | The status field can carry any error code instead of just EOF. Also only update it through a wrapper function and provide a timestamp. Update the few filters that used it directly.
* avfilter/all: propagate errors of functions from avfilter/formatsGanesh Ajjanagadde2015-10-14
| | | | | | | | | | | | | | | | | | Many of the functions from avfilter/formats can return errors, usually AVERROR(ENOMEM). This propagates the return values. All of these were found by using av_warn_unused_result, demonstrating its utility. Tested with FATE. I am least sure of the changes to avfilter/filtergraph, since I don't know what/how reduce_format is intended to behave and how it should react to errors. Fixes: CID 1325680, 1325679, 1325678. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Previous version Reviewed-by: Nicolas George <george@nsup.org> Previous version Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* Replace all remaining occurances of step/depth_minus1 and offset_plus1Hendrik Leppkes2015-09-08
|
* avfilter/vf_extractplanes: use faster path for input formats with only one ↵Paul B Mahol2015-07-01
| | | | | | component Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_extractplanes: rename misleading variablePaul B Mahol2015-07-01
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_extractplanes: support more pixel formatsPaul B Mahol2015-07-01
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_extractplanes: use the name 's' for the pointer to the private ↵Paul B Mahol2015-01-28
| | | | | | context Signed-off-by: Paul B Mahol <onemda@gmail.com>
* 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>
* avfilter: add av_cold to init()Paul B Mahol2013-09-27
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* Merge commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0'Michael Niedermayer2013-05-18
| | | | | | | | | | | | * commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0': lavfi: rename AVFilterFormats.format_count to nb_formats Conflicts: libavfilter/avfiltergraph.c libavfilter/filtfmts.c libavfilter/formats.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* replace remaining PIX_FMT_* flags with AV_PIX_FMT_FLAG_*Michael Niedermayer2013-05-15
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavfi: use ceil right shift for chroma width/height.Clément Bœsch2013-05-10
| | | | | | | This should fix several issues with odd dimensions inputs. lut, vflip, pad and crop video filters also need to be checked for such issues. It's possible sws is also affected.
* lavfi: remove alphaextract special codePaul B Mahol2013-05-09
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi/extractplanes: packed rgb supportPaul B Mahol2013-05-08
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi: add gbrap support to some filtersPaul B Mahol2013-05-08
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: add av_cold to uninit()Michael Niedermayer2013-05-06
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* extractplanes filterPaul B Mahol2013-05-03
Signed-off-by: Paul B Mahol <onemda@gmail.com>