summaryrefslogtreecommitdiffstats
path: root/libavfilter/drawutils.c
Commit message (Collapse)AuthorAgeFilesLines
* avfilter/drawutils: remove redundant xyz format checkNiklas Haas2023-10-311-3/+0
| | | | | | The code above this does a whitelist on desc->flags, which now includes the (disallowed) AV_PIX_FMT_FLAG_XYZ for XYZ formats. So there is no more need for a separate check, here.
* avfilter/drawutils: ban XYZ formatsNiklas Haas2023-10-311-0/+3
| | | | | | | | | These are not supported by the drawing functions at all, and were incorrectly advertised as supported in the past. Note: This check is added only to separate the logic change from the API change in the following commit, and will be removed again after it becomes redundant.
* avfilter/drawutils: rgb48/bgr48 is supportedPaul B Mahol2022-12-101-3/+0
|
* lavfi/drawutils: improve colorspace supportrcombs2022-06-191-32/+52
| | | | | | | | | | | | | | | | | | | | | - Introduce ff_draw_init2, which takes explicit colorspace and range args - Use lavu/csp and lavfi/colorspace for conversion, rather than the lavu/colorspace.h macros - Use the passed-in colorspace when performing RGB->YUV conversions The upshot of this is: - Support for YUV spaces other than BT601 - Better rounding for all conversions - Particular rounding improvements in >8-bit formats, which previously used simple left-shifts - Support for limited-range RGB - Support for full-range YUV in non-J pixfmts Due to the rounding improvements, this results in a large number of minor changes to FATE tests. Signed-off-by: rcombs <[email protected]>
* lavfi/drawutils: re-enable P010 and P016 supportrcombs2022-01-041-2/+0
| | | | These formats now work as expected.
* lavfi/drawutils: overhaul to improve pixel format supportrcombs2022-01-041-62/+48
| | | | | | | | | | | | - No longer mixes u8 and u16 component accesses (this was UB) - De-duplicated 8->16 conversion - De-duplicated component -> plane+offset conversion - De-duplicated planar + packed RGB - No longer calls ff_fill_rgba_map - Removed redundant comp_mask data member - RGB0 and related formats no longer write an alpha value to the 0 byte - Non-planar YA formats now work correctly - High-bit-depth semi-planar YUV now works correctly
* lavfi/drawutils: ensure we don't support formats with non-pixel-sized offsetsrcombs2022-01-041-0/+2
|
* lavfi/drawutils: ensure we can't overflow a componentrcombs2022-01-041-0/+2
|
* lavfi/drawutils: ensure we don't allow mixed-byte-depth formatsrcombs2022-01-041-0/+7
| | | | These could be hazardous because of FFDrawColor's union
* lavfi/drawutils: reimplement ff_fill_rgba_map without hardcoding the listrcombs2022-01-041-42/+39
| | | | | | Same outputs, but computed instead of statically known, so new formats will be supported more easily. Asserts in place to ensure we update this if we add anything incompatible with its logic.
* lavfi/drawutils: reject shift-packed formatsrcombs2022-01-041-0/+3
| | | | Disables x2bgr10/x2rgb10 (which did not behave correctly before).
* lavfi/drawutils: remove redundant BE format checksrcombs2022-01-041-1/+1
| | | | We already explicitly don't support big-endian in general
* lavfi/drawutils: move BE check out of looprcombs2022-01-041-2/+2
|
* Remove unnecessary avassert.h inclusionsAndreas Rheinhardt2021-07-221-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* Remove unnecessary mem.h inclusionsAndreas Rheinhardt2021-07-221-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avutil/pixdesc: Remove deprecated AV_PIX_FMT_FLAG_PSEUDOPALAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | Deprecated in d6fc031caf64eed921bbdef86d79d56bfc2633b0. Signed-off-by: Andreas Rheinhardt <[email protected]> Signed-off-by: James Almer <[email protected]>
* avfilter/vf_extractplanes: add float formats supportPaul B Mahol2021-02-071-0/+4
|
* avfilter/drawutils: Remove remnants of old APIAndreas Rheinhardt2021-01-291-98/+0
| | | | | | | | | ff_fill_line_with_color and ff_draw_rectangle are unused since 19c8f2271423281c9b876b984076a6467c455904; ff_copy_rectangle is unused since 53b7a3fe081ec56c5706228eb6431bb943ad471a. Reviewed-by: Paul B Mahol <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/drawutils: support gray14Paul B Mahol2018-05-051-1/+2
| | | | Signed-off-by: Paul B Mahol <[email protected]>
* avfilter/drawutils: add support for full rangePaul B Mahol2018-05-031-3/+8
| | | | Signed-off-by: Paul B Mahol <[email protected]>
* avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPALwm42018-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* lavfi/drawutils: Do not claim to support P016.Carl Eugen Hoyos2018-03-081-1/+1
| | | | Fixes fate on big-endian.
* avfilter/drawutils: add gray9/10/12 supportPaul B Mahol2017-08-071-6/+8
|
* avfilter/drawutils: support gbrap10 tooPaul B Mahol2017-08-071-0/+2
|
* avfilter/drawutils: allow drawing opaque text on transparent backgroundPaul B Mahol2016-09-211-3/+4
| | | | Signed-off-by: Paul B Mahol <[email protected]>
* avfilter/drawutils: honor shift for color component descriptionTimo Rothenpieler2016-08-311-1/+2
|
* avfilter/drawutils: P010 is not supportedTimo Rothenpieler2016-08-311-0/+2
|
* avfilter/drawutils: Fix single plane with alphaMichael Niedermayer2016-08-091-0/+2
| | | | | | Fixes Ticket5720 Signed-off-by: Michael Niedermayer <[email protected]>
* Split drawutils test out into separate fileDerek Buitenhuis2016-05-111-40/+0
| | | | | | | This was missed during 96d616052b3d39678e477fa10610ca688f46fff9 because it is not included in FATE. Signed-off-by: Derek Buitenhuis <[email protected]>
* lavfi/drawutils: support NV12 and NV21Rodger Combs2016-05-101-17/+16
|
* lavfi/drawutils: Add some missing GBRP pix_fmts.Carl Eugen Hoyos2016-03-031-0/+10
| | | | Fixes for example extractplanes with GBRAP16.
* avfilter/drawutils: fix gray and gbr formats on big endianMichael Niedermayer2016-02-251-5/+5
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* avfilter/drawutils: Fix ff_fill_rectangle() on big endianMichael Niedermayer2016-02-251-1/+8
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* avfilter/drawutils: >8 bit supportPaul B Mahol2016-02-171-40/+204
| | | | Signed-off-by: Paul B Mahol <[email protected]>
* avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPATDerek Buitenhuis2016-01-271-9/+9
| | | | | | | | | | 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 <[email protected]>
* lavfi: recognize GBR9-14P as RGB in ff_fill_rgba_map().Ronald S. Bultje2016-01-241-0/+4
|
* drawutils: ReindentTimothy Gu2015-10-261-2/+2
|
* lavfi/drawutils: add const to blending mask.Nicolas George2015-10-251-4/+5
|
* avfilter/all: propagate errors of functions from avfilter/formatsGanesh Ajjanagadde2015-10-141-2/+4
| | | | | | | | | | | | | | | | | | 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 <[email protected]> Previous version Reviewed-by: Nicolas George <[email protected]> Previous version Reviewed-by: Clément Bœsch <[email protected]> Signed-off-by: Ganesh Ajjanagadde <[email protected]>
* Replace all remaining occurances of step/depth_minus1 and offset_plus1Hendrik Leppkes2015-09-081-4/+4
|
* avfilter/drawutils: Assert av_pix_fmt_desc_get() return value in ↵Michael Niedermayer2015-06-131-1/+6
| | | | | | | | | | | ff_fill_line_with_color() Theres currently no case where this could be triggered Found-by: Daemon404 Reviewed-by: Nicolas George <[email protected]> Reviewed-by: Paul B Mahol <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* avfilter/drawutils: Fix format validity check in ff_draw_init()Michael Niedermayer2015-06-131-1/+1
| | | | | Found-by: Daemon404 Signed-off-by: Michael Niedermayer <[email protected]>
* avfilter/drawutils: Check for av_malloc* failuresMichael Niedermayer2015-01-221-0/+7
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* avfilter/drawutils: Use av_malloc_array()Michael Niedermayer2015-01-221-1/+1
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* avfilter/vf_drawtext: Avoid using non public AV_PIX_FMT_NBMichael Niedermayer2014-05-271-7/+6
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* lavfi/drawutils: set subsampling for rgb tooPaul B Mahol2013-07-141-4/+2
| | | | | | Otherwise it is incorrectly set to 1. Signed-off-by: Paul B Mahol <[email protected]>
* lavfi/drawutils: fix planar rgbPaul B Mahol2013-07-081-1/+6
| | | | Signed-off-by: Paul B Mahol <[email protected]>
* lavfi/drawutils: attempt to fix subsampling.Clément Bœsch2013-05-281-9/+13
|
* replace remaining PIX_FMT_* flags with AV_PIX_FMT_FLAG_*Michael Niedermayer2013-05-151-3/+3
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* lavfi/drawutils: add 16 bit rgb and planar rgb to ff_fill_rgba_map()Paul B Mahol2013-05-081-0/+10
| | | | Signed-off-by: Paul B Mahol <[email protected]>