1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
FFmpeg/libswscale
wm4 d6fc031caf avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPAL
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.
2018-04-03 17:53:00 +02:00
..
aarch64
arm arm: swscale: Only compile the rgb2yuv asm if .dn aliases are supported 2018-03-31 21:54:56 +03:00
ppc swscale: Drop is9_OR_10BPS() use, its name is not correct 2016-11-10 00:33:12 +01:00
tests Merge commit '0fd0d4fd0a518e30ff23972828ad7cf7f35cfb9d' 2017-10-30 12:34:40 -03:00
x86 swscale/rgb : add X86 SIMD (SSSE3), for shuffle_bytes_1230, shuffle_bytes_3012, shuffle_bytes_3210 2018-03-24 20:22:08 +01:00
alphablend.c
bayer_template.c
gamma.c
hscale_fast_bilinear.c
hscale.c
input.c libswscale: add gray9 support 2017-08-07 13:09:41 +02:00
libswscale.v build: Change structure of the linker version script templates 2016-05-29 16:43:11 +02:00
log2_tab.c
Makefile Merge commit '92db5083077a8b0f8e1050507671b456fd155125' 2017-05-04 19:59:30 -03:00
options.c swscale/options: Use AV_OPT_TYPE_PIXEL_FMT 2016-11-20 13:00:22 +01:00
output.c swscale: Add p016 output support and generalise yuv420p1x to p010 2018-03-02 14:52:48 -08:00
rgb2rgb_template.c swscale/rgb : move shuffle func shuffle_bytes_1230, shuffle_bytes_3012, shuffle_bytes_3210 in order to add SIMD 2018-03-24 20:22:02 +01:00
rgb2rgb.c swscale/rgb : move shuffle func shuffle_bytes_1230, shuffle_bytes_3012, shuffle_bytes_3210 in order to add SIMD 2018-03-24 20:22:02 +01:00
rgb2rgb.h swscale/rgb2rgb : cosmetic, move shuffle_bytes func declaration 2018-03-24 20:22:17 +01:00
slice.c lsws/slice: Move a misplaced const. 2017-03-08 00:33:21 +01:00
swscale_internal.h avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPAL 2018-04-03 17:53:00 +02:00
swscale_unscaled.c swscale: Introduce a helper to identify semi-planar formats 2018-03-03 15:20:19 -08:00
swscale.c Fix several typos 2017-09-21 16:17:02 -08:00
swscale.h doxygen: Standardize root-level modules 2016-08-02 22:15:25 -07:00
swscaleres.rc
utils.c swscale: Add p016 output support and generalise yuv420p1x to p010 2018-03-02 14:52:48 -08:00
version.h swscale: Add p016 output support and generalise yuv420p1x to p010 2018-03-02 14:52:48 -08:00
vscale.c
yuv2rgb.c lsws/yuv2rgb: Fix yuva2rgb32 on big endian hardware. 2017-10-29 14:53:57 +01:00