From patchwork Mon Dec 11 01:35:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= X-Patchwork-Id: 45039 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp2652056pzf; Sun, 10 Dec 2023 17:46:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFENTgIvvRhIy5hN3XFr9c3XUs2JbaDnsOlsx4J/y7pyjzSntK8hBrnqRJUl7D3dxn7FDik X-Received: by 2002:a50:8e12:0:b0:54c:5419:c16c with SMTP id 18-20020a508e12000000b0054c5419c16cmr1553143edw.70.1702259194663; Sun, 10 Dec 2023 17:46:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702259194; cv=none; d=google.com; s=arc-20160816; b=XOeFC1a8ZEPRtVmg2fDfrxtekGYaC1nGfJUc7xYs+GadwevHQGfriXy3x2jiDh1mjR IgF+hKIFbb9Np5mVOcNO5hzeuPqbvUPP8jtPeTlxeRtBUBq8VAz8mQvNe0A37VpFD/9q jIFW6shzT9/s1j4nILrHdosWaMZc0/jtnCPQuekK5x0Thxu+x8DKJeHlf8thcRX/D2jP Gr2hz90pwO/ITb1KWLO4YZAsdEi1Uyhep0ziKf/KZbWX9K7EooukZs9LX2+aEYofS4lI CnK7rcxQwZG0rI1QIHilKXZ6EflZp6lEEcR1C8DovlU6djReav6qBt8B/fP7UeouARb4 /RSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=7IPTRzLaGZnblwWP/cV3v8rdmJuQoaTB46lUBl0tj60=; fh=Jgo3TCyoG8OdFLqA8BuM7Wbf1w27210JU6p+E8x39/M=; b=I8GURClsYawrA4kIYGekBJvOOqMBvNPVPwB6nJ0dhNfotv5mapHx2DS+4bXTBlNjR3 RNYqTQyxHPvLYEouB2NEvt5DyxDgDKcDHN1UmwKmrTEoLbH/tCb3ZsgjojGbpeXvPZWg B1bKfglEhLPlidGGeoWq8r/vuzmOgkYWRsPAl37CzxGaBiVErefV67AfsZ0cE75fpvv8 /lJb+zNYAcxotGPnzm26PLOdn25DzuOfF+GMfj/fkQCjqVb+NBmbvbTdHT7Kc7RFSbd2 6eoyyP69bXMcCA4AVrFJZdrJ8NCwgIzlCOwAoQyu6EGgQ0FCWe0KPwX4onybBypManuJ pbaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b=ERbPGFOp; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=pkh.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id di8-20020a056402318800b0054ca37a260bsi3106964edb.654.2023.12.10.17.46.34; Sun, 10 Dec 2023 17:46:34 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b=ERbPGFOp; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=pkh.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DE8F068D1B7; Mon, 11 Dec 2023 03:45:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 E00F368D160 for ; Mon, 11 Dec 2023 03:44:55 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1702259076; 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=V/LW2F0cbsHdOlWpnT7MfKgchK8fF2bqSRdg1aaOIq0=; b=ERbPGFOpM0vDyfbLZIr3RyEscnLnRpAXJ8B3w+/wddxwjzPtLB9AY4ImreQknAzXSWj+AC W18mBmazPzF5gfIYajgXT4K5f8bdgiQOzt9Krlv0VwXdB9QufVUiFWned9fAJmHHlLjyJ2 JMFXAriqgg4vjjCMNSyMkTmsxjqomvI= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id 088b1da7; Mon, 11 Dec 2023 01:44:36 +0000 (UTC) From: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Dec 2023 02:35:14 +0100 Message-ID: <20231211014429.1841681-14-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 13/35] avcodec/proresenc_anatoliy: rework encode_codeword() prototype 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?b?Q2zDqW1lbnQgQsWTc2No?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: tArbslLuzOL7 This matches the function of the same name in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index c7e43fc88c..86e436615c 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -226,7 +226,7 @@ static int int_from_list_or_default(void *ctx, const char *val_name, int val, return default_value; } -static void encode_codeword(PutBitContext *pb, int val, unsigned codebook) +static void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val) { unsigned int rice_order, exp_order, switch_bits, switch_val; int exponent; @@ -277,7 +277,7 @@ static void encode_dc_coeffs(PutBitContext *pb, int16_t *in, prev_dc = QSCALE(qmat, 0, in[0] - 16384); code = TO_GOLOMB(prev_dc); - encode_codeword(pb, code, FIRST_DC_CB); + encode_vlc_codeword(pb, FIRST_DC_CB, code); code = 5; sign = 0; idx = 64; for (i = 1; i < blocks_per_slice; i++, idx += 64) { @@ -286,7 +286,7 @@ static void encode_dc_coeffs(PutBitContext *pb, int16_t *in, diff_sign = DIFF_SIGN(delta, sign); new_code = TO_GOLOMB2(get_level(delta), diff_sign); - encode_codeword(pb, new_code, ff_prores_dc_codebook[FFMIN(code, 6)]); + encode_vlc_codeword(pb, ff_prores_dc_codebook[FFMIN(code, 6)], new_code); code = new_code; sign = delta >> 31; @@ -306,14 +306,14 @@ static void encode_ac_coeffs(PutBitContext *pb, for (j = 0; j < blocks_per_slice; j++) { int val = QSCALE(qmat, indp, in[(j << 6) + indp]); if (val) { - encode_codeword(pb, run, ff_prores_run_to_cb[FFMIN(prev_run, 15)]); + encode_vlc_codeword(pb, ff_prores_run_to_cb[FFMIN(prev_run, 15)], run); prev_run = run; run = 0; level = get_level(val); code = level - 1; - encode_codeword(pb, code, ff_prores_lev_to_cb[FFMIN(prev_level, 9)]); + encode_vlc_codeword(pb, ff_prores_lev_to_cb[FFMIN(prev_level, 9)], code); prev_level = level;