From patchwork Wed Aug 24 08:43:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 37434 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2370952pzh; Wed, 24 Aug 2022 01:43:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR6dfUSHcavviwpcxDqEjgYSJwhEKZ3nP5+aZcr/ust9mrdtMXp2s1fMz2JTPnx+8pkoupDM X-Received: by 2002:a17:907:868a:b0:73d:6ec5:82bb with SMTP id qa10-20020a170907868a00b0073d6ec582bbmr2254578ejc.225.1661330636032; Wed, 24 Aug 2022 01:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661330636; cv=none; d=google.com; s=arc-20160816; b=yUo6hfb5PMqAcR+PwPR1n5MQSLOTUVvMLAYPgxrONeI5bRTyBofzmQ71ff7wK3Umsq 4oFk/RYYxQn64GGEM9p0Pb+K77yrY+hAU/ROOMcGEkYHB8OwIk7iBtINmYLfXWA9tCss 3BhzBGrE1hNFpqf+JSQNzg5Pl7n3wvYDDpaoolu95jodPm1lrW7WIfivxUmPDrbeeCHN P0TL8l6w8p30G6rM8HQoWBfJnPYj3FDCVxwIKsCfaPv2mKtV++NC1joR0PYmApPbniP1 1HwT/J92H+SfLPMN/Sx8g+gV5Sbj9/UXTcCydri0b3e10RtInAfiBuBj/hPkxh41egSp qYxg== 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:delivered-to; bh=rg77o6D/MCcQAp/4uyUAtoqs+uqpYgBZZ/xvdEvnQLo=; b=mneyHfHupnp9Sepdd/TRrblugQx4hkYcd4ZitMb0fRTvyWZIs9be9KTA5nIzyD/Cak M2fCVRsABmZAbgXhzVzMJDGpNCRJXT8+4DYidIxRJ+NIFqaTOfSlfFLuT7IVgmdKIIkD TnahzXsHhbz0oIuUl8SzSKnNEfmyHFg0q73zpAIDTEAj3I4bd5KvqDEQxvo4xKLw4xxr sHPLHAXf4PQ9E8dYz6ecVJlB5ETOK3OWGx1TLQf+qtPjumleqmGSWPoXuFt3DxF0XXmN hsJc+Hrt7NIrKMywYUkT7IR4CEj1+om8IkiG+I19Pfe23+U7R31ysrNKkq9+hHozS0ER 8IQg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d2-20020a170906370200b00733069541b8si1322280ejc.102.2022.08.24.01.43.54; Wed, 24 Aug 2022 01:43:56 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 947D868B9EC; Wed, 24 Aug 2022 11:43:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 977C068B73A for ; Wed, 24 Aug 2022 11:43:43 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id A0516240D29 for ; Wed, 24 Aug 2022 10:43:42 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 7rr_UCza8zNC for ; Wed, 24 Aug 2022 10:43:41 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 96A24240D1A for ; Wed, 24 Aug 2022 10:43:41 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 880933A21EE; Wed, 24 Aug 2022 10:43:35 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Aug 2022 10:43:06 +0200 Message-Id: <20220824084318.333-6-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220824084318.333-1-anton@khirnov.net> References: <20220824084318.333-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 06/18] lavc/dv: do not pass DVVideoContext to ff_dv_init_dynamic_tables() 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: CfhQIOU/npLc It only needs work_chunks from it, so pass that directly. This is done in preparation to splitting DVVideoContext. --- libavcodec/dv.c | 6 +++--- libavcodec/dv.h | 2 +- libavcodec/dvdec.c | 2 +- libavcodec/dvenc.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 9e05aa8927..b5e54de5dd 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -162,7 +162,7 @@ static inline void dv_calc_mb_coordinates(const AVDVProfile *d, int chan, } } -int ff_dv_init_dynamic_tables(DVVideoContext *ctx, const AVDVProfile *d) +int ff_dv_init_dynamic_tables(DVwork_chunk *work_chunks, const AVDVProfile *d) { int j, i, c, s, p; @@ -174,8 +174,8 @@ int ff_dv_init_dynamic_tables(DVVideoContext *ctx, const AVDVProfile *d) p += !(j % 3); if (!(DV_PROFILE_IS_1080i50(d) && c != 0 && s == 11) && !(DV_PROFILE_IS_720p50(d) && s > 9)) { - dv_calc_mb_coordinates(d, c, s, j, &ctx->work_chunks[i].mb_coordinates[0]); - ctx->work_chunks[i++].buf_offset = p; + dv_calc_mb_coordinates(d, c, s, j, &work_chunks[i].mb_coordinates[0]); + work_chunks[i++].buf_offset = p; } p += 5; } diff --git a/libavcodec/dv.h b/libavcodec/dv.h index 2b082d0140..286b267de2 100644 --- a/libavcodec/dv.h +++ b/libavcodec/dv.h @@ -95,7 +95,7 @@ enum dv_pack_type { */ #define DV_MAX_BPM 8 -int ff_dv_init_dynamic_tables(DVVideoContext *s, const AVDVProfile *d); +int ff_dv_init_dynamic_tables(DVwork_chunk *work_chunks, const AVDVProfile *d); static inline int dv_work_pool_size(const AVDVProfile *d) { diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index daee2347e6..1e2c097ed0 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -626,7 +626,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, } if (sys != s->sys) { - ret = ff_dv_init_dynamic_tables(s, sys); + ret = ff_dv_init_dynamic_tables(s->work_chunks, sys); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error initializing the work tables.\n"); return ret; diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c index 8027feb9b3..712ca325de 100644 --- a/libavcodec/dvenc.c +++ b/libavcodec/dvenc.c @@ -67,7 +67,7 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - ret = ff_dv_init_dynamic_tables(s, s->sys); + ret = ff_dv_init_dynamic_tables(s->work_chunks, s->sys); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error initializing work tables.\n"); return ret;