From patchwork Mon Apr 19 14:09:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 27087 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp575566iob; Mon, 19 Apr 2021 07:35:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqAhfjfRH+LhsKUzHrkwUO8JgR5k4xdA9jNnXQGvdsbbFrmZMY980ZnqBRDPnPSDjif+Yr X-Received: by 2002:aa7:d787:: with SMTP id s7mr7682609edq.240.1618842910664; Mon, 19 Apr 2021 07:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618842910; cv=none; d=google.com; s=arc-20160816; b=Ho11+zgtm3cpdYkGsWS4x1oCR6NiTbhGKFZchjXETDm8fZG0CCckyf+Ea5+TrSOxva T19ilCcgKV/oBHtuIzfNJdDBTGhoiHiWgZhpVf7DGFKWdQsabdlw713Dak32om3j3FSv 55uCxeiWNk/9Cxu7WMab8CJ6g6jlp9BdYikJogyB6kiDkHRa6StpV0kI9KPI/2K8hlWA Ro6G5IPH1QyYOhknjWImdEa85U/jCtgfxtTrwvHEQcb4Aps8m3M1eGF7N1OAvnzLFK46 2jEGr4F8OsLBedIN418B4LvP0/+jDwtekb1+wBdVt9Yh8ozg1KK1T8GOzF54fGz9eKNe UuQw== 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=+jony3Jrp1EedJC2vH5iJk5uPXxwvM6mZ63DHinsOlc=; b=oEySsOxjZK8Fdsoe5d6Ql7fzd4Y2Dx2VOVtrNy71tK5AUakYS+fEf164ntXctKUym+ 9hfZJT+Xxm0wjXxp+0hSZjDMYQHiXBzyL1bGMyBJKO6xkkuHKlVmyJ7KV0kxs+zW7O+B CztRur31X8lmjClnuDyHaNquDyUHdKDwP50MleXfYAndrEyp1MRXvnqG4qlFRhjeN89u MPPQDMb5TeNGkT24viXXkVLbzA3zFdenS3PtSrk3eFMQ5F6BPp4ayjyuDRh+ItsU6SEv wWe1tciKhXGSkMq7kAwvVaBKVfZUhYtq7mrGfQCFMQqOl8rPAP/pnm2blKAloZGLnzCi HPRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="jpg/Y5fA"; 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 x9si6307665eje.242.2021.04.19.07.35.09; Mon, 19 Apr 2021 07:35:10 -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="jpg/Y5fA"; 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 C847068A26A; Mon, 19 Apr 2021 17:35:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4C7A5689D6C for ; Mon, 19 Apr 2021 17:35:00 +0300 (EEST) Received: by mail-pg1-f174.google.com with SMTP id z16so24378853pga.1 for ; Mon, 19 Apr 2021 07:35:00 -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=FSsqgO/7D/x8+LJC+Nn5dZUM01HRhwIE1yDVktF7fBA=; b=jpg/Y5fAg9pKYsV3aqk2/iyFjLVE0aizrwvoEnZoRJ1tEeD4GfPQUcVXnYjWdyokUQ ZPS1YnTP3eNSZho8WF18n23vHNW7UWWTeh1jrVgzS4jZRG2xHsVpyjP24qnCljyPABz9 zMEkQ8i38rUYqyDs2eAdJAg0ptZevTiV8gM95QFQgM2I6qrgyRCuxrCoYwYbZDutXDtC vgYZNOieIH1lal7Tfi5cT48RTEhyykKkZk8prtR29hHGsbEHsUhWoySqxuGA/tBYDk7N uN/Odz7ADi80TZZz5ag7ZtWcEYwj2wCm4xABrVEEipBRFatyT5o+3Kkwqg2PZLBmAdxR MtBg== 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=FSsqgO/7D/x8+LJC+Nn5dZUM01HRhwIE1yDVktF7fBA=; b=gfnPvXvWGocXpd+xF29XD0yskPaZ3Dx1kHeMoBKP6UhBPQXegdNUscipZLkMXju6Fg OJQm6lkx5KWxGbZVU8wyMqkXubu4Gmy8r1L7e+Uv6sv/RdefjIJwGj0ElpfL8sAnpP6U J2X0Hh0RTrljcGheutYQ682dnB+arwP3zZFxe0m8olDw+e3HXLTXcab0+wtlFM1PzyFm SvsN0rxtENw+2YI1b22OZv2X/80HvdM+DBhZFy2Dq49CEV0V0+qEeqL1UhzUcpWvgT4H LixxPGCf2Dkafhpad6dbHj+d+K0SVh6YjK2Tl399dz40va6p7nuG4Ke2Ke9vt8tGVIYm Q52g== X-Gm-Message-State: AOAM530Ovgb/Y5PsFwN7jMQ6AmjUisvQKpUhRk608/fwDMFBOgqITIjW nWdUs6c4FBwGdi4TNDMFIpqDrXPlzMo= X-Received: by 2002:ad4:538a:: with SMTP id i10mr21716255qvv.9.1618841492219; Mon, 19 Apr 2021 07:11:32 -0700 (PDT) Received: from localhost.localdomain ([191.83.209.133]) by smtp.gmail.com with ESMTPSA id f7sm2049494qtv.53.2021.04.19.07.11.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 07:11:31 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 19 Apr 2021 11:09:22 -0300 Message-Id: <20210419141024.8174-26-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 25/87] avcodec: Remove deprecated AVPicture API 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: bzctGdQiAaN3 From: Andreas Rheinhardt Deprecated in a17a7661906ba295d67afd80ac0770422e1b02b3. Signed-off-by: Andreas Rheinhardt --- libavcodec/Makefile | 2 - libavcodec/avcodec.h | 99 -------------------- libavcodec/avpicture.c | 82 ---------------- libavcodec/dvbsubdec.c | 12 --- libavcodec/dvdsubdec.c | 18 ---- libavcodec/dvdsubenc.c | 14 --- libavcodec/imgconvert.c | 156 +------------------------------ libavcodec/libzvbi-teletextdec.c | 9 -- libavcodec/pgssubdec.c | 14 --- libavcodec/tests/.gitignore | 1 - libavcodec/tests/imgconvert.c | 46 --------- libavcodec/version.h | 3 - libavcodec/xsubdec.c | 14 --- libavcodec/xsubenc.c | 13 --- 14 files changed, 1 insertion(+), 482 deletions(-) delete mode 100644 libavcodec/avpicture.c delete mode 100644 libavcodec/tests/imgconvert.c diff --git a/libavcodec/Makefile b/libavcodec/Makefile index c11645616d..31b220025b 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -32,7 +32,6 @@ OBJS = ac3_parser.o \ avcodec.o \ avdct.o \ avpacket.o \ - avpicture.o \ bitstream.o \ bitstream_filters.o \ bsf.o \ @@ -1213,7 +1212,6 @@ TESTPROGS = avpacket \ celp_math \ codec_desc \ htmlsubtitles \ - imgconvert \ jpeg2000dwt \ mathops \ utils \ diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index ea60e1fe46..315246e68e 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2418,33 +2418,6 @@ typedef struct AVHWAccel { * @} */ -#if FF_API_AVPICTURE -/** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - */ - -/** - * Picture data structure. - * - * Up to four components can be stored into it, the last component is - * alpha. - * @deprecated use AVFrame or imgutils functions instead - */ -typedef struct AVPicture { - attribute_deprecated - uint8_t *data[AV_NUM_DATA_POINTERS]; ///< pointers to the image data planes - attribute_deprecated - int linesize[AV_NUM_DATA_POINTERS]; ///< number of bytes per line -} AVPicture; - -/** - * @} - */ -#endif - enum AVSubtitleType { SUBTITLE_NONE, @@ -2472,13 +2445,6 @@ typedef struct AVSubtitleRect { int h; ///< height of pict, undefined when pict is not set int nb_colors; ///< number of colors in pict, undefined when pict is not set -#if FF_API_AVPICTURE - /** - * @deprecated unused - */ - attribute_deprecated - AVPicture pict; -#endif /** * data+linesize for the bitmap of this subtitle. * Can be set for text/ass as well once they are rendered. @@ -3445,71 +3411,6 @@ int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, * @} */ -#if FF_API_AVPICTURE -/** - * @addtogroup lavc_picture - * @{ - */ - -/** - * @deprecated unused - */ -attribute_deprecated -int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height); - -/** - * @deprecated unused - */ -attribute_deprecated -void avpicture_free(AVPicture *picture); - -/** - * @deprecated use av_image_fill_arrays() instead. - */ -attribute_deprecated -int avpicture_fill(AVPicture *picture, const uint8_t *ptr, - enum AVPixelFormat pix_fmt, int width, int height); - -/** - * @deprecated use av_image_copy_to_buffer() instead. - */ -attribute_deprecated -int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt, - int width, int height, - unsigned char *dest, int dest_size); - -/** - * @deprecated use av_image_get_buffer_size() instead. - */ -attribute_deprecated -int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height); - -/** - * @deprecated av_image_copy() instead. - */ -attribute_deprecated -void av_picture_copy(AVPicture *dst, const AVPicture *src, - enum AVPixelFormat pix_fmt, int width, int height); - -/** - * @deprecated unused - */ -attribute_deprecated -int av_picture_crop(AVPicture *dst, const AVPicture *src, - enum AVPixelFormat pix_fmt, int top_band, int left_band); - -/** - * @deprecated unused - */ -attribute_deprecated -int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt, - int padtop, int padbottom, int padleft, int padright, int *color); - -/** - * @} - */ -#endif - /** * @defgroup lavc_misc Utility functions * @ingroup libavc diff --git a/libavcodec/avpicture.c b/libavcodec/avpicture.c deleted file mode 100644 index 56435f4fc9..0000000000 --- a/libavcodec/avpicture.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * AVPicture management routines - * Copyright (c) 2001, 2002, 2003 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * AVPicture management routines - */ - -#include "avcodec.h" -#include "internal.h" -#include "libavutil/common.h" -#include "libavutil/pixdesc.h" -#include "libavutil/imgutils.h" -#include "libavutil/internal.h" -#include "libavutil/colorspace.h" - -#if FF_API_AVPICTURE -FF_DISABLE_DEPRECATION_WARNINGS -int avpicture_fill(AVPicture *picture, const uint8_t *ptr, - enum AVPixelFormat pix_fmt, int width, int height) -{ - return av_image_fill_arrays(picture->data, picture->linesize, - ptr, pix_fmt, width, height, 1); -} - -int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt, int width, int height, - unsigned char *dest, int dest_size) -{ - return av_image_copy_to_buffer(dest, dest_size, - (const uint8_t * const*)src->data, src->linesize, - pix_fmt, width, height, 1); -} - -int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height) -{ - return av_image_get_buffer_size(pix_fmt, width, height, 1); -} - -int avpicture_alloc(AVPicture *picture, - enum AVPixelFormat pix_fmt, int width, int height) -{ - int ret = av_image_alloc(picture->data, picture->linesize, - width, height, pix_fmt, 1); - if (ret < 0) { - memset(picture, 0, sizeof(AVPicture)); - return ret; - } - - return 0; -} - -void avpicture_free(AVPicture *picture) -{ - av_freep(&picture->data[0]); -} - -void av_picture_copy(AVPicture *dst, const AVPicture *src, - enum AVPixelFormat pix_fmt, int width, int height) -{ - av_image_copy(dst->data, dst->linesize, (const uint8_t **)src->data, - src->linesize, pix_fmt, width, height); -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif /* FF_API_AVPICTURE */ diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index ec2304bfb9..7db1fef216 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -832,18 +832,6 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou memcpy(rect->data[1], region->computed_clut, sizeof(region->computed_clut)); } -#if FF_API_AVPICTURE -FF_DISABLE_DEPRECATION_WARNINGS -{ - int j; - for (j = 0; j < 4; j++) { - rect->pict.data[j] = rect->data[j]; - rect->pict.linesize[j] = rect->linesize[j]; - } -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif - i++; } } diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index bf49788e1b..91906b9df4 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -409,15 +409,6 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header, sub_header->rects[0]->type = SUBTITLE_BITMAP; sub_header->rects[0]->linesize[0] = w; sub_header->rects[0]->flags = is_menu ? AV_SUBTITLE_FLAG_FORCED : 0; - -#if FF_API_AVPICTURE -FF_DISABLE_DEPRECATION_WARNINGS - for (i = 0; i < 4; i++) { - sub_header->rects[0]->pict.data[i] = sub_header->rects[0]->data[i]; - sub_header->rects[0]->pict.linesize[i] = sub_header->rects[0]->linesize[i]; - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif } } if (next_cmd_pos < cmd_pos) { @@ -504,15 +495,6 @@ static int find_smallest_bounding_rectangle(DVDSubContext *ctx, AVSubtitle *s) s->rects[0]->x += x1; s->rects[0]->y += y1; -#if FF_API_AVPICTURE -FF_DISABLE_DEPRECATION_WARNINGS - for (i = 0; i < 4; i++) { - s->rects[0]->pict.data[i] = s->rects[0]->data[i]; - s->rects[0]->pict.linesize[i] = s->rects[0]->linesize[i]; - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif - return 1; } diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c index 9fa9d5b6d7..e55e2eab4f 100644 --- a/libavcodec/dvdsubenc.c +++ b/libavcodec/dvdsubenc.c @@ -279,20 +279,6 @@ static int encode_dvd_subtitles(AVCodecContext *avctx, break; } -#if FF_API_AVPICTURE -FF_DISABLE_DEPRECATION_WARNINGS - for (i = 0; i < rects; i++) - if (!h->rects[i]->data[0]) { - AVSubtitleRect *rect = h->rects[i]; - int j; - for (j = 0; j < 4; j++) { - rect->data[j] = rect->pict.data[j]; - rect->linesize[j] = rect->pict.linesize[j]; - } - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif - vrect = *h->rects[0]; if (rects > 1) { diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index a3443d1c72..40300f836d 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -25,13 +25,8 @@ */ #include "avcodec.h" -#include "internal.h" -#include "mathops.h" -#include "libavutil/colorspace.h" -#include "libavutil/common.h" #include "libavutil/pixdesc.h" -#include "libavutil/internal.h" -#include "libavutil/imgutils.h" +#include "libavutil/pixfmt.h" #if FF_API_AVCODEC_PIX_FMT int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, @@ -72,152 +67,3 @@ enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(const enum AVPixelFormat *p return best; } -#if FF_API_AVPICTURE -FF_DISABLE_DEPRECATION_WARNINGS -/* return true if yuv planar */ -static inline int is_yuv_planar(const AVPixFmtDescriptor *desc) -{ - int i; - int planes[4] = { 0 }; - - if ( desc->flags & AV_PIX_FMT_FLAG_RGB - || !(desc->flags & AV_PIX_FMT_FLAG_PLANAR)) - return 0; - - /* set the used planes */ - for (i = 0; i < desc->nb_components; i++) - planes[desc->comp[i].plane] = 1; - - /* if there is an unused plane, the format is not planar */ - for (i = 0; i < desc->nb_components; i++) - if (!planes[i]) - return 0; - return 1; -} - -int av_picture_crop(AVPicture *dst, const AVPicture *src, - enum AVPixelFormat pix_fmt, int top_band, int left_band) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); - int y_shift; - int x_shift; - int max_step[4]; - - if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) - return -1; - - y_shift = desc->log2_chroma_h; - x_shift = desc->log2_chroma_w; - av_image_fill_max_pixsteps(max_step, NULL, desc); - - if (is_yuv_planar(desc)) { - dst->data[0] = src->data[0] + (top_band * src->linesize[0]) + left_band; - dst->data[1] = src->data[1] + ((top_band >> y_shift) * src->linesize[1]) + (left_band >> x_shift); - dst->data[2] = src->data[2] + ((top_band >> y_shift) * src->linesize[2]) + (left_band >> x_shift); - } else{ - if(top_band % (1<data[0] = src->data[0] + (top_band * src->linesize[0]) + (left_band * max_step[0]); - } - - dst->linesize[0] = src->linesize[0]; - dst->linesize[1] = src->linesize[1]; - dst->linesize[2] = src->linesize[2]; - return 0; -} - -int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, - enum AVPixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright, - int *color) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); - uint8_t *optr; - int y_shift; - int x_shift; - int yheight; - int i, y; - int max_step[4]; - - if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) - return -1; - - if (!is_yuv_planar(desc)) { - if (src) - return -1; //TODO: Not yet implemented - - av_image_fill_max_pixsteps(max_step, NULL, desc); - - if (padtop || padleft) { - memset(dst->data[0], color[0], - dst->linesize[0] * padtop + (padleft * max_step[0])); - } - - if (padleft || padright) { - optr = dst->data[0] + dst->linesize[0] * padtop + - (dst->linesize[0] - (padright * max_step[0])); - yheight = height - 1 - (padtop + padbottom); - for (y = 0; y < yheight; y++) { - memset(optr, color[0], (padleft + padright) * max_step[0]); - optr += dst->linesize[0]; - } - } - - if (padbottom || padright) { - optr = dst->data[0] + dst->linesize[0] * (height - padbottom) - - (padright * max_step[0]); - memset(optr, color[0], dst->linesize[0] * padbottom + - (padright * max_step[0])); - } - - return 0; - } - - for (i = 0; i < 3; i++) { - x_shift = i ? desc->log2_chroma_w : 0; - y_shift = i ? desc->log2_chroma_h : 0; - - if (padtop || padleft) { - memset(dst->data[i], color[i], - dst->linesize[i] * (padtop >> y_shift) + (padleft >> x_shift)); - } - - if (padleft || padright) { - optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) + - (dst->linesize[i] - (padright >> x_shift)); - yheight = (height - 1 - (padtop + padbottom)) >> y_shift; - for (y = 0; y < yheight; y++) { - memset(optr, color[i], (padleft + padright) >> x_shift); - optr += dst->linesize[i]; - } - } - - if (src) { /* first line */ - uint8_t *iptr = src->data[i]; - optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) + - (padleft >> x_shift); - memcpy(optr, iptr, (width - padleft - padright) >> x_shift); - iptr += src->linesize[i]; - optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) + - (dst->linesize[i] - (padright >> x_shift)); - yheight = (height - 1 - (padtop + padbottom)) >> y_shift; - for (y = 0; y < yheight; y++) { - memset(optr, color[i], (padleft + padright) >> x_shift); - memcpy(optr + ((padleft + padright) >> x_shift), iptr, - (width - padleft - padright) >> x_shift); - iptr += src->linesize[i]; - optr += dst->linesize[i]; - } - } - - if (padbottom || padright) { - optr = dst->data[i] + dst->linesize[i] * - ((height - padbottom) >> y_shift) - (padright >> x_shift); - memset(optr, color[i],dst->linesize[i] * - (padbottom >> y_shift) + (padright >> x_shift)); - } - } - - return 0; -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif /* FF_API_AVPICTURE */ diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c index 0cc389a28e..e056ea5ef0 100644 --- a/libavcodec/libzvbi-teletextdec.c +++ b/libavcodec/libzvbi-teletextdec.c @@ -641,7 +641,6 @@ static int teletext_decode_frame(AVCodecContext *avctx, void *data, int *got_sub TeletextContext *ctx = avctx->priv_data; AVSubtitle *sub = data; int ret = 0; - int j; if (!ctx->vbi) { if (!(ctx->vbi = vbi_decoder_new())) @@ -701,14 +700,6 @@ static int teletext_decode_frame(AVCodecContext *avctx, void *data, int *got_sub if (sub->rects) { sub->num_rects = 1; sub->rects[0] = ctx->pages->sub_rect; -#if FF_API_AVPICTURE -FF_DISABLE_DEPRECATION_WARNINGS - for (j = 0; j < 4; j++) { - sub->rects[0]->pict.data[j] = sub->rects[0]->data[j]; - sub->rects[0]->pict.linesize[j] = sub->rects[0]->linesize[j]; - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif } else { ret = AVERROR(ENOMEM); } diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index 9c59a2297f..eaf069017a 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -596,20 +596,6 @@ static int display_end_segment(AVCodecContext *avctx, void *data, if (!ctx->forced_subs_only || ctx->presentation.objects[i].composition_flag & 0x40) memcpy(sub->rects[i]->data[1], palette->clut, sub->rects[i]->nb_colors * sizeof(uint32_t)); - -#if FF_API_AVPICTURE -FF_DISABLE_DEPRECATION_WARNINGS -{ - AVSubtitleRect *rect; - int j; - rect = sub->rects[i]; - for (j = 0; j < 4; j++) { - rect->pict.data[j] = rect->data[j]; - rect->pict.linesize[j] = rect->linesize[j]; - } -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif } return 1; } diff --git a/libavcodec/tests/.gitignore b/libavcodec/tests/.gitignore index 92aab1b73c..69bf891f44 100644 --- a/libavcodec/tests/.gitignore +++ b/libavcodec/tests/.gitignore @@ -11,7 +11,6 @@ /h265_levels /htmlsubtitles /iirfilter -/imgconvert /jpeg2000dwt /mathops /mjpegenc_huffman diff --git a/libavcodec/tests/imgconvert.c b/libavcodec/tests/imgconvert.c deleted file mode 100644 index aefc324bf5..0000000000 --- a/libavcodec/tests/imgconvert.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Misc image conversion routines - * Copyright (c) 2001, 2002, 2003 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "libavcodec/imgconvert.c" - -#if FF_API_AVPICTURE -FF_DISABLE_DEPRECATION_WARNINGS -int main(void){ - int i; - int err=0; - int skip = 0; - - for (i=0; iname) { - skip ++; - continue; - } - if (skip) { - av_log(NULL, AV_LOG_INFO, "%3d unused pixel format values\n", skip); - skip = 0; - } - av_log(NULL, AV_LOG_INFO, "pix fmt %s yuv_plan:%d avg_bpp:%d\n", desc->name, is_yuv_planar(desc), av_get_padded_bits_per_pixel(desc)); - } - return err; -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif /* FF_API_AVPICTURE */ diff --git a/libavcodec/version.h b/libavcodec/version.h index a785e18c9e..c502dd4fa9 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -54,9 +54,6 @@ #ifndef FF_API_CODED_FRAME #define FF_API_CODED_FRAME (LIBAVCODEC_VERSION_MAJOR < 59) #endif -#ifndef FF_API_AVPICTURE -#define FF_API_AVPICTURE (LIBAVCODEC_VERSION_MAJOR < 59) -#endif #ifndef FF_API_VBV_DELAY #define FF_API_VBV_DELAY (LIBAVCODEC_VERSION_MAJOR < 59) #endif diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index 87ac910577..caab330ed3 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -134,20 +134,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, ((uint32_t *)sub->rects[0]->data[1])[i] |= (unsigned)*buf++ << 24; } -#if FF_API_AVPICTURE -FF_DISABLE_DEPRECATION_WARNINGS -{ - AVSubtitleRect *rect; - int j; - rect = sub->rects[0]; - for (j = 0; j < 4; j++) { - rect->pict.data[j] = rect->data[j]; - rect->pict.linesize[j] = rect->linesize[j]; - } -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif - // process RLE-compressed data if ((ret = init_get_bits8(&gb, buf, buf_end - buf)) < 0) return ret; diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c index 9139159c98..53fcb76656 100644 --- a/libavcodec/xsubenc.c +++ b/libavcodec/xsubenc.c @@ -132,19 +132,6 @@ static int xsub_encode(AVCodecContext *avctx, unsigned char *buf, if (h->num_rects != 1) av_log(avctx, AV_LOG_WARNING, "Only single rects supported (%d in subtitle.)\n", h->num_rects); -#if FF_API_AVPICTURE -FF_DISABLE_DEPRECATION_WARNINGS - if (!h->rects[0]->data[0]) { - AVSubtitleRect *rect = h->rects[0]; - int j; - for (j = 0; j < 4; j++) { - rect->data[j] = rect->pict.data[j]; - rect->linesize[j] = rect->pict.linesize[j]; - } - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif - // TODO: render text-based subtitles into bitmaps if (!h->rects[0]->data[0] || !h->rects[0]->data[1]) { av_log(avctx, AV_LOG_WARNING, "No subtitle bitmap available.\n");