From patchwork Tue Nov 10 10:58:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23570 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 0847044B238 for ; Tue, 10 Nov 2020 13:14:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 908DD68C089; Tue, 10 Nov 2020 12:59:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AA0E668BFF0 for ; Tue, 10 Nov 2020 12:59:26 +0200 (EET) Received: by mail-wr1-f66.google.com with SMTP id o15so4334048wru.6 for ; Tue, 10 Nov 2020 02:59:26 -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=EH4KD5qFk9+kKsqq/pdR97VCPTAamWxKAr/a9KKpu08=; b=KeHGCNkDA/uoGdJ966GR3JeESjwFLaiDAidQ/OjCwQazBhZsrWwv/bHRNpYvz2VO66 99RZeGrO3MX5ARMFuXN4UbHr+FDgbR2OZKuA0kQd7q6Q4VA6ofyxuh4l54NRrA09vajp Q57biFJy018OFDBj9dcvURc6VPXU86cB9Bka1iNvdYlW8cTnBbamXrXgtNLx6glFaVra 5aEwpjXhyL08bM4h/qp7K2qMkjfCeO42piE7VRJVF5jzsxSk8P6oe/dpVh+Dq2FPwy9i 3UVW7fOX0gXi99ABWdLdKh9hW3b4eEsykWNvAg4licUAm+m+acDm+WTEQVLNohe+QORy QHJw== 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=EH4KD5qFk9+kKsqq/pdR97VCPTAamWxKAr/a9KKpu08=; b=FmTfjQQ9nZRbmJ2VZVEoBWCAC1x6KAxBYwpzsMwXrp907B3zjjbSNStMyYKNa5B/zL qWlW3rzNCgqaKVy/7Ur5q1v+3RqK3cKY0jTqEXXKqB0SvdHUUGwoNn45JD5xVQEZtCaE hXAlsA4J69UtW4T8JnduOX3DnUniO1CUXhF7Gx31zrltyhTGHjTsGz0WTYIJpe88PtLs jbUtSTOGzuXbMQdK2PgbMj5N3BD6q11TFrl9JyN3HLP3KTOJaJiM8sExg0H+/wN0wNUN 3FcTKRWUC8A8K7MvSwj9jBWDsJySgYco6jxR9Z3MD3+5X2xVGsZl6fOgZn4wJCMAyNqG DQ4Q== X-Gm-Message-State: AOAM5310dV7wsf0+RoLgAKufYgV3nSFy8ugCv+ldNONcDC6d9MfzsGOd qeXKPyVw6aODF+yRrhXg2DAdxCErxj4= X-Google-Smtp-Source: ABdhPJxMrhqLLWa5+7sOqoG7w0u4APrybC/7kxLeHh0+m8hqLHZ5tyqsqiOXNvhSJGVdmIe7T5nItw== X-Received: by 2002:adf:dc4c:: with SMTP id m12mr23620315wrj.177.1605005966146; Tue, 10 Nov 2020 02:59:26 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id o197sm2561308wme.17.2020.11.10.02.59.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 02:59:25 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 10 Nov 2020 11:58:25 +0100 Message-Id: <20201110105836.321916-12-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 103/114] avcodec/intrax8: Remove VLC offsets 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/intrax8.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index bd00a3e027..71a50cc063 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -50,18 +50,6 @@ static av_cold int x8_vlc_init(void) { int i; int offset = 0; - int sizeidx = 0; - static const uint16_t sizes[8 * 4 + 8 * 2 + 2 + 4] = { - 576, 548, 582, 618, 546, 616, 560, 642, - 584, 582, 704, 664, 512, 544, 656, 640, - 512, 648, 582, 566, 532, 614, 596, 648, - 586, 552, 584, 590, 544, 578, 584, 624, - - 528, 528, 526, 528, 536, 528, 526, 544, - 544, 512, 512, 528, 528, 544, 512, 544, - - 128, 128, 128, 128, 128, 128, - }; static VLC_TYPE table[28150][2]; @@ -69,10 +57,10 @@ static av_cold int x8_vlc_init(void) #define init_ac_vlc(dst, src) \ do { \ dst.table = &table[offset]; \ - dst.table_allocated = sizes[sizeidx]; \ - offset += sizes[sizeidx++]; \ + dst.table_allocated = FF_ARRAY_ELEMS(table) - offset; \ init_vlc(&dst, AC_VLC_BITS, 77, &src[1], 4, 2, &src[0], 4, 2, \ INIT_VLC_USE_NEW_STATIC); \ + offset += dst.table_size; \ } while(0) for (i = 0; i < 8; i++) { @@ -87,10 +75,10 @@ static av_cold int x8_vlc_init(void) #define init_dc_vlc(dst, src) \ do { \ dst.table = &table[offset]; \ - dst.table_allocated = sizes[sizeidx]; \ - offset += sizes[sizeidx++]; \ + dst.table_allocated = FF_ARRAY_ELEMS(table) - offset; \ init_vlc(&dst, DC_VLC_BITS, 34, &src[1], 4, 2, &src[0], 4, 2, \ INIT_VLC_USE_NEW_STATIC); \ + offset += dst.table_size; \ } while(0) for (i = 0; i < 8; i++) { @@ -103,10 +91,10 @@ static av_cold int x8_vlc_init(void) #define init_or_vlc(dst, src) \ do { \ dst.table = &table[offset]; \ - dst.table_allocated = sizes[sizeidx]; \ - offset += sizes[sizeidx++]; \ + dst.table_allocated = FF_ARRAY_ELEMS(table) - offset; \ init_vlc(&dst, OR_VLC_BITS, 12, &src[1], 4, 2, &src[0], 4, 2, \ INIT_VLC_USE_NEW_STATIC); \ + offset += dst.table_size; \ } while(0) for (i = 0; i < 2; i++)