From patchwork Tue Nov 10 10:47:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23488 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 23A0944B3FF for ; Tue, 10 Nov 2020 12:54:24 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 44D3968BE08; Tue, 10 Nov 2020 12:49:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C404268BDFA for ; Tue, 10 Nov 2020 12:49:43 +0200 (EET) Received: by mail-wm1-f65.google.com with SMTP id c9so2513583wml.5 for ; Tue, 10 Nov 2020 02:49:43 -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=X16zXXtRQW30vgwzsy/V0V/HbDjoedjcabd1xNIVCCg=; b=AZKyHSzoh7S163QPg7kvFKIGPgP10Zt4OzkAfvQ0vSUJSvMqKySDbChyYVcBOuIY4u 3ssnl1JPmVQvIBVvN8UWJ4FHU5+88tL9nWTz2E+X0EpZ3LqisSYSAhMVCgP4P/sfie2P R6IzO5XnOq5uUEOmpId14jaXC8YkInRX/PLlR2h3sTSXpaVA4lZkIPGJtQC22FVN9N1Y ROTJIE7w8WX+opn9nxzQVIsMEGgYxWY6V96OQMIDhSJikC0p7Odxc3Qlrdl6LqaCFzne YcU+9XCchyns0QeKed6LpcMBw6wYljxlyKefC/DSjI1ChjvaZqFrOdDXJlLa3v2jl8gF vgqQ== 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=X16zXXtRQW30vgwzsy/V0V/HbDjoedjcabd1xNIVCCg=; b=nNb0tgvJrL2s9kofyXISA9a3DG1MDXZhnHjYhjbTVafNdTEqNhDWXgDaxgp95q1+c6 shtrWtYEtuXM41K06lXJou8v+6KSL4Umg35LEx7vKmDF64oYICgtYFXz2meoyPBbVoTw Ywt2mFhYQW6xIfqz9PP8ckfOdYK6Dlw6dKtroJTmG7A0+G2L4T6aIgAXFE1qioxSYuV4 NftYMENqVbexOGZQ8/P/5pSQeBzFyb9bYtuC5Mve+COJfw89GUo6n68LMDBiMZfMm4Vv fr//vGVZp/np8RU1l4ZZMoocPSva8K+cFjahW5xJJ34QSGl/7g/UIPo+wi1vh/EZd32u zdUw== X-Gm-Message-State: AOAM531G0eCUDoqeFbu4cmywNFChZ3HWn5o5u0x8vY2yflM2ny8y84OZ JigVTgjHKPWm6XQU0CajkUb5KTtkZMo= X-Google-Smtp-Source: ABdhPJyRQf5yuGd6pJjyz417MM0S5ECe7jKxC5JVydhAOIO/rbUgisUW8+nfzLew7C3/AUKHBFNmVg== X-Received: by 2002:a1c:7215:: with SMTP id n21mr3965407wmc.173.1605005383031; Tue, 10 Nov 2020 02:49:43 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id l24sm2572543wmi.7.2020.11.10.02.49.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 02:49:42 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 10 Nov 2020 11:47:20 +0100 Message-Id: <20201110104851.321029-24-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 023/114] 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 7b24868f57..9f44df5332 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); + -12, 0); } 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",