From patchwork Tue Nov 10 10:47:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23479 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 72DBB449B06 for ; Tue, 10 Nov 2020 12:49:54 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 52C4068BDDB; Tue, 10 Nov 2020 12:49:54 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D9A8368BDED for ; Tue, 10 Nov 2020 12:49:41 +0200 (EET) Received: by mail-wm1-f68.google.com with SMTP id 10so2533213wml.2 for ; Tue, 10 Nov 2020 02:49:41 -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=0hZK3Eh6zLJJ1R1ZMdyA2cs4YzGrGjCaDFM4y4PtXcc=; b=tfsAf9K1KkbXnukEwErBxN/lMrTtoTdgdGKhW/4THfZVwunGaIWkCFt0mOHVp6MX6y VGmeCdKuo41MwXHQPCKQ7sx82tKVfCSytNUgNEOHFHj1xNiU66CqT6xEN1QkRZPSmo6M S+1YWhOafkkhskHsgTDVKsGuPdBzV1zYdpfXlG+kHx1rX+FL4tWN2B1EicOzsd7JWvbo TiWumEMQR1BG70gtl0ygP48IN5aNhMJgAahbhmiV9juBNoLblLR3BVELDiWnyefArrb7 9lF6OX5v+2cg2OgkDbvAbEHM5nvGUvgljtopaPlODY+XLpAXIrOwYTNGxPNsXI3l3cYu /J3g== 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=0hZK3Eh6zLJJ1R1ZMdyA2cs4YzGrGjCaDFM4y4PtXcc=; b=M+FvG7WtY6DvCFV+PUHNkUeSFtECdAJvJouaFeNNX72u3Uh5Tz2+72XsAPq6arvhot WMF0uehdqZXZnb/nb7VouBPljphRWbiUt6KDsdYBBoGV1XNhfJpcIei+SCY6D7OL+fgk +8ItrJGT+KIJApQxf+ZhEEWesHnzPX7Df+rdIWNUjCTLKmLehvqmjoUf0B9sjoCWqPcx gu2RLNR+twnvlGQo4kOF92CGBAh8M2uW8zlw03J3AgApk77Sh0MHc5X7kOTJgb3EZb+O Vu0kAzHhXWO2lHWgNXlsvJg/nZOo93u0hwZcnKl5TI5lUJhETQqv649u6BlatORrkY6x PvBg== X-Gm-Message-State: AOAM532DR7ZTVpnw3VvncGCexVZ/bYiugnMpNVE3J/Ya3cuxucAniwOy lCeu8L5z2qQ0GL2ezvbfW2CW+YhDtGs= X-Google-Smtp-Source: ABdhPJzzDtHTT+MVEUNV8tiYAnhtT6JyUcwchY6+KurXMcYpZIXNkzEYENf9sd2X0QCRQCxpzVENNg== X-Received: by 2002:a7b:c846:: with SMTP id c6mr3816603wml.143.1605005381070; Tue, 10 Nov 2020 02:49:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 02:49:40 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 10 Nov 2020 11:47:18 +0100 Message-Id: <20201110104851.321029-22-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 021/114] avcodec/wnv1: Apply offset during init, not later every time 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/wnv1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index f8a9b94746..7dd0e72596 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -43,10 +43,10 @@ static inline int wnv1_get_code(GetBitContext *gb, int shift, int base_value) { int v = get_vlc2(gb, code_vlc.table, CODE_VLC_BITS, 1); - if (v == 15) + if (v == 8) return get_bits(gb, 8 - shift) << shift; else - return base_value + ((v - 7U) << shift); + return base_value + v * (1 << shift); } static int decode_frame(AVCodecContext *avctx, @@ -119,7 +119,7 @@ static av_cold int decode_init(AVCodecContext *avctx) INIT_VLC_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16, &code_tab[0][1], 2, &code_tab[0][0], 2, 1, - 0, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); + -7, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); return 0; }