From patchwork Fri Nov 20 07:19:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23775 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 98425449F1B for ; Fri, 20 Nov 2020 09:29:01 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D965468BA19; Fri, 20 Nov 2020 09:24:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3B42768BA11 for ; Fri, 20 Nov 2020 09:24:38 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id gj5so11498113ejb.8 for ; Thu, 19 Nov 2020 23:24:38 -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=yL1GJc3DBEpZVjRsloBwR1+wsXSQKilFx3GbcKMyGYc=; b=J3nYTYBtRgqQSk1GglvmQO9EK/9WTTPYBfAxmMgMHBqj9BJ3Um8Qb0LpJuE1vYsBLQ OreDF6rQjDYN5fww7PnMYxC3wO117MPASWolczpz9mOqhKgidwEz7t7McQFKF6IFjQnx 2yz+dt/PgK+B2WwF7Wacj/m3tC+1Q+HKTXS8tKgz1kg2TPVy/Apc3CyPxg5F3leTGfku JmhTTUyeFK0Q5ziEQVNdNLxjbBrycbxTQsVFvEvDw9jTOTp9lKZ3jfeVeRxVxIiq0TrS 0o6V14OKDwmm/viMbL9FVrffDCa6h5vB3NypxpbNYD529m6zE3Pc2w9o/YOv/bKGEVWp k1sA== 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=yL1GJc3DBEpZVjRsloBwR1+wsXSQKilFx3GbcKMyGYc=; b=WMcqNSMi/IrJ0xFYip90N4zwnLdMLkkd0e9fBls7SsuejCkQWmxSlSQe0TFr8s5/GI ci5Nix4cdEDkjQ/FpWYSA9KnGGIKW1J9Y0PR+ZNf5QV2zVQX4XORVGU5wZsGcldQ87aO uVO+VHnxQaLR+moE5AelzeEvKu/VvKfbNOTKK52d8sk2bvDS6Nut8nI2Xf6EMAl3ibdT NKyMWiQMuLnXa45rm+IYfCtO8hg+uVV9hp8JAv9Ze3M89vLSZ0XnIhm+LftszClBod3+ Ws7VIBjaiwEj8A48+ynHSVMkBHWqlpiwjuhwhdJCcApSjZOpa7mqN6rmF+OFTJfvLlZr 8xqQ== X-Gm-Message-State: AOAM530e6Z+PEsxNVi0gvEjWGriFKVh4Kfyo6tfXzaT2Jcf/CvWzk0WP TvTN2l9jqG2uKVJhHbtOnNgtyfnOFzyIrQ== X-Google-Smtp-Source: ABdhPJzZwoiTiFSkWYjBN7RZYpxC3v+6JKkHHV2i3ZRV+Xx7KKAtnyxPf9FleN4lr+Kig82cR7ZCMw== X-Received: by 2002:a17:906:af47:: with SMTP id ly7mr33407629ejb.532.1605857077413; Thu, 19 Nov 2020 23:24:37 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id lz27sm779419ejb.39.2020.11.19.23.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:36 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:00 +0100 Message-Id: <20201120072116.818090-28-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201120072116.818090-1-andreas.rheinhardt@gmail.com> References: <20201120072116.818090-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 027/162] avcodec/cook: Apply offset when initializing VLC table 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/cook.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index f22fd02209..7756098d97 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -200,7 +200,7 @@ static av_cold int init_cook_vlc_tables(COOKContext *q) result |= ff_init_vlc_from_lengths(&q->envelope_quant_index[i], 9, 24, envelope_quant_index_huffbits[i], 1, envelope_quant_index_huffsyms[i], 1, 1, - 0, 0, q->avctx); + -12, 0, q->avctx); } av_log(q->avctx, AV_LOG_DEBUG, "sqvh VLC init\n"); for (i = 0; i < 7; i++) { @@ -385,7 +385,7 @@ static int decode_envelope(COOKContext *q, COOKSubpacket *p, j = get_vlc2(&q->gb, q->envelope_quant_index[vlc_index - 1].table, q->envelope_quant_index[vlc_index - 1].bits, 2); - quant_index_table[i] = quant_index_table[i - 1] + j - 12; // differential encoding + quant_index_table[i] = quant_index_table[i - 1] + j; // differential encoding if (quant_index_table[i] > 63 || quant_index_table[i] < -63) { av_log(q->avctx, AV_LOG_ERROR, "Invalid quantizer %d at position %d, outside [-63, 63] range\n",