From patchwork Tue Dec 29 21:53:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24680 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 09D1144AFEA for ; Wed, 30 Dec 2020 00:17:30 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8931668A708; Wed, 30 Dec 2020 00:17:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9D8AF68A31F for ; Wed, 30 Dec 2020 00:17:21 +0200 (EET) Received: by mail-lf1-f46.google.com with SMTP id y19so33722079lfa.13 for ; Tue, 29 Dec 2020 14:17:21 -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 :mime-version:content-transfer-encoding; bh=ktWTvSNrkbTunYiSlkOmMq598DT7J4Dj1SxjZWn3ii0=; b=JqcoEYgCPZCzbTQ8c9RdztXVHcADavqTUJYLY1HN4ZgAprR8faX7C/n3VXwY+1Kjwn VB75Bbg3Sx54vl4qUZJudslKDMaup58XRNuP5PM2wBxKt5W2BRhw84QqV66buZYBGFLE OX6ykk03ychLIhorgwU3QqDvU1qmHy3wA6eHWJu8Ounc58u1CohHxKykVOZzpVBEeouS U3D2MzmIyd1lIBpN5g5D0eY4BHVPcIu1M6ICPrzStZFer7YcqUsaS/2Tq9edNcSe5UVM bp8jIBdyStfvfGuxG+8zcgqkiegt21UIDDmlIr7q7f9K/fyXgmiuCTi+l8ysr6hDiJ43 7pOQ== 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:mime-version:content-transfer-encoding; bh=ktWTvSNrkbTunYiSlkOmMq598DT7J4Dj1SxjZWn3ii0=; b=UX3YLpRYhTDPNtMf6XibrHrD+c+/ooV1QDt3Z2wixGOsVYkYY4h2pjY8IpEOvPzRsw JxLyFczTQpWaCI8qITA79ooFAxqG+Z8hG3AKxO7G5FGakViGVfeyOqB5G6SGjE6NhmcD XN3xmjvxqePxQANSoRA5ElIYBaZmIgS2nMLbGXYVckJJU9teVoCYIYWwTTZPIlTDX04h K9BYj18+iClkxgHfQfSGxSN/hjSImZ2dqT3ATiOjxoTJb6VnkwwY3Ccyqkd2DLhovpAG 2bj5SUAS3FqB+JFUgQgAALu1oCoU7CrKmJ3w4hN2bYUgPGXuVwab8E/NYIM5IJug/trO k4Tw== X-Gm-Message-State: AOAM531vkjk6x5UyUPTayHCkrWu1P+pJFwseUtr2dlwOW6OePfHJq7YF tBEDt3/mI4beDpa9p9UjRrYjBwpdjYY= X-Google-Smtp-Source: ABdhPJyMxU4mW/oDLpK5hZiMjjox8whQ2OGVIMLDl3v9bIu14mBnagr4KkbmYf2lIVVX7azIxQh0Yw== X-Received: by 2002:a17:907:3e23:: with SMTP id hp35mr47609621ejc.254.1609278837317; Tue, 29 Dec 2020 13:53:57 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id s5sm18623396eju.98.2020.12.29.13.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Dec 2020 13:53:56 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 29 Dec 2020 22:53:50 +0100 Message-Id: <20201229215350.659208-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201210111657.2276739-1-andreas.rheinhardt@gmail.com> References: <20201210111657.2276739-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 40/40] avcodec/h261dec: Make VLC smaller 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" The VLC for the macroblock address increment uses nine bits; yet there is no code with this length: All codes are either shorter or longer. So one can make the table smaller without changing the amount of codes that need more than one round of parsing. Signed-off-by: Andreas Rheinhardt --- libavcodec/h261dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 817453f60c..2b3408d7b3 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -35,7 +35,7 @@ #include "h261.h" #include "internal.h" -#define H261_MBA_VLC_BITS 9 +#define H261_MBA_VLC_BITS 8 #define H261_MTYPE_VLC_BITS 6 #define H261_MV_VLC_BITS 7 #define H261_CBP_VLC_BITS 9 @@ -52,7 +52,7 @@ static av_cold void h261_decode_init_static(void) { INIT_VLC_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35, ff_h261_mba_bits, 1, 1, - ff_h261_mba_code, 1, 1, 662); + ff_h261_mba_code, 1, 1, 540); INIT_VLC_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10, ff_h261_mtype_bits, 1, 1, ff_h261_mtype_code, 1, 1, 80);