From patchwork Fri Nov 27 01:02:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24089 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id EAA68449584 for ; Fri, 27 Nov 2020 03:12:41 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6E5C468BB9B; Fri, 27 Nov 2020 03:07:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BE86168BAD4 for ; Fri, 27 Nov 2020 03:07:22 +0200 (EET) Received: by mail-wr1-f66.google.com with SMTP id t4so3917734wrr.12 for ; Thu, 26 Nov 2020 17:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EDPFVsbRF08uLbQwjR07+gAmkBSVCdDazBhQUkD/8H0=; b=nPY6PBrJ6Dfl2ecxR22qrfDW6o2aCDrsHvBBsv7jL8cC4SNhMdT2hykVpyBcVpN7lD OYdwn2KGGkzNTHCwo8/SlINQSTNBBK936c3f2bVZ6zjZbsWgvssccbTntxJssl66rWkO d4VEgYsR28Bni3mERj+2PQ0CqXfVm4kHTQfmuKvLX++A0Um14nBVCTTMbib7PDIkxTvD oCq8HyXjqCH1aBdJR+m86vExBCDH2mZLmV+WvIgcUCaa920N/oL8XZLz/HgJ0GAsHZw+ XgVn909oQzuciWjWhAoL1hnVdmLl0Jq7fkN+p28lCqsyJsy4beh8/SNIMiogEZ07Kocx rtSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EDPFVsbRF08uLbQwjR07+gAmkBSVCdDazBhQUkD/8H0=; b=NEO7Vhy5z85wRr8T3wM02CEJO6DerosHr8NwAjt1R+ZOUk2CzNCr5v7SHPuGPj/aPl bOxFpN5a0IuwGjR6rtHMwWPoBjyNAAlyECvMYi8uhMWrQQlL0uHixhZRaN/wrbjOptrJ w+C+68BvV4DAzI6xRGL5xMLnO8P1/Gts0mAk2O3twcJM011yGTiRrXUfDacfnhA+MbbE O/Svd3Sk6qWxIfvfX0/YXkXir4vesYS+Vv8SgtQ6EP885qnkmtAnLUn5I5aoRzhex3W6 V8ZHuCTh1U8blvooigmn6JmguPt8yI+tF+JIHHUuQqFnhmYGdUB8z52BwQQpug7L2nFA v1Aw== X-Gm-Message-State: AOAM533TTJuoldFZEXHXyUl94h3TElacWpsFw2br6g1lt4qhHzgC3b1I C9IMd4+MCp7ZnLURRqh/GntmefwynH/7Rg== X-Google-Smtp-Source: ABdhPJxeDBnKXr1IrDhotpgtWRq6lUDyHaMdpMd0XWbSd3tBoKbO3V3ph4KgAZcpq9zo/Hb9s0pQ3Q== X-Received: by 2002:a5d:6852:: with SMTP id o18mr7068534wrw.336.1606439242059; Thu, 26 Nov 2020 17:07:22 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id l8sm10504450wro.46.2020.11.26.17.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 17:07:21 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 27 Nov 2020 02:02:45 +0100 Message-Id: <20201127010249.2724610-41-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201127010249.2724610-1-andreas.rheinhardt@gmail.com> References: <20201127010249.2724610-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 41/45] avcodec/smvjpegdec: Remove unused MJpegDecodeContext X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The SMV JPEG uses the Motion JPEG decoder internally, but it does so by opening a decoder instance via avcodec_open2(); this means that the Motion JPEG decoder has its own context and its own private data; so there is no need to add a MJpegDecodeContext at the beginning of the SMV JPEG decoder's structure. In other words: The one that is already there can be removed (it is unused anyway). This reduces sizeof(SMVJpegDecodeContext) from 4576 to 32 bytes here. Signed-off-by: Andreas Rheinhardt --- libavcodec/smvjpegdec.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c index c134fdc685..72c8f34370 100644 --- a/libavcodec/smvjpegdec.c +++ b/libavcodec/smvjpegdec.c @@ -25,14 +25,14 @@ */ // #define DEBUG +#include "libavutil/avassert.h" +#include "libavutil/intreadwrite.h" #include "avcodec.h" #include "libavutil/opt.h" #include "libavutil/imgutils.h" -#include "mjpegdec.h" #include "internal.h" typedef struct SMVJpegDecodeContext { - MJpegDecodeContext jpg; AVFrame *picture[2]; /* pictures array */ AVCodecContext* avctx; int frames_per_jpeg; @@ -78,9 +78,7 @@ static inline void smv_img_pnt(uint8_t *dst_data[4], uint8_t *src_data[4], static av_cold int smvjpeg_decode_end(AVCodecContext *avctx) { SMVJpegDecodeContext *s = avctx->priv_data; - MJpegDecodeContext *jpg = &s->jpg; - jpg->picture_ptr = NULL; av_frame_free(&s->picture[0]); av_frame_free(&s->picture[1]); avcodec_free_context(&s->avctx); @@ -108,8 +106,6 @@ static av_cold int smvjpeg_decode_init(AVCodecContext *avctx) if (!s->picture[1]) return AVERROR(ENOMEM); - s->jpg.picture_ptr = s->picture[0]; - codec = avcodec_find_decoder(AV_CODEC_ID_MJPEG); if (!codec) { av_log(avctx, AV_LOG_ERROR, "MJPEG codec not found\n");