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 8E20D48830 for ; Thu, 18 Jul 2024 08:22:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0F8F968D999; Thu, 18 Jul 2024 11:22:47 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9872668D87E for ; Thu, 18 Jul 2024 11:22:40 +0300 (EEST) Authentication-Results: mail0.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=XRDu4vH7; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 42B3F240DB8 for ; Thu, 18 Jul 2024 10:22:40 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id qLsajtgoZHq0 for ; Thu, 18 Jul 2024 10:22:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1721290959; bh=oBIAIjPeD9ipx/zEwJH4z6BI5DWZj6XJ922PUmVo3zU=; h=Subject:From:To:In-Reply-To:References:Date:From; b=XRDu4vH7kK0km9s269jwyMYNj7OVA/AO6OJVR47LB/2jJiBcyhGEm0r45MM7qatK1 5Nj1up/kqAbWSA18w13QpM3V42SXdubhkVKfJ1QaxP92j8BWconlIdH+JT3rSLCYHx ti76PQC2JDLrrZ5wJnd09cxNRsavXXzBhvNXoTGh+SeynBXuFKXWTiNo8KylklW92o F+SoIswQnt26azlOjbYtgBNEAySEtrnrYj4QN9iPju1IzaTaBsIalAWJUYt03+NZmZ 5MkS6aYyuMtME2TFOcAMjQgrstd2vn9oFPl4JRBytDfdTeioOub0VhMpvyXjppCwGg 4z7Usym+KL+TQ== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (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 "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id E3349240DB7 for ; Thu, 18 Jul 2024 10:22:39 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id D07101601B9; Thu, 18 Jul 2024 10:22:39 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20240717223725.GX4991@pb2> References: <20240716171155.31838-1-anton@khirnov.net> <20240716171155.31838-12-anton@khirnov.net> <20240717223725.GX4991@pb2> Mail-Followup-To: FFmpeg development discussions and patches Date: Thu, 18 Jul 2024 10:22:39 +0200 Message-ID: <172129095983.21847.8644924027474085419@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 12/39] lavc/ffv1: drop redundant FFV1Context.quant_table 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: Quoting Michael Niedermayer (2024-07-18 00:37:25) > On Tue, Jul 16, 2024 at 07:11:27PM +0200, Anton Khirnov wrote: > > In all cases except decoding version 1 it's either not used, or contains > > a copy of a table from quant_tables, which we can just as well use > > directly. > > > > When decoding version 1, we can just as well decode into > > quant_tables[0], which would otherwise be unused. > > --- > > libavcodec/ffv1.h | 1 - > > libavcodec/ffv1dec.c | 10 +++++++--- > > libavcodec/ffv1enc.c | 6 ++---- > > 3 files changed, 9 insertions(+), 8 deletions(-) > > the code is 1 line longer and using the first entry as a special > case doesnt seem simpler The simplicity is in the fact it's actually not special at all. quant_tables[quant_table_idx] is always the location of the quant table for any bitstream version, so the rest of the code does not need to care. -- Anton Khirnov _______________________________________________ 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".