summaryrefslogtreecommitdiff
path: root/libavfilter/vf_shuffleplanes.c
Commit message (Collapse)AuthorAge
* 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: 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: Remove redundant ff_formats/channel_layouts_unref()Andreas Rheinhardt2020-08-24
| | | | | | | | ff_add_format() and ff_add_channel_layout() already unref the list upon error. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_shuffleplanes: add mising query_formats()Paul B Mahol2019-10-18
| | | | Fixes #8298
* avfilter/vf_shuffleplanes: remove not needed linePaul B Mahol2019-09-16
|
* avfilter/vf_shuffleplanes: add support for timelinePaul B Mahol2018-04-27
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPALwm42018-04-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PSEUDOPAL pixel formats are not paletted, but carried a palette with the intention of allowing code to treat unpaletted formats as paletted. The palette simply mapped the byte values to the resulting RGB values, making it some sort of LUT for RGB conversion. It was used for 1 byte formats only: RGB4_BYTE, BGR4_BYTE, RGB8, BGR8, GRAY8. The first 4 are awfully obscure, used only by some ancient bitmap formats. The last one, GRAY8, is more common, but its treatment is grossly incorrect. It considers full range GRAY8 only, so GRAY8 coming from typical Y video planes was not mapped to the correct RGB values. This cannot be fixed, because AVFrame.color_range can be freely changed at runtime, and there is nothing to ensure the pseudo palette is updated. Also, nothing actually used the PSEUDOPAL palette data, except xwdenc (trivially changed in the previous commit). All other code had to treat it as a special case, just to ignore or to propagate palette data. In conclusion, this was just a very strange old mechnaism that has no real justification to exist anymore (although it may have been nice and useful in the past). Now it's an artifact that makes the API harder to use: API users who allocate their own pixel data have to be aware that they need to allocate the palette, or FFmpeg will crash on them in _some_ situations. On top of this, there was no API to allocate the pseuo palette outside of av_frame_get_buffer(). This patch not only deprecates AV_PIX_FMT_FLAG_PSEUDOPAL, but also makes the pseudo palette optional. Nothing accesses it anymore, though if it's set, it's propagated. It's still allocated and initialized for compatibility with API users that rely on this feature. But new API users do not need to allocate it. This was an explicit goal of this patch. Most changes replace AV_PIX_FMT_FLAG_PSEUDOPAL with FF_PSEUDOPAL. I first tried #ifdefing all code, but it was a mess. The FF_PSEUDOPAL macro reduces the mess, and still allows defining FF_API_PSEUDOPAL to 0. Passes FATE with FF_API_PSEUDOPAL enabled and disabled. In addition, FATE passes with FF_API_PSEUDOPAL set to 1, but with allocation functions manually changed to not allocating a palette.
* avfilter: add '.' at and of long filter description where it is missingPaul B Mahol2015-11-25
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: use AVFILTER_DEFINE_CLASS()Paul B Mahol2015-07-02
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_shuffleplanes: Fix flags / add AV_OPT_FLAG_FILTERING_PARAMMichael Niedermayer2014-03-06
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2014-03-06
|\ | | | | | | | | | | | | * qatar/master: vf_shuffleplanes: fix the type of the mapping indices Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_shuffleplanes: fix the type of the mapping indicesAnton Khirnov2014-03-06
| | | | | | | | They are TYPE_INT AVOptions, so they must be ints
* | Merge commit '599b81ca9a8e04a27ddad94af462171d16063167'Michael Niedermayer2014-03-06
|/ | | | | | | | | | | | | | * commit '599b81ca9a8e04a27ddad94af462171d16063167': lavfi: add shuffleplanes filter Conflicts: Changelog doc/filters.texi libavfilter/Makefile libavfilter/allfilters.c libavfilter/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
* lavfi: add shuffleplanes filterAnton Khirnov2014-03-05