aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-14 01:46:26 +0200
committerJames Almer <jamrial@gmail.com>2021-04-27 10:43:13 -0300
commit985c0dac674846721ec8ff23344c16ac7d1c9a1e (patch)
tree1979990f3e66231dca31b81ce0426b227eeaf71e /libavutil
parent1eb311011548867b118dd461442365195fb5fb7d (diff)
downloadffmpeg-985c0dac674846721ec8ff23344c16ac7d1c9a1e.tar.gz
avutil/pixdesc: Remove deprecated AV_PIX_FMT_FLAG_PSEUDOPAL
Deprecated in d6fc031caf64eed921bbdef86d79d56bfc2633b0. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/frame.c2
-rw-r--r--libavutil/imgutils.c15
-rw-r--r--libavutil/internal.h9
-rw-r--r--libavutil/pixdesc.c9
-rw-r--r--libavutil/pixdesc.h20
-rw-r--r--libavutil/version.h3
6 files changed, 9 insertions, 49 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c
index 7d5a36b2f1..5bc8ab36df 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -741,7 +741,7 @@ static int calc_cropping_offsets(size_t offsets[4], const AVFrame *frame,
int shift_x = (i == 1 || i == 2) ? desc->log2_chroma_w : 0;
int shift_y = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
- if (desc->flags & (AV_PIX_FMT_FLAG_PAL | FF_PSEUDOPAL) && i == 1) {
+ if (desc->flags & AV_PIX_FMT_FLAG_PAL && i == 1) {
offsets[i] = 0;
break;
}
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index bd1333170a..53faad889a 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -123,8 +123,7 @@ int av_image_fill_plane_sizes(size_t sizes[4], enum AVPixelFormat pix_fmt,
return AVERROR(EINVAL);
sizes[0] = linesizes[0] * (size_t)height;
- if (desc->flags & AV_PIX_FMT_FLAG_PAL ||
- desc->flags & FF_PSEUDOPAL) {
+ if (desc->flags & AV_PIX_FMT_FLAG_PAL) {
sizes[1] = 256 * 4; /* palette is stored here as 256 32 bits words */
return 0;
}
@@ -250,7 +249,7 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
av_free(buf);
return ret;
}
- if (desc->flags & AV_PIX_FMT_FLAG_PAL || (desc->flags & FF_PSEUDOPAL && pointers[1])) {
+ if (desc->flags & AV_PIX_FMT_FLAG_PAL) {
avpriv_set_systematic_pal2((uint32_t*)pointers[1], pix_fmt);
if (align < 4) {
av_log(NULL, AV_LOG_ERROR, "Formats with a palette require a minimum alignment of 4\n");
@@ -259,8 +258,7 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
}
}
- if ((desc->flags & AV_PIX_FMT_FLAG_PAL ||
- desc->flags & FF_PSEUDOPAL) && pointers[1] &&
+ if (desc->flags & AV_PIX_FMT_FLAG_PAL && pointers[1] &&
pointers[1] - pointers[0] > linesizes[0] * h) {
/* zero-initialize the padding before the palette */
memset(pointers[0] + linesizes[0] * h, 0,
@@ -388,8 +386,7 @@ static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
if (!desc || desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
return;
- if (desc->flags & AV_PIX_FMT_FLAG_PAL ||
- desc->flags & FF_PSEUDOPAL) {
+ if (desc->flags & AV_PIX_FMT_FLAG_PAL) {
copy_plane(dst_data[0], dst_linesizes[0],
src_data[0], src_linesizes[0],
width, height);
@@ -478,10 +475,6 @@ int av_image_get_buffer_size(enum AVPixelFormat pix_fmt,
if (ret < 0)
return ret;
- // do not include palette for these pseudo-paletted formats
- if (desc->flags & FF_PSEUDOPAL)
- return FFALIGN(width, align) * height;
-
ret = av_image_fill_linesizes(linesize, pix_fmt, width);
if (ret < 0)
return ret;
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 2ed1c2abb1..854e9cbed2 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -292,15 +292,6 @@ void ff_check_pixfmt_descriptors(void);
*/
int avpriv_dict_set_timestamp(AVDictionary **dict, const char *key, int64_t timestamp);
-// Helper macro for AV_PIX_FMT_FLAG_PSEUDOPAL deprecation. Code inside FFmpeg
-// should always use FF_PSEUDOPAL. Once the public API flag gets removed, all
-// code using it is dead code.
-#if FF_API_PSEUDOPAL
-#define FF_PSEUDOPAL AV_PIX_FMT_FLAG_PSEUDOPAL
-#else
-#define FF_PSEUDOPAL 0
-#endif
-
// Temporary typedef to simplify porting all AVBufferRef users to size_t
#if FF_API_BUFFER_SIZE_T
typedef int buffer_size_t;
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index e701005bc0..751843e991 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -341,7 +341,6 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.comp = {
{ 0, 1, 0, 0, 8 }, /* Y */
},
- .flags = FF_PSEUDOPAL,
.alias = "gray8,y8",
},
[AV_PIX_FMT_MONOWHITE] = {
@@ -446,7 +445,7 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{ 0, 1, 0, 3, 3 }, /* G */
{ 0, 1, 0, 6, 2 }, /* B */
},
- .flags = AV_PIX_FMT_FLAG_RGB | FF_PSEUDOPAL,
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_BGR4] = {
.name = "bgr4",
@@ -470,7 +469,7 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{ 0, 1, 0, 1, 2 }, /* G */
{ 0, 1, 0, 3, 1 }, /* B */
},
- .flags = AV_PIX_FMT_FLAG_RGB | FF_PSEUDOPAL,
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_RGB8] = {
.name = "rgb8",
@@ -482,7 +481,7 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{ 0, 1, 0, 3, 3 }, /* G */
{ 0, 1, 0, 0, 3 }, /* B */
},
- .flags = AV_PIX_FMT_FLAG_RGB | FF_PSEUDOPAL,
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_RGB4] = {
.name = "rgb4",
@@ -506,7 +505,7 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{ 0, 1, 0, 1, 2 }, /* G */
{ 0, 1, 0, 0, 1 }, /* B */
},
- .flags = AV_PIX_FMT_FLAG_RGB | FF_PSEUDOPAL,
+ .flags = AV_PIX_FMT_FLAG_RGB,
},
[AV_PIX_FMT_NV12] = {
.name = "nv12",
diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h
index 81b51b767f..9e7cfad983 100644
--- a/libavutil/pixdesc.h
+++ b/libavutil/pixdesc.h
@@ -136,26 +136,6 @@ typedef struct AVPixFmtDescriptor {
*/
#define AV_PIX_FMT_FLAG_RGB (1 << 5)
-#if FF_API_PSEUDOPAL
-/**
- * The pixel format is "pseudo-paletted". This means that it contains a
- * fixed palette in the 2nd plane but the palette is fixed/constant for each
- * PIX_FMT. This allows interpreting the data as if it was PAL8, which can
- * in some cases be simpler. Or the data can be interpreted purely based on
- * the pixel format without using the palette.
- * An example of a pseudo-paletted format is AV_PIX_FMT_GRAY8
- *
- * @deprecated This flag is deprecated, and will be removed. When it is removed,
- * the extra palette allocation in AVFrame.data[1] is removed as well. Only
- * actual paletted formats (as indicated by AV_PIX_FMT_FLAG_PAL) will have a
- * palette. Starting with FFmpeg versions which have this flag deprecated, the
- * extra "pseudo" palette is already ignored, and API users are not required to
- * allocate a palette for AV_PIX_FMT_FLAG_PSEUDOPAL formats (it was required
- * before the deprecation, though).
- */
-#define AV_PIX_FMT_FLAG_PSEUDOPAL (1 << 6)
-#endif
-
/**
* The pixel format has an alpha channel. This is set on all formats that
* support alpha in some way, including AV_PIX_FMT_PAL8. The alpha is always
diff --git a/libavutil/version.h b/libavutil/version.h
index 47cec351f0..b78ff1acec 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,9 +105,6 @@
* @{
*/
-#ifndef FF_API_PSEUDOPAL
-#define FF_API_PSEUDOPAL (LIBAVUTIL_VERSION_MAJOR < 57)
-#endif
#ifndef FF_API_CHILD_CLASS_NEXT
#define FF_API_CHILD_CLASS_NEXT (LIBAVUTIL_VERSION_MAJOR < 57)
#endif