From patchwork Mon Apr 19 14:10:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 27054 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp564474iob; Mon, 19 Apr 2021 07:21:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1XgKAn7N1DzcBD81Fpw+BYKE4haOEt5y1TuM0qFMI0jgUTRjm5ZCGFEz2dQBIFwxWcttc X-Received: by 2002:a50:fd07:: with SMTP id i7mr14824915eds.92.1618842119608; Mon, 19 Apr 2021 07:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618842119; cv=none; d=google.com; s=arc-20160816; b=CvBXLM/Twf4HQ648Y/H8W6HLMnunIE/InHLBMedX5LWDIackNoodTNBBAMIFH+EbaD u6NOEEpJBgVn/tlVIQUwzzvV3rBUURukNTVcolAX44f1iWrU0il0zZb+k9r6ZmGPqVGH d/cdtBwIxrGaSZtPj8MHgpzsCYecjhhL7wx7ZnsbRl/1rHWjyn3fshyIS6iquDJS29rC uXQLGmdHfQAv36F5R3scDuXZ7kYKJIyGNtCPJpfcjvk25ol5ztmxPG5mmsx5MFsCFdoK e25R2nsWHSnYo+Tk+lVrRVmdEzOadBWjTGmLEBN+m/5MBXlgZOHMzUETMr+h4N9rPS5S Z9/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=AfGbvW6EC+pMUUQlOsxVSf/NC5wUHMN5o80yqqWAi5I=; b=bJpuwKuIsbTB1EzQFyx8vOJe6mSkaPdSl5v4vmaYRbMRtgbmTS7dY1g/Ap/yxr3Ne9 9GhjgueBxiyLYaBQ4Gs/F/2RFOpuI8c4WiWhmYKY72N55X9ORvvoCmeI02mFiJcr3iqr Aw1BaI/hdTzUqmUutCW7RiNv8c2RVVTh2l1F1d184/rPeIkzNMr/A3LQgmYz/ftBQrKk CDh3/3Doqx3ztz4JKWu1pA32fkGDFwsMUGge4hUP2E19SiLUiDrWWNAf+uWfXhG/3QMG 1uWWGYZ1sXRrK10Hx9CuE/p4EwLqMbJeWxLzW9TBSiRQ2moS7DJR7l24ZW/lF2D615wC Nz6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=HpO6ywjD; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id pj1si11950443ejb.586.2021.04.19.07.21.59; Mon, 19 Apr 2021 07:21:59 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=HpO6ywjD; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A7CF8689D24; Mon, 19 Apr 2021 17:12:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 57E60689CB4 for ; Mon, 19 Apr 2021 17:12:27 +0300 (EEST) Received: by mail-qk1-f178.google.com with SMTP id v7so7773591qkj.13 for ; Mon, 19 Apr 2021 07:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=hruFEyjUp1d/3BmV4iZxQF/2ibdJNmuM8Ih35TUCM3I=; b=HpO6ywjDbTy8XIIijLhTomk6fg2Z3cuFwIqjwY40gZq5osQvepj75WucUixQQSOzmI duG3+qVL3IC4hEPNl8gQsXH37er/WD3AAXRZJ5NRXsDDsavTHUcODjBbvMS+41UJx3AA 4UKpVNaVfztxdKEBXp8UULrvHysePpcilkKV9Iem1MJP2cVLHm9CyoCzOu/QX1wHxA1F uh3quqpXXhOXbERdAN1wof+AiZJP/8QTZC7rKYZOYFoPKxfyqP7oOvBTxXP2KMXBDOFz UofQ40y3yoJdqmqjpvcq2CuKbpNMysV0BFxPKle2ITj89hUdsx3XItT7NYfKeEkLxvHS waJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hruFEyjUp1d/3BmV4iZxQF/2ibdJNmuM8Ih35TUCM3I=; b=ZqYfUaCSA51PhmRJhNOWo0wFMsNpkVtlIK1D72zUJtQGXDNajbEPp9w7xo2mckp7o8 WczSt8WBeDE5atWCZPY4Z8YQ599wvLLDgzoI9IjYz7IHUGVh3xnt8YxUAGsJQhiC5q9L BIrEZ2/3GIOwncPz1gvMWkl2Tby+QGXIYErVqogmylF6O58ZauOw6VkH/wKqEMPttyao 8FnA7nOuVSc6tIjqawcCvA1wtq2GJJD43Pj2ZPABG5bTIVwEXPOj7LqwqyeiND33VvkJ OUcs9vnMeUcYRE8AhVpY0wZXKU8VoN60K5ErlsBblyXyU7upU2WiXNLhVY0Z2LrkKh7j kOqw== X-Gm-Message-State: AOAM533JxHw5PpAMS4/DXhxI4Os23L5N2IH7nf/xi+TkB9iN/aeZ2j93 N/tC/yuGKuFkcVOJif6iDESR9hJMZs8= X-Received: by 2002:a37:b103:: with SMTP id a3mr12616166qkf.261.1618841545717; Mon, 19 Apr 2021 07:12:25 -0700 (PDT) Received: from localhost.localdomain ([191.83.209.133]) by smtp.gmail.com with ESMTPSA id f7sm2049494qtv.53.2021.04.19.07.12.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 07:12:25 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 19 Apr 2021 11:10:06 -0300 Message-Id: <20210419141024.8174-70-jamrial@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419141024.8174-1-jamrial@gmail.com> References: <20210419141024.8174-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 69/87] avutil/pixdesc: Remove deprecated AV_PIX_FMT_FLAG_PSEUDOPAL X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 1AjbY7CubTIx From: Andreas Rheinhardt Deprecated in d6fc031caf64eed921bbdef86d79d56bfc2633b0. Signed-off-by: Andreas Rheinhardt --- libavcodec/decode.c | 5 +---- libavcodec/ffv1dec.c | 3 +-- libavcodec/rawdec.c | 17 +++++------------ libavfilter/drawutils.c | 2 +- libavfilter/framepool.c | 6 ++---- libavfilter/vf_crop.c | 2 +- libavfilter/vf_pixdesctest.c | 3 +-- libavfilter/vf_scale.c | 3 +-- libavfilter/vf_untile.c | 2 +- libavutil/frame.c | 2 +- libavutil/imgutils.c | 15 ++++----------- libavutil/internal.h | 9 --------- libavutil/pixdesc.c | 9 ++++----- libavutil/pixdesc.h | 20 -------------------- libavutil/version.h | 3 --- tests/ref/fate/imgutils | 10 +++++----- 16 files changed, 28 insertions(+), 83 deletions(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 1a7c37043e..9e5230ae1d 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -1425,8 +1425,7 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic) pic->data[i] = NULL; pic->linesize[i] = 0; } - if (desc->flags & AV_PIX_FMT_FLAG_PAL || - ((desc->flags & FF_PSEUDOPAL) && pic->data[1])) + if (desc->flags & AV_PIX_FMT_FLAG_PAL) avpriv_set_systematic_pal2((uint32_t *)pic->data[1], pic->format); if (s->debug & FF_DEBUG_BUFFERS) @@ -1589,8 +1588,6 @@ static void validate_avframe_allocation(AVCodecContext *avctx, AVFrame *frame) int flags = desc ? desc->flags : 0; if (num_planes == 1 && (flags & AV_PIX_FMT_FLAG_PAL)) num_planes = 2; - if ((flags & FF_PSEUDOPAL) && frame->data[1]) - num_planes = 2; for (i = 0; i < num_planes; i++) { av_assert0(frame->data[i]); } diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 8516fef5d7..14879779fa 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -952,8 +952,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac (fs->slice_y >> sv) + ((fs->slice_x >> sh) << pixshift); } - if (desc->flags & AV_PIX_FMT_FLAG_PAL || - desc->flags & FF_PSEUDOPAL) { + if (desc->flags & AV_PIX_FMT_FLAG_PAL) { dst[1] = p->data[1]; src[1] = f->last_picture.f->data[1]; } diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index d3756328ba..a13f88b148 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -93,19 +93,13 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) return AVERROR(EINVAL); } - if (desc->flags & (AV_PIX_FMT_FLAG_PAL | FF_PSEUDOPAL)) { + if (desc->flags & AV_PIX_FMT_FLAG_PAL) { context->palette = av_buffer_alloc(AVPALETTE_SIZE); if (!context->palette) return AVERROR(ENOMEM); -#if FF_API_PSEUDOPAL - if (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) - avpriv_set_systematic_pal2((uint32_t*)context->palette->data, avctx->pix_fmt); -#endif - else { - memset(context->palette->data, 0, AVPALETTE_SIZE); - if (avctx->bits_per_coded_sample == 1) - memset(context->palette->data, 0xff, 4); - } + memset(context->palette->data, 0, AVPALETTE_SIZE); + if (avctx->bits_per_coded_sample == 1) + memset(context->palette->data, 0xff, 4); } if ((avctx->extradata_size >= 9 && @@ -416,8 +410,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, frame->linesize[1] = FFALIGN(frame->linesize[1], linesize_align); } - if ((avctx->pix_fmt == AV_PIX_FMT_PAL8 && buf_size < context->frame_size) || - (desc->flags & FF_PSEUDOPAL)) { + if (avctx->pix_fmt == AV_PIX_FMT_PAL8 && buf_size < context->frame_size) { frame->buf[1] = av_buffer_ref(context->palette); if (!frame->buf[1]) { av_buffer_unref(&frame->buf[0]); diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 0a59ff9987..f95e12091b 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -91,7 +91,7 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags) if (!desc || !desc->name) return AVERROR(EINVAL); - if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | FF_PSEUDOPAL | AV_PIX_FMT_FLAG_ALPHA)) + if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA)) return AVERROR(ENOSYS); if (format == AV_PIX_FMT_P010LE || format == AV_PIX_FMT_P010BE || format == AV_PIX_FMT_P016LE || format == AV_PIX_FMT_P016BE) return AVERROR(ENOSYS); diff --git a/libavfilter/framepool.c b/libavfilter/framepool.c index dab8891524..5f67fa170a 100644 --- a/libavfilter/framepool.c +++ b/libavfilter/framepool.c @@ -102,8 +102,7 @@ FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(buffer_size_t size), goto fail; } - if (desc->flags & AV_PIX_FMT_FLAG_PAL || - desc->flags & FF_PSEUDOPAL) { + if (desc->flags & AV_PIX_FMT_FLAG_PAL) { pool->pools[1] = av_buffer_pool_init(AVPALETTE_SIZE, alloc); if (!pool->pools[1]) goto fail; @@ -226,8 +225,7 @@ AVFrame *ff_frame_pool_get(FFFramePool *pool) frame->data[i] = frame->buf[i]->data; } - if (desc->flags & AV_PIX_FMT_FLAG_PAL || - desc->flags & FF_PSEUDOPAL) { + if (desc->flags & AV_PIX_FMT_FLAG_PAL) { enum AVPixelFormat format = pool->format == AV_PIX_FMT_PAL8 ? AV_PIX_FMT_BGR8 : pool->format; diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c index 3d5cb95f78..dffb6dab5e 100644 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@ -300,7 +300,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) frame->data[0] += s->y * frame->linesize[0]; frame->data[0] += s->x * s->max_step[0]; - if (!(desc->flags & AV_PIX_FMT_FLAG_PAL || desc->flags & FF_PSEUDOPAL)) { + if (!(desc->flags & AV_PIX_FMT_FLAG_PAL)) { for (i = 1; i < 3; i ++) { if (frame->data[i]) { frame->data[i] += (s->y >> s->vsub) * frame->linesize[i]; diff --git a/libavfilter/vf_pixdesctest.c b/libavfilter/vf_pixdesctest.c index 680d1a772a..066b8a0290 100644 --- a/libavfilter/vf_pixdesctest.c +++ b/libavfilter/vf_pixdesctest.c @@ -80,8 +80,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) } /* copy palette */ - if (priv->pix_desc->flags & AV_PIX_FMT_FLAG_PAL || - ((priv->pix_desc->flags & FF_PSEUDOPAL) && out->data[1] && in->data[1])) + if (priv->pix_desc->flags & AV_PIX_FMT_FLAG_PAL) memcpy(out->data[1], in->data[1], AVPALETTE_SIZE); for (c = 0; c < priv->pix_desc->nb_components; c++) { diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index 5ad9334d02..3add31bace 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -510,8 +510,7 @@ static int config_props(AVFilterLink *outlink) scale->input_is_pal = desc->flags & AV_PIX_FMT_FLAG_PAL; if (outfmt == AV_PIX_FMT_PAL8) outfmt = AV_PIX_FMT_BGR8; - scale->output_is_pal = av_pix_fmt_desc_get(outfmt)->flags & AV_PIX_FMT_FLAG_PAL || - av_pix_fmt_desc_get(outfmt)->flags & FF_PSEUDOPAL; + scale->output_is_pal = av_pix_fmt_desc_get(outfmt)->flags & AV_PIX_FMT_FLAG_PAL; if (scale->sws) sws_freeContext(scale->sws); diff --git a/libavfilter/vf_untile.c b/libavfilter/vf_untile.c index 9a2eb24901..154b92d08c 100644 --- a/libavfilter/vf_untile.c +++ b/libavfilter/vf_untile.c @@ -136,7 +136,7 @@ static int activate(AVFilterContext *ctx) out->height = outlink->h; out->data[0] += y * out->linesize[0]; out->data[0] += x * s->max_step[0]; - if (!(s->desc->flags & AV_PIX_FMT_FLAG_PAL || s->desc->flags & FF_PSEUDOPAL)) { + if (!(s->desc->flags & AV_PIX_FMT_FLAG_PAL)) { for (i = 1; i < 3; i ++) { if (out->data[i]) { out->data[i] += (y >> s->desc->log2_chroma_w) * out->linesize[i]; 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 81f8690e01..0d015335c3 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 diff --git a/tests/ref/fate/imgutils b/tests/ref/fate/imgutils index c968ea0e85..f510150ea1 100644 --- a/tests/ref/fate/imgutils +++ b/tests/ref/fate/imgutils @@ -62,7 +62,7 @@ yuv422p planes: 3, linesizes: 64 32 32 0, plane_sizes: 3072 1536 yuv444p planes: 3, linesizes: 64 64 64 0, plane_sizes: 3072 3072 3072 0, plane_offsets: 3072 3072 0, total_size: 9216 yuv410p planes: 3, linesizes: 64 16 16 0, plane_sizes: 3072 192 192 0, plane_offsets: 3072 192 0, total_size: 3456 yuv411p planes: 3, linesizes: 64 16 16 0, plane_sizes: 3072 768 768 0, plane_offsets: 3072 768 0, total_size: 4608 -gray planes: 2, linesizes: 64 0 0 0, plane_sizes: 3072 1024 0 0, plane_offsets: 3072 0 0, total_size: 4096 +gray planes: 1, linesizes: 64 0 0 0, plane_sizes: 3072 0 0 0, plane_offsets: 0 0 0, total_size: 3072 monow planes: 1, linesizes: 8 0 0 0, plane_sizes: 384 0 0 0, plane_offsets: 0 0 0, total_size: 384 monob planes: 1, linesizes: 8 0 0 0, plane_sizes: 384 0 0 0, plane_offsets: 0 0 0, total_size: 384 pal8 planes: 2, linesizes: 64 0 0 0, plane_sizes: 3072 1024 0 0, plane_offsets: 3072 0 0, total_size: 4096 @@ -71,12 +71,12 @@ yuvj422p planes: 3, linesizes: 64 32 32 0, plane_sizes: 3072 1536 yuvj444p planes: 3, linesizes: 64 64 64 0, plane_sizes: 3072 3072 3072 0, plane_offsets: 3072 3072 0, total_size: 9216 uyvy422 planes: 1, linesizes: 128 0 0 0, plane_sizes: 6144 0 0 0, plane_offsets: 0 0 0, total_size: 6144 uyyvyy411 planes: 1, linesizes: 96 0 0 0, plane_sizes: 4608 0 0 0, plane_offsets: 0 0 0, total_size: 4608 -bgr8 planes: 2, linesizes: 64 0 0 0, plane_sizes: 3072 1024 0 0, plane_offsets: 3072 0 0, total_size: 4096 +bgr8 planes: 1, linesizes: 64 0 0 0, plane_sizes: 3072 0 0 0, plane_offsets: 0 0 0, total_size: 3072 bgr4 planes: 1, linesizes: 32 0 0 0, plane_sizes: 1536 0 0 0, plane_offsets: 0 0 0, total_size: 1536 -bgr4_byte planes: 2, linesizes: 64 0 0 0, plane_sizes: 3072 1024 0 0, plane_offsets: 3072 0 0, total_size: 4096 -rgb8 planes: 2, linesizes: 64 0 0 0, plane_sizes: 3072 1024 0 0, plane_offsets: 3072 0 0, total_size: 4096 +bgr4_byte planes: 1, linesizes: 64 0 0 0, plane_sizes: 3072 0 0 0, plane_offsets: 0 0 0, total_size: 3072 +rgb8 planes: 1, linesizes: 64 0 0 0, plane_sizes: 3072 0 0 0, plane_offsets: 0 0 0, total_size: 3072 rgb4 planes: 1, linesizes: 32 0 0 0, plane_sizes: 1536 0 0 0, plane_offsets: 0 0 0, total_size: 1536 -rgb4_byte planes: 2, linesizes: 64 0 0 0, plane_sizes: 3072 1024 0 0, plane_offsets: 3072 0 0, total_size: 4096 +rgb4_byte planes: 1, linesizes: 64 0 0 0, plane_sizes: 3072 0 0 0, plane_offsets: 0 0 0, total_size: 3072 nv12 planes: 2, linesizes: 64 64 0 0, plane_sizes: 3072 1536 0 0, plane_offsets: 3072 0 0, total_size: 4608 nv21 planes: 2, linesizes: 64 64 0 0, plane_sizes: 3072 1536 0 0, plane_offsets: 3072 0 0, total_size: 4608 argb planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288