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 0C03249D0A for ; Sat, 8 Jun 2024 09:05:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F3E3D68D67F; Sat, 8 Jun 2024 12:05:38 +0300 (EEST) Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 092ED68D65A for ; Sat, 8 Jun 2024 12:05:31 +0300 (EEST) Received: from 0a640b2b8f6cec0d64b76f5ca22489a1 ([1.145.185.203]) (authenticated (0 bits)) by mx.sdf.org (8.16.1/8.14.3) with ESMTPSA id 45895PwU010935 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Sat, 8 Jun 2024 09:05:29 GMT Date: Sat, 8 Jun 2024 19:05:20 +1000 From: Peter Ross To: ffmpeg-devel@ffmpeg.org Message-ID: References: <5b83443361479c11a5975c8dd308375a0f101e59.1717837373.git.pross@xvid.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5b83443361479c11a5975c8dd308375a0f101e59.1717837373.git.pross@xvid.org> Subject: [FFmpeg-devel] [PATCH 2/4] mm: decode partial palette 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: --- palette decoding now conforms to description at https://wiki.multimedia.cx/index.php/IBM_PhotoMotion libavcodec/mmvideo.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index 3038d9ea92..b5b6ffd25b 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -79,12 +79,10 @@ static av_cold int mm_decode_init(AVCodecContext *avctx) static void mm_decode_pal(MmContext *s) { int i; - - bytestream2_skip(&s->gb, 4); - for (i = 0; i < 128; i++) { - s->palette[i] = 0xFFU << 24 | bytestream2_get_be24(&s->gb); - s->palette[i+128] = s->palette[i]<<2; - } + int start = bytestream2_get_le16(&s->gb); + int count = bytestream2_get_le16(&s->gb); + for (i = 0; i < count; i++) + s->palette[start+i] = 0xFFU << 24 | (bytestream2_get_be24(&s->gb) << 2); } /** -- 2.43.0 -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) _______________________________________________ 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".