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 7F243473DB for ; Sat, 7 Oct 2023 00:15:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 48E5168CACD; Sat, 7 Oct 2023 03:14:55 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A791A68C94F for ; Sat, 7 Oct 2023 03:14:47 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C77B940002 for ; Sat, 7 Oct 2023 00:14:46 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 7 Oct 2023 02:14:43 +0200 Message-Id: <20231007001444.31861-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231007001444.31861-1-michael@niedermayer.cc> References: <20231007001444.31861-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/ffv1: Store and reuse sx/sy 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 MIME-Version: 1.0 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: Signed-off-by: Michael Niedermayer --- libavcodec/ffv1.c | 2 ++ libavcodec/ffv1.h | 1 + libavcodec/ffv1enc.c | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index b6204740edb..f44fead350b 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -129,6 +129,8 @@ av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f) fs->slice_height = sye - sys; fs->slice_x = sxs; fs->slice_y = sys; + fs->sx = sx; + fs->sy = sy; fs->sample_buffer = av_malloc_array((fs->width + 6), 3 * MAX_PLANES * sizeof(*fs->sample_buffer)); diff --git a/libavcodec/ffv1.h b/libavcodec/ffv1.h index 04869da5c9a..14e40936065 100644 --- a/libavcodec/ffv1.h +++ b/libavcodec/ffv1.h @@ -129,6 +129,7 @@ typedef struct FFV1Context { int slice_height; int slice_x; int slice_y; + int sx, sy; int slice_reset_contexts; int slice_coding_mode; int slice_rct_by_coef; diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index 4d0ddc167ae..11be7fe32ea 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -912,8 +912,8 @@ static void encode_slice_header(FFV1Context *f, FFV1Context *fs) int j; memset(state, 128, sizeof(state)); - put_symbol(c, state, (fs->slice_x +1)*f->num_h_slices / f->width , 0); - put_symbol(c, state, (fs->slice_y +1)*f->num_v_slices / f->height , 0); + put_symbol(c, state, fs->sx, 0); + put_symbol(c, state, fs->sy, 0); put_symbol(c, state, 0, 0); put_symbol(c, state, 0, 0); for (j=0; jplane_count; j++) { -- 2.17.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".