summaryrefslogtreecommitdiff
path: root/libavfilter/vf_fieldorder.c
Commit message (Collapse)AuthorAge
* avfilter: Reindentation after query_formats changesAndreas Rheinhardt2021-10-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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_fieldorder: Remove always-true checkAndreas Rheinhardt2021-10-05
| | | | | | | A filter's formats.query callback is only called after all the inputs and outputs have already been created. 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/vf_fieldorder: Simplify setting common pixel formatsAndreas Rheinhardt2021-08-15
| | | | | | | by using ff_set_common_formats(). Reviewed-by: Paul B Mahol <onemda@gmail.com> 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>
* 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/vf_fieldorder: fix heap-buffer overflowPaul B Mahol2019-10-13
| | | | Fixes #8264
* 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>
* Merge commit '1a3eb042c704dea190c644def5b32c9cee8832b8'Michael Niedermayer2015-04-20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1a3eb042c704dea190c644def5b32c9cee8832b8': Replace av_dlog with normal av_log at trace level Conflicts: ffplay.c libavdevice/fbdev_dec.c libavfilter/avfilter.c libavfilter/internal.h libavfilter/setpts.c libavfilter/src_movie.c libavfilter/vf_crop.c libavfilter/vf_drawtext.c libavfilter/vf_fieldorder.c libavformat/assdec.c libavformat/avidec.c libavformat/flvdec.c libavformat/http.c libavformat/ipmovie.c libavformat/isom.c libavformat/mov.c libavformat/mpegenc.c libavformat/mpegts.c libavformat/mpegtsenc.c libavformat/mux.c libavformat/mxfdec.c libavformat/nsvdec.c libavformat/oggdec.c libavformat/r3d.c libavformat/rtspdec.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace av_dlog with normal av_log at trace levelVittorio Giovara2015-04-19
| | | | | | | | This applies to every library where performance is not critical.
* | Merge commit 'a7d070acb55c3ebbdd5e93e3366f32865732b8a3'Michael Niedermayer2014-05-27
|\| | | | | | | | | | | | | * commit 'a7d070acb55c3ebbdd5e93e3366f32865732b8a3': vf_fieldorder: avoid using AV_PIX_FMT_NB Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_fieldorder: avoid using AV_PIX_FMT_NBAnton Khirnov2014-05-26
| | | | | | | | | | That hardcodes the number of pixel formats into lavfi and will break when a shared lavu is updated, adding new pixel formats.
* | 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
| |
| * vf_fieldorder: remove superfluous get_video_bufferVittorio Giovara2013-11-04
| |
* | 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
| |
* | Merge commit '00d7369de06a16f7c8770a899fcb16bcb94b1e20'Michael Niedermayer2013-10-22
|\| | | | | | | | | | | | | * commit '00d7369de06a16f7c8770a899fcb16bcb94b1e20': vf_fieldorder: log when processing is skipped Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_fieldorder: log when processing is skippedVittorio Giovara2013-10-22
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avfilter: remove duplicate includesMichael Niedermayer2013-09-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avfilter: various cosmeticsPaul B Mahol2013-09-12
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavfi/fieldorder: work with non writtable frames tooPaul B Mahol2013-09-06
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavfi/fieldorder: remove pal8 formatPaul B Mahol2013-09-06
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavfi/fieldorder: add timeline supportPaul B Mahol2013-09-06
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavfi/fieldorder: use av_image_fill_linesizes()Paul B Mahol2013-09-06
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavfi/fieldorder: remove redundant get_video_buffer()Paul B Mahol2013-09-06
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avfilter: fix plane validity checksMichael Niedermayer2013-08-03
| | | | | | | | | | | | Fixes out of array accesses Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f6b6d6ac42c0ee427fcd3fae4c398b2103b491b8'Michael Niedermayer2013-05-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f6b6d6ac42c0ee427fcd3fae4c398b2103b491b8': vf_frei0r: use the name 's' for the pointer to the private context vf_format: use the name 's' for the pointer to the private context vf_fieldorder: use the name 's' for the pointer to the private context vf_fieldorder: cosmetics, remove an extra linebreak Conflicts: libavfilter/vf_frei0r.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_fieldorder: use the name 's' for the pointer to the private contextAnton Khirnov2013-05-16
| | | | | | | | This is shorter and consistent across filters.
| * vf_fieldorder: cosmetics, remove an extra linebreakAnton Khirnov2013-05-16
| |
| * Remove commented-out debug #define cruftDiego Biurrun2013-05-16
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-05-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_* Conflicts: doc/APIchanges libavcodec/avpicture.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/imgconvert.c libavcodec/tiffenc.c libavfilter/vf_pixdesctest.c libavfilter/vf_scale.c libavutil/imgutils.c libavutil/pixdesc.c libavutil/version.h libswscale/swscale_internal.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_*Anton Khirnov2013-05-15
| |
* | Merge commit 'a39c154049a2d0c4fb02a5c74f58d6986ec21cec'Michael Niedermayer2013-04-10
|\| | | | | | | | | | | | | | | | | | | | | * commit 'a39c154049a2d0c4fb02a5c74f58d6986ec21cec': vf_fieldorder: switch to an AVOptions-based system. Conflicts: doc/filters.texi libavfilter/vf_fieldorder.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_fieldorder: switch to an AVOptions-based system.Anton Khirnov2013-04-09
| |
* | lavfi/fieldorder: use standard options parsing.Clément Bœsch2013-03-24
| |
* | lavfi/fieldorder: add support to named optionsStefano Sabatini2013-03-13
| |
* | lavfi/fieldorder: remove unused headers and commented defineStefano Sabatini2013-03-13
| |
* | Merge commit '7e350379f87e7f74420b4813170fe808e2313911'Michael Niedermayer2013-03-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7e350379f87e7f74420b4813170fe808e2313911': lavfi: switch to AVFrame. Conflicts: doc/filters.texi libavfilter/af_ashowinfo.c libavfilter/audio.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/buffersink.c libavfilter/buffersrc.c libavfilter/buffersrc.h libavfilter/f_select.c libavfilter/f_setpts.c libavfilter/fifo.c libavfilter/split.c libavfilter/src_movie.c libavfilter/version.h libavfilter/vf_aspect.c libavfilter/vf_bbox.c libavfilter/vf_blackframe.c libavfilter/vf_delogo.c libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_fieldorder.c libavfilter/vf_fps.c libavfilter/vf_frei0r.c libavfilter/vf_gradfun.c libavfilter/vf_hqdn3d.c libavfilter/vf_lut.c libavfilter/vf_overlay.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/vf_showinfo.c libavfilter/vf_transpose.c libavfilter/vf_vflip.c libavfilter/vf_yadif.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavfilter/yadif.h Following are notes about the merge authorship and various technical details. Michael Niedermayer: * Main merge operation, notably avfilter.c and video.c * Switch to AVFrame: - afade - anullsrc - apad - aresample - blackframe - deshake - idet - il - mandelbrot - mptestsrc - noise - setfield - smartblur - tinterlace * various merge changes and fixes in: - ashowinfo - blackdetect - field - fps - select - testsrc - yadif Nicolas George: * Switch to AVFrame: - make rawdec work with refcounted frames. Adapted from commit 759001c534287a96dc96d1e274665feb7059145d by Anton Khirnov. Also, fix the use of || instead of | in a flags check. - make buffer sink and src, audio and video work all together Clément Bœsch: * Switch to AVFrame: - aevalsrc - alphaextract - blend - cellauto - colormatrix - concat - earwax - ebur128 - edgedetect - geq - histeq - histogram - hue - kerndeint - life - movie - mp (with the help of Michael) - overlay - pad - pan - pp - pp - removelogo - sendcmd - showspectrum - showwaves - silencedetect - stereo3d - subtitles - super2xsai - swapuv - thumbnail - tile Hendrik Leppkes: * Switch to AVFrame: - aconvert - amerge - asetnsamples - atempo - biquads Matthieu Bouron: * Switch to AVFrame - alphamerge - decimate - volumedetect Stefano Sabatini: * Switch to AVFrame: - astreamsync - flite - framestep Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Clément Bœsch <ubitux@gmail.com> Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Stefano Sabatini <stefasab@gmail.com> Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: switch to AVFrame.Anton Khirnov2013-03-08
| | | | | | | | | | Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it and use AVFrame instead.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-11-29
|\| | | | | | | | | | | | | | | | | | | | | * qatar/master: vf_fieldorder: require write permissions vf_fieldorder: reindent Conflicts: libavfilter/vf_fieldorder.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_fieldorder: require write permissionsAnton Khirnov2012-11-28
| | | | | | | | This filter modifies the input frame.
| * vf_fieldorder: reindentAnton Khirnov2012-11-28
| |
| * lavfi: merge start_frame/draw_slice/end_frameAnton Khirnov2012-11-28
| | | | | | | | | | Any alleged performance benefits gained from the split are purely mythological and do not justify added code complexity.
* | vf_fieldorder: switch to filter_frame, this filter did not support real slicesAnton Khirnov2012-11-28
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '59ee9f78b0cc4fb84ae606fa317d8102ad32a627'Michael Niedermayer2012-10-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '59ee9f78b0cc4fb84ae606fa317d8102ad32a627': lavfi: do not use av_pix_fmt_descriptors directly. Conflicts: libavfilter/buffersrc.c libavfilter/drawutils.c libavfilter/filtfmts.c libavfilter/vf_ass.c libavfilter/vf_boxblur.c libavfilter/vf_drawtext.c libavfilter/vf_lut.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/vf_showinfo.c libavfilter/vf_transpose.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: do not use av_pix_fmt_descriptors directly.Anton Khirnov2012-10-12
| |
* | Merge commit '4436f25a1682ada3f7226cb6fadf429946933161'Michael Niedermayer2012-10-11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '4436f25a1682ada3f7226cb6fadf429946933161': build: remove references to unused EXTRAOBJS variable lavfi: convert input/ouput list compound literals to named objects fate: add h263 obmc vsynth tests avconv: remove bogus warning when using avconv -h without parameter averror: explicitly define AVERROR_* values flashsv: propagate inflateReset() errors indeo4/5: remove constant parameter num_bands from wavelet recomposition mxfdec: return error if no segments are available in mxf_get_sorted_table_segments Double motion vector range for HPEL interlaced picture in proper place Conflicts: libavcodec/v210dec.h libavfilter/af_aformat.c libavfilter/af_amix.c libavfilter/af_asyncts.c libavfilter/af_channelmap.c libavfilter/af_join.c libavfilter/asrc_anullsrc.c libavfilter/buffersrc.c libavfilter/f_setpts.c libavfilter/f_settb.c libavfilter/fifo.c libavfilter/src_movie.c libavfilter/vf_ass.c libavfilter/vf_blackframe.c libavfilter/vf_boxblur.c libavfilter/vf_delogo.c libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_fieldorder.c libavfilter/vf_fps.c libavfilter/vf_hflip.c libavfilter/vf_overlay.c libavfilter/vf_pad.c libavfilter/vf_select.c libavfilter/vf_transpose.c libavfilter/vf_yadif.c libavfilter/vsrc_testsrc.c libavformat/mxfdec.c libavutil/error.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: convert input/ouput list compound literals to named objectsMans Rullgard2012-10-10
| | | | | | | | | | | | | | A number of compilers, for example those from TI and IBM, choke on these initialisers. The current style is also quite ugly. Signed-off-by: Mans Rullgard <mans@mansr.com>