From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 3E71F426FC for ; Wed, 24 Aug 2022 08:45:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0D3CB68BA3E; Wed, 24 Aug 2022 11:43:59 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1DB7B68B9E7 for ; Wed, 24 Aug 2022 11:43:50 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id C12AD240D22 for ; Wed, 24 Aug 2022 10:43:47 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 4XI-VTgPL3wa for ; Wed, 24 Aug 2022 10:43:47 +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 D41C8240D24 for ; Wed, 24 Aug 2022 10:43:41 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 8C5C33A2209; Wed, 24 Aug 2022 10:43:35 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Aug 2022 10:43:07 +0200 Message-Id: <20220824084318.333-7-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 07/18] lavc/dv: do not pass DVVideoContext to dv_calculate_mb_xy() 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Pass the two variables needed from it directly. This is done in preparation to splitting DVVideoContext. --- libavcodec/dv.h | 5 +++-- libavcodec/dvdec.c | 2 +- libavcodec/dvenc.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libavcodec/dv.h b/libavcodec/dv.h index 286b267de2..6430688795 100644 --- a/libavcodec/dv.h +++ b/libavcodec/dv.h @@ -107,7 +107,8 @@ static inline int dv_work_pool_size(const AVDVProfile *d) return size; } -static inline void dv_calculate_mb_xy(const DVVideoContext *s, +static inline void dv_calculate_mb_xy(const AVDVProfile *sys, + const uint8_t *buf, const DVwork_chunk *work_chunk, int m, int *mb_x, int *mb_y) { @@ -116,7 +117,7 @@ static inline void dv_calculate_mb_xy(const DVVideoContext *s, /* We work with 720p frames split in half. * The odd half-frame (chan == 2,3) is displaced :-( */ - if (s->sys->height == 720 && !(s->buf[1] & 0x0C)) + if (sys->height == 720 && !(buf[1] & 0x0C)) /* shifting the Y coordinate down by 72/2 macro blocks */ *mb_y -= (*mb_y > 17) ? 18 : -72; } diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 1e2c097ed0..7f9e4eb0c0 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -535,7 +535,7 @@ retry: block = &sblock[0][0]; mb = mb_data; for (mb_index = 0; mb_index < 5; mb_index++) { - dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y); + dv_calculate_mb_xy(s->sys, s->buf, work_chunk, mb_index, &mb_x, &mb_y); /* idct_put'ting luminance */ if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) || diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c index 712ca325de..c12fce9e8b 100644 --- a/libavcodec/dvenc.c +++ b/libavcodec/dvenc.c @@ -866,7 +866,7 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg) p = dif = &s->buf[work_chunk->buf_offset * 80]; enc_blk = &enc_blks[0]; for (mb_index = 0; mb_index < 5; mb_index++) { - dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y); + dv_calculate_mb_xy(s->sys, s->buf, work_chunk, mb_index, &mb_x, &mb_y); qnos[mb_index] = DV_PROFILE_IS_HD(s->sys) ? 1 : 15; -- 2.35.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".