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 8820F48106 for ; Mon, 11 Dec 2023 01:48:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0DE4E68D213; Mon, 11 Dec 2023 03:45:21 +0200 (EET) Received: from ssq0.pkh.me (laubervilliers-656-1-228-164.w92-154.abo.wanadoo.fr [92.154.28.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D689768D17E for ; Mon, 11 Dec 2023 03:44:56 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1702259079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TGHCzCQ94hicvOziMSjO14joTgfRM5H8/NtMlOi6ayw=; b=U8q0TUaoV7u+5FoGK3mTlZQEIB9pGWZZ+mTJge4YprpmTARTgejYd32ke+LQaqhgVyMxDd XvpBW7lu2BER5BxEFVMAUAP+dUcUo8DsCxF/wvo1Cp4g0j6RHqDHwbFA2um/Vh6SxniKzf bLjKOz4uWaX/M60xfjslNv2mvrZkHZU= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id f6f82f3c; Mon, 11 Dec 2023 01:44:39 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Dec 2023 02:35:30 +0100 Message-ID: <20231211014429.1841681-30-u@pkh.me> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231211014429.1841681-1-u@pkh.me> References: <20231211014429.1841681-1-u@pkh.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 29/35] avcodec/proresenc_anatoliy: replace get_level() with FFABS() 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 Cc: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= 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: This matches the code from proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 0318379461..88c6d47ab7 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -258,13 +258,6 @@ static void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val) #define GET_SIGN(x) ((x) >> 31) #define MAKE_CODE(x) (((x) * 2) ^ GET_SIGN(x)) -static av_always_inline int get_level(int val) -{ - int sign = (val >> 31); - return (val ^ sign) - sign; -} - - static void encode_dcs(PutBitContext *pb, int16_t *blocks, int blocks_per_slice, int scale) { @@ -305,7 +298,7 @@ static void encode_ac_coeffs(PutBitContext *pb, prev_run = run; run = 0; - level = get_level(val); + level = FFABS(val); code = level - 1; encode_vlc_codeword(pb, ff_prores_lev_to_cb[FFMIN(prev_level, 9)], code); -- 2.43.0 _______________________________________________ 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".