From patchwork Tue Nov 10 10:47:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23490 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 B250444B3FF for ; Tue, 10 Nov 2020 12:54:26 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 256D468BE94; Tue, 10 Nov 2020 12:50:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8C6F368BEC0 for ; Tue, 10 Nov 2020 12:50:18 +0200 (EET) Received: by mail-wm1-f66.google.com with SMTP id h2so2543447wmm.0 for ; Tue, 10 Nov 2020 02:50:18 -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=M8ZbgWYGdYN/wEYrs90BmAy5G3eULm1OfZ/u7ebfqNU=; b=OvVyhnVGCRuLZ7k51YSv8CdzEnpvJJ8lou6HsLclcZdqqPhdjsxyhhQAsZiXcYRLdP TQzGHTpw/XH8rEREgrOk5DKF/UENHiB3SqWcDUXxybhFKO4IzeN4sqWmTjw8Qy+wI6xn DSLEL2kWPkYng9ozZCLAk87Rh06Ih6R9yI+92kQSDv6T8yMjoF6z5PnBxQo7YPBoAF1R lTZGvdUbEio+vSPtbXkh1SWpZwOSVPgfuFJLbgoiTF4AKzP/DN4UtWXyacOe0bzbOQTS Bfj3McmxaGdfspZTwJN5tQv2BE9ufDGcqDUembGDcy0NpAU2OfxDy0PWmjH247Fj6kQs GTAw== 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=M8ZbgWYGdYN/wEYrs90BmAy5G3eULm1OfZ/u7ebfqNU=; b=mOlqnVRi/+HqCPNiJhs0T3puFv+b8OAv0Z6e/PXGX81COcR9E/RM9RaWhXqwAo5etN w0pBbwGX7PEJYkyjz2wYYspueuPh6X1vniW9DXCFcqXj1aQcXftB3X+a0eoVkhzdD61O SrSuNK1Wag8I/qpRLofAW8z9zBrsDttW2a/ln8cFepc1OiPFvqDRArHh2aaRp+aPkjuz W8f9D/wpR919tzOz06nZSwQccqjYoYYawCCzC8mfBUjl/e9/fa8AMnFs1NNSMaDJj2f3 9LJXMSOgCrXgnoJSb6C78s50cBwO3MdT9HtGykKFUJkdTB+hu6dwIIfJ2GSGsjvAQiKT 6+Xg== X-Gm-Message-State: AOAM533oAaLilBt91ER5RVWnxqnNM2QCVzlTXS+m0Nv8igYeKRdMWe7t 22xGJbMlq6K0B4kpRAc2wdQ/sgh6+gw= X-Google-Smtp-Source: ABdhPJxzFPpeD+2g2RXSslfhWQqkSEvu9y5t3IFzFNXqLFZb0mdxMPOy2bGHX6eapKHwtQ4L45WSDg== X-Received: by 2002:a1c:3907:: with SMTP id g7mr4027497wma.176.1605005416942; Tue, 10 Nov 2020 02:50:16 -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.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 02:50:16 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 10 Nov 2020 11:47:55 +0100 Message-Id: <20201110104851.321029-59-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 058/114] avcodec/rv40: Avoid code duplication when initializing VLCs 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" Besides removing code duplication the method for determining the offset of each VLC table in the VLC_TYPE buffer also has the advantage of not wasting space for skipped AIC mode 1 VLCs. Signed-off-by: Andreas Rheinhardt --- libavcodec/rv40.c | 52 +++--- libavcodec/rv40vlc2.h | 383 +++++++++++++++++++----------------------- 2 files changed, 200 insertions(+), 235 deletions(-) diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c index 7ed599cd69..15e00c2694 100644 --- a/libavcodec/rv40.c +++ b/libavcodec/rv40.c @@ -41,31 +41,35 @@ static VLC aic_top_vlc; static VLC aic_mode1_vlc[AIC_MODE1_NUM], aic_mode2_vlc[AIC_MODE2_NUM]; static VLC ptype_vlc[NUM_PTYPE_VLCS], btype_vlc[NUM_BTYPE_VLCS]; +static av_cold void rv40_init_table(VLC *vlc, unsigned *offset, int nb_bits, + int nb_codes, const uint8_t (*tab)[2]) +{ + static VLC_TYPE vlc_buf[11776][2]; + + vlc->table = &vlc_buf[*offset]; + vlc->table_allocated = 1 << nb_bits; + *offset += 1 << nb_bits; + + ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + &tab[0][1], 2, &tab[0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC); +} + /** * Initialize all tables. */ static av_cold void rv40_init_tables(void) { - int i; - static VLC_TYPE aic_table[1 << AIC_TOP_BITS][2]; - static VLC_TYPE aic_mode1_table[AIC_MODE1_NUM << AIC_MODE1_BITS][2]; + int i, offset = 0; static VLC_TYPE aic_mode2_table[11814][2]; - static VLC_TYPE ptype_table[NUM_PTYPE_VLCS << PTYPE_VLC_BITS][2]; - static VLC_TYPE btype_table[NUM_BTYPE_VLCS << BTYPE_VLC_BITS][2]; - - aic_top_vlc.table = aic_table; - aic_top_vlc.table_allocated = 1 << AIC_TOP_BITS; - init_vlc(&aic_top_vlc, AIC_TOP_BITS, AIC_TOP_SIZE, - rv40_aic_top_vlc_bits, 1, 1, - rv40_aic_top_vlc_codes, 1, 1, INIT_VLC_USE_NEW_STATIC); + + rv40_init_table(&aic_top_vlc, &offset, AIC_TOP_BITS, AIC_TOP_SIZE, + rv40_aic_top_vlc_tab); for(i = 0; i < AIC_MODE1_NUM; i++){ // Every tenth VLC table is empty if((i % 10) == 9) continue; - aic_mode1_vlc[i].table = &aic_mode1_table[i << AIC_MODE1_BITS]; - aic_mode1_vlc[i].table_allocated = 1 << AIC_MODE1_BITS; - init_vlc(&aic_mode1_vlc[i], AIC_MODE1_BITS, AIC_MODE1_SIZE, - aic_mode1_vlc_bits[i], 1, 1, - aic_mode1_vlc_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + rv40_init_table(&aic_mode1_vlc[i], &offset, AIC_MODE1_BITS, + AIC_MODE1_SIZE, aic_mode1_vlc_tabs[i]); } for (unsigned i = 0, offset = 0; i < AIC_MODE2_NUM; i++){ uint16_t syms[AIC_MODE2_SIZE]; @@ -86,20 +90,12 @@ static av_cold void rv40_init_tables(void) offset += aic_mode2_vlc[i].table_size; } for(i = 0; i < NUM_PTYPE_VLCS; i++){ - ptype_vlc[i].table = &ptype_table[i << PTYPE_VLC_BITS]; - ptype_vlc[i].table_allocated = 1 << PTYPE_VLC_BITS; - ff_init_vlc_from_lengths(&ptype_vlc[i], PTYPE_VLC_BITS, PTYPE_VLC_SIZE, - &ptype_vlc_tabs[i][0][1], 2, - &ptype_vlc_tabs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC); + rv40_init_table(&ptype_vlc[i], &offset, PTYPE_VLC_BITS, PTYPE_VLC_SIZE, + ptype_vlc_tabs[i]); } for(i = 0; i < NUM_BTYPE_VLCS; i++){ - btype_vlc[i].table = &btype_table[i << BTYPE_VLC_BITS]; - btype_vlc[i].table_allocated = 1 << BTYPE_VLC_BITS; - ff_init_vlc_from_lengths(&btype_vlc[i], BTYPE_VLC_BITS, BTYPE_VLC_SIZE, - &btype_vlc_tabs[i][0][1], 2, - &btype_vlc_tabs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC); + rv40_init_table(&btype_vlc[i], &offset, BTYPE_VLC_BITS, BTYPE_VLC_SIZE, + btype_vlc_tabs[i]); } } diff --git a/libavcodec/rv40vlc2.h b/libavcodec/rv40vlc2.h index 783b93ba2e..fec47ff4ad 100644 --- a/libavcodec/rv40vlc2.h +++ b/libavcodec/rv40vlc2.h @@ -35,13 +35,10 @@ //@{ #define AIC_TOP_BITS 7 #define AIC_TOP_SIZE 16 -static const uint8_t rv40_aic_top_vlc_codes[AIC_TOP_SIZE] = { - 0x01, 0x05, 0x01, 0x00, 0x03, 0x3D, 0x1D, 0x02, - 0x04, 0x3C, 0x3F, 0x1C, 0x0D, 0x3E, 0x0C, 0x01 -}; - -static const uint8_t rv40_aic_top_vlc_bits[AIC_TOP_SIZE] = { - 1, 4, 5, 5, 5, 7, 6, 5, 4, 7, 7, 6, 5, 7, 5, 3 +static const uint8_t rv40_aic_top_vlc_tab[AIC_TOP_SIZE][2] = { + { 0x3, 5 }, { 0x2, 5 }, { 0x7, 5 }, { 0x4, 5 }, { 0xF, 3 }, { 0x8, 4 }, + { 0x1, 4 }, { 0xE, 5 }, { 0xC, 5 }, { 0xB, 6 }, { 0x6, 6 }, { 0x9, 7 }, + { 0x5, 7 }, { 0xD, 7 }, { 0xA, 7 }, { 0x0, 1 }, }; //@} @@ -388,206 +385,178 @@ static const uint8_t aic_mode2_vlc_bits[AIC_MODE2_NUM][AIC_MODE2_SIZE] = { #define AIC_MODE1_SIZE 9 #define AIC_MODE1_BITS 7 -static const uint8_t aic_mode1_vlc_codes[AIC_MODE1_NUM][AIC_MODE1_SIZE] = { - { 0x01, 0x01, 0x01, 0x11, 0x00, 0x09, 0x03, 0x10, 0x05,}, - { 0x09, 0x01, 0x01, 0x05, 0x11, 0x00, 0x03, 0x21, 0x20,}, - { 0x01, 0x01, 0x01, 0x11, 0x09, 0x10, 0x05, 0x00, 0x03,}, - { 0x01, 0x01, 0x00, 0x03, 0x21, 0x05, 0x09, 0x20, 0x11,}, - { 0x01, 0x09, 0x00, 0x29, 0x08, 0x15, 0x03, 0x0B, 0x28,}, - { 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x03, 0x02,}, - { 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x01, 0x09, 0x08,}, - { 0x01, 0x01, 0x01, 0x09, 0x01, 0x08, 0x00, 0x03, 0x05,}, - { 0x01, 0x01, 0x01, 0x00, 0x05, 0x11, 0x09, 0x10, 0x03,}, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}, - - { 0x01, 0x01, 0x01, 0x05, 0x01, 0x00, 0x03, 0x09, 0x08,}, - { 0x09, 0x01, 0x01, 0x05, 0x11, 0x00, 0x03, 0x21, 0x20,}, - { 0x01, 0x01, 0x01, 0x0D, 0x05, 0x04, 0x00, 0x07, 0x0C,}, - { 0x01, 0x01, 0x00, 0x05, 0x11, 0x03, 0x09, 0x21, 0x20,}, - { 0x05, 0x01, 0x01, 0x11, 0x00, 0x09, 0x03, 0x21, 0x20,}, - { 0x09, 0x01, 0x01, 0x00, 0x05, 0x01, 0x03, 0x11, 0x10,}, - { 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x03, 0x02,}, - { 0x01, 0x01, 0x01, 0x09, 0x00, 0x05, 0x01, 0x03, 0x08,}, - { 0x01, 0x01, 0x01, 0x09, 0x11, 0x05, 0x00, 0x10, 0x03,}, - { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}, - - { 0x01, 0x00, 0x01, 0x09, 0x08, 0x15, 0x14, 0x0B, 0x03,}, - { 0x0D, 0x01, 0x01, 0x05, 0x0C, 0x04, 0x01, 0x00, 0x07,}, - { 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x03, 0x01, 0x01,}, - { 0x05, 0x01, 0x01, 0x04, 0x19, 0x07, 0x18, 0x0D, 0x00,}, - { 0x11, 0x09, 0x01, 0x21, 0x05, 0x20, 0x01, 0x00, 0x03,}, - { 0x41, 0x01, 0x00, 0x05, 0x40, 0x03, 0x09, 0x21, 0x11,}, - { 0x29, 0x01, 0x00, 0x28, 0x09, 0x15, 0x03, 0x08, 0x0B,}, - { 0x01, 0x00, 0x01, 0x11, 0x09, 0x10, 0x05, 0x01, 0x03,}, - { 0x05, 0x01, 0x01, 0x04, 0x0D, 0x0C, 0x07, 0x00, 0x01,}, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}, - - { 0x01, 0x00, 0x03, 0x05, 0x11, 0x10, 0x25, 0x24, 0x13,}, - { 0x21, 0x01, 0x01, 0x00, 0x11, 0x03, 0x05, 0x20, 0x09,}, - { 0x01, 0x01, 0x01, 0x00, 0x09, 0x11, 0x10, 0x05, 0x03,}, - { 0x21, 0x05, 0x01, 0x01, 0x09, 0x00, 0x11, 0x20, 0x03,}, - { 0x05, 0x01, 0x00, 0x04, 0x01, 0x19, 0x07, 0x18, 0x0D,}, - { 0x11, 0x01, 0x00, 0x01, 0x09, 0x01, 0x03, 0x10, 0x05,}, - { 0x1D, 0x01, 0x05, 0x0D, 0x0C, 0x04, 0x00, 0x1C, 0x0F,}, - { 0x05, 0x19, 0x01, 0x04, 0x00, 0x18, 0x1B, 0x1A, 0x07,}, - { 0x09, 0x01, 0x00, 0x01, 0x05, 0x03, 0x11, 0x10, 0x01,}, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}, - - { 0x01, 0x00, 0x03, 0x41, 0x05, 0x40, 0x09, 0x11, 0x21,}, - { 0x05, 0x01, 0x01, 0x19, 0x04, 0x07, 0x00, 0x18, 0x0D,}, - { 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x01, 0x00, 0x03,}, - { 0x01, 0x05, 0x00, 0x0D, 0x01, 0x04, 0x07, 0x19, 0x18,}, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,}, - { 0x31, 0x01, 0x05, 0x19, 0x04, 0x07, 0x00, 0x30, 0x0D,}, - { 0x01, 0x00, 0x03, 0x11, 0x01, 0x05, 0x01, 0x09, 0x10,}, - { 0x01, 0x05, 0x01, 0x11, 0x01, 0x10, 0x00, 0x03, 0x09,}, - { 0x01, 0x09, 0x00, 0x29, 0x03, 0x08, 0x28, 0x15, 0x0B,}, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}, - - { 0x01, 0x01, 0x00, 0x09, 0x15, 0x03, 0x08, 0x14, 0x0B,}, - { 0x11, 0x01, 0x01, 0x00, 0x09, 0x01, 0x03, 0x10, 0x05,}, - { 0x01, 0x00, 0x03, 0x25, 0x11, 0x05, 0x10, 0x24, 0x13,}, - { 0x11, 0x01, 0x00, 0x01, 0x09, 0x01, 0x05, 0x10, 0x03,}, - { 0x05, 0x01, 0x00, 0x0D, 0x0C, 0x04, 0x0F, 0x1D, 0x1C,}, - { 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x03, 0x02,}, - { 0x21, 0x01, 0x05, 0x09, 0x11, 0x00, 0x03, 0x41, 0x40,}, - { 0x05, 0x01, 0x00, 0x1D, 0x1C, 0x0D, 0x0C, 0x0F, 0x04,}, - { 0x05, 0x01, 0x00, 0x0D, 0x31, 0x04, 0x19, 0x30, 0x07,}, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}, - - { 0x01, 0x01, 0x00, 0x21, 0x05, 0x11, 0x03, 0x09, 0x20,}, - { 0x01, 0x01, 0x00, 0x11, 0x03, 0x05, 0x01, 0x09, 0x10,}, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,}, - { 0x05, 0x01, 0x04, 0x19, 0x07, 0x0D, 0x00, 0x31, 0x30,}, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,}, - { 0x05, 0x01, 0x01, 0x11, 0x09, 0x00, 0x03, 0x21, 0x20,}, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,}, - { 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x01, 0x01, 0x02,}, - { 0x09, 0x01, 0x00, 0x29, 0x08, 0x15, 0x03, 0x28, 0x0B,}, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}, - - { 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x00, 0x01, 0x03,}, - { 0x09, 0x01, 0x00, 0x29, 0x28, 0x15, 0x08, 0x03, 0x0B,}, - { 0x01, 0x00, 0x01, 0x11, 0x05, 0x10, 0x09, 0x01, 0x03,}, - { 0x05, 0x04, 0x01, 0x1D, 0x0D, 0x0C, 0x1C, 0x00, 0x0F,}, - { 0x09, 0x11, 0x01, 0x41, 0x00, 0x40, 0x05, 0x03, 0x21,}, - { 0x0D, 0x05, 0x01, 0x1D, 0x1C, 0x0C, 0x04, 0x00, 0x0F,}, - { 0x41, 0x09, 0x01, 0x40, 0x00, 0x11, 0x05, 0x03, 0x21,}, - { 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x00, 0x01, 0x03,}, - { 0x05, 0x04, 0x01, 0x0D, 0x01, 0x0C, 0x07, 0x01, 0x00,}, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}, - - { 0x05, 0x04, 0x01, 0x07, 0x19, 0x31, 0x30, 0x0D, 0x00,}, - { 0x21, 0x01, 0x01, 0x00, 0x11, 0x09, 0x20, 0x05, 0x03,}, - { 0x05, 0x01, 0x01, 0x04, 0x07, 0x0D, 0x0C, 0x00, 0x01,}, - { 0x21, 0x09, 0x01, 0x00, 0x20, 0x05, 0x23, 0x22, 0x03,}, - { 0x31, 0x0D, 0x01, 0x19, 0x05, 0x30, 0x04, 0x07, 0x00,}, - { 0x31, 0x05, 0x01, 0x04, 0x19, 0x00, 0x0D, 0x30, 0x07,}, - { 0x31, 0x01, 0x00, 0x0D, 0x05, 0x19, 0x04, 0x30, 0x07,}, - { 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02, 0x01, 0x01,}, - { 0x01, 0x00, 0x01, 0x01, 0x05, 0x09, 0x08, 0x03, 0x01,}, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}, -}; - -static const uint8_t aic_mode1_vlc_bits[AIC_MODE1_NUM][AIC_MODE1_SIZE] = { - { 1, 4, 2, 7, 4, 6, 4, 7, 5,}, - { 5, 1, 3, 4, 6, 3, 3, 7, 7,}, - { 1, 4, 2, 7, 6, 7, 5, 4, 4,}, - { 1, 3, 3, 3, 7, 4, 5, 7, 6,}, - { 2, 4, 2, 6, 4, 5, 2, 4, 6,}, - { 7, 2, 3, 4, 7, 1, 5, 7, 7,}, - { 5, 1, 3, 6, 5, 5, 2, 7, 7,}, - { 2, 5, 1, 7, 3, 7, 5, 5, 6,}, - { 2, 4, 1, 4, 5, 7, 6, 7, 4,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - - { 2, 1, 3, 6, 5, 5, 5, 7, 7,}, - { 5, 1, 3, 4, 6, 3, 3, 7, 7,}, - { 4, 1, 2, 6, 5, 5, 4, 5, 6,}, - { 3, 1, 3, 4, 6, 3, 5, 7, 7,}, - { 4, 1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 3, 3, 2, 3, 5, 6, 6, 4, 2,}, - { 7, 1, 3, 3, 6, 5, 7, 4, 3,}, - { 5, 4, 1, 5, 5, 6, 6, 4, 2,}, - { 6, 4, 2, 2, 6, 3, 6, 6, 2,}, - { 6, 4, 2, 5, 3, 6, 3, 3, 2,}, - { 6, 3, 2, 3, 5, 2, 4, 6, 3,}, - { 6, 2, 2, 4, 3, 5, 3, 6, 3,}, - { 7, 5, 1, 7, 4, 7, 7, 3, 2,}, - { 5, 5, 2, 3, 6, 7, 7, 5, 1,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0,}, +static const uint8_t aic_mode1_vlc_tabs[AIC_MODE1_NUM][AIC_MODE1_SIZE][2] = { + { { 4, 4 }, { 1, 4 }, { 7, 7 }, { 3, 7 }, { 5, 6 }, + { 8, 5 }, { 6, 4 }, { 2, 2 }, { 0, 1 } }, + { { 5, 3 }, { 2, 3 }, { 8, 7 }, { 7, 7 }, { 4, 6 }, + { 0, 5 }, { 3, 4 }, { 6, 3 }, { 1, 1 } }, + { { 7, 4 }, { 1, 4 }, { 5, 7 }, { 3, 7 }, { 4, 6 }, + { 6, 5 }, { 8, 4 }, { 2, 2 }, { 0, 1 } }, + { { 2, 3 }, { 1, 3 }, { 7, 7 }, { 4, 7 }, { 8, 6 }, + { 6, 5 }, { 5, 4 }, { 3, 3 }, { 0, 1 } }, + { { 2, 2 }, { 0, 2 }, { 4, 4 }, { 1, 4 }, { 8, 6 }, + { 3, 6 }, { 5, 5 }, { 7, 4 }, { 6, 2 } }, + { { 4, 7 }, { 0, 7 }, { 8, 7 }, { 7, 7 }, { 6, 5 }, + { 3, 4 }, { 2, 3 }, { 1, 2 }, { 5, 1 } }, + { { 4, 5 }, { 0, 5 }, { 8, 7 }, { 7, 7 }, { 3, 6 }, + { 5, 5 }, { 2, 3 }, { 6, 2 }, { 1, 1 } }, + { { 6, 5 }, { 1, 5 }, { 5, 7 }, { 3, 7 }, { 8, 6 }, + { 7, 5 }, { 4, 3 }, { 0, 2 }, { 2, 1 } }, + { { 3, 4 }, { 1, 4 }, { 7, 7 }, { 5, 7 }, { 6, 6 }, + { 4, 5 }, { 8, 4 }, { 0, 2 }, { 2, 1 } }, + { { 0 } }, /* unused */ + { { 5, 5 }, { 4, 5 }, { 8, 7 }, { 7, 7 }, { 3, 6 }, + { 6, 5 }, { 2, 3 }, { 0, 2 }, { 1, 1 } }, + { { 5, 3 }, { 2, 3 }, { 8, 7 }, { 7, 7 }, { 4, 6 }, + { 0, 5 }, { 3, 4 }, { 6, 3 }, { 1, 1 } }, + { { 6, 4 }, { 0, 4 }, { 5, 5 }, { 4, 5 }, { 8, 6 }, + { 3, 6 }, { 7, 5 }, { 2, 2 }, { 1, 1 } }, + { { 2, 3 }, { 0, 3 }, { 8, 7 }, { 7, 7 }, { 4, 6 }, + { 6, 5 }, { 3, 4 }, { 5, 3 }, { 1, 1 } }, + { { 4, 3 }, { 2, 3 }, { 8, 7 }, { 7, 7 }, { 3, 6 }, + { 5, 5 }, { 0, 4 }, { 6, 3 }, { 1, 1 } }, + { { 3, 4 }, { 2, 4 }, { 8, 7 }, { 7, 7 }, { 0, 6 }, + { 4, 5 }, { 6, 4 }, { 5, 2 }, { 1, 1 } }, + { { 3, 7 }, { 0, 7 }, { 8, 7 }, { 7, 7 }, { 2, 5 }, + { 4, 4 }, { 5, 3 }, { 6, 2 }, { 1, 1 } }, + { { 4, 5 }, { 0, 5 }, { 8, 7 }, { 3, 7 }, { 5, 6 }, + { 7, 5 }, { 1, 3 }, { 2, 2 }, { 6, 1 } }, + { { 6, 4 }, { 0, 4 }, { 7, 7 }, { 4, 7 }, { 3, 6 }, + { 5, 5 }, { 8, 4 }, { 2, 2 }, { 1, 1 } }, + { { 2, 1 }, { 0, 1 } }, /* Unused */ + { { 1, 3 }, { 0, 3 }, { 4, 5 }, { 3, 5 }, { 6, 6 }, + { 5, 6 }, { 7, 5 }, { 8, 3 }, { 2, 1 } }, + { { 7, 4 }, { 6, 4 }, { 5, 5 }, { 3, 5 }, { 4, 6 }, + { 0, 6 }, { 8, 5 }, { 1, 2 }, { 2, 1 } }, + { { 4, 6 }, { 0, 6 }, { 5, 7 }, { 3, 7 }, { 6, 6 }, + { 1, 4 }, { 7, 3 }, { 8, 2 }, { 2, 1 } }, + { { 8, 3 }, { 1, 3 }, { 3, 4 }, { 0, 4 }, { 6, 6 }, + { 4, 6 }, { 7, 5 }, { 5, 4 }, { 2, 1 } }, + { { 7, 3 }, { 6, 3 }, { 5, 7 }, { 3, 7 }, { 0, 6 }, + { 1, 5 }, { 4, 4 }, { 8, 3 }, { 2, 1 } }, + { { 2, 2 }, { 1, 2 }, { 4, 7 }, { 0, 7 }, { 7, 6 }, + { 8, 5 }, { 6, 4 }, { 3, 3 }, { 5, 2 } }, + { { 2, 2 }, { 1, 2 }, { 7, 4 }, { 4, 4 }, { 3, 6 }, + { 0, 6 }, { 5, 5 }, { 8, 4 }, { 6, 2 } }, + { { 1, 4 }, { 0, 4 }, { 5, 7 }, { 3, 7 }, { 4, 6 }, + { 6, 5 }, { 8, 4 }, { 7, 2 }, { 2, 1 } }, + { { 7, 4 }, { 1, 4 }, { 3, 5 }, { 0, 5 }, { 5, 6 }, + { 4, 6 }, { 6, 5 }, { 8, 2 }, { 2, 1 } }, + { { 0 } }, /* unused */ + { { 1, 2 }, { 0, 2 }, { 5, 5 }, { 4, 5 }, { 7, 6 }, + { 6, 6 }, { 8, 5 }, { 3, 3 }, { 2, 2 } }, + { { 3, 3 }, { 2, 3 }, { 7, 7 }, { 0, 7 }, { 4, 6 }, + { 8, 5 }, { 6, 4 }, { 5, 3 }, { 1, 1 } }, + { { 3, 4 }, { 1, 4 }, { 6, 7 }, { 5, 7 }, { 4, 6 }, + { 7, 5 }, { 8, 4 }, { 0, 2 }, { 2, 1 } }, + { { 5, 3 }, { 2, 3 }, { 7, 7 }, { 0, 7 }, { 6, 6 }, + { 4, 5 }, { 1, 4 }, { 8, 3 }, { 3, 1 } }, + { { 2, 3 }, { 1, 3 }, { 3, 4 }, { 0, 4 }, { 7, 6 }, + { 5, 6 }, { 8, 5 }, { 6, 4 }, { 4, 1 } }, + { { 2, 4 }, { 1, 4 }, { 7, 7 }, { 0, 7 }, { 4, 6 }, + { 8, 5 }, { 6, 4 }, { 3, 2 }, { 5, 1 } }, + { { 6, 2 }, { 1, 2 }, { 5, 3 }, { 2, 3 }, { 4, 4 }, + { 3, 4 }, { 7, 5 }, { 0, 5 }, { 8, 4 } }, + { { 4, 2 }, { 2, 2 }, { 3, 3 }, { 0, 3 }, { 5, 5 }, + { 1, 5 }, { 7, 5 }, { 6, 5 }, { 8, 3 } }, + { { 2, 4 }, { 1, 4 }, { 7, 7 }, { 6, 7 }, { 0, 6 }, + { 4, 5 }, { 5, 4 }, { 3, 2 }, { 8, 1 } }, + { { 0 } }, /* unused */ + { { 1, 2 }, { 0, 2 }, { 5, 7 }, { 3, 7 }, { 8, 6 }, + { 7, 5 }, { 6, 4 }, { 4, 3 }, { 2, 2 } }, + { { 6, 3 }, { 2, 3 }, { 4, 4 }, { 0, 4 }, { 7, 6 }, + { 3, 6 }, { 8, 5 }, { 5, 4 }, { 1, 1 } }, + { { 7, 6 }, { 6, 6 }, { 5, 7 }, { 3, 7 }, { 8, 6 }, + { 1, 4 }, { 4, 3 }, { 0, 2 }, { 2, 1 } }, + { { 2, 3 }, { 0, 3 }, { 5, 4 }, { 1, 4 }, { 8, 6 }, + { 7, 6 }, { 3, 5 }, { 6, 4 }, { 4, 1 } }, + { { 5, 7 }, { 3, 7 }, { 8, 7 }, { 7, 7 }, { 1, 5 }, + { 0, 4 }, { 6, 3 }, { 2, 2 }, { 4, 1 } }, + { { 6, 2 }, { 1, 2 }, { 4, 3 }, { 2, 3 }, { 7, 6 }, + { 0, 6 }, { 3, 5 }, { 8, 4 }, { 5, 3 } }, + { { 1, 4 }, { 0, 4 }, { 8, 7 }, { 3, 7 }, { 7, 6 }, + { 5, 5 }, { 2, 4 }, { 4, 2 }, { 6, 1 } }, + { { 6, 4 }, { 0, 4 }, { 5, 7 }, { 3, 7 }, { 8, 6 }, + { 1, 5 }, { 7, 4 }, { 2, 2 }, { 4, 1 } }, + { { 2, 2 }, { 0, 2 }, { 5, 4 }, { 1, 4 }, { 6, 6 }, + { 3, 6 }, { 7, 5 }, { 8, 4 }, { 4, 2 } }, + { { 0 } }, /* unused */ + { { 2, 3 }, { 1, 3 }, { 6, 5 }, { 3, 5 }, { 7, 6 }, + { 4, 6 }, { 8, 5 }, { 5, 3 }, { 0, 1 } }, + { { 3, 4 }, { 2, 4 }, { 7, 7 }, { 0, 7 }, { 4, 6 }, + { 8, 5 }, { 6, 4 }, { 5, 2 }, { 1, 1 } }, + { { 1, 2 }, { 0, 2 }, { 6, 5 }, { 4, 5 }, { 7, 6 }, + { 3, 6 }, { 8, 5 }, { 5, 3 }, { 2, 2 } }, + { { 2, 4 }, { 1, 4 }, { 7, 7 }, { 0, 7 }, { 4, 6 }, + { 6, 5 }, { 8, 4 }, { 3, 2 }, { 5, 1 } }, + { { 2, 2 }, { 1, 2 }, { 5, 3 }, { 0, 3 }, { 4, 4 }, + { 3, 4 }, { 8, 5 }, { 7, 5 }, { 6, 4 } }, + { { 4, 7 }, { 0, 7 }, { 8, 7 }, { 7, 7 }, { 2, 5 }, + { 6, 4 }, { 3, 3 }, { 1, 2 }, { 5, 1 } }, + { { 5, 2 }, { 1, 2 }, { 8, 7 }, { 7, 7 }, { 0, 6 }, + { 4, 5 }, { 3, 4 }, { 2, 3 }, { 6, 2 } }, + { { 2, 2 }, { 1, 2 }, { 8, 3 }, { 0, 3 }, { 6, 4 }, + { 5, 4 }, { 4, 5 }, { 3, 5 }, { 7, 4 } }, + { { 2, 2 }, { 1, 2 }, { 5, 3 }, { 0, 3 }, { 7, 6 }, + { 4, 6 }, { 6, 5 }, { 3, 4 }, { 8, 3 } }, + { { 0 } }, /* unused */ + { { 2, 3 }, { 1, 3 }, { 8, 7 }, { 3, 7 }, { 5, 6 }, + { 7, 5 }, { 4, 4 }, { 6, 3 }, { 0, 1 } }, + { { 2, 4 }, { 0, 4 }, { 8, 7 }, { 3, 7 }, { 7, 6 }, + { 5, 5 }, { 4, 4 }, { 6, 2 }, { 1, 1 } }, + { { 5, 7 }, { 3, 7 }, { 8, 7 }, { 7, 7 }, { 4, 5 }, + { 1, 4 }, { 6, 3 }, { 0, 2 }, { 2, 1 } }, + { { 6, 2 }, { 1, 2 }, { 2, 3 }, { 0, 3 }, { 8, 6 }, + { 7, 6 }, { 3, 5 }, { 5, 4 }, { 4, 3 } }, + { { 5, 7 }, { 3, 7 }, { 8, 7 }, { 7, 7 }, { 1, 5 }, + { 2, 4 }, { 0, 3 }, { 4, 2 }, { 6, 1 } }, + { { 5, 3 }, { 2, 3 }, { 8, 7 }, { 7, 7 }, { 3, 6 }, + { 4, 5 }, { 0, 4 }, { 6, 3 }, { 1, 1 } }, + { { 5, 7 }, { 3, 7 }, { 8, 7 }, { 7, 7 }, { 2, 5 }, + { 0, 4 }, { 4, 3 }, { 1, 2 }, { 6, 1 } }, + { { 3, 7 }, { 0, 7 }, { 8, 7 }, { 5, 7 }, { 7, 5 }, + { 1, 4 }, { 4, 3 }, { 6, 2 }, { 2, 1 } }, + { { 2, 2 }, { 1, 2 }, { 4, 4 }, { 0, 4 }, { 7, 6 }, + { 3, 6 }, { 5, 5 }, { 8, 4 }, { 6, 2 } }, + { { 0 } }, /* unused */ + { { 6, 6 }, { 4, 6 }, { 5, 7 }, { 3, 7 }, { 8, 6 }, + { 1, 4 }, { 0, 3 }, { 7, 2 }, { 2, 1 } }, + { { 2, 2 }, { 1, 2 }, { 6, 4 }, { 0, 4 }, { 4, 6 }, + { 3, 6 }, { 5, 5 }, { 8, 4 }, { 7, 2 } }, + { { 1, 4 }, { 0, 4 }, { 5, 7 }, { 3, 7 }, { 6, 6 }, + { 4, 5 }, { 8, 4 }, { 7, 2 }, { 2, 1 } }, + { { 7, 2 }, { 2, 2 }, { 1, 3 }, { 0, 3 }, { 5, 4 }, + { 4, 4 }, { 6, 5 }, { 3, 5 }, { 8, 4 } }, + { { 4, 2 }, { 2, 2 }, { 5, 7 }, { 3, 7 }, { 8, 6 }, + { 1, 5 }, { 0, 4 }, { 6, 3 }, { 7, 2 } }, + { { 7, 2 }, { 2, 2 }, { 6, 3 }, { 1, 3 }, { 5, 4 }, + { 0, 4 }, { 4, 5 }, { 3, 5 }, { 8, 4 } }, + { { 4, 2 }, { 2, 2 }, { 3, 7 }, { 0, 7 }, { 8, 6 }, + { 5, 5 }, { 1, 4 }, { 6, 3 }, { 7, 2 } }, + { { 6, 6 }, { 1, 6 }, { 5, 7 }, { 3, 7 }, { 8, 6 }, + { 0, 4 }, { 4, 3 }, { 2, 2 }, { 7, 1 } }, + { { 8, 4 }, { 4, 4 }, { 1, 5 }, { 0, 5 }, { 5, 6 }, + { 3, 6 }, { 6, 5 }, { 7, 2 }, { 2, 1 } }, + { { 0 } }, /* unused */ + { { 8, 2 }, { 2, 2 }, { 1, 3 }, { 0, 3 }, { 6, 6 }, + { 5, 6 }, { 4, 5 }, { 7, 4 }, { 3, 3 } }, + { { 3, 3 }, { 2, 3 }, { 6, 7 }, { 0, 7 }, { 4, 6 }, + { 5, 5 }, { 7, 4 }, { 8, 3 }, { 1, 1 } }, + { { 7, 4 }, { 1, 4 }, { 3, 5 }, { 0, 5 }, { 6, 6 }, + { 5, 6 }, { 4, 5 }, { 8, 2 }, { 2, 1 } }, + { { 3, 2 }, { 2, 2 }, { 4, 6 }, { 0, 6 }, { 7, 6 }, + { 6, 6 }, { 1, 4 }, { 5, 3 }, { 8, 2 } }, + { { 8, 2 }, { 2, 2 }, { 6, 3 }, { 4, 3 }, { 5, 6 }, + { 0, 6 }, { 3, 5 }, { 1, 4 }, { 7, 3 } }, + { { 5, 2 }, { 2, 2 }, { 3, 3 }, { 1, 3 }, { 7, 6 }, + { 0, 6 }, { 4, 5 }, { 6, 4 }, { 8, 3 } }, + { { 2, 2 }, { 1, 2 }, { 6, 3 }, { 4, 3 }, { 7, 6 }, + { 0, 6 }, { 5, 5 }, { 3, 4 }, { 8, 3 } }, + { { 3, 7 }, { 0, 7 }, { 6, 7 }, { 5, 7 }, { 1, 5 }, + { 4, 4 }, { 7, 3 }, { 8, 2 }, { 2, 1 } }, + { { 1, 5 }, { 0, 5 }, { 6, 7 }, { 5, 7 }, { 4, 6 }, + { 7, 5 }, { 3, 3 }, { 2, 2 }, { 8, 1 } }, + { { 0 } }, /* unused */ }; //@}