1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00
FFmpeg/fftools
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
..
cmdutils.c fftools/cmdutils: add support for level flag in loglevel option parser 2018-04-03 10:17:38 +02:00
cmdutils.h cmdutils: print supported codecs in show_help_bsf() 2018-03-22 00:15:05 -03:00
ffmpeg_cuvid.c
ffmpeg_filter.c ffmpeg_filter: use nb_threads=1 on unused filtergraph 2017-11-19 04:38:29 +01:00
ffmpeg_hw.c ffmpeg: Use codec hardware config to configure hwaccels 2017-11-26 21:41:19 +00:00
ffmpeg_opt.c ffmpeg: support dump bit stream filter options. 2018-03-16 02:09:59 +01:00
ffmpeg_qsv.c
ffmpeg_videotoolbox.c
ffmpeg.c lav*,tests: remove several register_all calls 2018-04-02 03:26:22 +01:00
ffmpeg.h ffmpeg: remove dead call to av_parser_change() 2018-03-23 22:03:22 -03:00
ffplay.c lav*,tests: remove several register_all calls 2018-04-02 03:26:22 +01:00
ffprobe.c avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPAL 2018-04-03 17:53:00 +02:00
Makefile Remove the ffserver program 2018-01-06 18:31:37 +00:00