From patchwork Tue Nov 10 10:58:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23572 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 73C5244B3E8 for ; Tue, 10 Nov 2020 13:15:18 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5E6F768C0B3; Tue, 10 Nov 2020 12:59:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EE17768C08A for ; Tue, 10 Nov 2020 12:59:30 +0200 (EET) Received: by mail-wr1-f48.google.com with SMTP id p8so11369695wrx.5 for ; Tue, 10 Nov 2020 02:59:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=p/oMjQvxdx07FZpYLcfD90CVwtTdtlHcIvAfgrtfdhg=; b=UMVc/3ibKE1mUAbB0ShB8MlbvUOdafMZ2oxrOBFHGT7iyPOyKqjViih2KEPjCmpq+P X4vN1bWn5zutGPdGIY3gfbJQN68CyIfh19XD3HvogbPVjovXtjI8IPgY+sUKl9o9ntDf TPWn2vzN7tsor/tfrwnkdg/E07J4723MVyjj15/SwI4kHmhrhIagA5C5EqLzsozcyqek or+xIGovMJ/rkfE9r+Fp7st4BX4QdUh5tyrnaeBECpQWEyR2Osg1FruR8VQroscNWZuh AUuKvxMumzKLlZN/p06EpG/ReAXnhow/UOkZyjAQELVP7U0vh8AwaDE2yyPdM/X34gvQ q8tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=p/oMjQvxdx07FZpYLcfD90CVwtTdtlHcIvAfgrtfdhg=; b=XNMRl9FLQcE6BHB6vg+r6kgM03PYe4a5UFTDbYMLDW9ZwPxQqKqmF9e4vmsEAFslmZ ajlcjCfllf6FF20Sj+L+MgAsV0NQu3PDea0olNqCBRPy3FWgk43NqsIvcb7phFMXJ9Ki Us5GKhEfObmGiZyDeZGWvX/vIWhmj/Ba6ZbXzSKkyI8MHlmD9wW1FQFv8GdyHmhgjswg /cRi8g0XyU8ke4b2izVxjhk1D4Ojylk4Sjr8DWPYNaDdrcuVWr+tMQOdTTfsjSHYjhHA SKViFZ1RVs/Eo/SvqipUjzgMpzGRyNKteb+D9SurPOecXn4+ARfoHtbrI1nmTo03cF4E P0Pw== X-Gm-Message-State: AOAM532sVt0E0ihbjNO47z1FYNVyGIePFQm0KNuxPf8uhpWQEgSencbh B1vj2vYv+2jppImhX6Z9tvIgZ8ti9mM= X-Google-Smtp-Source: ABdhPJxoYwUWUqpnQusnsP7XcQz/HLe06Y9AyH/1gOZjKxEtfJ2ORD3UBYuWm+mq3mswvS+8hnkrMg== X-Received: by 2002:adf:fd49:: with SMTP id h9mr24348346wrs.115.1605005970206; Tue, 10 Nov 2020 02:59:30 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id o197sm2561308wme.17.2020.11.10.02.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 02:59:29 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 10 Nov 2020 11:58:29 +0100 Message-Id: <20201110105836.321916-16-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201110104851.321029-1-andreas.rheinhardt@gmail.com> References: <20201110104851.321029-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 107/114] avcodec/hqx: Inline constants X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Rheinhardt --- libavcodec/hqx.c | 4 ++-- libavcodec/hqx.h | 1 + libavcodec/hqxvlc.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c index e2b895ac40..44c6c1883c 100644 --- a/libavcodec/hqx.c +++ b/libavcodec/hqx.c @@ -197,7 +197,7 @@ static int hqx_decode_422a(HQXContext *ctx, int slice_no, int x, int y) int i, ret; int cbp; - cbp = get_vlc2(gb, ctx->cbp_vlc.table, ctx->cbp_vlc.bits, 1); + cbp = get_vlc2(gb, ctx->cbp_vlc.table, HQX_CBP_VLC_BITS, 1); for (i = 0; i < 12; i++) memset(slice->block[i], 0, sizeof(**slice->block) * 64); @@ -283,7 +283,7 @@ static int hqx_decode_444a(HQXContext *ctx, int slice_no, int x, int y) int i, ret; int cbp; - cbp = get_vlc2(gb, ctx->cbp_vlc.table, ctx->cbp_vlc.bits, 1); + cbp = get_vlc2(gb, ctx->cbp_vlc.table, HQX_CBP_VLC_BITS, 1); for (i = 0; i < 16; i++) memset(slice->block[i], 0, sizeof(**slice->block) * 64); diff --git a/libavcodec/hqx.h b/libavcodec/hqx.h index 42d382de1f..50d60f9e03 100644 --- a/libavcodec/hqx.h +++ b/libavcodec/hqx.h @@ -77,6 +77,7 @@ typedef struct HQXContext { VLC dc_vlc[3]; } HQXContext; +#define HQX_CBP_VLC_BITS 5 #define HQX_DC_VLC_BITS 9 extern const HQXAC ff_hqx_ac[NUM_HQX_AC]; diff --git a/libavcodec/hqxvlc.c b/libavcodec/hqxvlc.c index 06a8073661..7ab2427660 100644 --- a/libavcodec/hqxvlc.c +++ b/libavcodec/hqxvlc.c @@ -2150,7 +2150,7 @@ const HQXAC ff_hqx_ac[NUM_HQX_AC] = { av_cold int ff_hqx_init_vlcs(HQXContext *ctx) { - int ret = init_vlc(&ctx->cbp_vlc, 5, FF_ARRAY_ELEMS(cbp_vlc_lens), + int ret = init_vlc(&ctx->cbp_vlc, HQX_CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_vlc_lens), cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0); if (ret < 0) return ret;