From patchwork Fri Nov 20 07:18:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23796 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 742174499F4 for ; Fri, 20 Nov 2020 09:32:32 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5FAA068BA98; Fri, 20 Nov 2020 09:32:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6C33568BA8A for ; Fri, 20 Nov 2020 09:32:31 +0200 (EET) Received: by mail-lj1-f194.google.com with SMTP id p12so9018792ljc.9 for ; Thu, 19 Nov 2020 23:32:31 -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=bP4AWfBbvxWEU/3ntIhkZUoQVVqtpqs48a4jRLD28Ks=; b=fOh5l50e2f2FIDxyONbIwfMG7AarGo9rp26JescxnPcSPJUoALYbjuPC/yTY+uDEQP MJzQ8Qaw+w/ejyS5qHkn8P+bjrz0hq1E2RqoLQTPj80uAyQVIo/NNSGqrXL4ednEfNgs g1C+Pgp0pQcCFdyjIklYpVNPbvGgrOEMppvGlkw5zpqshyAyGsSsY7uLC8Holnuw8Avc Av1qbTpUGtc0ol0zajnGy/bSnDcRG1yJYFbDjMLcURTzz2OhR/LF4uAu0fFSKCxqe4FK OoW2Qz9wLTCGBpFUT1DN51CuJKBWXr2unorLhqZh+ax7qnmGCMyR70asW5mt8SA3OIR1 Yq0A== 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=bP4AWfBbvxWEU/3ntIhkZUoQVVqtpqs48a4jRLD28Ks=; b=q3YndKoxpvohsNjQKy32VctjOYWWS9RRQwzcukgJVDbRHI5uxthodzU1mjh+/gYZlo JDL1K+RHqinw1k3f0qX61PVE2DO5/8FK/m0wkdjl/TVrG/C5WlQMWT3CUJAVIUiXj1EU T22x8rnGm8Nqbmc1Tdjwunl5bgWfACneu9IXxEoOjKdPYlRlYNA9iajtOps9eScsgsek PRRnD5gubCr7AHx3nDxT8imsZpTj6iKEJeeRjoiecyQk9aI4dXyUwUrZzIYSWCBopIS8 e3vwa46ICDuWVAq1XZOmmRGnWiqBsq4cjl05kvZpJzzO9e/o08Y6qgVR0ZFxs4+s0/IB +h5Q== X-Gm-Message-State: AOAM533bzWaqZmU2hhF8wjMT9piO4DyxaoDSQlxo0TLSb62RGaAgFt5o sYspYjF1XQIFAN7xuZ2mOoKJFxpvNjAWQA== X-Google-Smtp-Source: ABdhPJwWJZDHL1dGFlNBwJRfliYSlo+tGogvFsuoDVevxtDnn2uXEf7sPWxHnlIQ4T2NA9G1yh4ZFw== X-Received: by 2002:aa7:d54b:: with SMTP id u11mr35303047edr.341.1605857058615; Thu, 19 Nov 2020 23:24:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:18 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:45 +0100 Message-Id: <20201120072116.818090-13-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 012/162] avcodec/on2avc: Apply offset when initializing VLC 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/on2avc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c index 64480c0701..3885f9acd7 100644 --- a/libavcodec/on2avc.c +++ b/libavcodec/on2avc.c @@ -169,7 +169,7 @@ static int on2avc_decode_band_scales(On2AVCContext *c, GetBitContext *gb) scale = get_bits(gb, 7); first = 0; } else { - scale += get_vlc2(gb, c->scale_diff.table, 9, 3) - 60; + scale += get_vlc2(gb, c->scale_diff.table, 9, 3); } if (scale < 0 || scale > 127) { av_log(c->avctx, AV_LOG_ERROR, "Invalid scale value %d\n", @@ -960,7 +960,7 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) ret = ff_init_vlc_from_lengths(&c->scale_diff, 9, ON2AVC_SCALE_DIFFS, ff_on2avc_scale_diff_bits, 1, - ff_on2avc_scale_diff_syms, 1, 1, 0, 0, avctx); + ff_on2avc_scale_diff_syms, 1, 1, -60, 0, avctx); if (ret < 0) goto vlc_fail; for (i = 1; i < 16; i++) {