From patchwork Fri Nov 20 07:18:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23778 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 3041344AB58 for ; Fri, 20 Nov 2020 09:29:26 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0EF7068B9E5; Fri, 20 Nov 2020 09:29:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 24F1268B9D9 for ; Fri, 20 Nov 2020 09:29:24 +0200 (EET) Received: by mail-lj1-f180.google.com with SMTP id l10so9036685lji.4 for ; Thu, 19 Nov 2020 23:29:23 -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=sHi7fQIlhSpnYQKERpgUzGsPLFCPvF/LSq6qevCnhiI=; b=fEPP/shMphKFe850DmIurmyXvv5U1WIdhiNfvwv/kRykJkNiAcCEnBasFuotrcji1w wXaCO6xKqxVWgY02Nm11A5xJv73hwRBEO2kOpCDFcaiULIH209XqdtJLhU8wy0yMoM7s Pk/SyDJaQO/g9vor5393sil8ywJzthXC9jpOFGtG5sBjiAXhP3mJImoYA5H+eixmnO87 puKABJ1wTsW6fIhfhsnq8yBWLy9++mmV4AUYYkNugta5lf0gBoCGD5HX9WTdLsqR05zR pRvqQEpT3OZNQaEZRPehsnpsyc8b/L9L2ZRy5No9ubtkeRczo0k9pr700kia7i4Ue0uo k2Mw== 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=sHi7fQIlhSpnYQKERpgUzGsPLFCPvF/LSq6qevCnhiI=; b=BcnW6PdN1TPd/otiKQGLwwI2Wao3swvrrW030b6OKr+tCfBmw/TEegsadYsW0+QCJp 5zPQLPpTQEQxENF78NrPKB0aDy7RLSa2uEcnOdhFRxQxZp7WGBgBLIDYAopwgtqQzttJ 1Z5r70sg0/zTePVWMyPKu4WohvahalZMB5O54ROYW3OjKhAP6FeVQA5W8RTGrYLVONpK eO0VDaB2a5w6yeRpj07FJka/dzcrXN3K1qSsBZSMpSm8gVYcFWfMg2lLDUKsOJByz9JL xfnMFkDunGWnXvbKPhQZE9jTlV3//xJbkEaWsnmtnQMiumK8fq8H/QadZ3iDH3aV67Ff G81w== X-Gm-Message-State: AOAM532HFxjkkZmLX/9AFJ2AhY7yOHT+hvQ7SJIJgOUQWPronKidG8xy CNGbI+2gNKxAoK72qpegz1hWGRjN/tqnog== X-Google-Smtp-Source: ABdhPJw/1BmSipZvNDtwaPdgkzB2DfRFTGJb78Y9LFNEO0vW4I3HEV0BPKCm4sxX9j2YHY9iCYZr0w== X-Received: by 2002:a05:6402:100e:: with SMTP id c14mr32741447edu.243.1605857046134; Thu, 19 Nov 2020 23:24:06 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:05 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:34 +0100 Message-Id: <20201120072116.818090-2-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 001/162] avcodec/bitstream: Add second function to create 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" When using ff_init_vlc_sparse() to create a VLC, three input tables are used: A table for lengths, one for codes and one for symbols; the latter one can be omitted, then a default one will be used. These input tables will be traversed twice, once to get the long codes (which will be put into subtables) and once for the small codes. The long codes are then sorted so that entries that should be in the same subtable are contiguous. This commit adds an alternative to ff_init_vlc_sparse(): ff_init_vlc_from_lengths(). It is based upon the observation that if lengths, codes and symbols tables are permuted (in the same way) so that the codes are ordered from left to right in the corresponding tree and if said tree is complete (i.e. every non-leaf node has two children), the codes can be easily computed from the lengths and are therefore redundant. This means that if one initializes such a VLC with explicitly coded lengths, codes and symbols, the codes can be avoided; and even if one has no explicitly coded symbols, it might still be beneficial to remove the codes even when one has to add a new symbol table, because codes are typically longer than symbols so that the latter often fit into a smaller type, saving space. Furthermore, given that the codes here are by definition ordered from left to right, it is unnecessary to sort them again; for the same reason, one does not have to traverse the input twice. This function proved to be faster than ff_init_vlc_sparse() whenever it has been benchmarked. This function is usable for static tables (they can simply be permuted once) as well as in scenarios where the tables are naturally ordered from left to right in the tree; the latter e.g. happens with Smacker, Theora and several other formats. In order to make it also usable for (static) tables with incomplete trees, negative lengths are used to indicate that there is an open end of a certain length. Finally, ff_init_vlc_from_lengths() has one downside compared to ff_init_vlc_sparse(): The latter uses tables that can be reused by encoders. Of course, one could calculate the needed table at runtime if one so wishes, but it is nevertheless an obstacle. Signed-off-by: Andreas Rheinhardt --- With logcontext as desired. libavcodec/bitstream.c | 138 ++++++++++++++++++++++++++++++----------- libavcodec/vlc.h | 48 ++++++++++++++ 2 files changed, 150 insertions(+), 36 deletions(-) diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index c7a87734e5..4ce49fd51c 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -132,6 +132,8 @@ static int alloc_table(VLC *vlc, int size, int use_static) return index; } +#define LOCALBUF_ELEMS 1500 // the maximum currently needed is 1296 by rv34 + typedef struct VLCcode { uint8_t bits; VLC_TYPE symbol; @@ -140,6 +142,31 @@ typedef struct VLCcode { uint32_t code; } VLCcode; +static int vlc_common_init(VLC *vlc_arg, int nb_bits, int nb_codes, + VLC **vlc, VLC *localvlc, VLCcode **buf, + int flags) +{ + *vlc = vlc_arg; + (*vlc)->bits = nb_bits; + if (flags & INIT_VLC_USE_NEW_STATIC) { + av_assert0(nb_codes <= LOCALBUF_ELEMS); + *localvlc = *vlc_arg; + *vlc = localvlc; + (*vlc)->table_size = 0; + } else { + (*vlc)->table = NULL; + (*vlc)->table_allocated = 0; + (*vlc)->table_size = 0; + } + if (nb_codes > LOCALBUF_ELEMS) { + *buf = av_malloc_array(nb_codes, sizeof(VLCcode)); + if (!*buf) + return AVERROR(ENOMEM); + } + + return 0; +} + static int compare_vlcspec(const void *a, const void *b) { const VLCcode *sa = a, *sb = b; @@ -248,6 +275,27 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, return table_index; } +static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, + int flags, VLC *vlc_arg, VLCcode localbuf[LOCALBUF_ELEMS]) +{ + int ret = build_table(vlc, nb_bits, nb_codes, codes, flags); + + if (flags & INIT_VLC_USE_NEW_STATIC) { + if(vlc->table_size != vlc->table_allocated) + av_log(NULL, AV_LOG_ERROR, "needed %d had %d\n", vlc->table_size, vlc->table_allocated); + + av_assert0(ret >= 0); + *vlc_arg = *vlc; + } else { + if (codes != localbuf) + av_free(codes); + if (ret < 0) { + av_freep(&vlc->table); + return ret; + } + } + return 0; +} /* Build VLC decoding tables suitable for use with get_vlc(). @@ -278,30 +326,14 @@ int ff_init_vlc_sparse(VLC *vlc_arg, int nb_bits, int nb_codes, const void *symbols, int symbols_wrap, int symbols_size, int flags) { - VLCcode *buf; + VLCcode localbuf[LOCALBUF_ELEMS], *buf = localbuf; int i, j, ret; - VLCcode localbuf[1500]; // the maximum currently needed is 1296 by rv34 VLC localvlc, *vlc; - vlc = vlc_arg; - vlc->bits = nb_bits; - if (flags & INIT_VLC_USE_NEW_STATIC) { - av_assert0(nb_codes <= FF_ARRAY_ELEMS(localbuf)); - localvlc = *vlc_arg; - vlc = &localvlc; - vlc->table_size = 0; - } else { - vlc->table = NULL; - vlc->table_allocated = 0; - vlc->table_size = 0; - } - if (nb_codes > FF_ARRAY_ELEMS(localbuf)) { - buf = av_malloc_array(nb_codes, sizeof(VLCcode)); - if (!buf) - return AVERROR(ENOMEM); - } else - buf = localbuf; - + ret = vlc_common_init(vlc_arg, nb_bits, nb_codes, &vlc, &localvlc, + &buf, flags); + if (ret < 0) + return ret; av_assert0(symbols_size <= 2 || !symbols); j = 0; @@ -342,26 +374,60 @@ int ff_init_vlc_sparse(VLC *vlc_arg, int nb_bits, int nb_codes, COPY(len && len <= nb_bits); nb_codes = j; - ret = build_table(vlc, nb_bits, nb_codes, buf, flags); - - if (flags & INIT_VLC_USE_NEW_STATIC) { - if(vlc->table_size != vlc->table_allocated) - av_log(NULL, AV_LOG_ERROR, "needed %d had %d\n", vlc->table_size, vlc->table_allocated); + return vlc_common_end(vlc, nb_bits, nb_codes, buf, + flags, vlc_arg, localbuf); +} - av_assert0(ret >= 0); - *vlc_arg = *vlc; - } else { - if (buf != localbuf) - av_free(buf); - if (ret < 0) { - av_freep(&vlc->table); - return ret; +int ff_init_vlc_from_lengths(VLC *vlc_arg, int nb_bits, int nb_codes, + const int8_t *lens, int lens_wrap, + const void *symbols, int symbols_wrap, int symbols_size, + int offset, int flags, void *logctx) +{ + VLCcode localbuf[LOCALBUF_ELEMS], *buf = localbuf; + VLC localvlc, *vlc; + uint64_t code; + int ret, j, len_max = FFMIN(32, 3 * nb_bits); + + ret = vlc_common_init(vlc_arg, nb_bits, nb_codes, &vlc, &localvlc, + &buf, flags); + if (ret < 0) + return ret; + + j = code = 0; + for (int i = 0; i < nb_codes; i++, lens += lens_wrap) { + int len = *lens; + if (len > 0) { + unsigned sym; + + buf[j].bits = len; + if (symbols) + GET_DATA(sym, symbols, i, symbols_wrap, symbols_size) + else + sym = i; + buf[j].symbol = sym + offset; + buf[j++].code = code; + } else if (len < 0) { + len = -len; + } else + continue; + if (len > len_max || code & ((1U << (32 - len)) - 1)) { + av_log(logctx, AV_LOG_ERROR, "Invalid VLC (length %u)\n", len); + goto fail; + } + code += 1U << (32 - len); + if (code > UINT32_MAX + 1ULL) { + av_log(logctx, AV_LOG_ERROR, "Overdetermined VLC tree\n"); + goto fail; } } - return 0; + return vlc_common_end(vlc, nb_bits, j, buf, + flags, vlc_arg, localbuf); +fail: + if (buf != localbuf) + av_free(buf); + return AVERROR_INVALIDDATA; } - void ff_free_vlc(VLC *vlc) { av_freep(&vlc->table); diff --git a/libavcodec/vlc.h b/libavcodec/vlc.h index 22d3e33485..50a1834b84 100644 --- a/libavcodec/vlc.h +++ b/libavcodec/vlc.h @@ -49,6 +49,41 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags); + +/** + * Build VLC decoding tables suitable for use with get_vlc2() + * + * This function takes lengths and symbols and calculates the codes from them. + * For this the input lengths and symbols have to be sorted according to "left + * nodes in the corresponding tree first". + * + * @param[in,out] vlc The VLC to be initialized; table and table_allocated + * must have been set when initializing a static VLC, + * otherwise this will be treated as uninitialized. + * @param[in] nb_bits The number of bits to use for the VLC table; + * higher values take up more memory and cache, but + * allow to read codes with fewer reads. + * @param[in] nb_codes The number of provided length and (if supplied) symbol + * entries. + * @param[in] lens The lengths of the codes. Entries > 0 correspond to + * valid codes; entries == 0 will be skipped and entries + * with len < 0 indicate that the tree is incomplete and + * has an open end of length -len at this position. + * @param[in] lens_wrap Stride (in bytes) of the lengths. + * @param[in] symbols The symbols, i.e. what is returned from get_vlc2() + * when the corresponding code is encountered. + * May be NULL, then 0, 1, 2, 3, 4,... will be used. + * @param[in] symbols_wrap Stride (in bytes) of the symbols. + * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. + * @param[in] offset An offset to apply to all the valid symbols. + * @param[in] flags A combination of the INIT_VLC_* flags; notice that + * INIT_VLC_INPUT_LE is pointless and ignored. + */ +int ff_init_vlc_from_lengths(VLC *vlc, int nb_bits, int nb_codes, + const int8_t *lens, int lens_wrap, + const void *symbols, int symbols_wrap, int symbols_size, + int offset, int flags, void *logctx); + void ff_free_vlc(VLC *vlc); /* If INIT_VLC_INPUT_LE is set, the LSB bit of the codes used to @@ -87,4 +122,17 @@ void ff_free_vlc(VLC *vlc); #define INIT_LE_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) +#define INIT_VLC_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \ + symbols, symbols_wrap, symbols_size, \ + offset, flags, static_size) \ + do { \ + static VLC_TYPE table[static_size][2]; \ + (vlc)->table = table; \ + (vlc)->table_allocated = static_size; \ + ff_init_vlc_from_lengths(vlc, bits, nb_codes, lens, len_wrap, \ + symbols, symbols_wrap, symbols_size, \ + offset, flags | INIT_VLC_USE_NEW_STATIC, \ + NULL); \ + } while (0) + #endif /* AVCODEC_VLC_H */ From patchwork Fri Nov 20 07:18:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23749 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 B138644A644 for ; Fri, 20 Nov 2020 09:24:18 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9B72968B9A3; Fri, 20 Nov 2020 09:24:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4257768B97C for ; Fri, 20 Nov 2020 09:24:10 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id gj5so11496740ejb.8 for ; Thu, 19 Nov 2020 23:24:10 -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=3IRRz2+v9aJ7r5EVC+vOqYiXk/xwhcmuqaJduKDi4LI=; b=g6VubAfWK2CEb38Ao7MKtSyI5Q8ep3NNZAdAZtoIt0OhcaX5sYCkaGg2r1QjNmKMXk AuUucMotWycg/Sn0CEhJEqS04b3SbMnssB8V10L59MFXxc16Zy1kNL7J+n5svlA0njzw G3hQuTvconCgCJ38+29HNkuydJxG2pbymfI9pILBQd6RYDi/9yy/ztJj503dBseMG3gv s4HMUTr9SkizG2WOG2+TZIFccfZYbCAsvB0cCmJ92aFueZR+rP7UVoVhP1Ykwu038YIU eH0yHJtV18y7oYnQ4RFlQxJYRtrrK+8qDLDak4tz63ELkc37dToVJZHXx3lKhaWB9Qx+ MFNg== 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=3IRRz2+v9aJ7r5EVC+vOqYiXk/xwhcmuqaJduKDi4LI=; b=jVGIZSsRsLw8Ww+oPmap5JIhyuYpBks2fVVb8VGxz0dUh8u1Dpxk6NqpskCPrHzTM0 izYFUk5fCfRG5WZ2S2ze40TRv6oxPia/DzPFhe9s9qFe5dfmwVxThzmywsIYPUpREj06 IhpQXzFanBNxW61OgI5EEYxWsIq7ZOfZqkZm544KgdacEnPt0OHIsGe5HA1p4/95Y4RL EliobBxViWmQLM2IHOlORbU1coPTD43c6gnVRTzy4ak2ng3RPbbjvwfnH71hTTdM+Bye BwhcrvL4bkHLFV2WFfAk+mtnZ5lrRsnwWDP0f9zRq0tdeb0he5SWTg9lwGunv6Eqw2+S Ce3w== X-Gm-Message-State: AOAM533eVedgeZ3ssfYg8XcuGZRGfocxWUdU7u9I2+X+5b5irZARMvyp 1bVU8b85O6en9CqP0KQuBxCqCFsLIIXq9Q== X-Google-Smtp-Source: ABdhPJwfczUU7vMIlXLEILkOoNP02nV5vez7jQFFmGuLWB0MWf9HH+ABt4RI1bLN7SXUy+K2VvXJLg== X-Received: by 2002:a17:907:20ac:: with SMTP id pw12mr4217033ejb.245.1605857047371; Thu, 19 Nov 2020 23:24:07 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:06 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:35 +0100 Message-Id: <20201120072116.818090-3-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 002/162] avcodec/tscc2: Reduce the size of the tables used to initialize 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" After permuting both the codes, lengths and symbols tables so that the codes tables are ordered from left to right in the tree, the codes tables can be easily computed from the lengths tables at runtime and therefore omitted. This saves about 2KB from the binary. Signed-off-by: Andreas Rheinhardt --- libavcodec/tscc2.c | 24 +- libavcodec/tscc2data.h | 1195 +++++++++++++--------------------------- 2 files changed, 393 insertions(+), 826 deletions(-) diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index 9fa28fe9fc..2522324d94 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -62,24 +62,24 @@ static av_cold int init_vlcs(TSCC2Context *c) { int i, ret; - ret = ff_init_vlc_sparse(&c->dc_vlc, 9, DC_VLC_COUNT, - tscc2_dc_vlc_bits, 1, 1, - tscc2_dc_vlc_codes, 2, 2, - tscc2_dc_vlc_syms, 2, 2, INIT_VLC_LE); + ret = ff_init_vlc_from_lengths(&c->dc_vlc, 9, DC_VLC_COUNT, + tscc2_dc_vlc_lens, 1, + tscc2_dc_vlc_syms, 2, 2, + 0, INIT_VLC_OUTPUT_LE, c->avctx); if (ret) return ret; for (i = 0; i < NUM_VLC_SETS; i++) { - ret = ff_init_vlc_sparse(c->nc_vlc + i, 9, 16, - tscc2_nc_vlc_bits[i], 1, 1, - tscc2_nc_vlc_codes[i], 2, 2, - tscc2_nc_vlc_syms, 1, 1, INIT_VLC_LE); + ret = ff_init_vlc_from_lengths(c->nc_vlc + i, 9, 16, + tscc2_nc_vlc_lens[i], 1, + tscc2_nc_vlc_syms[i], 1, 1, + 0, INIT_VLC_OUTPUT_LE, c->avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(c->ac_vlc + i, 9, tscc2_ac_vlc_sizes[i], - tscc2_ac_vlc_bits[i], 1, 1, - tscc2_ac_vlc_codes[i], 2, 2, - tscc2_ac_vlc_syms[i], 2, 2, INIT_VLC_LE); + ret = ff_init_vlc_from_lengths(c->ac_vlc + i, 9, tscc2_ac_vlc_sizes[i], + tscc2_ac_vlc_bits[i], 1, + tscc2_ac_vlc_syms[i], 2, 2, + 0, INIT_VLC_OUTPUT_LE, c->avctx); if (ret) return ret; } diff --git a/libavcodec/tscc2data.h b/libavcodec/tscc2data.h index 5e8d18b3f5..2ccfa3b811 100644 --- a/libavcodec/tscc2data.h +++ b/libavcodec/tscc2data.h @@ -37,866 +37,441 @@ static const uint16_t tscc2_quants[NUM_VLC_SETS][3] = { #define DC_VLC_COUNT 47 static const uint16_t tscc2_dc_vlc_syms[DC_VLC_COUNT] = { - 0x100, 0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, - 0xF8, 0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, - 0xF0, 0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0x17, - 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, - 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, -}; - -static const uint16_t tscc2_dc_vlc_codes[DC_VLC_COUNT] = { - 0x000A, 0x0000, 0x0006, 0x002E, 0x0002, 0x000E, 0x001A, 0x007E, - 0x004E, 0x005A, 0x00E2, 0x01BE, 0x01BA, 0x00BA, 0x0072, 0x0022, - 0x02BE, 0x00BE, 0x033A, 0x03F2, 0x01F2, 0x03A2, 0x0122, 0x0322, - 0x01A2, 0x0172, 0x0372, 0x013A, 0x00CE, 0x02CE, 0x02FE, 0x00FE, - 0x00A2, 0x00F2, 0x003A, 0x01CE, 0x01FE, 0x0062, 0x00DA, 0x003E, - 0x0032, 0x007A, 0x0012, 0x001E, 0x0016, 0x0004, 0x0001, -}; - -static const uint8_t tscc2_dc_vlc_bits[DC_VLC_COUNT] = { - 5, 3, 5, 6, 6, 7, 7, 8, - 8, 8, 8, 9, 9, 9, 9, 9, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 9, 9, 9, 9, 9, 8, 8, 8, - 7, 7, 6, 6, 5, 3, 1, -}; - -static const uint8_t tscc2_nc_vlc_syms[16] = { - 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, - 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, -}; - -static const uint16_t tscc2_nc_vlc_codes[NUM_VLC_SETS][16] = { - { 0x0023, 0x0003, 0x0031, 0x0021, 0x0011, 0x0053, 0x0013, 0x0001, - 0x0009, 0x0029, 0x0033, 0x0019, 0x000B, 0x0005, 0x0007, 0x0000, }, - { 0x0030, 0x0022, 0x0028, 0x0020, 0x0008, 0x0000, 0x0032, 0x0072, - 0x0010, 0x0002, 0x0012, 0x0018, 0x000A, 0x0004, 0x0006, 0x0001, }, - { 0x0032, 0x0038, 0x0020, 0x0008, 0x0002, 0x0018, 0x0072, 0x0000, - 0x0028, 0x0022, 0x0012, 0x0010, 0x000A, 0x0004, 0x0006, 0x0001, }, - { 0x0032, 0x0010, 0x0072, 0x0030, 0x0022, 0x0038, 0x0008, 0x0028, - 0x0018, 0x0002, 0x0012, 0x0000, 0x000A, 0x0004, 0x0006, 0x0001, }, - { 0x0012, 0x0052, 0x0000, 0x0020, 0x0018, 0x0022, 0x0008, 0x0028, - 0x0038, 0x0002, 0x0032, 0x0010, 0x000A, 0x0004, 0x0006, 0x0001, }, - { 0x0016, 0x0096, 0x0006, 0x0046, 0x0056, 0x0002, 0x0036, 0x0076, - 0x0012, 0x0022, 0x0032, 0x0026, 0x000A, 0x000E, 0x0000, 0x0001, }, - { 0x001A, 0x009A, 0x0032, 0x0072, 0x005A, 0x007A, 0x003A, 0x0002, - 0x0012, 0x0022, 0x000A, 0x002A, 0x0006, 0x000E, 0x0000, 0x0001, }, - { 0x002A, 0x00AA, 0x0002, 0x0042, 0x006A, 0x003A, 0x007A, 0x0022, - 0x0032, 0x0012, 0x000A, 0x001A, 0x0006, 0x000E, 0x0000, 0x0001, }, - { 0x0042, 0x00C2, 0x0002, 0x000A, 0x004A, 0x003A, 0x007A, 0x0022, - 0x0012, 0x0032, 0x002A, 0x001A, 0x0006, 0x000E, 0x0000, 0x0001, }, - { 0x00BA, 0x01BA, 0x003A, 0x0012, 0x0052, 0x007A, 0x0002, 0x0022, - 0x0032, 0x000A, 0x002A, 0x001A, 0x0000, 0x0004, 0x0006, 0x0001, }, - { 0x00AA, 0x01AA, 0x002A, 0x0022, 0x0062, 0x006A, 0x0002, 0x0012, - 0x0032, 0x000A, 0x001A, 0x003A, 0x0000, 0x0004, 0x0006, 0x0001, }, - { 0x00AA, 0x01AA, 0x002A, 0x0022, 0x0062, 0x006A, 0x0002, 0x0012, - 0x0032, 0x000A, 0x003A, 0x001A, 0x0000, 0x0004, 0x0006, 0x0001, }, - { 0x008A, 0x018A, 0x000A, 0x0022, 0x0062, 0x004A, 0x0002, 0x0012, - 0x0032, 0x002A, 0x001A, 0x003A, 0x0000, 0x0004, 0x0006, 0x0001, }, -}; - -static const uint8_t tscc2_nc_vlc_bits[NUM_VLC_SETS][16] = { - { 6, 6, 6, 6, 6, 7, 7, 6, 6, 6, 6, 5, 4, 3, 3, 1 }, - { 6, 6, 6, 6, 6, 6, 7, 7, 6, 6, 6, 5, 4, 3, 3, 1 }, - { 7, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 5, 4, 3, 3, 1 }, - { 7, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 4, 3, 3, 1 }, - { 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 4, 3, 3, 1 }, - { 8, 8, 7, 7, 7, 6, 7, 7, 6, 6, 6, 6, 4, 4, 2, 1 }, - { 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 4, 4, 2, 1 }, - { 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 4, 4, 2, 1 }, - { 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 4, 4, 2, 1 }, - { 9, 9, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 3, 3, 3, 1 }, - { 9, 9, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 3, 3, 3, 1 }, - { 9, 9, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 3, 3, 3, 1 }, - { 9, 9, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 3, 3, 3, 1 }, + 0x0FF, 0x001, 0x0FC, 0x0F1, 0x0EA, 0x017, 0x00E, 0x016, 0x0EB, 0x009, + 0x0F6, 0x004, 0x006, 0x0F2, 0x015, 0x014, 0x00D, 0x0EC, 0x0ED, 0x100, + 0x0FA, 0x0F7, 0x008, 0x00C, 0x013, 0x0EE, 0x0F3, 0x0F4, 0x005, 0x0FE, + 0x002, 0x0FB, 0x0F8, 0x012, 0x011, 0x00B, 0x0FD, 0x003, 0x007, 0x0EF, + 0x0F0, 0x0F5, 0x0F9, 0x00F, 0x010, 0x00A, 0x000, +}; + +static const uint8_t tscc2_dc_vlc_lens[DC_VLC_COUNT] = { + 3, 3, 6, 9, 10, 10, 9, 10, 10, 8, 8, 6, 7, 9, 10, 10, 9, 10, + 10, 5, 7, 8, 8, 9, 10, 10, 9, 9, 7, 5, 5, 7, 8, 10, 10, 9, + 6, 6, 8, 10, 10, 9, 8, 10, 10, 9, 1, +}; + +static const uint8_t tscc2_nc_vlc_syms[NUM_VLC_SETS][16] = { + { 0x00, 0x08, 0x0C, 0x0B, 0x0D, 0x07, 0x06, 0x04, + 0x02, 0x0E, 0x0F, 0x09, 0x0A, 0x05, 0x03, 0x01 }, + { 0x0A, 0x0C, 0x07, 0x0F, 0x0B, 0x0D, 0x04, 0x02, + 0x06, 0x0E, 0x05, 0x09, 0x08, 0x03, 0x01, 0x00 }, + { 0x08, 0x0D, 0x04, 0x0C, 0x07, 0x0A, 0x0E, 0x02, + 0x0B, 0x06, 0x05, 0x0F, 0x09, 0x03, 0x01, 0x00 }, + { 0x04, 0x0E, 0x0C, 0x09, 0x08, 0x07, 0x0A, 0x02, + 0x06, 0x0B, 0x05, 0x0F, 0x0D, 0x03, 0x01, 0x00 }, + { 0x0D, 0x0C, 0x04, 0x09, 0x08, 0x0B, 0x07, 0x02, + 0x06, 0x0A, 0x0F, 0x0E, 0x05, 0x03, 0x01, 0x00 }, + { 0x01, 0x0A, 0x06, 0x07, 0x05, 0x03, 0x0D, 0x0C, + 0x04, 0x0F, 0x0E, 0x0B, 0x09, 0x08, 0x02, 0x00 }, + { 0x01, 0x08, 0x06, 0x07, 0x0D, 0x0C, 0x05, 0x04, + 0x0F, 0x0E, 0x0B, 0x09, 0x0A, 0x03, 0x02, 0x00 }, + { 0x01, 0x0D, 0x0C, 0x08, 0x06, 0x07, 0x05, 0x0F, + 0x0E, 0x0B, 0x04, 0x0A, 0x09, 0x03, 0x02, 0x00 }, + { 0x01, 0x0D, 0x0F, 0x0E, 0x08, 0x07, 0x06, 0x0C, + 0x0B, 0x05, 0x04, 0x0A, 0x09, 0x03, 0x02, 0x00 }, + { 0x03, 0x02, 0x09, 0x08, 0x0C, 0x0B, 0x07, 0x06, + 0x05, 0x04, 0x0D, 0x0F, 0x0E, 0x0A, 0x01, 0x00 }, + { 0x03, 0x02, 0x09, 0x0C, 0x0B, 0x08, 0x07, 0x06, + 0x0D, 0x0F, 0x0E, 0x0A, 0x05, 0x04, 0x01, 0x00 }, + { 0x03, 0x02, 0x09, 0x0C, 0x0B, 0x08, 0x07, 0x06, + 0x0D, 0x0F, 0x0E, 0x0A, 0x04, 0x05, 0x01, 0x00 }, + { 0x03, 0x02, 0x09, 0x0C, 0x0B, 0x08, 0x07, 0x0D, + 0x0F, 0x0E, 0x0A, 0x06, 0x05, 0x04, 0x01, 0x00 }, +}; + +static const uint8_t tscc2_nc_vlc_lens[NUM_VLC_SETS][16] = { + { 1, 6, 6, 6, 6, 6, 6, 5, 3, 6, 6, 7, 7, 6, 4, 3 }, + { 6, 6, 6, 6, 6, 6, 5, 3, 6, 6, 6, 7, 7, 4, 3, 1 }, + { 6, 6, 5, 6, 6, 6, 6, 3, 6, 6, 6, 7, 7, 4, 3, 1 }, + { 5, 6, 6, 6, 6, 6, 6, 3, 6, 6, 6, 7, 7, 4, 3, 1 }, + { 6, 6, 5, 6, 6, 6, 6, 3, 6, 6, 7, 7, 6, 4, 3, 1 }, + { 2, 6, 6, 6, 6, 4, 7, 7, 6, 8, 8, 7, 7, 7, 4, 1 }, + { 2, 6, 6, 6, 7, 7, 6, 6, 8, 8, 7, 7, 7, 4, 4, 1 }, + { 2, 7, 7, 6, 6, 6, 6, 8, 8, 7, 6, 7, 7, 4, 4, 1 }, + { 2, 7, 8, 8, 6, 6, 6, 7, 7, 6, 6, 7, 7, 4, 4, 1 }, + { 3, 3, 6, 6, 7, 7, 6, 6, 6, 6, 8, 9, 9, 7, 3, 1 }, + { 3, 3, 6, 7, 7, 6, 6, 6, 8, 9, 9, 7, 6, 6, 3, 1 }, + { 3, 3, 6, 7, 7, 6, 6, 6, 8, 9, 9, 7, 6, 6, 3, 1 }, + { 3, 3, 6, 7, 7, 6, 6, 8, 9, 9, 7, 6, 6, 6, 3, 1 }, }; static const uint16_t ac_vlc_desc0_syms[172] = { - 0x1000, 0xFF8, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, 0xFF1, - 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, 0xFE0, - 0xFD6, 0xFD5, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6, 0xFC5, - 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB5, 0xFB3, 0xFB2, 0xFB1, - 0xFB0, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF95, 0xF91, 0xF90, - 0xF83, 0xF81, 0xF80, 0xF73, 0xF71, 0xF70, 0xF61, 0xF60, - 0xF51, 0xF50, 0xF45, 0xF41, 0xF40, 0xF31, 0xF30, 0xF21, - 0xF20, 0xF10, 0xF00, 0xEF0, 0xEE0, 0xED5, 0xED1, 0xED0, - 0xEC0, 0xEB0, 0xEA0, 0xE90, 0xE80, 0xE70, 0xE60, 0xE50, - 0xE40, 0xE30, 0xE20, 0xE10, 0xE00, 0xDF0, 0xDE0, 0xDD0, - 0xDC0, 0xDB0, 0xDA0, 0xD90, 0xD80, 0xD60, 0xCD1, 0x280, - 0x270, 0x260, 0x250, 0x240, 0x230, 0x220, 0x210, 0x200, - 0x1F0, 0x1E0, 0x1D0, 0x1C0, 0x1B0, 0x1A1, 0x1A0, 0x190, - 0x180, 0x170, 0x160, 0x150, 0x140, 0x130, 0x121, 0x120, - 0x111, 0x110, 0x101, 0x100, 0x0F1, 0x0F0, 0x0E1, 0x0E0, - 0x0D1, 0x0D0, 0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A5, 0x0A1, - 0x0A0, 0x091, 0x090, 0x081, 0x080, 0x075, 0x071, 0x070, - 0x065, 0x063, 0x061, 0x060, 0x055, 0x053, 0x052, 0x051, - 0x050, 0x046, 0x045, 0x043, 0x042, 0x041, 0x040, 0x036, - 0x035, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025, 0x024, - 0x023, 0x022, 0x021, 0x020, 0x018, 0x016, 0x015, 0x014, - 0x013, 0x012, 0x011, 0x010, -}; - -static const uint16_t ac_vlc_desc0_codes[172] = { - 0x001F, 0x0D71, 0x013F, 0x006C, 0x00A7, 0x0067, 0x001C, 0x0008, - 0x0005, 0x06F1, 0x002C, 0x04BA, 0x0072, 0x01AA, 0x0002, 0x0006, - 0x06AC, 0x02AF, 0x06EF, 0x018F, 0x000A, 0x0009, 0x02AC, 0x042A, - 0x06E1, 0x068F, 0x00B1, 0x0000, 0x0317, 0x0C17, 0x0612, 0x010F, - 0x0011, 0x0FBA, 0x002A, 0x0172, 0x000C, 0x05AC, 0x03D7, 0x0037, - 0x0E8F, 0x02F2, 0x0041, 0x0BE1, 0x057F, 0x004A, 0x00AF, 0x006F, - 0x06AA, 0x0097, 0x0101, 0x0012, 0x0081, 0x0571, 0x0092, 0x0EAF, - 0x01BF, 0x00D7, 0x0031, 0x0001, 0x01F2, 0x0F17, 0x053A, 0x00BF, - 0x038F, 0x0217, 0x0371, 0x01F1, 0x01BA, 0x022A, 0x02BF, 0x028F, - 0x008F, 0x03F1, 0x00E1, 0x00BA, 0x00F2, 0x0EBF, 0x06AF, 0x048F, - 0x0FE1, 0x0271, 0x07BA, 0x0D3A, 0x0C12, 0x08AC, 0x0717, 0x00AC, - 0x0412, 0x0901, 0x04E1, 0x07E1, 0x0417, 0x0CAF, 0x04AC, 0x01AC, - 0x04F2, 0x03BA, 0x05D7, 0x07F1, 0x01D7, 0x04AF, 0x04EF, 0x03AC, - 0x00AA, 0x01E1, 0x0071, 0x00F1, 0x012C, 0x03EF, 0x082A, 0x0112, - 0x03E1, 0x01FA, 0x0DAC, 0x0131, 0x0E12, 0x000F, 0x0B17, 0x007F, - 0x0AEF, 0x007A, 0x02AA, 0x0061, 0x0671, 0x0027, 0x013A, 0x058F, - 0x00FF, 0x033A, 0x0032, 0x0301, 0x0021, 0x0C8F, 0x037F, 0x0077, - 0x02F1, 0x02E1, 0x003A, 0x003C, 0x0212, 0x0817, 0x0CE1, 0x003F, - 0x0007, 0x0017, 0x0501, 0x02BA, 0x06BF, 0x0057, 0x0010, 0x02EF, - 0x0117, 0x017F, 0x00EF, 0x006A, 0x0019, 0x0171, 0x01EF, 0x06BA, - 0x012A, 0x00FA, 0x0022, 0x000E, 0x0AE1, 0x01AF, 0x0052, 0x002F, - 0x004F, 0x001A, 0x0004, 0x0003, + 0x0FC0, 0x0040, 0x0FF1, 0x0011, 0x0FA0, 0x0FE5, 0x0140, 0x0280, 0x0D60, + 0x0210, 0x0FC6, 0x0FD6, 0x0200, 0x0F95, 0x0101, 0x0190, 0x0FF5, 0x0FF2, + 0x0060, 0x0FE1, 0x0021, 0x0F41, 0x0270, 0x0D80, 0x0055, 0x0FB2, 0x00F1, + 0x0120, 0x0F30, 0x0015, 0x0090, 0x0FE3, 0x0FA1, 0x0E00, 0x01F0, 0x0F81, + 0x0EE0, 0x0FD1, 0x0F70, 0x0FA3, 0x0121, 0x0FC5, 0x0E70, 0x0023, 0x0180, + 0x00C1, 0x0F51, 0x0FE2, 0x0031, 0x0012, 0x0061, 0x00A5, 0x0ED1, 0x0D90, + 0x0091, 0x0E10, 0x0FE4, 0x0043, 0x0024, 0x0E80, 0x01E0, 0x0DA0, 0x0FA5, + 0x00D0, 0x0022, 0x0110, 0x0FE0, 0x0020, 0x0EF0, 0x0F45, 0x0260, 0x0045, + 0x0081, 0x0F40, 0x0F80, 0x0080, 0x00C0, 0x0E20, 0x0250, 0x0052, 0x0063, + 0x0018, 0x0FC3, 0x0170, 0x0111, 0x0F73, 0x0240, 0x0DC0, 0x0FB0, 0x0F00, + 0x0100, 0x0FC1, 0x0160, 0x0DB0, 0x00B1, 0x0026, 0x0F31, 0x0FF8, 0x0EA0, + 0x0150, 0x0065, 0x0FE6, 0x0E90, 0x0E30, 0x01C0, 0x0FD0, 0x0030, 0x0FF0, + 0x0010, 0x0050, 0x00B0, 0x0FF4, 0x0FF3, 0x0046, 0x0053, 0x0230, 0x0FB3, + 0x0EB0, 0x0035, 0x0FB5, 0x00E1, 0x0CD1, 0x0ED5, 0x0F50, 0x0041, 0x0F10, + 0x01B0, 0x01D0, 0x0F91, 0x0F90, 0x0070, 0x00F0, 0x0FB1, 0x0E40, 0x0DD0, + 0x0075, 0x0E50, 0x0FC2, 0x0F83, 0x0FD2, 0x00A1, 0x0EC0, 0x0013, 0x0014, + 0x0F61, 0x01A1, 0x0220, 0x0FD5, 0x0DE0, 0x0F21, 0x0016, 0x0F60, 0x0032, + 0x01A0, 0x0036, 0x00D1, 0x0FD3, 0x0025, 0x0130, 0x1000, 0x0051, 0x0FF6, + 0x0ED0, 0x0E60, 0x0042, 0x0DF0, 0x0F20, 0x00E0, 0x0033, 0x0F71, 0x0071, + 0x00A0, }; -static const uint8_t ac_vlc_desc0_bits[172] = { - 6, 12, 9, 7, 8, 7, 6, 4, - 3, 11, 9, 11, 9, 9, 6, 4, - 11, 11, 11, 11, 7, 5, 11, 11, - 11, 12, 8, 5, 12, 12, 12, 9, - 6, 12, 12, 9, 6, 12, 10, 7, - 12, 10, 7, 12, 11, 7, 11, 8, - 11, 8, 12, 11, 8, 12, 8, 12, - 9, 9, 9, 9, 9, 12, 12, 10, - 10, 10, 10, 10, 10, 10, 11, 11, - 11, 11, 11, 11, 11, 12, 12, 12, - 12, 11, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 11, 11, - 11, 11, 11, 11, 11, 12, 11, 10, - 10, 10, 10, 10, 9, 10, 12, 9, - 12, 9, 12, 9, 12, 9, 12, 9, - 12, 8, 11, 8, 11, 8, 11, 11, - 8, 10, 7, 10, 7, 12, 10, 7, - 11, 12, 9, 6, 11, 12, 12, 9, - 6, 12, 11, 11, 12, 8, 5, 12, - 10, 11, 11, 7, 5, 11, 10, 11, - 9, 9, 6, 4, 12, 9, 7, 8, - 7, 6, 4, 3, +static const uint16_t ac_vlc_desc1_syms[169] = { + 0x00D0, 0x0E50, 0x00D1, 0x0091, 0x0160, 0x0F31, 0x0EE1, 0x0250, 0x0F70, + 0x0051, 0x0F41, 0x0063, 0x0150, 0x0EF0, 0x01A0, 0x0F51, 0x0FD5, 0x0F93, + 0x0DC0, 0x0240, 0x0095, 0x0FD2, 0x00C0, 0x0FC0, 0x0040, 0x0090, 0x0016, + 0x0F40, 0x0FA0, 0x0026, 0x0EB0, 0x0EF1, 0x0DF0, 0x0053, 0x0F01, 0x01F0, + 0x0FC2, 0x0FF6, 0x0FF5, 0x0060, 0x0015, 0x0F85, 0x0DE1, 0x0032, 0x0100, + 0x0046, 0x0DB0, 0x0FB5, 0x0F81, 0x0FA1, 0x0012, 0x0011, 0x0FF1, 0x0FF2, + 0x0F00, 0x0E00, 0x0F21, 0x0F45, 0x0FD3, 0x0E60, 0x00C1, 0x0E80, 0x0035, + 0x0045, 0x0140, 0x0042, 0x0FB2, 0x0EB6, 0x0033, 0x0FC5, 0x0190, 0x0FE6, + 0x0024, 0x0F61, 0x0085, 0x0E33, 0x0E70, 0x0EC0, 0x00B0, 0x0F50, 0x0F80, + 0x0080, 0x0023, 0x0FE4, 0x01E0, 0x0F11, 0x0081, 0x0FC1, 0x0FD1, 0x0052, + 0x0FA5, 0x0F95, 0x0EC6, 0x00B1, 0x0111, 0x0061, 0x00F0, 0x0FE3, 0x0FE1, + 0x0021, 0x0041, 0x0FE2, 0x0055, 0x0FC6, 0x0E10, 0x0180, 0x0E20, 0x0DE0, + 0x0022, 0x0025, 0x0FB3, 0x0FA3, 0x0036, 0x0FC3, 0x00E0, 0x0FE0, 0x0020, + 0x0050, 0x0FB0, 0x1000, 0x0031, 0x01D0, 0x0018, 0x00A1, 0x0FB6, 0x00C6, + 0x0043, 0x0F10, 0x0F20, 0x0101, 0x0E30, 0x0FA6, 0x00F1, 0x0ED0, 0x0FD0, + 0x00A0, 0x0FD6, 0x0DA0, 0x0E31, 0x0120, 0x0130, 0x0170, 0x01C0, 0x00E1, + 0x0F60, 0x0014, 0x0070, 0x0F90, 0x0030, 0x0FB1, 0x0075, 0x0E90, 0x0F91, + 0x0FF4, 0x0013, 0x0FF3, 0x0EE0, 0x0FF8, 0x0065, 0x0E40, 0x01B0, 0x0F30, + 0x0071, 0x0FE5, 0x0EA0, 0x0F71, 0x0110, 0x0FF0, 0x0010, }; -static const uint16_t ac_vlc_desc1_syms[169] = { - 0x1000, 0xFF8, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, 0xFF1, - 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, 0xFE0, - 0xFD6, 0xFD5, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6, 0xFC5, - 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3, 0xFB2, - 0xFB1, 0xFB0, 0xFA6, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF95, - 0xF93, 0xF91, 0xF90, 0xF85, 0xF81, 0xF80, 0xF71, 0xF70, - 0xF61, 0xF60, 0xF51, 0xF50, 0xF45, 0xF41, 0xF40, 0xF31, - 0xF30, 0xF21, 0xF20, 0xF11, 0xF10, 0xF01, 0xF00, 0xEF1, - 0xEF0, 0xEE1, 0xEE0, 0xED0, 0xEC6, 0xEC0, 0xEB6, 0xEB0, - 0xEA0, 0xE90, 0xE80, 0xE70, 0xE60, 0xE50, 0xE40, 0xE33, - 0xE31, 0xE30, 0xE20, 0xE10, 0xE00, 0xDF0, 0xDE1, 0xDE0, - 0xDC0, 0xDB0, 0xDA0, 0x250, 0x240, 0x1F0, 0x1E0, 0x1D0, - 0x1C0, 0x1B0, 0x1A0, 0x190, 0x180, 0x170, 0x160, 0x150, - 0x140, 0x130, 0x120, 0x111, 0x110, 0x101, 0x100, 0x0F1, - 0x0F0, 0x0E1, 0x0E0, 0x0D1, 0x0D0, 0x0C6, 0x0C1, 0x0C0, - 0x0B1, 0x0B0, 0x0A1, 0x0A0, 0x095, 0x091, 0x090, 0x085, - 0x081, 0x080, 0x075, 0x071, 0x070, 0x065, 0x063, 0x061, - 0x060, 0x055, 0x053, 0x052, 0x051, 0x050, 0x046, 0x045, - 0x043, 0x042, 0x041, 0x040, 0x036, 0x035, 0x033, 0x032, - 0x031, 0x030, 0x026, 0x025, 0x024, 0x023, 0x022, 0x021, - 0x020, 0x018, 0x016, 0x015, 0x014, 0x013, 0x012, 0x011, - 0x010, -}; - -static const uint16_t ac_vlc_desc1_codes[169] = { - 0x0019, 0x027D, 0x0084, 0x0044, 0x009D, 0x003D, 0x000A, 0x0002, - 0x0003, 0x00EA, 0x02FD, 0x017A, 0x01C6, 0x00B6, 0x0026, 0x000E, - 0x0095, 0x0260, 0x032A, 0x0360, 0x0006, 0x0005, 0x05B6, 0x036A, - 0x06F6, 0x0704, 0x00FA, 0x0010, 0x0279, 0x04D4, 0x00F6, 0x066A, - 0x001D, 0x0029, 0x05F9, 0x0846, 0x04F6, 0x01D4, 0x0038, 0x0446, - 0x0160, 0x031D, 0x0075, 0x0054, 0x02D4, 0x005A, 0x05FD, 0x0040, - 0x06EA, 0x0055, 0x0460, 0x009A, 0x052A, 0x00A0, 0x00D8, 0x0380, - 0x017D, 0x092A, 0x00F9, 0x0D7A, 0x0179, 0x0304, 0x002A, 0x0104, - 0x01A0, 0x0780, 0x007D, 0x03F9, 0x0C46, 0x03EA, 0x0E6A, 0x0204, - 0x01FD, 0x051D, 0x02AA, 0x05EA, 0x00AA, 0x0080, 0x067D, 0x09EA, - 0x0C95, 0x09F9, 0x07B6, 0x0DB6, 0x012A, 0x0904, 0x0454, 0x0FB6, - 0x0960, 0x08D4, 0x0495, 0x0F80, 0x0560, 0x0B04, 0x057A, 0x0079, - 0x0795, 0x0E7D, 0x0060, 0x076A, 0x03B6, 0x0395, 0x0180, 0x02A0, - 0x006A, 0x0195, 0x0295, 0x0646, 0x03FD, 0x01F9, 0x0154, 0x0DF9, - 0x00C6, 0x0F95, 0x01F6, 0x0480, 0x0000, 0x0A79, 0x04AA, 0x00E0, - 0x0246, 0x001A, 0x0479, 0x0015, 0x0D60, 0x0280, 0x0018, 0x01EA, - 0x037A, 0x003A, 0x011D, 0x00FD, 0x0035, 0x0A7D, 0x04A0, 0x0146, - 0x0024, 0x01B6, 0x0504, 0x0046, 0x0020, 0x0009, 0x00D4, 0x03AA, - 0x0679, 0x026A, 0x0036, 0x0008, 0x02F6, 0x01AA, 0x016A, 0x0254, - 0x0039, 0x000D, 0x0004, 0x0176, 0x02EA, 0x007A, 0x0076, 0x0016, - 0x0001, 0x0879, 0x0058, 0x0014, 0x00D5, 0x005D, 0x0034, 0x000C, - 0x0007, +static const uint16_t ac_vlc_desc2_syms[165] = { + 0x0051, 0x0E61, 0x0E81, 0x0E80, 0x0FF7, 0x0E00, 0x0E30, 0x0F71, 0x0130, + 0x00F0, 0x0170, 0x0E70, 0x0F81, 0x0F40, 0x0FF3, 0x0040, 0x0013, 0x0FA0, + 0x0FC0, 0x0060, 0x0065, 0x0E40, 0x0ED0, 0x0043, 0x0086, 0x0F93, 0x0036, + 0x0035, 0x0F10, 0x0EA1, 0x01B3, 0x0F36, 0x0FD5, 0x0FA1, 0x0F41, 0x0096, + 0x0EB3, 0x0F26, 0x0F16, 0x0FB6, 0x0FB5, 0x0160, 0x0FD6, 0x0F80, 0x0080, + 0x1000, 0x00B0, 0x0FE5, 0x0091, 0x0E90, 0x0241, 0x0231, 0x0FF5, 0x0015, + 0x0081, 0x0120, 0x0EA0, 0x0053, 0x0F51, 0x0FC2, 0x0F50, 0x0FF6, 0x0061, + 0x0EB1, 0x0018, 0x0FF8, 0x0240, 0x0042, 0x0085, 0x0EF1, 0x0FD1, 0x0FF2, + 0x0012, 0x0016, 0x0FD2, 0x0FC6, 0x0063, 0x00A5, 0x0F20, 0x0055, 0x0052, + 0x0E10, 0x0150, 0x00C1, 0x01D0, 0x0F95, 0x0032, 0x00E0, 0x01A0, 0x0EE1, + 0x0024, 0x0EF0, 0x0FC1, 0x0F60, 0x0031, 0x0190, 0x0F11, 0x0FB2, 0x0F21, + 0x0110, 0x0FC3, 0x0FE4, 0x0F01, 0x0095, 0x0FD3, 0x0FB3, 0x0E71, 0x0F61, + 0x0EB0, 0x0026, 0x00A0, 0x00D0, 0x0045, 0x00A1, 0x00B1, 0x0180, 0x01C0, + 0x0FF1, 0x0011, 0x0FB0, 0x0050, 0x0F90, 0x0041, 0x0033, 0x0F91, 0x0F30, + 0x0FE1, 0x0FE0, 0x0020, 0x0FD0, 0x0070, 0x0FE2, 0x0E50, 0x0FA3, 0x0F75, + 0x0EA3, 0x01B0, 0x0140, 0x0023, 0x0FE3, 0x0021, 0x0030, 0x0100, 0x0071, + 0x0FC5, 0x0EC0, 0x0F00, 0x0090, 0x0022, 0x0F06, 0x0F31, 0x0FA5, 0x00D1, + 0x0E60, 0x0075, 0x0F70, 0x0014, 0x0FF4, 0x0025, 0x0FB1, 0x0FE6, 0x0EE0, + 0x00C0, 0x0FF0, 0x0010, }; -static const uint8_t ac_vlc_desc1_bits[169] = { - 6, 12, 8, 7, 8, 7, 6, 4, - 3, 10, 10, 11, 9, 9, 6, 4, - 11, 10, 10, 10, 7, 5, 12, 11, - 11, 11, 8, 5, 12, 11, 11, 12, - 9, 6, 12, 12, 11, 9, 6, 12, - 12, 10, 7, 11, 10, 7, 11, 7, - 11, 8, 11, 8, 11, 11, 8, 11, - 9, 12, 9, 12, 9, 12, 9, 12, - 9, 12, 10, 10, 12, 10, 12, 10, - 11, 11, 10, 11, 11, 11, 12, 12, - 12, 12, 12, 12, 12, 12, 11, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 11, 11, 11, 11, 10, 10, - 10, 10, 10, 11, 10, 12, 9, 12, - 9, 12, 9, 11, 8, 12, 11, 8, - 11, 8, 11, 8, 12, 10, 7, 12, - 10, 7, 11, 10, 7, 12, 11, 9, - 6, 11, 11, 12, 8, 6, 12, 10, - 11, 11, 8, 5, 11, 10, 10, 10, - 7, 5, 10, 9, 11, 9, 9, 6, - 4, 12, 8, 7, 8, 7, 6, 4, - 3, +static const uint16_t ac_vlc_desc3_syms[162] = { + 0x0FC5, 0x0EC1, 0x0033, 0x0FE3, 0x0FD6, 0x0110, 0x00E0, 0x0071, 0x0F36, + 0x0095, 0x01A1, 0x0F71, 0x0060, 0x0FA0, 0x0FE2, 0x0F20, 0x0F21, 0x0085, + 0x0150, 0x0053, 0x0023, 0x0022, 0x0FF4, 0x0043, 0x0E70, 0x0034, 0x0017, + 0x0140, 0x0170, 0x0EF0, 0x0F50, 0x0F80, 0x00B0, 0x0F26, 0x00D1, 0x0065, + 0x0113, 0x0FF7, 0x0073, 0x01E1, 0x0EF3, 0x0F31, 0x0FB5, 0x0FC0, 0x0040, + 0x0080, 0x0FA1, 0x0FD3, 0x0075, 0x0F41, 0x0FD4, 0x0F83, 0x0EB0, 0x0061, + 0x0013, 0x0FF3, 0x0F10, 0x0F30, 0x0100, 0x0EB1, 0x0F93, 0x0130, 0x00D0, + 0x00A0, 0x00C1, 0x0F95, 0x0FB3, 0x0FC3, 0x0FE5, 0x0FF5, 0x0F81, 0x0F00, + 0x0091, 0x0F66, 0x01B1, 0x0F51, 0x0F60, 0x0FD1, 0x0180, 0x0FF8, 0x0076, + 0x0FB2, 0x0063, 0x0042, 0x0081, 0x0052, 0x0EE1, 0x0FC2, 0x0160, 0x0036, + 0x01D0, 0x0FD2, 0x0EA0, 0x0018, 0x0E80, 0x0FD5, 0x0070, 0x0F90, 0x0FB0, + 0x0015, 0x0032, 0x0123, 0x0F01, 0x0EE3, 0x0ED1, 0x00C0, 0x0FC1, 0x0FF2, + 0x0012, 0x0050, 0x00A1, 0x00F0, 0x0ED0, 0x0FC6, 0x0ED3, 0x01D1, 0x0120, + 0x0016, 0x0031, 0x0FF6, 0x0F40, 0x0EC0, 0x0E90, 0x0F91, 0x0041, 0x0EF1, + 0x0F61, 0x0035, 0x0FB1, 0x0FF1, 0x0011, 0x0FE0, 0x0020, 0x0FE1, 0x0090, + 0x00B1, 0x0163, 0x0055, 0x0024, 0x0F56, 0x0FA3, 0x0FE4, 0x0F46, 0x0FE6, + 0x0025, 0x0026, 0x0EE0, 0x0FA5, 0x01C1, 0x0F70, 0x0FD0, 0x0030, 0x1000, + 0x0045, 0x0F11, 0x0066, 0x0F85, 0x0051, 0x0014, 0x0021, 0x0FF0, 0x0010, }; -static const uint16_t ac_vlc_desc2_syms[165] = { - 0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, - 0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, - 0xFE0, 0xFD6, 0xFD5, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6, - 0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3, - 0xFB2, 0xFB1, 0xFB0, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF95, - 0xF93, 0xF91, 0xF90, 0xF81, 0xF80, 0xF75, 0xF71, 0xF70, - 0xF61, 0xF60, 0xF51, 0xF50, 0xF41, 0xF40, 0xF36, 0xF31, - 0xF30, 0xF26, 0xF21, 0xF20, 0xF16, 0xF11, 0xF10, 0xF06, - 0xF01, 0xF00, 0xEF1, 0xEF0, 0xEE1, 0xEE0, 0xED0, 0xEC0, - 0xEB3, 0xEB1, 0xEB0, 0xEA3, 0xEA1, 0xEA0, 0xE90, 0xE81, - 0xE80, 0xE71, 0xE70, 0xE61, 0xE60, 0xE50, 0xE40, 0xE30, - 0xE10, 0xE00, 0x241, 0x240, 0x231, 0x1D0, 0x1C0, 0x1B3, - 0x1B0, 0x1A0, 0x190, 0x180, 0x170, 0x160, 0x150, 0x140, - 0x130, 0x120, 0x110, 0x100, 0x0F0, 0x0E0, 0x0D1, 0x0D0, - 0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A5, 0x0A1, 0x0A0, 0x096, - 0x095, 0x091, 0x090, 0x086, 0x085, 0x081, 0x080, 0x075, - 0x071, 0x070, 0x065, 0x063, 0x061, 0x060, 0x055, 0x053, - 0x052, 0x051, 0x050, 0x045, 0x043, 0x042, 0x041, 0x040, - 0x036, 0x035, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025, - 0x024, 0x023, 0x022, 0x021, 0x020, 0x018, 0x016, 0x015, - 0x014, 0x013, 0x012, 0x011, 0x010, -}; - -static const uint16_t ac_vlc_desc2_codes[165] = { - 0x0034, 0x059C, 0x0280, 0x001C, 0x004C, 0x00BD, 0x0020, 0x003C, - 0x000A, 0x0003, 0x00FD, 0x008C, 0x0332, 0x01D5, 0x0055, 0x003E, - 0x0001, 0x07E4, 0x0264, 0x00B2, 0x00A2, 0x005C, 0x0005, 0x02A2, - 0x011D, 0x0132, 0x076C, 0x0012, 0x0018, 0x01E4, 0x05E4, 0x02B2, - 0x0432, 0x017D, 0x000E, 0x055D, 0x0955, 0x0164, 0x0028, 0x0D62, - 0x0B24, 0x02DE, 0x001E, 0x0340, 0x0014, 0x0555, 0x0180, 0x00DD, - 0x01B2, 0x0092, 0x036C, 0x00EC, 0x00E4, 0x00C0, 0x0C64, 0x095D, - 0x01DE, 0x0AE4, 0x0C32, 0x01A2, 0x06E4, 0x0832, 0x01A4, 0x015D, - 0x0732, 0x031D, 0x0F9C, 0x03E2, 0x09E2, 0x02FD, 0x0224, 0x051D, - 0x02E4, 0x019C, 0x05B2, 0x0355, 0x0064, 0x016C, 0x038C, 0x0880, - 0x0480, 0x06B2, 0x0540, 0x0080, 0x075D, 0x0155, 0x0424, 0x0680, - 0x0A62, 0x0A80, 0x078C, 0x0D9C, 0x0F8C, 0x0562, 0x0FF2, 0x0464, - 0x0B55, 0x01E2, 0x0032, 0x07F2, 0x0140, 0x03E4, 0x0662, 0x0755, - 0x0380, 0x026C, 0x0232, 0x001D, 0x0040, 0x00E2, 0x035D, 0x00F2, - 0x0162, 0x01FD, 0x03F2, 0x000C, 0x0EA2, 0x05F2, 0x0072, 0x04E4, - 0x0F32, 0x018C, 0x009D, 0x0324, 0x079C, 0x006C, 0x0054, 0x0F5D, - 0x021D, 0x0015, 0x0024, 0x06A2, 0x009C, 0x0004, 0x0062, 0x056C, - 0x0262, 0x0000, 0x002E, 0x01F2, 0x0124, 0x039C, 0x005E, 0x0010, - 0x0724, 0x00A4, 0x00DE, 0x0362, 0x0052, 0x000D, 0x03B2, 0x007D, - 0x05E2, 0x00D5, 0x005D, 0x0035, 0x0009, 0x099C, 0x0022, 0x002C, - 0x003D, 0x0008, 0x0002, 0x0006, 0x0007, +static const uint16_t ac_vlc_desc4_syms[131] = { + 0x0010, 0x0FB0, 0x0050, 0x0070, 0x0FF5, 0x0FC1, 0x0090, 0x0FD1, 0x00E0, + 0x0161, 0x0085, 0x0F41, 0x0F20, 0x0FD6, 0x0F70, 0x0FD3, 0x0032, 0x0FD2, + 0x0055, 0x0191, 0x0063, 0x0091, 0x0081, 0x0F91, 0x0015, 0x0031, 0x0065, + 0x0036, 0x00B1, 0x0130, 0x0018, 0x0F93, 0x0F50, 0x0041, 0x0FD5, 0x0100, + 0x0F51, 0x00B0, 0x0FE6, 0x0FC5, 0x0F40, 0x0FF2, 0x0FE0, 0x0012, 0x0FE1, + 0x0043, 0x0F61, 0x0FA3, 0x0140, 0x0120, 0x0FB1, 0x0051, 0x0EE0, 0x0F21, + 0x0066, 0x0F03, 0x0F01, 0x0060, 0x0016, 0x0FF6, 0x0FA0, 0x0020, 0x0FF1, + 0x0FD0, 0x0030, 0x0011, 0x0021, 0x0071, 0x00D0, 0x0FE4, 0x0024, 0x0F30, + 0x0080, 0x0123, 0x00A1, 0x0F71, 0x0F00, 0x0180, 0x0EC0, 0x00F3, 0x0F31, + 0x0EF0, 0x0033, 0x0014, 0x0FC0, 0x0F80, 0x0FE3, 0x0FE2, 0x0025, 0x0FC3, + 0x00F0, 0x0053, 0x0075, 0x0F66, 0x0FF4, 0x0040, 0x0F60, 0x0022, 0x00A0, + 0x0ED0, 0x0F13, 0x0181, 0x0F76, 0x0F23, 0x0045, 0x1000, 0x0023, 0x00C0, + 0x0F56, 0x0171, 0x0F10, 0x0FA1, 0x0EB0, 0x0056, 0x0026, 0x0035, 0x0FB5, + 0x0FB3, 0x0EF1, 0x0FF3, 0x0013, 0x0F90, 0x0FA5, 0x0FC2, 0x0F11, 0x0F81, + 0x0110, 0x0042, 0x0061, 0x0FE5, 0x0FF0, }; -static const uint8_t ac_vlc_desc2_bits[165] = { - 6, 12, 12, 8, 7, 8, 6, 6, - 4, 3, 10, 9, 11, 9, 9, 6, - 4, 11, 10, 10, 10, 7, 5, 11, - 11, 10, 11, 8, 5, 11, 11, 11, - 12, 9, 6, 11, 12, 9, 6, 12, - 12, 10, 7, 10, 7, 11, 10, 8, - 11, 8, 11, 8, 11, 8, 12, 12, - 9, 12, 12, 9, 11, 12, 9, 12, - 12, 10, 12, 10, 12, 10, 10, 11, - 12, 12, 11, 12, 11, 11, 11, 12, - 11, 11, 11, 12, 12, 12, 11, 11, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 11, 11, 11, 11, - 10, 10, 10, 10, 9, 9, 11, 9, - 11, 9, 11, 8, 12, 11, 8, 11, - 12, 10, 8, 12, 12, 10, 7, 12, - 10, 7, 11, 12, 9, 6, 10, 11, - 12, 8, 6, 11, 10, 11, 8, 5, - 11, 9, 10, 10, 7, 5, 10, 9, - 11, 9, 9, 6, 4, 12, 8, 7, - 8, 6, 6, 4, 3, +static const uint16_t ac_vlc_desc5_syms[132] = { + 0x0010, 0x0F81, 0x0FC5, 0x0F20, 0x0F76, 0x0061, 0x0F41, 0x00D3, 0x0FB3, + 0x0023, 0x0F31, 0x0EC0, 0x00B1, 0x0045, 0x0F50, 0x0FF5, 0x0042, 0x00C1, + 0x0EC1, 0x00D0, 0x0F33, 0x0F93, 0x0FF8, 0x0EF0, 0x0140, 0x0035, 0x0071, + 0x0FD1, 0x0FE3, 0x0FC1, 0x0FF3, 0x0013, 0x0052, 0x0F85, 0x0F51, 0x0046, + 0x0065, 0x0F21, 0x0F30, 0x0041, 0x0031, 0x0034, 0x0FD4, 0x0F43, 0x0032, + 0x0FB5, 0x0FD2, 0x0FE5, 0x0EE0, 0x0120, 0x0F23, 0x0F00, 0x0015, 0x0FE1, + 0x0FE0, 0x0020, 0x1000, 0x0081, 0x0018, 0x0075, 0x0043, 0x00C3, 0x0121, + 0x00A0, 0x0080, 0x0FA0, 0x0060, 0x0FD0, 0x0030, 0x0FF2, 0x0012, 0x0FF1, + 0x0F80, 0x0F91, 0x0141, 0x00A1, 0x0F96, 0x0FB1, 0x00C0, 0x0111, 0x0F66, + 0x00F0, 0x0F40, 0x0FE6, 0x0016, 0x0021, 0x0FC0, 0x0051, 0x00E0, 0x0F86, + 0x0033, 0x0FF6, 0x0F75, 0x0F11, 0x0055, 0x0F61, 0x0FA3, 0x0131, 0x0FD5, + 0x0FA1, 0x0FC3, 0x0024, 0x0056, 0x0FD6, 0x0F60, 0x0011, 0x0040, 0x0025, + 0x0FE4, 0x0103, 0x0091, 0x0026, 0x0F10, 0x0014, 0x0FE2, 0x0022, 0x0070, + 0x0090, 0x0100, 0x0FC2, 0x0151, 0x0FD3, 0x0FF4, 0x0050, 0x0F70, 0x0053, + 0x0110, 0x0F71, 0x00B0, 0x0F90, 0x0FB0, 0x0FF0, }; -static const uint16_t ac_vlc_desc3_syms[162] = { - 0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, - 0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, - 0xFE0, 0xFD6, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, - 0xFC6, 0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB5, 0xFB3, - 0xFB2, 0xFB1, 0xFB0, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF95, - 0xF93, 0xF91, 0xF90, 0xF85, 0xF83, 0xF81, 0xF80, 0xF71, - 0xF70, 0xF66, 0xF61, 0xF60, 0xF56, 0xF51, 0xF50, 0xF46, - 0xF41, 0xF40, 0xF36, 0xF31, 0xF30, 0xF26, 0xF21, 0xF20, - 0xF11, 0xF10, 0xF01, 0xF00, 0xEF3, 0xEF1, 0xEF0, 0xEE3, - 0xEE1, 0xEE0, 0xED3, 0xED1, 0xED0, 0xEC1, 0xEC0, 0xEB1, - 0xEB0, 0xEA0, 0xE90, 0xE80, 0xE70, 0x1E1, 0x1D1, 0x1D0, - 0x1C1, 0x1B1, 0x1A1, 0x180, 0x170, 0x163, 0x160, 0x150, - 0x140, 0x130, 0x123, 0x120, 0x113, 0x110, 0x100, 0x0F0, - 0x0E0, 0x0D1, 0x0D0, 0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A1, - 0x0A0, 0x095, 0x091, 0x090, 0x085, 0x081, 0x080, 0x076, - 0x075, 0x073, 0x071, 0x070, 0x066, 0x065, 0x063, 0x061, - 0x060, 0x055, 0x053, 0x052, 0x051, 0x050, 0x045, 0x043, - 0x042, 0x041, 0x040, 0x036, 0x035, 0x034, 0x033, 0x032, - 0x031, 0x030, 0x026, 0x025, 0x024, 0x023, 0x022, 0x021, - 0x020, 0x018, 0x017, 0x016, 0x015, 0x014, 0x013, 0x012, - 0x011, 0x010, -}; - -static const uint16_t ac_vlc_desc3_codes[162] = { - 0x001D, 0x087C, 0x0AE8, 0x003A, 0x001C, 0x0008, 0x000C, 0x0032, - 0x0006, 0x0003, 0x03A5, 0x01EC, 0x01A5, 0x0080, 0x0030, 0x0005, - 0x0001, 0x0040, 0x03FC, 0x02D4, 0x0154, 0x02FC, 0x003C, 0x0015, - 0x051A, 0x0000, 0x02EC, 0x077C, 0x00D2, 0x0018, 0x03E8, 0x04EC, - 0x027C, 0x01FA, 0x0022, 0x0765, 0x0EA5, 0x0054, 0x0010, 0x08EC, - 0x0AAC, 0x03BA, 0x0042, 0x065D, 0x0AD4, 0x005C, 0x0028, 0x03C0, - 0x00E5, 0x035C, 0x04FA, 0x00DC, 0x06A5, 0x075C, 0x00C8, 0x05A5, - 0x04D4, 0x00BA, 0x01C0, 0x05E8, 0x012C, 0x00E8, 0x01B0, 0x00B0, - 0x025D, 0x002C, 0x0A52, 0x025C, 0x01E8, 0x00FA, 0x0348, 0x0652, - 0x0B7C, 0x0365, 0x031A, 0x0E52, 0x011A, 0x0200, 0x01BA, 0x02AC, - 0x06D4, 0x01FC, 0x05BA, 0x0DFC, 0x0248, 0x0EE8, 0x0B1A, 0x0CFC, - 0x0F65, 0x0B5C, 0x0DC0, 0x007C, 0x0548, 0x08A5, 0x00FC, 0x03B0, - 0x0148, 0x06AC, 0x0252, 0x071A, 0x02E8, 0x0240, 0x00AC, 0x021A, - 0x0140, 0x08E8, 0x01AC, 0x00EC, 0x0152, 0x00A5, 0x0068, 0x001A, - 0x006C, 0x05C0, 0x015C, 0x0025, 0x05B0, 0x017C, 0x0014, 0x047C, - 0x00D4, 0x06E8, 0x00C0, 0x0002, 0x0A5D, 0x04E8, 0x0A7C, 0x01D4, - 0x0020, 0x04A5, 0x07B0, 0x037C, 0x015D, 0x002A, 0x005D, 0x0048, - 0x067C, 0x007A, 0x0004, 0x04FC, 0x02FA, 0x0648, 0x0100, 0x0052, - 0x005A, 0x000D, 0x0165, 0x0065, 0x02A5, 0x0070, 0x00F0, 0x003D, - 0x0009, 0x05FC, 0x0E48, 0x009A, 0x0012, 0x00DD, 0x0034, 0x000A, - 0x000E, 0x0007, +static const uint16_t ac_vlc_desc6_syms[130] = { + 0x0010, 0x0FF4, 0x0F96, 0x0F71, 0x00D1, 0x0FF7, 0x00E3, 0x0045, 0x0FC1, + 0x1000, 0x00C0, 0x0042, 0x0120, 0x00A0, 0x0F80, 0x0FD1, 0x0F43, 0x0F63, + 0x0EF0, 0x0F86, 0x0F60, 0x0023, 0x0080, 0x00F0, 0x0FB3, 0x00E0, 0x0063, + 0x0110, 0x0F41, 0x0F93, 0x0FF8, 0x0081, 0x0FF5, 0x0041, 0x0FD2, 0x0F30, + 0x0F81, 0x00B1, 0x00E1, 0x0F00, 0x0031, 0x0060, 0x0035, 0x0F51, 0x0FB5, + 0x0FE3, 0x0FF3, 0x0013, 0x0FE0, 0x0032, 0x0075, 0x0FD4, 0x0046, 0x0F40, + 0x0F91, 0x0FE5, 0x00B3, 0x00C3, 0x0EE1, 0x0F31, 0x0FA0, 0x0FE1, 0x0FD0, + 0x0020, 0x0030, 0x0F10, 0x00A1, 0x0FA3, 0x0033, 0x0111, 0x0FA6, 0x0100, + 0x0F61, 0x0026, 0x0FB1, 0x0061, 0x0025, 0x0F95, 0x0FD6, 0x0036, 0x0034, + 0x0F20, 0x00B0, 0x0121, 0x0018, 0x0131, 0x0051, 0x0FF2, 0x0040, 0x0021, + 0x0FC0, 0x0015, 0x0090, 0x0043, 0x0FC5, 0x0056, 0x0055, 0x0016, 0x0FF1, + 0x0011, 0x0012, 0x0FF6, 0x0F50, 0x0FC2, 0x0053, 0x0F76, 0x0F85, 0x0FD3, + 0x0091, 0x0101, 0x0071, 0x0070, 0x0F90, 0x0FB0, 0x0FC3, 0x0065, 0x00F1, + 0x0F53, 0x00D0, 0x0FE2, 0x0FA1, 0x0024, 0x0FE4, 0x0022, 0x0050, 0x0FE6, + 0x0FD5, 0x0F70, 0x0014, 0x0FF0, }; -static const uint8_t ac_vlc_desc3_bits[162] = { - 7, 12, 12, 8, 7, 7, 6, 6, - 4, 3, 10, 9, 11, 8, 8, 6, - 4, 10, 10, 12, 9, 10, 7, 5, - 11, 10, 10, 11, 8, 5, 10, 11, - 12, 9, 6, 12, 12, 9, 6, 12, - 12, 10, 7, 11, 12, 10, 7, 10, - 8, 12, 11, 8, 12, 11, 8, 11, - 11, 9, 11, 11, 9, 12, 11, 9, - 12, 9, 12, 10, 11, 11, 10, 12, - 12, 11, 12, 12, 11, 10, 11, 12, - 11, 11, 11, 12, 11, 12, 12, 12, - 12, 12, 12, 12, 11, 12, 11, 11, - 11, 11, 12, 11, 12, 10, 10, 10, - 9, 12, 9, 12, 9, 12, 8, 10, - 8, 12, 10, 8, 11, 10, 7, 11, - 11, 12, 9, 7, 12, 11, 12, 9, - 6, 11, 11, 12, 9, 6, 10, 10, - 11, 8, 5, 12, 10, 12, 9, 10, - 7, 5, 10, 9, 11, 8, 8, 6, - 4, 12, 12, 8, 7, 8, 6, 6, - 4, 3, +static const uint16_t ac_vlc_desc7_syms[125] = { + 0x0010, 0x0022, 0x0FD5, 0x0F71, 0x0F63, 0x0052, 0x0F31, 0x0042, 0x0024, + 0x0FE4, 0x0F86, 0x0F93, 0x00C1, 0x0025, 0x0FD1, 0x0FE6, 0x0F95, 0x00D1, + 0x0FA6, 0x0FD2, 0x00E1, 0x0017, 0x0FF7, 0x0081, 0x0FB3, 0x0046, 0x0014, + 0x0FF4, 0x0FC1, 0x0023, 0x0031, 0x0060, 0x0FA0, 0x0061, 0x00B0, 0x00C3, + 0x0F00, 0x0121, 0x0F80, 0x0FF5, 0x0041, 0x0FF8, 0x0100, 0x0032, 0x0090, + 0x0F81, 0x0F30, 0x0045, 0x0F61, 0x00C0, 0x0063, 0x0FD4, 0x0055, 0x0F70, + 0x0FF3, 0x0FD0, 0x0030, 0x0FE0, 0x0020, 0x0013, 0x0FE1, 0x0FE3, 0x0FB1, + 0x0093, 0x00B1, 0x0026, 0x0F10, 0x00F0, 0x0FA5, 0x0FB5, 0x0070, 0x0F90, + 0x0FC0, 0x0040, 0x0033, 0x0F40, 0x0FE5, 0x00A1, 0x0034, 0x0036, 0x0F96, + 0x0F91, 0x0043, 0x0F01, 0x0053, 0x0FC5, 0x0035, 0x0F51, 0x00A3, 0x0FC2, + 0x0FA3, 0x0F50, 0x00F1, 0x0071, 0x0051, 0x0021, 0x0FF2, 0x0FF1, 0x0012, + 0x0015, 0x0016, 0x00A0, 0x0FD3, 0x0065, 0x0111, 0x0FC3, 0x0091, 0x0018, + 0x0F20, 0x0050, 0x1000, 0x0FF6, 0x0FB0, 0x0FA1, 0x0101, 0x0F53, 0x00E0, + 0x0080, 0x0F60, 0x00D0, 0x0F41, 0x0F73, 0x0FE2, 0x0011, 0x0FF0, }; -static const uint16_t ac_vlc_desc4_syms[131] = { - 0x1000, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, 0xFF1, 0xFF0, - 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, 0xFE0, 0xFD6, - 0xFD5, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC5, 0xFC3, 0xFC2, - 0xFC1, 0xFC0, 0xFB5, 0xFB3, 0xFB1, 0xFB0, 0xFA5, 0xFA3, - 0xFA1, 0xFA0, 0xF93, 0xF91, 0xF90, 0xF81, 0xF80, 0xF76, - 0xF71, 0xF70, 0xF66, 0xF61, 0xF60, 0xF56, 0xF51, 0xF50, - 0xF41, 0xF40, 0xF31, 0xF30, 0xF23, 0xF21, 0xF20, 0xF13, - 0xF11, 0xF10, 0xF03, 0xF01, 0xF00, 0xEF1, 0xEF0, 0xEE0, - 0xED0, 0xEC0, 0xEB0, 0x191, 0x181, 0x180, 0x171, 0x161, - 0x140, 0x130, 0x123, 0x120, 0x110, 0x100, 0x0F3, 0x0F0, - 0x0E0, 0x0D0, 0x0C0, 0x0B1, 0x0B0, 0x0A1, 0x0A0, 0x091, - 0x090, 0x085, 0x081, 0x080, 0x075, 0x071, 0x070, 0x066, - 0x065, 0x063, 0x061, 0x060, 0x056, 0x055, 0x053, 0x051, - 0x050, 0x045, 0x043, 0x042, 0x041, 0x040, 0x036, 0x035, - 0x033, 0x032, 0x031, 0x030, 0x026, 0x025, 0x024, 0x023, - 0x022, 0x021, 0x020, 0x018, 0x016, 0x015, 0x014, 0x013, - 0x012, 0x011, 0x010, -}; - -static const uint16_t ac_vlc_desc4_codes[131] = { - 0x006B, 0x00BE, 0x0052, 0x00F3, 0x005B, 0x003A, 0x0009, 0x0007, - 0x00DA, 0x03FB, 0x0123, 0x00B3, 0x01B3, 0x002E, 0x0006, 0x030A, - 0x005A, 0x004A, 0x034A, 0x0072, 0x0005, 0x02DA, 0x0173, 0x04FB, - 0x0032, 0x0013, 0x039B, 0x0B9B, 0x011E, 0x0002, 0x00FB, 0x021E, - 0x009B, 0x007E, 0x0E1A, 0x03CA, 0x007B, 0x02FB, 0x0033, 0x03AB, - 0x0463, 0x008A, 0x0773, 0x041E, 0x002B, 0x031B, 0x065A, 0x011A, - 0x060A, 0x01DA, 0x0963, 0x0323, 0x0BAB, 0x059E, 0x010A, 0x05AB, - 0x0CFB, 0x071B, 0x079E, 0x0F9E, 0x0263, 0x079B, 0x0563, 0x019E, - 0x01AB, 0x0E63, 0x029B, 0x04CA, 0x0DAB, 0x0663, 0x0B1B, 0x020A, - 0x0A1E, 0x021A, 0x0063, 0x061E, 0x06FB, 0x025A, 0x0163, 0x0573, - 0x000A, 0x0223, 0x011B, 0x0C1A, 0x015A, 0x0863, 0x00AB, 0x02CA, - 0x00B2, 0x0A0A, 0x01CA, 0x00A3, 0x0B73, 0x0023, 0x0012, 0x039E, - 0x001A, 0x0CCA, 0x01FB, 0x005E, 0x0A9B, 0x00CA, 0x0373, 0x009E, - 0x0022, 0x07AB, 0x001E, 0x0EFB, 0x009A, 0x000B, 0x041A, 0x019B, - 0x0363, 0x014A, 0x006A, 0x0015, 0x069B, 0x0073, 0x0523, 0x001B, - 0x012B, 0x0003, 0x0001, 0x061A, 0x003E, 0x002A, 0x00E3, 0x003B, - 0x000E, 0x000D, 0x0000, +static const uint16_t ac_vlc_desc8_syms[121] = { + 0x0010, 0x0F60, 0x0093, 0x00A3, 0x0F95, 0x0018, 0x0FE2, 0x0FA6, 0x0FA1, + 0x0022, 0x0090, 0x0042, 0x0F86, 0x0F93, 0x0036, 0x0FE6, 0x0F50, 0x0FD1, + 0x0060, 0x0FA0, 0x0025, 0x0FD2, 0x0046, 0x0F70, 0x0031, 0x0045, 0x0F40, + 0x0F81, 0x0FB3, 0x0111, 0x0073, 0x0023, 0x0FC1, 0x0FE4, 0x0024, 0x0081, + 0x0FA5, 0x0032, 0x0014, 0x0FF4, 0x0FD0, 0x0030, 0x0041, 0x0070, 0x0FF5, + 0x00E1, 0x0061, 0x0F73, 0x0063, 0x0F41, 0x00B3, 0x0FD5, 0x00F1, 0x0017, + 0x0FF7, 0x00A0, 0x0055, 0x00C1, 0x0F30, 0x0043, 0x0FD4, 0x0065, 0x0FF8, + 0x0FB1, 0x1000, 0x0020, 0x0FE0, 0x0040, 0x0FC0, 0x0FE1, 0x0FF3, 0x0013, + 0x0FE3, 0x0FA3, 0x0083, 0x0F96, 0x00D1, 0x0026, 0x0033, 0x0101, 0x00B1, + 0x0FB6, 0x0F90, 0x0080, 0x00E0, 0x0071, 0x0034, 0x0FC2, 0x0F20, 0x00A1, + 0x0021, 0x0050, 0x00B0, 0x0F71, 0x0FC5, 0x0F91, 0x0F80, 0x0035, 0x0F63, + 0x0053, 0x00C0, 0x0FF1, 0x0FF2, 0x0FB0, 0x0016, 0x0FB5, 0x0F51, 0x0091, + 0x0F21, 0x0FD3, 0x0FC3, 0x00D0, 0x0F83, 0x0F61, 0x0012, 0x0015, 0x0051, + 0x0FE5, 0x0FF6, 0x0011, 0x0FF0, }; -static const uint8_t ac_vlc_desc4_bits[131] = { - 7, 8, 7, 8, 7, 6, 4, 3, - 10, 10, 11, 9, 9, 6, 4, 10, - 10, 9, 10, 7, 5, 10, 11, 12, - 8, 6, 12, 12, 9, 6, 11, 12, - 10, 7, 12, 10, 8, 11, 8, 12, - 11, 8, 11, 11, 9, 12, 11, 9, - 11, 9, 12, 10, 12, 11, 10, 12, - 12, 11, 12, 12, 11, 11, 11, 11, - 11, 12, 12, 12, 12, 12, 12, 12, - 12, 11, 12, 11, 12, 11, 12, 11, - 10, 10, 10, 12, 9, 12, 9, 10, - 8, 12, 10, 8, 12, 10, 7, 11, - 11, 12, 10, 7, 12, 11, 12, 9, - 6, 11, 11, 12, 8, 6, 12, 10, - 10, 10, 7, 5, 11, 9, 11, 9, - 9, 6, 4, 12, 8, 7, 8, 7, - 6, 4, 2, +static const uint16_t ac_vlc_desc9_syms[114] = { + 0x0010, 0x0015, 0x0042, 0x0091, 0x0FD2, 0x0036, 0x0FE2, 0x0022, 0x00C0, + 0x0121, 0x0065, 0x0F31, 0x0018, 0x0F60, 0x0FF6, 0x0070, 0x00B0, 0x0045, + 0x0F71, 0x0FD1, 0x0FC1, 0x0FA1, 0x0055, 0x0FB5, 0x0FB2, 0x0F93, 0x0FC5, + 0x0023, 0x0F70, 0x0083, 0x0061, 0x0031, 0x0025, 0x0FA5, 0x0FB3, 0x0032, + 0x0FD5, 0x0081, 0x0F61, 0x0FE4, 0x0F21, 0x0073, 0x0F73, 0x0024, 0x0041, + 0x0030, 0x0FD0, 0x0014, 0x0FF4, 0x0040, 0x0FE0, 0x0FC0, 0x0080, 0x0043, + 0x00E1, 0x00D1, 0x0FE3, 0x1000, 0x0F90, 0x0FE1, 0x0FB1, 0x0026, 0x0FD4, + 0x0063, 0x0034, 0x0FA3, 0x00A3, 0x0F80, 0x0F40, 0x0017, 0x0FF7, 0x0F83, + 0x0FF5, 0x0020, 0x0050, 0x0FB0, 0x0021, 0x0013, 0x0FF3, 0x0FF1, 0x0F51, + 0x0093, 0x0FF8, 0x0F91, 0x0F50, 0x0071, 0x00B1, 0x0051, 0x0033, 0x0090, + 0x00D0, 0x00F1, 0x0FC2, 0x0FE6, 0x0FA6, 0x0FB6, 0x0FA0, 0x0FF2, 0x0060, + 0x0FD3, 0x0F30, 0x00A1, 0x0F96, 0x0053, 0x0035, 0x00A0, 0x0016, 0x00C1, + 0x0FC3, 0x0F81, 0x0FE5, 0x0012, 0x0011, 0x0FF0, }; -static const uint16_t ac_vlc_desc5_syms[132] = { - 0x1000, 0xFF8, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, 0xFF1, - 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, 0xFE0, - 0xFD6, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC5, - 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB5, 0xFB3, 0xFB1, 0xFB0, - 0xFA3, 0xFA1, 0xFA0, 0xF96, 0xF93, 0xF91, 0xF90, 0xF86, - 0xF85, 0xF81, 0xF80, 0xF76, 0xF75, 0xF71, 0xF70, 0xF66, - 0xF61, 0xF60, 0xF51, 0xF50, 0xF43, 0xF41, 0xF40, 0xF33, - 0xF31, 0xF30, 0xF23, 0xF21, 0xF20, 0xF11, 0xF10, 0xF00, - 0xEF0, 0xEE0, 0xEC1, 0xEC0, 0x151, 0x141, 0x140, 0x131, - 0x121, 0x120, 0x111, 0x110, 0x103, 0x100, 0x0F0, 0x0E0, - 0x0D3, 0x0D0, 0x0C3, 0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A1, - 0x0A0, 0x091, 0x090, 0x081, 0x080, 0x075, 0x071, 0x070, - 0x065, 0x061, 0x060, 0x056, 0x055, 0x053, 0x052, 0x051, - 0x050, 0x046, 0x045, 0x043, 0x042, 0x041, 0x040, 0x035, - 0x034, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025, 0x024, - 0x023, 0x022, 0x021, 0x020, 0x018, 0x016, 0x015, 0x014, - 0x013, 0x012, 0x011, 0x010, -}; - -static const uint16_t ac_vlc_desc5_codes[132] = { - 0x0001, 0x0D62, 0x00BD, 0x0022, 0x009B, 0x0032, 0x0019, 0x0005, - 0x0007, 0x034D, 0x009A, 0x012B, 0x0052, 0x006B, 0x003A, 0x0006, - 0x06FD, 0x017D, 0x081A, 0x031B, 0x031A, 0x0012, 0x0011, 0x0202, - 0x00FD, 0x051B, 0x00D2, 0x001D, 0x011A, 0x0782, 0x018D, 0x007B, - 0x067D, 0x037D, 0x0021, 0x0E8D, 0x0562, 0x008D, 0x00BB, 0x053D, - 0x082A, 0x0002, 0x000D, 0x0302, 0x007D, 0x053B, 0x003B, 0x0A4D, - 0x027D, 0x01FD, 0x042A, 0x01C2, 0x041A, 0x0182, 0x014D, 0x0162, - 0x00C2, 0x032A, 0x0D9A, 0x012A, 0x0102, 0x087D, 0x072B, 0x039A, - 0x0362, 0x019A, 0x0C62, 0x04C2, 0x0D1B, 0x028D, 0x0762, 0x0E7D, - 0x0E41, 0x059A, 0x024D, 0x093B, 0x052B, 0x011B, 0x064D, 0x013D, - 0x0382, 0x0262, 0x0641, 0x0462, 0x004D, 0x0CC2, 0x033B, 0x068D, - 0x0141, 0x0D2B, 0x001B, 0x0041, 0x00C1, 0x0C41, 0x01E2, 0x00EB, - 0x062A, 0x0082, 0x0061, 0x02FD, 0x047D, 0x013B, 0x002A, 0x003D, - 0x005B, 0x022A, 0x02C2, 0x0241, 0x0062, 0x00AA, 0x000B, 0x00E2, - 0x001A, 0x033D, 0x021A, 0x006A, 0x0009, 0x032B, 0x002B, 0x04FD, - 0x0042, 0x016B, 0x002D, 0x000E, 0x0441, 0x00CD, 0x005A, 0x00AB, - 0x000A, 0x0039, 0x0003, 0x0000, +static const uint16_t ac_vlc_descA_syms[110] = { + 0x0010, 0x0F60, 0x0051, 0x0F90, 0x0FE2, 0x0044, 0x0FA5, 0x0053, 0x00A1, + 0x0035, 0x0022, 0x0026, 0x0073, 0x0080, 0x0FD1, 0x0015, 0x0FE5, 0x0090, + 0x0091, 0x0055, 0x0F73, 0x0F51, 0x00D1, 0x0023, 0x0FA1, 0x0061, 0x0FB3, + 0x0FC5, 0x0031, 0x0FF6, 0x1000, 0x0FD5, 0x0F91, 0x0FC1, 0x0032, 0x0F41, + 0x00B0, 0x00B1, 0x0081, 0x0FB2, 0x0F96, 0x0FD0, 0x0030, 0x0040, 0x0025, + 0x0F81, 0x0F70, 0x0FE3, 0x0FB6, 0x00A0, 0x0018, 0x0FA3, 0x0F31, 0x0FE0, + 0x0FC0, 0x0FB0, 0x0050, 0x0FE1, 0x0014, 0x0F80, 0x0FE6, 0x0FE4, 0x0043, + 0x0083, 0x0024, 0x0FB1, 0x0020, 0x0FF4, 0x0041, 0x0F50, 0x0FF8, 0x0F93, + 0x00C1, 0x0033, 0x0021, 0x0FF5, 0x0060, 0x0063, 0x0034, 0x0FD4, 0x0FC2, + 0x0071, 0x0FC6, 0x0093, 0x0045, 0x0FA6, 0x00C0, 0x0013, 0x0FF1, 0x0FF3, + 0x0F71, 0x00E1, 0x0F40, 0x0FC3, 0x0FB5, 0x0070, 0x0042, 0x0F61, 0x0F83, + 0x0FF7, 0x0017, 0x0FD2, 0x0036, 0x0FD3, 0x0016, 0x0FA0, 0x0FF2, 0x0012, + 0x0011, 0x0FF0, }; -static const uint8_t ac_vlc_desc5_bits[132] = { - 7, 12, 8, 7, 8, 6, 6, 4, - 3, 10, 9, 11, 8, 9, 6, 4, - 11, 10, 12, 10, 10, 7, 5, 10, - 11, 12, 8, 6, 10, 11, 9, 7, - 12, 10, 7, 12, 12, 10, 8, 11, - 12, 10, 8, 10, 12, 11, 9, 12, - 11, 9, 11, 9, 11, 10, 10, 11, - 11, 10, 12, 10, 10, 12, 11, 10, - 11, 11, 12, 12, 12, 11, 11, 12, - 12, 12, 12, 12, 12, 11, 11, 11, - 11, 10, 12, 12, 10, 12, 10, 12, - 9, 12, 9, 11, 8, 12, 9, 8, - 11, 9, 7, 11, 11, 12, 12, 9, - 7, 11, 10, 11, 11, 8, 6, 9, - 12, 10, 10, 7, 5, 11, 9, 11, - 8, 9, 6, 4, 12, 8, 7, 8, - 6, 6, 4, 2, +static const uint16_t ac_vlc_descB_syms[101] = { + 0x0010, 0x0012, 0x0023, 0x0091, 0x0061, 0x0FA1, 0x0FD1, 0x0015, 0x0030, + 0x0FD0, 0x0FB3, 0x0F71, 0x0F60, 0x0FA6, 0x0063, 0x0032, 0x0FC1, 0x0031, + 0x0040, 0x0080, 0x0FD5, 0x0FE3, 0x0050, 0x0FC0, 0x0FB0, 0x0FF6, 0x0F81, + 0x0FB6, 0x0F70, 0x0F91, 0x0025, 0x1000, 0x0FE1, 0x00A1, 0x0FA3, 0x00F1, + 0x0F61, 0x0F51, 0x0081, 0x00C1, 0x0018, 0x0060, 0x0041, 0x0073, 0x0FE4, + 0x0F80, 0x0FE0, 0x0020, 0x0021, 0x0FC5, 0x0055, 0x0042, 0x0026, 0x0070, + 0x0024, 0x0043, 0x00A0, 0x0033, 0x0FF8, 0x0071, 0x0014, 0x0FF4, 0x0FB1, + 0x0FB5, 0x0034, 0x0F41, 0x0036, 0x0F90, 0x0FC6, 0x0090, 0x0FF5, 0x0FA0, + 0x0FD4, 0x0F83, 0x0083, 0x0051, 0x00B1, 0x0FD3, 0x0FF1, 0x0013, 0x0FF3, + 0x0FF2, 0x0035, 0x0045, 0x0FC2, 0x00D1, 0x0FE2, 0x0016, 0x0FC3, 0x0FD2, + 0x00B0, 0x0FE6, 0x0F93, 0x0F50, 0x0FF7, 0x0017, 0x0053, 0x0022, 0x0FE5, + 0x0011, 0x0FF0, }; -static const uint16_t ac_vlc_desc6_syms[130] = { - 0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, - 0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, - 0xFE0, 0xFD6, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, - 0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB5, 0xFB3, 0xFB1, - 0xFB0, 0xFA6, 0xFA3, 0xFA1, 0xFA0, 0xF96, 0xF95, 0xF93, - 0xF91, 0xF90, 0xF86, 0xF85, 0xF81, 0xF80, 0xF76, 0xF71, - 0xF70, 0xF63, 0xF61, 0xF60, 0xF53, 0xF51, 0xF50, 0xF43, - 0xF41, 0xF40, 0xF31, 0xF30, 0xF20, 0xF10, 0xF00, 0xEF0, - 0xEE1, 0x131, 0x121, 0x120, 0x111, 0x110, 0x101, 0x100, - 0x0F1, 0x0F0, 0x0E3, 0x0E1, 0x0E0, 0x0D1, 0x0D0, 0x0C3, - 0x0C0, 0x0B3, 0x0B1, 0x0B0, 0x0A1, 0x0A0, 0x091, 0x090, - 0x081, 0x080, 0x075, 0x071, 0x070, 0x065, 0x063, 0x061, - 0x060, 0x056, 0x055, 0x053, 0x051, 0x050, 0x046, 0x045, - 0x043, 0x042, 0x041, 0x040, 0x036, 0x035, 0x034, 0x033, - 0x032, 0x031, 0x030, 0x026, 0x025, 0x024, 0x023, 0x022, - 0x021, 0x020, 0x018, 0x016, 0x015, 0x014, 0x013, 0x012, - 0x011, 0x010, -}; - -static const uint16_t ac_vlc_desc6_codes[130] = { - 0x0022, 0x0BB2, 0x0942, 0x002B, 0x0072, 0x0002, 0x001A, 0x0039, - 0x000D, 0x0007, 0x007B, 0x008E, 0x06DB, 0x00EA, 0x015B, 0x002E, - 0x0006, 0x0959, 0x027B, 0x0A0E, 0x01AB, 0x008A, 0x0012, 0x001E, - 0x0575, 0x005B, 0x02AB, 0x00C2, 0x0015, 0x036A, 0x04B2, 0x0099, - 0x001B, 0x0519, 0x0C19, 0x00DB, 0x004E, 0x0042, 0x0159, 0x03B2, - 0x030E, 0x00EB, 0x0252, 0x0EAB, 0x018A, 0x00E2, 0x06AB, 0x0242, - 0x017B, 0x0452, 0x0319, 0x0152, 0x025B, 0x016A, 0x00AB, 0x0052, - 0x05B2, 0x010E, 0x038E, 0x028A, 0x0359, 0x0019, 0x078A, 0x0C52, - 0x0D8E, 0x0ED9, 0x02D9, 0x0662, 0x0119, 0x09B2, 0x0BAB, 0x0D19, - 0x0C5B, 0x00B2, 0x0542, 0x0B8A, 0x02B2, 0x0142, 0x065B, 0x058E, - 0x0062, 0x018E, 0x038A, 0x00D9, 0x0419, 0x0162, 0x03AB, 0x0075, - 0x07B2, 0x0032, 0x020E, 0x07AB, 0x006B, 0x045B, 0x01B2, 0x0199, - 0x002A, 0x0375, 0x0775, 0x0AAB, 0x01D9, 0x003B, 0x060E, 0x0342, - 0x0175, 0x0262, 0x000A, 0x0005, 0x0559, 0x006A, 0x0D59, 0x0219, - 0x000E, 0x004A, 0x0009, 0x0719, 0x0059, 0x02DB, 0x00D2, 0x01DB, - 0x0025, 0x0001, 0x06D9, 0x00F5, 0x0035, 0x00FB, 0x003A, 0x000B, - 0x0003, 0x0000, +static const uint16_t ac_vlc_descC_syms[96] = { + 0x0010, 0x0012, 0x0FC3, 0x00B1, 0x00A1, 0x0022, 0x0FE5, 0x0F93, 0x0090, + 0x0061, 0x0055, 0x0042, 0x0FE6, 0x0040, 0x0030, 0x0FD1, 0x0050, 0x0015, + 0x0FD0, 0x0FC0, 0x0023, 0x0FC1, 0x0017, 0x00C1, 0x0032, 0x0FB5, 0x0FF7, + 0x00A0, 0x0060, 0x0031, 0x0041, 0x0FE3, 0x0FD5, 0x0091, 0x0053, 0x0FF8, + 0x0FA0, 0x0FF6, 0x0FB0, 0x0070, 0x0080, 0x1000, 0x0FE1, 0x0FE0, 0x0020, + 0x0021, 0x0063, 0x0033, 0x0FA1, 0x0F60, 0x0F61, 0x0043, 0x0073, 0x0FC6, + 0x0FE4, 0x00E1, 0x0034, 0x0018, 0x0F91, 0x0F80, 0x0024, 0x0026, 0x0014, + 0x0FF4, 0x0FB1, 0x0FB6, 0x0071, 0x0FA6, 0x0FD4, 0x0035, 0x0F70, 0x0036, + 0x0051, 0x0FF5, 0x0FF1, 0x0FD3, 0x0045, 0x0F81, 0x0F90, 0x0083, 0x0081, + 0x0FA3, 0x0FE2, 0x0FC5, 0x0F51, 0x0F71, 0x0FD2, 0x0FB3, 0x0FC2, 0x0025, + 0x0016, 0x0013, 0x0FF3, 0x0FF2, 0x0011, 0x0FF0, }; -static const uint8_t ac_vlc_desc6_bits[130] = { - 7, 12, 12, 8, 7, 7, 6, 6, - 4, 3, 10, 9, 11, 8, 9, 6, - 4, 12, 10, 12, 10, 10, 7, 5, - 11, 11, 12, 8, 6, 10, 11, 9, - 7, 12, 12, 10, 7, 10, 12, 12, - 10, 8, 10, 12, 10, 8, 12, 10, - 9, 12, 11, 9, 11, 10, 10, 11, - 11, 10, 10, 10, 10, 11, 11, 12, - 12, 12, 11, 11, 11, 12, 12, 12, - 12, 11, 11, 12, 10, 12, 11, 12, - 10, 11, 12, 10, 12, 9, 12, 9, - 11, 8, 12, 11, 8, 12, 12, 9, - 7, 11, 11, 12, 9, 7, 11, 10, - 11, 11, 8, 6, 12, 9, 12, 10, - 10, 7, 5, 11, 9, 11, 8, 9, - 6, 4, 12, 8, 7, 8, 6, 6, - 4, 2, +static const uint8_t ac_vlc_desc0_bits[172] = { + 5, 5, 4, 4, 6, 9, 9, 12, 12, 11, 11, 11, 11, 12, 12, 10, 7, 6, + 6, 6, 6, 11, 12, 12, 11, 12, 12, 9, 8, 7, 7, 9, 9, 11, 11, 10, + 9, 7, 7, 12, 12, 11, 10, 9, 10, 11, 11, 9, 7, 6, 9, 11, 12, 12, + 10, 11, 11, 11, 11, 10, 11, 12, 12, 8, 9, 9, 4, 4, 9, 12, 12, 11, + 10, 8, 7, 7, 8, 11, 12, 12, 12, 12, 11, 10, 12, 12, 12, 12, 6, 9, + 9, 8, 10, 11, 11, 11, 12, 12, 10, 10, 11, 11, 10, 11, 11, 5, 5, 3, + 3, 6, 8, 8, 7, 12, 12, 12, 12, 10, 10, 12, 12, 12, 12, 8, 8, 9, + 11, 11, 10, 7, 7, 9, 9, 11, 12, 12, 11, 12, 12, 11, 11, 10, 7, 8, + 11, 12, 12, 11, 12, 12, 9, 8, 11, 11, 12, 12, 11, 10, 10, 6, 9, 9, + 10, 11, 12, 12, 9, 9, 11, 11, 10, 8, }; -static const uint16_t ac_vlc_desc7_syms[125] = { - 0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, - 0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, - 0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC5, - 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB5, 0xFB3, 0xFB1, 0xFB0, - 0xFA6, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF96, 0xF95, 0xF93, - 0xF91, 0xF90, 0xF86, 0xF81, 0xF80, 0xF73, 0xF71, 0xF70, - 0xF63, 0xF61, 0xF60, 0xF53, 0xF51, 0xF50, 0xF41, 0xF40, - 0xF31, 0xF30, 0xF20, 0xF10, 0xF01, 0xF00, 0x121, 0x111, - 0x101, 0x100, 0x0F1, 0x0F0, 0x0E1, 0x0E0, 0x0D1, 0x0D0, - 0x0C3, 0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A3, 0x0A1, 0x0A0, - 0x093, 0x091, 0x090, 0x081, 0x080, 0x071, 0x070, 0x065, - 0x063, 0x061, 0x060, 0x055, 0x053, 0x052, 0x051, 0x050, - 0x046, 0x045, 0x043, 0x042, 0x041, 0x040, 0x036, 0x035, - 0x034, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025, 0x024, - 0x023, 0x022, 0x021, 0x020, 0x018, 0x017, 0x016, 0x015, - 0x014, 0x013, 0x012, 0x011, 0x010, -}; - -static const uint16_t ac_vlc_desc7_codes[125] = { - 0x0053, 0x009A, 0x0EE2, 0x00D3, 0x006A, 0x0052, 0x003A, 0x0035, - 0x000D, 0x0007, 0x0062, 0x0125, 0x0142, 0x0019, 0x01F3, 0x0029, - 0x000E, 0x0082, 0x0ADA, 0x02E3, 0x00E2, 0x0022, 0x0006, 0x0065, - 0x05E3, 0x0765, 0x0032, 0x0039, 0x0F99, 0x05E2, 0x0099, 0x0033, - 0x0362, 0x0799, 0x0F65, 0x0073, 0x004A, 0x02A5, 0x0162, 0x0742, - 0x01A5, 0x00D9, 0x0342, 0x005A, 0x00AA, 0x0EF3, 0x0182, 0x01DA, - 0x0382, 0x035A, 0x00F3, 0x0673, 0x0165, 0x00E5, 0x06F3, 0x0225, - 0x0842, 0x025A, 0x07E3, 0x0399, 0x07A5, 0x072A, 0x0F2A, 0x09E3, - 0x0273, 0x049A, 0x02E5, 0x0B99, 0x02E2, 0x0E73, 0x0562, 0x02F3, - 0x032A, 0x0F42, 0x00DA, 0x0999, 0x012A, 0x0365, 0x00A5, 0x00E3, - 0x0199, 0x03E3, 0x019A, 0x01E2, 0x0173, 0x06E5, 0x0059, 0x01E3, - 0x02DA, 0x002A, 0x000A, 0x06DA, 0x0FA5, 0x0042, 0x01E5, 0x0013, - 0x03E2, 0x015A, 0x03A5, 0x0442, 0x001A, 0x0005, 0x04A5, 0x0265, - 0x08A5, 0x0025, 0x029A, 0x0072, 0x0016, 0x0599, 0x00C2, 0x0242, - 0x00B2, 0x0002, 0x0015, 0x0001, 0x0BE3, 0x06E2, 0x0063, 0x0023, - 0x0012, 0x0009, 0x0003, 0x000B, 0x0000, +static const uint8_t ac_vlc_desc1_bits[169] = { + 8, 11, 11, 10, 10, 11, 12, 12, 7, 8, 11, 11, 10, 9, 11, 11, 10, 12, + 12, 12, 12, 10, 8, 5, 5, 7, 8, 8, 6, 10, 10, 12, 12, 11, 12, 12, + 11, 8, 7, 6, 7, 11, 11, 10, 9, 12, 12, 11, 10, 9, 6, 4, 4, 6, + 9, 12, 12, 11, 10, 11, 11, 10, 10, 10, 10, 11, 12, 12, 10, 11, 11, 10, + 11, 11, 12, 12, 11, 10, 8, 8, 7, 7, 9, 11, 12, 12, 10, 8, 7, 12, + 12, 12, 12, 11, 11, 9, 9, 9, 6, 6, 8, 9, 11, 12, 12, 11, 12, 12, + 9, 9, 11, 11, 11, 11, 9, 4, 4, 6, 6, 6, 7, 12, 12, 11, 12, 12, + 11, 9, 9, 12, 12, 12, 12, 10, 5, 8, 11, 12, 12, 10, 10, 11, 12, 12, + 8, 8, 7, 7, 5, 9, 11, 11, 10, 8, 7, 7, 10, 12, 12, 12, 12, 9, + 10, 10, 11, 11, 10, 3, 3, }; -static const uint8_t ac_vlc_desc7_bits[125] = { - 8, 11, 12, 8, 7, 7, 6, 6, - 4, 3, 9, 9, 10, 8, 9, 6, - 4, 9, 12, 10, 10, 7, 5, 10, - 11, 12, 8, 6, 12, 11, 9, 7, - 10, 12, 12, 10, 7, 10, 11, 12, - 10, 8, 11, 10, 8, 12, 10, 9, - 10, 10, 10, 12, 10, 10, 12, 10, - 12, 10, 11, 12, 12, 12, 12, 12, - 11, 11, 11, 12, 11, 12, 11, 11, - 11, 12, 10, 12, 10, 11, 12, 10, - 12, 12, 9, 11, 9, 11, 8, 12, - 12, 9, 7, 11, 12, 12, 9, 7, - 10, 10, 11, 11, 8, 6, 11, 10, - 12, 10, 10, 7, 5, 11, 8, 10, - 8, 8, 6, 4, 12, 12, 8, 7, - 7, 6, 6, 4, 2, +static const uint8_t ac_vlc_desc2_bits[165] = { + 8, 12, 12, 11, 12, 12, 11, 10, 10, 9, 11, 11, 10, 8, 6, 5, 6, 6, + 5, 6, 11, 11, 10, 10, 12, 12, 11, 9, 9, 11, 12, 12, 10, 9, 11, 11, + 12, 12, 11, 11, 11, 11, 11, 7, 7, 6, 8, 9, 10, 11, 12, 12, 7, 7, + 10, 10, 11, 11, 11, 11, 8, 8, 9, 12, 12, 12, 12, 11, 12, 12, 7, 6, + 6, 8, 10, 11, 12, 12, 9, 10, 12, 12, 11, 11, 12, 12, 10, 9, 12, 12, + 11, 10, 8, 8, 7, 12, 12, 12, 12, 10, 10, 11, 12, 12, 10, 11, 11, 11, + 11, 10, 8, 9, 11, 11, 11, 12, 12, 4, 4, 6, 6, 7, 8, 10, 10, 9, + 6, 4, 4, 5, 7, 9, 12, 12, 11, 12, 12, 11, 9, 9, 6, 5, 10, 10, + 11, 11, 10, 8, 9, 12, 12, 11, 11, 12, 12, 8, 8, 8, 9, 9, 10, 10, + 9, 3, 3, }; -static const uint16_t ac_vlc_desc8_syms[121] = { - 0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, - 0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, - 0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC5, - 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3, 0xFB1, - 0xFB0, 0xFA6, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF96, 0xF95, - 0xF93, 0xF91, 0xF90, 0xF86, 0xF83, 0xF81, 0xF80, 0xF73, - 0xF71, 0xF70, 0xF63, 0xF61, 0xF60, 0xF51, 0xF50, 0xF41, - 0xF40, 0xF30, 0xF21, 0xF20, 0x111, 0x101, 0x0F1, 0x0E1, - 0x0E0, 0x0D1, 0x0D0, 0x0C1, 0x0C0, 0x0B3, 0x0B1, 0x0B0, - 0x0A3, 0x0A1, 0x0A0, 0x093, 0x091, 0x090, 0x083, 0x081, - 0x080, 0x073, 0x071, 0x070, 0x065, 0x063, 0x061, 0x060, - 0x055, 0x053, 0x051, 0x050, 0x046, 0x045, 0x043, 0x042, - 0x041, 0x040, 0x036, 0x035, 0x034, 0x033, 0x032, 0x031, - 0x030, 0x026, 0x025, 0x024, 0x023, 0x022, 0x021, 0x020, - 0x018, 0x017, 0x016, 0x015, 0x014, 0x013, 0x012, 0x011, - 0x010, -}; - -static const uint16_t ac_vlc_desc8_codes[121] = { - 0x00F6, 0x0676, 0x0EB6, 0x00F3, 0x0056, 0x006A, 0x0039, 0x0003, - 0x000D, 0x0007, 0x00A2, 0x0173, 0x00CA, 0x0025, 0x0082, 0x0019, - 0x0001, 0x00B6, 0x0276, 0x02E3, 0x00B2, 0x0062, 0x001A, 0x0175, - 0x01E3, 0x0BE5, 0x004A, 0x0029, 0x07A5, 0x00E3, 0x030A, 0x0176, - 0x0023, 0x0042, 0x05CA, 0x00A5, 0x0142, 0x0052, 0x04A5, 0x0B02, - 0x0D22, 0x0375, 0x0065, 0x0522, 0x0DE3, 0x010A, 0x00F5, 0x0136, - 0x0275, 0x01B2, 0x03F5, 0x03E3, 0x0002, 0x08E3, 0x01A2, 0x0B36, - 0x020A, 0x0076, 0x0CE3, 0x07E5, 0x070A, 0x03A5, 0x02B6, 0x0036, - 0x01E5, 0x02A5, 0x05E3, 0x07B6, 0x07F5, 0x0736, 0x0BA5, 0x0075, - 0x0302, 0x0FE5, 0x01B6, 0x0102, 0x04E3, 0x0022, 0x08A5, 0x01CA, - 0x00E5, 0x0F0A, 0x05E5, 0x0096, 0x0A76, 0x0336, 0x0236, 0x0012, - 0x03B6, 0x0BF5, 0x0073, 0x0035, 0x02B2, 0x000A, 0x0476, 0x0122, - 0x0016, 0x0009, 0x0322, 0x01F5, 0x03E5, 0x01A5, 0x03CA, 0x0072, - 0x0006, 0x06A5, 0x0032, 0x02CA, 0x008A, 0x00C2, 0x0015, 0x000E, - 0x0702, 0x06B6, 0x0063, 0x0033, 0x002A, 0x0005, 0x0013, 0x000B, - 0x0000, +static const uint8_t ac_vlc_desc3_bits[162] = { + 10, 10, 9, 8, 10, 10, 9, 9, 11, 12, 12, 10, 6, 6, 8, 9, 11, 11, + 11, 11, 8, 8, 7, 10, 11, 12, 12, 11, 11, 10, 8, 7, 8, 12, 12, 11, + 12, 12, 12, 12, 11, 11, 10, 5, 5, 7, 9, 9, 11, 11, 12, 12, 11, 9, + 6, 6, 9, 9, 10, 12, 12, 11, 9, 8, 12, 12, 11, 10, 9, 7, 10, 10, + 10, 12, 12, 11, 8, 7, 12, 12, 11, 12, 12, 11, 10, 12, 12, 11, 11, 12, + 12, 10, 11, 12, 12, 10, 7, 7, 6, 7, 10, 12, 12, 12, 12, 9, 8, 6, + 6, 6, 10, 10, 11, 11, 12, 12, 11, 8, 7, 8, 9, 11, 11, 10, 8, 11, + 11, 10, 9, 4, 4, 4, 4, 6, 8, 12, 12, 11, 11, 12, 12, 11, 11, 10, + 9, 10, 11, 12, 12, 8, 5, 5, 7, 10, 12, 12, 11, 9, 8, 6, 3, 3, }; -static const uint8_t ac_vlc_desc8_bits[121] = { - 8, 11, 12, 8, 7, 7, 6, 6, - 4, 3, 9, 9, 10, 8, 8, 6, - 4, 10, 12, 10, 10, 7, 5, 10, - 11, 12, 8, 6, 11, 12, 11, 9, - 7, 9, 11, 12, 9, 7, 11, 12, - 12, 10, 8, 12, 12, 10, 9, 10, - 10, 9, 12, 10, 9, 12, 9, 12, - 10, 11, 12, 12, 12, 12, 11, 10, - 11, 11, 12, 11, 11, 11, 12, 10, - 12, 12, 10, 10, 12, 9, 12, 11, - 9, 12, 11, 8, 12, 12, 10, 7, - 11, 12, 9, 7, 10, 10, 11, 11, - 8, 6, 10, 10, 12, 10, 10, 7, - 5, 11, 8, 10, 8, 8, 6, 4, - 11, 12, 8, 7, 7, 6, 6, 4, - 2, +static const uint8_t ac_vlc_desc4_bits[131] = { + 2, 6, 6, 7, 7, 8, 8, 7, 10, 12, 12, 11, 10, 10, 8, 9, 10, 10, + 11, 12, 12, 10, 10, 10, 7, 7, 11, 12, 12, 11, 12, 12, 9, 8, 10, 11, + 11, 9, 10, 10, 9, 6, 4, 6, 6, 11, 11, 12, 12, 11, 9, 9, 11, 11, + 11, 12, 12, 7, 8, 8, 7, 4, 4, 5, 5, 4, 6, 10, 10, 11, 11, 10, + 8, 12, 12, 11, 11, 12, 12, 12, 12, 11, 10, 8, 6, 8, 9, 9, 9, 11, + 11, 12, 12, 11, 8, 6, 9, 9, 9, 11, 12, 12, 12, 12, 11, 7, 9, 10, + 12, 12, 11, 10, 12, 12, 11, 10, 12, 12, 11, 7, 7, 8, 11, 12, 12, 11, + 12, 12, 10, 10, 3, }; -static const uint16_t ac_vlc_desc9_syms[114] = { - 0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, - 0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, - 0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC5, - 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3, 0xFB2, - 0xFB1, 0xFB0, 0xFA6, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF96, - 0xF93, 0xF91, 0xF90, 0xF83, 0xF81, 0xF80, 0xF73, 0xF71, - 0xF70, 0xF61, 0xF60, 0xF51, 0xF50, 0xF40, 0xF31, 0xF30, - 0xF21, 0x121, 0x0F1, 0x0E1, 0x0D1, 0x0D0, 0x0C1, 0x0C0, - 0x0B1, 0x0B0, 0x0A3, 0x0A1, 0x0A0, 0x093, 0x091, 0x090, - 0x083, 0x081, 0x080, 0x073, 0x071, 0x070, 0x065, 0x063, - 0x061, 0x060, 0x055, 0x053, 0x051, 0x050, 0x045, 0x043, - 0x042, 0x041, 0x040, 0x036, 0x035, 0x034, 0x033, 0x032, - 0x031, 0x030, 0x026, 0x025, 0x024, 0x023, 0x022, 0x021, - 0x020, 0x018, 0x017, 0x016, 0x015, 0x014, 0x013, 0x012, - 0x011, 0x010, -}; - -static const uint16_t ac_vlc_desc9_codes[114] = { - 0x0061, 0x0403, 0x0DB1, 0x0012, 0x0071, 0x0056, 0x0035, 0x0023, - 0x000D, 0x0007, 0x0243, 0x01D3, 0x026A, 0x00A1, 0x00A2, 0x0011, - 0x000E, 0x01AA, 0x0531, 0x0093, 0x0222, 0x0032, 0x0006, 0x07F2, - 0x04D3, 0x0C43, 0x0072, 0x0001, 0x0343, 0x05F2, 0x04AA, 0x03F2, - 0x0031, 0x0045, 0x0143, 0x00AA, 0x0B31, 0x00F2, 0x00C3, 0x0693, - 0x0BF2, 0x0203, 0x00E1, 0x03B1, 0x02D3, 0x00B1, 0x056A, 0x01D2, - 0x008A, 0x046A, 0x01E2, 0x0003, 0x0103, 0x01B1, 0x02E2, 0x0293, - 0x016A, 0x04E2, 0x0443, 0x0521, 0x0321, 0x0043, 0x00D3, 0x00E2, - 0x0703, 0x00D2, 0x0731, 0x0A93, 0x0393, 0x0803, 0x0422, 0x0383, - 0x018A, 0x006A, 0x0021, 0x096A, 0x0303, 0x0052, 0x0CE2, 0x0D31, - 0x038A, 0x0013, 0x01F2, 0x0E93, 0x0083, 0x0005, 0x02D2, 0x0121, - 0x0022, 0x00EA, 0x0036, 0x0122, 0x0193, 0x0331, 0x0183, 0x02AA, - 0x004A, 0x001A, 0x0131, 0x002A, 0x036A, 0x000A, 0x0062, 0x0025, - 0x0009, 0x06E2, 0x05B1, 0x0053, 0x0002, 0x0016, 0x0015, 0x0033, - 0x000B, 0x0000, +static const uint8_t ac_vlc_desc5_bits[132] = { + 2, 10, 10, 10, 10, 9, 10, 11, 11, 8, 11, 12, 12, 10, 9, 7, 11, 12, + 12, 10, 11, 12, 12, 11, 11, 9, 9, 7, 8, 8, 6, 6, 12, 12, 11, 11, + 11, 10, 10, 8, 7, 12, 12, 11, 10, 10, 10, 9, 11, 12, 12, 10, 7, 6, + 4, 4, 7, 11, 12, 12, 11, 12, 12, 9, 8, 7, 7, 5, 5, 6, 6, 4, + 8, 10, 11, 12, 12, 9, 10, 12, 12, 11, 10, 10, 8, 6, 6, 9, 11, 11, + 10, 8, 12, 12, 11, 11, 12, 12, 10, 10, 11, 11, 11, 11, 9, 4, 6, 9, + 11, 12, 12, 11, 11, 8, 9, 9, 8, 9, 11, 12, 12, 10, 8, 7, 9, 12, + 12, 11, 10, 8, 7, 3, }; -static const uint8_t ac_vlc_desc9_bits[114] = { - 8, 11, 12, 7, 7, 7, 6, 6, - 4, 3, 10, 9, 10, 8, 8, 6, - 4, 9, 12, 10, 10, 7, 5, 11, - 11, 12, 8, 6, 10, 11, 11, 12, - 9, 7, 10, 11, 12, 9, 8, 12, - 12, 10, 8, 10, 10, 9, 11, 9, - 9, 11, 9, 12, 10, 11, 11, 12, - 12, 12, 12, 11, 10, 11, 11, 11, - 11, 10, 11, 12, 10, 12, 11, 10, - 10, 11, 9, 12, 11, 8, 12, 12, - 10, 8, 11, 12, 9, 7, 10, 11, - 11, 8, 6, 9, 10, 12, 10, 10, - 7, 5, 11, 8, 10, 8, 8, 6, - 4, 11, 12, 8, 6, 7, 6, 6, - 4, 2, +static const uint8_t ac_vlc_desc6_bits[130] = { + 2, 7, 10, 10, 12, 12, 11, 10, 8, 7, 10, 11, 11, 9, 8, 7, 11, 12, + 12, 10, 9, 8, 8, 11, 11, 10, 12, 12, 11, 12, 12, 11, 7, 8, 10, 10, + 10, 12, 12, 11, 7, 7, 9, 10, 10, 8, 6, 6, 4, 10, 12, 12, 11, 10, + 10, 9, 11, 12, 12, 10, 7, 6, 5, 4, 5, 11, 12, 12, 10, 11, 12, 12, + 11, 11, 9, 9, 9, 12, 12, 12, 12, 10, 10, 11, 12, 12, 9, 6, 6, 6, + 6, 7, 9, 11, 11, 11, 11, 8, 4, 4, 6, 8, 10, 12, 12, 12, 12, 10, + 12, 12, 11, 8, 8, 7, 11, 12, 12, 11, 11, 9, 10, 11, 11, 9, 7, 10, + 10, 9, 8, 3, }; -static const uint16_t ac_vlc_descA_syms[110] = { - 0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, - 0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, - 0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6, - 0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3, - 0xFB2, 0xFB1, 0xFB0, 0xFA6, 0xFA5, 0xFA3, 0xFA1, 0xFA0, - 0xF96, 0xF93, 0xF91, 0xF90, 0xF83, 0xF81, 0xF80, 0xF73, - 0xF71, 0xF70, 0xF61, 0xF60, 0xF51, 0xF50, 0xF41, 0xF40, - 0xF31, 0x0E1, 0x0D1, 0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A1, - 0x0A0, 0x093, 0x091, 0x090, 0x083, 0x081, 0x080, 0x073, - 0x071, 0x070, 0x063, 0x061, 0x060, 0x055, 0x053, 0x051, - 0x050, 0x045, 0x044, 0x043, 0x042, 0x041, 0x040, 0x036, - 0x035, 0x034, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025, - 0x024, 0x023, 0x022, 0x021, 0x020, 0x018, 0x017, 0x016, - 0x015, 0x014, 0x013, 0x012, 0x011, 0x010, -}; - -static const uint16_t ac_vlc_descA_codes[110] = { - 0x002A, 0x04C5, 0x02A3, 0x004A, 0x0015, 0x0005, 0x0003, 0x0013, - 0x000D, 0x0007, 0x0171, 0x0032, 0x0371, 0x0076, 0x0042, 0x0011, - 0x000E, 0x00AA, 0x04D5, 0x03A3, 0x06A3, 0x0062, 0x001A, 0x06D5, - 0x07F2, 0x0223, 0x0CD5, 0x006A, 0x0001, 0x00F6, 0x0623, 0x03F2, - 0x07EA, 0x01F1, 0x0021, 0x03D5, 0x08C2, 0x07F6, 0x00F2, 0x00E3, - 0x0FEA, 0x02C5, 0x01AA, 0x0082, 0x04A3, 0x00B6, 0x0071, 0x03B2, - 0x0023, 0x01B6, 0x08A3, 0x0002, 0x0BB2, 0x00C5, 0x02EA, 0x0C23, - 0x0FF6, 0x0423, 0x07B2, 0x01C5, 0x07D5, 0x01EA, 0x06EA, 0x02C2, - 0x01F6, 0x01D5, 0x01B2, 0x00B2, 0x04F1, 0x03EA, 0x01A2, 0x02A2, - 0x02D5, 0x0123, 0x00D5, 0x01F2, 0x0055, 0x05B2, 0x04C2, 0x0102, - 0x0061, 0x05D5, 0x00C2, 0x00F1, 0x00A3, 0x0045, 0x0016, 0x01A3, - 0x01C2, 0x08D5, 0x03C5, 0x00EA, 0x000A, 0x0006, 0x00A2, 0x0036, - 0x02F1, 0x0072, 0x0022, 0x0025, 0x0009, 0x03F6, 0x0AA3, 0x0063, - 0x0012, 0x0031, 0x0035, 0x0033, 0x000B, 0x0000, +static const uint8_t ac_vlc_desc7_bits[125] = { + 2, 8, 9, 10, 10, 12, 12, 11, 10, 10, 11, 12, 12, 8, 7, 9, 11, 11, + 10, 10, 11, 12, 12, 11, 11, 10, 7, 7, 8, 8, 7, 7, 7, 9, 10, 11, + 12, 12, 8, 7, 8, 11, 11, 10, 9, 10, 10, 10, 10, 10, 12, 12, 11, 9, + 6, 5, 5, 4, 4, 6, 6, 8, 9, 12, 12, 11, 12, 12, 12, 12, 8, 8, + 6, 6, 10, 10, 9, 12, 12, 11, 10, 10, 11, 12, 12, 10, 10, 10, 11, 12, + 12, 10, 11, 11, 9, 6, 6, 4, 6, 7, 8, 10, 10, 12, 12, 11, 12, 12, + 11, 7, 8, 8, 7, 10, 11, 12, 12, 9, 10, 11, 12, 12, 9, 4, 3, }; -static const uint8_t ac_vlc_descA_bits[110] = { - 8, 11, 12, 7, 7, 7, 6, 6, - 4, 3, 10, 8, 10, 8, 8, 6, - 4, 9, 12, 10, 11, 7, 5, 11, - 11, 11, 12, 8, 6, 9, 11, 11, - 12, 9, 7, 11, 12, 12, 9, 8, - 12, 10, 9, 8, 11, 9, 9, 12, - 11, 9, 12, 9, 12, 11, 11, 12, - 12, 12, 11, 10, 11, 10, 11, 10, - 10, 11, 11, 9, 11, 11, 9, 10, - 11, 9, 12, 10, 8, 11, 11, 9, - 7, 11, 12, 11, 12, 8, 6, 10, - 9, 12, 10, 10, 7, 5, 10, 8, - 10, 8, 8, 6, 4, 11, 12, 8, - 6, 7, 6, 6, 4, 2, +static const uint8_t ac_vlc_desc8_bits[121] = { + 2, 9, 10, 12, 12, 11, 8, 9, 9, 8, 9, 11, 12, 12, 10, 9, 9, 7, + 7, 7, 8, 10, 10, 9, 7, 10, 10, 10, 11, 12, 12, 8, 8, 10, 10, 11, + 11, 10, 7, 7, 5, 5, 8, 8, 7, 10, 10, 10, 12, 12, 11, 10, 11, 12, + 12, 10, 11, 11, 11, 11, 12, 12, 11, 9, 8, 4, 4, 6, 6, 6, 6, 6, + 8, 12, 12, 11, 11, 11, 10, 12, 12, 11, 8, 9, 11, 11, 12, 12, 12, 12, + 6, 7, 10, 10, 10, 10, 9, 10, 12, 12, 11, 4, 6, 7, 8, 12, 12, 12, + 12, 10, 11, 12, 12, 10, 6, 7, 9, 9, 8, 4, 3, }; -static const uint16_t ac_vlc_descB_syms[101] = { - 0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, - 0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, - 0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6, - 0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3, - 0xFB1, 0xFB0, 0xFA6, 0xFA3, 0xFA1, 0xFA0, 0xF93, 0xF91, - 0xF90, 0xF83, 0xF81, 0xF80, 0xF71, 0xF70, 0xF61, 0xF60, - 0xF51, 0xF50, 0xF41, 0x0F1, 0x0D1, 0x0C1, 0x0B1, 0x0B0, - 0x0A1, 0x0A0, 0x091, 0x090, 0x083, 0x081, 0x080, 0x073, - 0x071, 0x070, 0x063, 0x061, 0x060, 0x055, 0x053, 0x051, - 0x050, 0x045, 0x043, 0x042, 0x041, 0x040, 0x036, 0x035, - 0x034, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025, 0x024, - 0x023, 0x022, 0x021, 0x020, 0x018, 0x017, 0x016, 0x015, - 0x014, 0x013, 0x012, 0x011, 0x010, -}; - -static const uint16_t ac_vlc_descB_codes[101] = { - 0x00EE, 0x03A5, 0x0B73, 0x004E, 0x0035, 0x0015, 0x0023, 0x0013, - 0x000D, 0x0007, 0x0673, 0x01F3, 0x02FE, 0x0096, 0x0133, 0x001E, - 0x0001, 0x0116, 0x00F5, 0x03F5, 0x0473, 0x0052, 0x001A, 0x01D5, - 0x0025, 0x0073, 0x0633, 0x0086, 0x0036, 0x012E, 0x0155, 0x0006, - 0x0055, 0x000E, 0x0106, 0x023E, 0x0192, 0x0075, 0x0173, 0x01AE, - 0x00D5, 0x08F5, 0x002E, 0x01FE, 0x0406, 0x00AE, 0x0E3E, 0x0206, - 0x013E, 0x0373, 0x0D55, 0x063E, 0x0E33, 0x033E, 0x01F5, 0x0273, - 0x003E, 0x06A5, 0x0092, 0x03D5, 0x04F5, 0x053E, 0x0016, 0x00FE, - 0x07A5, 0x0125, 0x0506, 0x0292, 0x00BE, 0x0425, 0x0F73, 0x02F5, - 0x0056, 0x0233, 0x02A5, 0x0C25, 0x007E, 0x0026, 0x0355, 0x0033, - 0x0555, 0x01A5, 0x0306, 0x0046, 0x000A, 0x0225, 0x006E, 0x00A5, - 0x0012, 0x00F3, 0x0005, 0x0009, 0x073E, 0x0773, 0x00B3, 0x0032, - 0x0065, 0x0003, 0x0002, 0x000B, 0x0000, +static const uint8_t ac_vlc_desc9_bits[114] = { + 2, 6, 11, 11, 10, 9, 8, 8, 11, 12, 12, 11, 11, 9, 7, 8, 10, 10, + 9, 7, 8, 9, 11, 11, 12, 12, 11, 8, 9, 10, 10, 7, 8, 11, 11, 10, + 9, 11, 11, 10, 12, 12, 11, 10, 8, 5, 5, 7, 7, 6, 4, 6, 9, 11, + 11, 10, 8, 8, 8, 6, 9, 11, 12, 12, 12, 12, 11, 9, 11, 12, 12, 10, + 7, 4, 7, 7, 6, 6, 6, 4, 12, 12, 11, 10, 10, 11, 11, 9, 10, 10, + 11, 12, 12, 10, 10, 10, 8, 6, 8, 10, 12, 12, 12, 12, 10, 10, 8, 11, + 11, 10, 9, 6, 4, 3, }; -static const uint8_t ac_vlc_descB_bits[101] = { - 8, 11, 12, 7, 7, 7, 6, 6, - 4, 3, 11, 9, 10, 8, 9, 6, - 4, 9, 12, 10, 11, 7, 5, 10, - 11, 11, 12, 8, 6, 9, 11, 11, - 9, 7, 11, 11, 9, 8, 10, 9, - 9, 12, 9, 9, 11, 9, 12, 10, - 11, 12, 12, 12, 12, 11, 10, 11, - 10, 11, 10, 10, 11, 11, 9, 10, - 11, 9, 11, 10, 8, 12, 12, 10, - 7, 11, 11, 12, 8, 6, 10, 10, - 12, 10, 10, 7, 5, 10, 8, 10, - 8, 9, 6, 4, 11, 12, 8, 6, - 7, 6, 5, 4, 2, +static const uint8_t ac_vlc_descA_bits[110] = { + 2, 9, 9, 8, 8, 12, 12, 11, 10, 9, 8, 10, 10, 9, 7, 6, 8, 9, + 11, 11, 12, 12, 11, 8, 9, 10, 11, 11, 7, 7, 8, 9, 9, 8, 10, 11, + 11, 10, 11, 12, 12, 5, 5, 6, 8, 9, 9, 8, 9, 10, 11, 12, 12, 4, + 6, 7, 7, 6, 7, 9, 10, 10, 11, 11, 10, 9, 4, 7, 8, 11, 11, 10, + 10, 10, 6, 7, 8, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 6, 4, 6, + 11, 12, 12, 11, 11, 9, 12, 12, 11, 12, 12, 11, 10, 10, 8, 8, 6, 6, + 4, 3, }; -static const uint16_t ac_vlc_descC_syms[96] = { - 0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, - 0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, - 0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6, - 0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3, - 0xFB1, 0xFB0, 0xFA6, 0xFA3, 0xFA1, 0xFA0, 0xF93, 0xF91, - 0xF90, 0xF81, 0xF80, 0xF71, 0xF70, 0xF61, 0xF60, 0xF51, - 0x0E1, 0x0C1, 0x0B1, 0x0A1, 0x0A0, 0x091, 0x090, 0x083, - 0x081, 0x080, 0x073, 0x071, 0x070, 0x063, 0x061, 0x060, - 0x055, 0x053, 0x051, 0x050, 0x045, 0x043, 0x042, 0x041, - 0x040, 0x036, 0x035, 0x034, 0x033, 0x032, 0x031, 0x030, - 0x026, 0x025, 0x024, 0x023, 0x022, 0x021, 0x020, 0x018, - 0x017, 0x016, 0x015, 0x014, 0x013, 0x012, 0x011, 0x010, -}; - -static const uint16_t ac_vlc_descC_codes[96] = { - 0x00DE, 0x072E, 0x0576, 0x006E, 0x0075, 0x0055, 0x0013, 0x0033, - 0x000D, 0x0007, 0x07D2, 0x0052, 0x0065, 0x00CE, 0x0183, 0x003E, - 0x0001, 0x002E, 0x0F35, 0x0003, 0x0243, 0x001A, 0x0006, 0x01A5, - 0x0043, 0x0012, 0x0E43, 0x00B6, 0x0016, 0x0135, 0x0176, 0x0643, - 0x0035, 0x001E, 0x0735, 0x0283, 0x0125, 0x00AE, 0x00D2, 0x0165, - 0x0103, 0x0603, 0x00E5, 0x0C43, 0x02B5, 0x04A5, 0x00A5, 0x0443, - 0x0265, 0x0476, 0x0212, 0x0112, 0x0376, 0x012E, 0x02D2, 0x0083, - 0x0483, 0x015E, 0x06A5, 0x0335, 0x005E, 0x0025, 0x01D2, 0x00F6, - 0x03D2, 0x032E, 0x03B5, 0x005A, 0x0203, 0x02A5, 0x0BD2, 0x004E, - 0x0032, 0x01B5, 0x00B5, 0x0A65, 0x0225, 0x0276, 0x000E, 0x000A, - 0x03E5, 0x0143, 0x01E5, 0x0036, 0x0092, 0x0005, 0x0009, 0x0665, - 0x0076, 0x00C3, 0x003A, 0x0015, 0x0023, 0x0002, 0x000B, 0x0000, +static const uint8_t ac_vlc_descB_bits[101] = { + 2, 5, 8, 10, 10, 9, 7, 6, 5, 5, 11, 11, 10, 11, 11, 10, 8, 7, + 6, 9, 9, 8, 7, 6, 7, 7, 9, 9, 9, 9, 8, 8, 6, 10, 11, 12, + 12, 11, 11, 11, 11, 8, 8, 10, 10, 9, 4, 4, 6, 11, 12, 12, 10, 9, + 10, 11, 11, 10, 11, 11, 7, 7, 9, 11, 12, 12, 10, 9, 10, 10, 7, 8, + 12, 12, 11, 10, 10, 10, 4, 6, 6, 6, 10, 11, 12, 12, 9, 8, 11, 11, + 11, 11, 10, 12, 12, 12, 12, 9, 9, 4, 3, }; static const uint8_t ac_vlc_descC_bits[96] = { - 8, 11, 11, 7, 7, 7, 6, 6, - 4, 3, 11, 8, 10, 8, 9, 6, - 4, 9, 12, 10, 11, 7, 5, 9, - 11, 10, 12, 8, 6, 10, 11, 12, - 9, 7, 12, 10, 9, 8, 10, 9, - 9, 11, 9, 12, 10, 11, 11, 12, - 12, 11, 10, 9, 10, 10, 10, 11, - 11, 9, 11, 11, 9, 10, 10, 8, - 12, 11, 10, 7, 11, 11, 12, 8, - 6, 10, 10, 12, 10, 10, 7, 5, - 10, 9, 10, 8, 8, 6, 4, 11, - 11, 8, 6, 7, 6, 5, 4, 2, + 2, 5, 10, 10, 9, 8, 8, 10, 10, 10, 12, 12, 11, 6, 5, 7, 7, 6, + 5, 6, 8, 8, 11, 11, 10, 11, 11, 10, 8, 7, 8, 8, 9, 10, 11, 11, + 8, 7, 7, 9, 9, 8, 6, 4, 4, 6, 10, 10, 9, 11, 11, 11, 11, 9, + 10, 12, 12, 11, 9, 9, 10, 10, 7, 7, 9, 10, 11, 12, 12, 10, 10, 10, + 10, 7, 4, 10, 11, 11, 9, 11, 11, 10, 9, 11, 12, 12, 11, 12, 12, 9, + 8, 6, 6, 6, 4, 3, }; static const int tscc2_ac_vlc_sizes[NUM_VLC_SETS] = { @@ -910,14 +485,6 @@ static const uint16_t * const tscc2_ac_vlc_syms[NUM_VLC_SETS] = { ac_vlc_descC_syms, }; -static const uint16_t * const tscc2_ac_vlc_codes[NUM_VLC_SETS] = { - ac_vlc_desc0_codes, ac_vlc_desc1_codes, ac_vlc_desc2_codes, - ac_vlc_desc3_codes, ac_vlc_desc4_codes, ac_vlc_desc5_codes, - ac_vlc_desc6_codes, ac_vlc_desc7_codes, ac_vlc_desc8_codes, - ac_vlc_desc9_codes, ac_vlc_descA_codes, ac_vlc_descB_codes, - ac_vlc_descC_codes, -}; - static const uint8_t * const tscc2_ac_vlc_bits[NUM_VLC_SETS] = { ac_vlc_desc0_bits, ac_vlc_desc1_bits, ac_vlc_desc2_bits, ac_vlc_desc3_bits, ac_vlc_desc4_bits, ac_vlc_desc5_bits, ac_vlc_desc6_bits, ac_vlc_desc7_bits, From patchwork Fri Nov 20 07:18:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23747 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 BA41A44A644 for ; Fri, 20 Nov 2020 09:24:16 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 94EBD68B994; Fri, 20 Nov 2020 09:24:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8C18768B900 for ; Fri, 20 Nov 2020 09:24:09 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id k27so11452234ejs.10 for ; Thu, 19 Nov 2020 23:24:09 -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=Sbe+Xlh8EuG8tp3oslVENvkxbbFc66/jCfMortypAyA=; b=DX0TQ8LOqPT/zd0GJEk8GDpuXjkoI/qED/E9/w0wfGhbWQ5MWjKMyQqdNCQwEZTVey HG+OM8Akr+o52wQlKKpFH6D2ufnKIba6JtA123DrzYhgfUtMK+qc2ZAHmO/jiDrPCLfl 39yKoBuS290jAABrBg9W2udP8gWJlFHz066fthH0WtPQVDe7R3QI8HDmYhT++WinIiAW yXFCWWd27HAUOLFjNHvDNJwrpzt/tQA8aglyjn3uIBYqbrCNsHxf+E3jaT35K9EZUOg+ pJdHb4kQChbDIyb6XOfB9DE3JzQBYssTcNsLGZDz912x9eUtEc2XL+xT7KyB2nS36ilu OLAw== 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=Sbe+Xlh8EuG8tp3oslVENvkxbbFc66/jCfMortypAyA=; b=LZ/g8H8+M8L3MzcsFuhy1Kred6Lt+0pNpWhOGc6GkXUOlMQU5M598E0PyKD+SPyWLg R1N8hCNDAMvgJaZpL5Kla2/Y9LAgedU/RUIWPEr1UvB3j72FKK1qw3HZeIedJBSjMFr6 OMRwN+SCJkQE2qJqKsoDwW1xAcjybDKzxCTdsm5D5bZo5XQlEhpbxRJ4t5k6Nu7kBCFx vbhAw5cTPvgzTByQO0xE1YlYpEfe5xmXPCV94F1GXX6V0b0e8k4f/whchkDsMY6IbqtA 0BUm1xpywQSv69jtEKwdGWDTnIoQNN65sxL3zGwKg2WfQKwpDwYzFdUxPVtUMwqqfJHL 0WXA== X-Gm-Message-State: AOAM532ND0nNKf6y3LDQjCF7wgnl/+PJrpPwLVeCGa1NO4QDNNu7JWU1 NOozZQPzPz/MmZ6yh8ESR/szQniwvDiA1g== X-Google-Smtp-Source: ABdhPJwv0nVGoRNqYCLRTH2OBsGStAsbFyWZywDSVIy8qaFltedDqNyzpvDzICc97xYf+tvtzPilXQ== X-Received: by 2002:a17:906:2345:: with SMTP id m5mr183514eja.329.1605857048324; Thu, 19 Nov 2020 23:24:08 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:07 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:36 +0100 Message-Id: <20201120072116.818090-4-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 003/162] avcodec/tscc2: Combine tables for 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" Using one big table for the symbols and lengths makes it possible to remove the pointers to the individual tables. Signed-off-by: Andreas Rheinhardt --- libavcodec/tscc2.c | 8 ++- libavcodec/tscc2data.h | 116 ++++++++++------------------------------- 2 files changed, 34 insertions(+), 90 deletions(-) diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index 2522324d94..10bdff9a4e 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -60,6 +60,8 @@ static av_cold void free_vlcs(TSCC2Context *c) static av_cold int init_vlcs(TSCC2Context *c) { + const uint16_t *ac_vlc_syms = tscc2_ac_vlc_syms; + const uint8_t *ac_vlc_lens = tscc2_ac_vlc_lens; int i, ret; ret = ff_init_vlc_from_lengths(&c->dc_vlc, 9, DC_VLC_COUNT, @@ -77,11 +79,13 @@ static av_cold int init_vlcs(TSCC2Context *c) if (ret) return ret; ret = ff_init_vlc_from_lengths(c->ac_vlc + i, 9, tscc2_ac_vlc_sizes[i], - tscc2_ac_vlc_bits[i], 1, - tscc2_ac_vlc_syms[i], 2, 2, + ac_vlc_lens, 1, + ac_vlc_syms, 2, 2, 0, INIT_VLC_OUTPUT_LE, c->avctx); if (ret) return ret; + ac_vlc_lens += tscc2_ac_vlc_sizes[i]; + ac_vlc_syms += tscc2_ac_vlc_sizes[i]; } return 0; diff --git a/libavcodec/tscc2data.h b/libavcodec/tscc2data.h index 2ccfa3b811..63f5619141 100644 --- a/libavcodec/tscc2data.h +++ b/libavcodec/tscc2data.h @@ -95,7 +95,8 @@ static const uint8_t tscc2_nc_vlc_lens[NUM_VLC_SETS][16] = { { 3, 3, 6, 7, 7, 6, 6, 8, 9, 9, 7, 6, 6, 6, 3, 1 }, }; -static const uint16_t ac_vlc_desc0_syms[172] = { +static const uint16_t tscc2_ac_vlc_syms[] = { + /* Descriptor 0 - 172 entries */ 0x0FC0, 0x0040, 0x0FF1, 0x0011, 0x0FA0, 0x0FE5, 0x0140, 0x0280, 0x0D60, 0x0210, 0x0FC6, 0x0FD6, 0x0200, 0x0F95, 0x0101, 0x0190, 0x0FF5, 0x0FF2, 0x0060, 0x0FE1, 0x0021, 0x0F41, 0x0270, 0x0D80, 0x0055, 0x0FB2, 0x00F1, @@ -116,9 +117,7 @@ static const uint16_t ac_vlc_desc0_syms[172] = { 0x01A0, 0x0036, 0x00D1, 0x0FD3, 0x0025, 0x0130, 0x1000, 0x0051, 0x0FF6, 0x0ED0, 0x0E60, 0x0042, 0x0DF0, 0x0F20, 0x00E0, 0x0033, 0x0F71, 0x0071, 0x00A0, -}; - -static const uint16_t ac_vlc_desc1_syms[169] = { + /* Descriptor 1 - 169 entries */ 0x00D0, 0x0E50, 0x00D1, 0x0091, 0x0160, 0x0F31, 0x0EE1, 0x0250, 0x0F70, 0x0051, 0x0F41, 0x0063, 0x0150, 0x0EF0, 0x01A0, 0x0F51, 0x0FD5, 0x0F93, 0x0DC0, 0x0240, 0x0095, 0x0FD2, 0x00C0, 0x0FC0, 0x0040, 0x0090, 0x0016, @@ -138,9 +137,7 @@ static const uint16_t ac_vlc_desc1_syms[169] = { 0x0F60, 0x0014, 0x0070, 0x0F90, 0x0030, 0x0FB1, 0x0075, 0x0E90, 0x0F91, 0x0FF4, 0x0013, 0x0FF3, 0x0EE0, 0x0FF8, 0x0065, 0x0E40, 0x01B0, 0x0F30, 0x0071, 0x0FE5, 0x0EA0, 0x0F71, 0x0110, 0x0FF0, 0x0010, -}; - -static const uint16_t ac_vlc_desc2_syms[165] = { + /* Descriptor 2 - 165 entries */ 0x0051, 0x0E61, 0x0E81, 0x0E80, 0x0FF7, 0x0E00, 0x0E30, 0x0F71, 0x0130, 0x00F0, 0x0170, 0x0E70, 0x0F81, 0x0F40, 0x0FF3, 0x0040, 0x0013, 0x0FA0, 0x0FC0, 0x0060, 0x0065, 0x0E40, 0x0ED0, 0x0043, 0x0086, 0x0F93, 0x0036, @@ -160,9 +157,7 @@ static const uint16_t ac_vlc_desc2_syms[165] = { 0x0FC5, 0x0EC0, 0x0F00, 0x0090, 0x0022, 0x0F06, 0x0F31, 0x0FA5, 0x00D1, 0x0E60, 0x0075, 0x0F70, 0x0014, 0x0FF4, 0x0025, 0x0FB1, 0x0FE6, 0x0EE0, 0x00C0, 0x0FF0, 0x0010, -}; - -static const uint16_t ac_vlc_desc3_syms[162] = { + /* Descriptor 3 - 162 entries */ 0x0FC5, 0x0EC1, 0x0033, 0x0FE3, 0x0FD6, 0x0110, 0x00E0, 0x0071, 0x0F36, 0x0095, 0x01A1, 0x0F71, 0x0060, 0x0FA0, 0x0FE2, 0x0F20, 0x0F21, 0x0085, 0x0150, 0x0053, 0x0023, 0x0022, 0x0FF4, 0x0043, 0x0E70, 0x0034, 0x0017, @@ -181,9 +176,7 @@ static const uint16_t ac_vlc_desc3_syms[162] = { 0x00B1, 0x0163, 0x0055, 0x0024, 0x0F56, 0x0FA3, 0x0FE4, 0x0F46, 0x0FE6, 0x0025, 0x0026, 0x0EE0, 0x0FA5, 0x01C1, 0x0F70, 0x0FD0, 0x0030, 0x1000, 0x0045, 0x0F11, 0x0066, 0x0F85, 0x0051, 0x0014, 0x0021, 0x0FF0, 0x0010, -}; - -static const uint16_t ac_vlc_desc4_syms[131] = { + /* Descriptor 4 - 131 entries */ 0x0010, 0x0FB0, 0x0050, 0x0070, 0x0FF5, 0x0FC1, 0x0090, 0x0FD1, 0x00E0, 0x0161, 0x0085, 0x0F41, 0x0F20, 0x0FD6, 0x0F70, 0x0FD3, 0x0032, 0x0FD2, 0x0055, 0x0191, 0x0063, 0x0091, 0x0081, 0x0F91, 0x0015, 0x0031, 0x0065, @@ -199,9 +192,7 @@ static const uint16_t ac_vlc_desc4_syms[131] = { 0x0F56, 0x0171, 0x0F10, 0x0FA1, 0x0EB0, 0x0056, 0x0026, 0x0035, 0x0FB5, 0x0FB3, 0x0EF1, 0x0FF3, 0x0013, 0x0F90, 0x0FA5, 0x0FC2, 0x0F11, 0x0F81, 0x0110, 0x0042, 0x0061, 0x0FE5, 0x0FF0, -}; - -static const uint16_t ac_vlc_desc5_syms[132] = { + /* Descriptor 5 - 132 entries */ 0x0010, 0x0F81, 0x0FC5, 0x0F20, 0x0F76, 0x0061, 0x0F41, 0x00D3, 0x0FB3, 0x0023, 0x0F31, 0x0EC0, 0x00B1, 0x0045, 0x0F50, 0x0FF5, 0x0042, 0x00C1, 0x0EC1, 0x00D0, 0x0F33, 0x0F93, 0x0FF8, 0x0EF0, 0x0140, 0x0035, 0x0071, @@ -217,9 +208,7 @@ static const uint16_t ac_vlc_desc5_syms[132] = { 0x0FE4, 0x0103, 0x0091, 0x0026, 0x0F10, 0x0014, 0x0FE2, 0x0022, 0x0070, 0x0090, 0x0100, 0x0FC2, 0x0151, 0x0FD3, 0x0FF4, 0x0050, 0x0F70, 0x0053, 0x0110, 0x0F71, 0x00B0, 0x0F90, 0x0FB0, 0x0FF0, -}; - -static const uint16_t ac_vlc_desc6_syms[130] = { + /* Descriptor 6 - 130 entries */ 0x0010, 0x0FF4, 0x0F96, 0x0F71, 0x00D1, 0x0FF7, 0x00E3, 0x0045, 0x0FC1, 0x1000, 0x00C0, 0x0042, 0x0120, 0x00A0, 0x0F80, 0x0FD1, 0x0F43, 0x0F63, 0x0EF0, 0x0F86, 0x0F60, 0x0023, 0x0080, 0x00F0, 0x0FB3, 0x00E0, 0x0063, @@ -235,9 +224,7 @@ static const uint16_t ac_vlc_desc6_syms[130] = { 0x0091, 0x0101, 0x0071, 0x0070, 0x0F90, 0x0FB0, 0x0FC3, 0x0065, 0x00F1, 0x0F53, 0x00D0, 0x0FE2, 0x0FA1, 0x0024, 0x0FE4, 0x0022, 0x0050, 0x0FE6, 0x0FD5, 0x0F70, 0x0014, 0x0FF0, -}; - -static const uint16_t ac_vlc_desc7_syms[125] = { + /* Descriptor 7 - 125 entries */ 0x0010, 0x0022, 0x0FD5, 0x0F71, 0x0F63, 0x0052, 0x0F31, 0x0042, 0x0024, 0x0FE4, 0x0F86, 0x0F93, 0x00C1, 0x0025, 0x0FD1, 0x0FE6, 0x0F95, 0x00D1, 0x0FA6, 0x0FD2, 0x00E1, 0x0017, 0x0FF7, 0x0081, 0x0FB3, 0x0046, 0x0014, @@ -252,9 +239,7 @@ static const uint16_t ac_vlc_desc7_syms[125] = { 0x0015, 0x0016, 0x00A0, 0x0FD3, 0x0065, 0x0111, 0x0FC3, 0x0091, 0x0018, 0x0F20, 0x0050, 0x1000, 0x0FF6, 0x0FB0, 0x0FA1, 0x0101, 0x0F53, 0x00E0, 0x0080, 0x0F60, 0x00D0, 0x0F41, 0x0F73, 0x0FE2, 0x0011, 0x0FF0, -}; - -static const uint16_t ac_vlc_desc8_syms[121] = { + /* Descriptor 8 - 121 entries */ 0x0010, 0x0F60, 0x0093, 0x00A3, 0x0F95, 0x0018, 0x0FE2, 0x0FA6, 0x0FA1, 0x0022, 0x0090, 0x0042, 0x0F86, 0x0F93, 0x0036, 0x0FE6, 0x0F50, 0x0FD1, 0x0060, 0x0FA0, 0x0025, 0x0FD2, 0x0046, 0x0F70, 0x0031, 0x0045, 0x0F40, @@ -269,9 +254,7 @@ static const uint16_t ac_vlc_desc8_syms[121] = { 0x0053, 0x00C0, 0x0FF1, 0x0FF2, 0x0FB0, 0x0016, 0x0FB5, 0x0F51, 0x0091, 0x0F21, 0x0FD3, 0x0FC3, 0x00D0, 0x0F83, 0x0F61, 0x0012, 0x0015, 0x0051, 0x0FE5, 0x0FF6, 0x0011, 0x0FF0, -}; - -static const uint16_t ac_vlc_desc9_syms[114] = { + /* Descriptor 9 - 114 entries */ 0x0010, 0x0015, 0x0042, 0x0091, 0x0FD2, 0x0036, 0x0FE2, 0x0022, 0x00C0, 0x0121, 0x0065, 0x0F31, 0x0018, 0x0F60, 0x0FF6, 0x0070, 0x00B0, 0x0045, 0x0F71, 0x0FD1, 0x0FC1, 0x0FA1, 0x0055, 0x0FB5, 0x0FB2, 0x0F93, 0x0FC5, @@ -285,9 +268,7 @@ static const uint16_t ac_vlc_desc9_syms[114] = { 0x00D0, 0x00F1, 0x0FC2, 0x0FE6, 0x0FA6, 0x0FB6, 0x0FA0, 0x0FF2, 0x0060, 0x0FD3, 0x0F30, 0x00A1, 0x0F96, 0x0053, 0x0035, 0x00A0, 0x0016, 0x00C1, 0x0FC3, 0x0F81, 0x0FE5, 0x0012, 0x0011, 0x0FF0, -}; - -static const uint16_t ac_vlc_descA_syms[110] = { + /* Descriptor A - 110 entries */ 0x0010, 0x0F60, 0x0051, 0x0F90, 0x0FE2, 0x0044, 0x0FA5, 0x0053, 0x00A1, 0x0035, 0x0022, 0x0026, 0x0073, 0x0080, 0x0FD1, 0x0015, 0x0FE5, 0x0090, 0x0091, 0x0055, 0x0F73, 0x0F51, 0x00D1, 0x0023, 0x0FA1, 0x0061, 0x0FB3, @@ -301,9 +282,7 @@ static const uint16_t ac_vlc_descA_syms[110] = { 0x0F71, 0x00E1, 0x0F40, 0x0FC3, 0x0FB5, 0x0070, 0x0042, 0x0F61, 0x0F83, 0x0FF7, 0x0017, 0x0FD2, 0x0036, 0x0FD3, 0x0016, 0x0FA0, 0x0FF2, 0x0012, 0x0011, 0x0FF0, -}; - -static const uint16_t ac_vlc_descB_syms[101] = { + /* Descriptor B - 101 entries */ 0x0010, 0x0012, 0x0023, 0x0091, 0x0061, 0x0FA1, 0x0FD1, 0x0015, 0x0030, 0x0FD0, 0x0FB3, 0x0F71, 0x0F60, 0x0FA6, 0x0063, 0x0032, 0x0FC1, 0x0031, 0x0040, 0x0080, 0x0FD5, 0x0FE3, 0x0050, 0x0FC0, 0x0FB0, 0x0FF6, 0x0F81, @@ -316,9 +295,7 @@ static const uint16_t ac_vlc_descB_syms[101] = { 0x0FF2, 0x0035, 0x0045, 0x0FC2, 0x00D1, 0x0FE2, 0x0016, 0x0FC3, 0x0FD2, 0x00B0, 0x0FE6, 0x0F93, 0x0F50, 0x0FF7, 0x0017, 0x0053, 0x0022, 0x0FE5, 0x0011, 0x0FF0, -}; - -static const uint16_t ac_vlc_descC_syms[96] = { + /* Descriptor C - 96 entries */ 0x0010, 0x0012, 0x0FC3, 0x00B1, 0x00A1, 0x0022, 0x0FE5, 0x0F93, 0x0090, 0x0061, 0x0055, 0x0042, 0x0FE6, 0x0040, 0x0030, 0x0FD1, 0x0050, 0x0015, 0x0FD0, 0x0FC0, 0x0023, 0x0FC1, 0x0017, 0x00C1, 0x0032, 0x0FB5, 0x0FF7, @@ -332,7 +309,8 @@ static const uint16_t ac_vlc_descC_syms[96] = { 0x0016, 0x0013, 0x0FF3, 0x0FF2, 0x0011, 0x0FF0, }; -static const uint8_t ac_vlc_desc0_bits[172] = { +static const uint8_t tscc2_ac_vlc_lens[] = { + /* Descriptor 0 - 172 entries */ 5, 5, 4, 4, 6, 9, 9, 12, 12, 11, 11, 11, 11, 12, 12, 10, 7, 6, 6, 6, 6, 11, 12, 12, 11, 12, 12, 9, 8, 7, 7, 9, 9, 11, 11, 10, 9, 7, 7, 12, 12, 11, 10, 9, 10, 11, 11, 9, 7, 6, 9, 11, 12, 12, @@ -343,9 +321,7 @@ static const uint8_t ac_vlc_desc0_bits[172] = { 11, 11, 10, 7, 7, 9, 9, 11, 12, 12, 11, 12, 12, 11, 11, 10, 7, 8, 11, 12, 12, 11, 12, 12, 9, 8, 11, 11, 12, 12, 11, 10, 10, 6, 9, 9, 10, 11, 12, 12, 9, 9, 11, 11, 10, 8, -}; - -static const uint8_t ac_vlc_desc1_bits[169] = { + /* Descriptor 1 - 169 entries */ 8, 11, 11, 10, 10, 11, 12, 12, 7, 8, 11, 11, 10, 9, 11, 11, 10, 12, 12, 12, 12, 10, 8, 5, 5, 7, 8, 8, 6, 10, 10, 12, 12, 11, 12, 12, 11, 8, 7, 6, 7, 11, 11, 10, 9, 12, 12, 11, 10, 9, 6, 4, 4, 6, @@ -356,9 +332,7 @@ static const uint8_t ac_vlc_desc1_bits[169] = { 11, 9, 9, 12, 12, 12, 12, 10, 5, 8, 11, 12, 12, 10, 10, 11, 12, 12, 8, 8, 7, 7, 5, 9, 11, 11, 10, 8, 7, 7, 10, 12, 12, 12, 12, 9, 10, 10, 11, 11, 10, 3, 3, -}; - -static const uint8_t ac_vlc_desc2_bits[165] = { + /* Descriptor 2 - 165 entries */ 8, 12, 12, 11, 12, 12, 11, 10, 10, 9, 11, 11, 10, 8, 6, 5, 6, 6, 5, 6, 11, 11, 10, 10, 12, 12, 11, 9, 9, 11, 12, 12, 10, 9, 11, 11, 12, 12, 11, 11, 11, 11, 11, 7, 7, 6, 8, 9, 10, 11, 12, 12, 7, 7, @@ -369,9 +343,7 @@ static const uint8_t ac_vlc_desc2_bits[165] = { 6, 4, 4, 5, 7, 9, 12, 12, 11, 12, 12, 11, 9, 9, 6, 5, 10, 10, 11, 11, 10, 8, 9, 12, 12, 11, 11, 12, 12, 8, 8, 8, 9, 9, 10, 10, 9, 3, 3, -}; - -static const uint8_t ac_vlc_desc3_bits[162] = { + /* Descriptor 3 - 162 entries */ 10, 10, 9, 8, 10, 10, 9, 9, 11, 12, 12, 10, 6, 6, 8, 9, 11, 11, 11, 11, 8, 8, 7, 10, 11, 12, 12, 11, 11, 10, 8, 7, 8, 12, 12, 11, 12, 12, 12, 12, 11, 11, 10, 5, 5, 7, 9, 9, 11, 11, 12, 12, 11, 9, @@ -381,9 +353,7 @@ static const uint8_t ac_vlc_desc3_bits[162] = { 6, 6, 10, 10, 11, 11, 12, 12, 11, 8, 7, 8, 9, 11, 11, 10, 8, 11, 11, 10, 9, 4, 4, 4, 4, 6, 8, 12, 12, 11, 11, 12, 12, 11, 11, 10, 9, 10, 11, 12, 12, 8, 5, 5, 7, 10, 12, 12, 11, 9, 8, 6, 3, 3, -}; - -static const uint8_t ac_vlc_desc4_bits[131] = { + /* Descriptor 4 - 131 entries */ 2, 6, 6, 7, 7, 8, 8, 7, 10, 12, 12, 11, 10, 10, 8, 9, 10, 10, 11, 12, 12, 10, 10, 10, 7, 7, 11, 12, 12, 11, 12, 12, 9, 8, 10, 11, 11, 9, 10, 10, 9, 6, 4, 6, 6, 11, 11, 12, 12, 11, 9, 9, 11, 11, @@ -392,9 +362,7 @@ static const uint8_t ac_vlc_desc4_bits[131] = { 11, 12, 12, 11, 8, 6, 9, 9, 9, 11, 12, 12, 12, 12, 11, 7, 9, 10, 12, 12, 11, 10, 12, 12, 11, 10, 12, 12, 11, 7, 7, 8, 11, 12, 12, 11, 12, 12, 10, 10, 3, -}; - -static const uint8_t ac_vlc_desc5_bits[132] = { + /* Descriptor 5 - 132 entries */ 2, 10, 10, 10, 10, 9, 10, 11, 11, 8, 11, 12, 12, 10, 9, 7, 11, 12, 12, 10, 11, 12, 12, 11, 11, 9, 9, 7, 8, 8, 6, 6, 12, 12, 11, 11, 11, 10, 10, 8, 7, 12, 12, 11, 10, 10, 10, 9, 11, 12, 12, 10, 7, 6, @@ -403,9 +371,7 @@ static const uint8_t ac_vlc_desc5_bits[132] = { 10, 8, 12, 12, 11, 11, 12, 12, 10, 10, 11, 11, 11, 11, 9, 4, 6, 9, 11, 12, 12, 11, 11, 8, 9, 9, 8, 9, 11, 12, 12, 10, 8, 7, 9, 12, 12, 11, 10, 8, 7, 3, -}; - -static const uint8_t ac_vlc_desc6_bits[130] = { + /* Descriptor 6 - 130 entries */ 2, 7, 10, 10, 12, 12, 11, 10, 8, 7, 10, 11, 11, 9, 8, 7, 11, 12, 12, 10, 9, 8, 8, 11, 11, 10, 12, 12, 11, 12, 12, 11, 7, 8, 10, 10, 10, 12, 12, 11, 7, 7, 9, 10, 10, 8, 6, 6, 4, 10, 12, 12, 11, 10, @@ -414,9 +380,7 @@ static const uint8_t ac_vlc_desc6_bits[130] = { 6, 7, 9, 11, 11, 11, 11, 8, 4, 4, 6, 8, 10, 12, 12, 12, 12, 10, 12, 12, 11, 8, 8, 7, 11, 12, 12, 11, 11, 9, 10, 11, 11, 9, 7, 10, 10, 9, 8, 3, -}; - -static const uint8_t ac_vlc_desc7_bits[125] = { + /* Descriptor 7 - 125 entries */ 2, 8, 9, 10, 10, 12, 12, 11, 10, 10, 11, 12, 12, 8, 7, 9, 11, 11, 10, 10, 11, 12, 12, 11, 11, 10, 7, 7, 8, 8, 7, 7, 7, 9, 10, 11, 12, 12, 8, 7, 8, 11, 11, 10, 9, 10, 10, 10, 10, 10, 12, 12, 11, 9, @@ -424,9 +388,7 @@ static const uint8_t ac_vlc_desc7_bits[125] = { 6, 6, 10, 10, 9, 12, 12, 11, 10, 10, 11, 12, 12, 10, 10, 10, 11, 12, 12, 10, 11, 11, 9, 6, 6, 4, 6, 7, 8, 10, 10, 12, 12, 11, 12, 12, 11, 7, 8, 8, 7, 10, 11, 12, 12, 9, 10, 11, 12, 12, 9, 4, 3, -}; - -static const uint8_t ac_vlc_desc8_bits[121] = { + /* Descriptor 8 - 121 entries */ 2, 9, 10, 12, 12, 11, 8, 9, 9, 8, 9, 11, 12, 12, 10, 9, 9, 7, 7, 7, 8, 10, 10, 9, 7, 10, 10, 10, 11, 12, 12, 8, 8, 10, 10, 11, 11, 10, 7, 7, 5, 5, 8, 8, 7, 10, 10, 10, 12, 12, 11, 10, 11, 12, @@ -434,9 +396,7 @@ static const uint8_t ac_vlc_desc8_bits[121] = { 8, 12, 12, 11, 11, 11, 10, 12, 12, 11, 8, 9, 11, 11, 12, 12, 12, 12, 6, 7, 10, 10, 10, 10, 9, 10, 12, 12, 11, 4, 6, 7, 8, 12, 12, 12, 12, 10, 11, 12, 12, 10, 6, 7, 9, 9, 8, 4, 3, -}; - -static const uint8_t ac_vlc_desc9_bits[114] = { + /* Descriptor 9 - 114 entries */ 2, 6, 11, 11, 10, 9, 8, 8, 11, 12, 12, 11, 11, 9, 7, 8, 10, 10, 9, 7, 8, 9, 11, 11, 12, 12, 11, 8, 9, 10, 10, 7, 8, 11, 11, 10, 9, 11, 11, 10, 12, 12, 11, 10, 8, 5, 5, 7, 7, 6, 4, 6, 9, 11, @@ -444,9 +404,7 @@ static const uint8_t ac_vlc_desc9_bits[114] = { 7, 4, 7, 7, 6, 6, 6, 4, 12, 12, 11, 10, 10, 11, 11, 9, 10, 10, 11, 12, 12, 10, 10, 10, 8, 6, 8, 10, 12, 12, 12, 12, 10, 10, 8, 11, 11, 10, 9, 6, 4, 3, -}; - -static const uint8_t ac_vlc_descA_bits[110] = { + /* Descriptor A - 110 entries */ 2, 9, 9, 8, 8, 12, 12, 11, 10, 9, 8, 10, 10, 9, 7, 6, 8, 9, 11, 11, 12, 12, 11, 8, 9, 10, 11, 11, 7, 7, 8, 9, 9, 8, 10, 11, 11, 10, 11, 12, 12, 5, 5, 6, 8, 9, 9, 8, 9, 10, 11, 12, 12, 4, @@ -454,18 +412,14 @@ static const uint8_t ac_vlc_descA_bits[110] = { 10, 10, 6, 7, 8, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 6, 4, 6, 11, 12, 12, 11, 11, 9, 12, 12, 11, 12, 12, 11, 10, 10, 8, 8, 6, 6, 4, 3, -}; - -static const uint8_t ac_vlc_descB_bits[101] = { + /* Descriptor B - 101 entries */ 2, 5, 8, 10, 10, 9, 7, 6, 5, 5, 11, 11, 10, 11, 11, 10, 8, 7, 6, 9, 9, 8, 7, 6, 7, 7, 9, 9, 9, 9, 8, 8, 6, 10, 11, 12, 12, 11, 11, 11, 11, 8, 8, 10, 10, 9, 4, 4, 6, 11, 12, 12, 10, 9, 10, 11, 11, 10, 11, 11, 7, 7, 9, 11, 12, 12, 10, 9, 10, 10, 7, 8, 12, 12, 11, 10, 10, 10, 4, 6, 6, 6, 10, 11, 12, 12, 9, 8, 11, 11, 11, 11, 10, 12, 12, 12, 12, 9, 9, 4, 3, -}; - -static const uint8_t ac_vlc_descC_bits[96] = { + /* Descriptor C - 96 entries */ 2, 5, 10, 10, 9, 8, 8, 10, 10, 10, 12, 12, 11, 6, 5, 7, 7, 6, 5, 6, 8, 8, 11, 11, 10, 11, 11, 10, 8, 7, 8, 8, 9, 10, 11, 11, 8, 7, 7, 9, 9, 8, 6, 4, 4, 6, 10, 10, 9, 11, 11, 11, 11, 9, @@ -478,18 +432,4 @@ static const int tscc2_ac_vlc_sizes[NUM_VLC_SETS] = { 172, 169, 165, 162, 131, 132, 130, 125, 121, 114, 110, 101, 96 }; -static const uint16_t * const tscc2_ac_vlc_syms[NUM_VLC_SETS] = { - ac_vlc_desc0_syms, ac_vlc_desc1_syms, ac_vlc_desc2_syms, ac_vlc_desc3_syms, - ac_vlc_desc4_syms, ac_vlc_desc5_syms, ac_vlc_desc6_syms, ac_vlc_desc7_syms, - ac_vlc_desc8_syms, ac_vlc_desc9_syms, ac_vlc_descA_syms, ac_vlc_descB_syms, - ac_vlc_descC_syms, -}; - -static const uint8_t * const tscc2_ac_vlc_bits[NUM_VLC_SETS] = { - ac_vlc_desc0_bits, ac_vlc_desc1_bits, ac_vlc_desc2_bits, ac_vlc_desc3_bits, - ac_vlc_desc4_bits, ac_vlc_desc5_bits, ac_vlc_desc6_bits, ac_vlc_desc7_bits, - ac_vlc_desc8_bits, ac_vlc_desc9_bits, ac_vlc_descA_bits, ac_vlc_descB_bits, - ac_vlc_descC_bits, -}; - #endif /* AVCODEC_TSCC2DATA_H */ From patchwork Fri Nov 20 07:18:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23748 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 A2EF644A644 for ; Fri, 20 Nov 2020 09:24:17 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8C18068B984; Fri, 20 Nov 2020 09:24:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2899568B900 for ; Fri, 20 Nov 2020 09:24:10 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id i19so11469688ejx.9 for ; Thu, 19 Nov 2020 23:24:10 -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=isUcl6KzQvlFd+BvfNsECK96ELHkOjs3KdIeTah0WPE=; b=XN1zUWJKOs/XNOAB32OYr9EFD70WFjQF5I08UUERqiZ63/UvXPwJW99E36njrTKtRG iBMPjEw7DXjkH5ErTxeLhcQ3hH1X6ksKdH6F4HOqwU8pKXpuQ4UibWrCiaIf2M+7yl3T UzLZcd5P0gPY+BxTQ1fZ4np/8AP5179AJBV5RG79Qzx3xIk5uhPWpf6OasJG6bS9h7Oh Q8TURWv+7LHpXq+mvUP5hxh3XEliyXubTvE+RnDg9gKTiefNdvnJSJB1D2AUSKm6iiKd 2hRQRGh6TQFUOSCOl6UmvqV5UFTyNK7+q2iyP4+yHgPTD+yyiC9pbxt3+QSsUIN97RGs GqLQ== 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=isUcl6KzQvlFd+BvfNsECK96ELHkOjs3KdIeTah0WPE=; b=afMmHFKI35Gafai8+/ndy8cKFRvhMRcaYs1Dq7rzExLHaQ42WYbn4/7uSYH9a0Qu0i 8WbrFXNAWnZECBSFlb/XpbWlmM36a19fM6MqJxPco+/H6Tg8RtlUMk6yJlJpN2ZQT/kE qWLhbutMLzpteZuDzL/TxiH4wrpNNvnkti859DsLUrgAnhLsrCxQ3st7/0s6eMNtp6HW R6F9GasBy9i9/8khJOdTHTXqzBsSX+CzL8UsUUDy53mvog8ISXzrC3+Jq7N9T8q67R7L vmnKd1ZTgu+CjRFaxPL6zZ991Q/d2CiVSbCOLgqOSJovyl6+GObSBfFcXXYZ9VfEzE7x Unag== X-Gm-Message-State: AOAM531FtyqH8Cu5fhVW9tjqAkF/VqQca3cXKvUMHjUw4BLsJ0Si50Vw y6+5aXAfTYchCscxsSbcSQ7T8sMSNWgJNA== X-Google-Smtp-Source: ABdhPJx01sIU+YVguskfXw3ZFtG6RgViDW4gul5CgotcEAcNXnG0H64PwdzqTv3CH93ibHadsey8gQ== X-Received: by 2002:a17:907:9d0:: with SMTP id bx16mr32732568ejc.426.1605857049309; Thu, 19 Nov 2020 23:24:09 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:08 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:37 +0100 Message-Id: <20201120072116.818090-5-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 004/162] avcodec/bitstream: Allow static VLC tables to be bigger than needed 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" Right now the allocated size of the VLC table of a static VLC has to exactly match the size actually used for the VLC: If it is not enough, abort is called; if it is more than enough, an error message is emitted. This is no problem when one wants to initialize an individual VLC via one of the INIT_VLC macros as one just hardcodes the needed size. Yet it is an obstacle when one wants to initialize several VLCs in a loop as one then needs to add an array for the sizes/offsets of the VLC tables (unless max_depth of all arrays is one in which case the sizes are derivable from the number of bits used). Yet said size array is not necessary if one disables the warning for too big buffers. The reason is that the amount of entries needed for the table is of course generated as a byproduct of initializing the VLC. To this end a flag that disables the warning has been added. So one can proceed as follows: static VLC vlcs[NUM]; static VLC_TYPE vlc_table[BUF_SIZE][2]; for (int i = 0, offset = 0; i < NUM; i++) { vlcs[i].table = &vlc_table[offset]; vlcs[i].table_allocated = BUF_SIZE - offset; init_vlc(); /* With INIT_VLC_STATIC_OVERLONG flag */ offset += vlcs[i].table_size; } Of course, BUF_SIZE should be equal to the number of entries actually needed. Signed-off-by: Andreas Rheinhardt --- Default behaviour is unchanged as Paul wished. The reason I opted for the flag (and not AV_LOG_DEBUG) is that initialization of all static VLCs should be done via ff_thread_once() in the future (this patchset already does this for several of them), so that no logcontext will be available anyway. And therefore it should be completely quiet in normal mode. libavcodec/bitstream.c | 4 ++-- libavcodec/vlc.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index 4ce49fd51c..7570fb2204 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -281,9 +281,9 @@ static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, int ret = build_table(vlc, nb_bits, nb_codes, codes, flags); if (flags & INIT_VLC_USE_NEW_STATIC) { - if(vlc->table_size != vlc->table_allocated) + if (vlc->table_size != vlc->table_allocated && + !(flags & (INIT_VLC_STATIC_OVERLONG & ~INIT_VLC_USE_NEW_STATIC))) av_log(NULL, AV_LOG_ERROR, "needed %d had %d\n", vlc->table_size, vlc->table_allocated); - av_assert0(ret >= 0); *vlc_arg = *vlc; } else { diff --git a/libavcodec/vlc.h b/libavcodec/vlc.h index 50a1834b84..6879c3ca6a 100644 --- a/libavcodec/vlc.h +++ b/libavcodec/vlc.h @@ -93,6 +93,7 @@ void ff_free_vlc(VLC *vlc); #define INIT_VLC_OUTPUT_LE 8 #define INIT_VLC_LE (INIT_VLC_INPUT_LE | INIT_VLC_OUTPUT_LE) #define INIT_VLC_USE_NEW_STATIC 4 +#define INIT_VLC_STATIC_OVERLONG (1 | INIT_VLC_USE_NEW_STATIC) #define INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ h, i, j, flags, static_size) \ From patchwork Fri Nov 20 07:18:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23750 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 B1E9244A644 for ; Fri, 20 Nov 2020 09:24:19 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9B8FB68B97E; Fri, 20 Nov 2020 09:24:19 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 09FF368B97E for ; Fri, 20 Nov 2020 09:24:11 +0200 (EET) Received: by mail-ej1-f44.google.com with SMTP id oq3so11471422ejb.7 for ; Thu, 19 Nov 2020 23:24:11 -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=itLXV+8UGJ69Xp7tUyQSFgvVvr9WKag1NoKx6EZ+9eE=; b=JZdzFnW2NuPo8UaEqvzxfoHyFi1Gnp6uud7oOMuabcdA4JSbiHihq43663Atuu4bla e94vPJeCyOhJf35OhgzNrQc0xSSEA0bDloI4M1I4rtHSLm5ldu2aEd1Nq/xNchrAuys3 NCXqve9Ve6uuWiDGdoOlOSs0P3j6vgSXQylQH2gxA0v6XIUGQ9W/ORyCNybh+HwcRXFK YeNhX42bNEpEkPtlxzoFnQo605GgL/WiDEAG1sol7rpsXLmuAGquSzTYpYN8SGVDjdNj rYZd05w6NvrOM45sWwNlc0JgnNODR3pPvMm9tYJ7L0BWfcdHfsk5yp0uZtY/xzKucCHH 1Qzg== 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=itLXV+8UGJ69Xp7tUyQSFgvVvr9WKag1NoKx6EZ+9eE=; b=Htz7JFZhaAyassgurIzDUmnRrzl4NsL0yNS2oMw3h31qHbnI//i/9QRi9mWXGthtCQ 9GWsAaGVu+Cw9JvMyQE7nQNR4rj0sB6D+C0udeClttjQFjiekv4emKkalGNLzhwObe/o sqt0lYjTsUKeLDFq0Ezk5X7XT/ZxU9v1XxctHmam49NgPtBrzoU6xtH5OUo+W0uUiIXH f+OtmyYQebyx4mxequJ3E4QmVq0wQeNZLtPt2ZzpqWAuCOCsNHO9eYOkI64DxQyudHvZ eeKs7ctLIt7WZJGlbMjObJ7VNeEr/kEZhZU/E5h8hUno058sWcswfQUu52jkfvA8jCFl p8mA== X-Gm-Message-State: AOAM533nQ/Zm2KyFaswPmn/8FQFgrq3qA9X7jRMFVSfawHgzNxDkw6p+ lhkEMOmgwmNEFSpY0UppMgm/zB9OVkevRA== X-Google-Smtp-Source: ABdhPJwbQcjWLPgfM5OV8L+4Wzy4JyZwvF8QOxOmUPk4nZrwnoLDvZ9c0418ystGKEseqrGK1yENQg== X-Received: by 2002:a17:906:4ec8:: with SMTP id i8mr26251705ejv.184.1605857050198; Thu, 19 Nov 2020 23:24:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:09 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:38 +0100 Message-Id: <20201120072116.818090-6-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 005/162] avcodec/tscc2: Mark tscc2 decoder as init-threadsafe 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/tscc2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index 10bdff9a4e..17eb2c854f 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -374,5 +374,5 @@ AVCodec ff_tscc2_decoder = { .close = tscc2_decode_end, .decode = tscc2_decode_frame, .capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Fri Nov 20 07:18:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23791 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 8015344B17A for ; Fri, 20 Nov 2020 09:31:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 636FB68B9FC; Fri, 20 Nov 2020 09:31:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C510D68B99F for ; Fri, 20 Nov 2020 09:31:29 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id y17so11472226ejh.11 for ; Thu, 19 Nov 2020 23:31:29 -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=DwGViy6VfVvDUCg9P3n5jU1/sz28I4FD6Zlho+bqWZM=; b=ngx3/oumINvY9jRzlaFxMKa3qzqi9O4GPPW+czTvyz2D9ta2NXdoy/sCk+9qQv4BnW V0B5FeC7P9PQ1FYbXWN+A3vCkCshDJjOegpOq21y8Jd0wNGybVKbWgHkpOKVtGZXUgMT dEwqsCCvIThvamhK7K0b4pZRoagvDyLZDuoyMqGg77j/hZo2Psi0g2xTYTzA/YRa7rvP J7Q4GZK4t03n//xlfKrd26uOKVyKwMofgPXQwpawTQoWtsJn6xMPnhbWqH0SuIzUudPQ ALPRb2oHyE9QKJ3e7pOev4FX3/3dePxD823qEA7egKs6D3XpaHNktantnNVVhhSgGJ4M S5Iw== 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=DwGViy6VfVvDUCg9P3n5jU1/sz28I4FD6Zlho+bqWZM=; b=Y2HPujuX3vVYgQnl5BE4PdI6/ccxGvGN/OjI/xh6eoFHz+XdqrKvJz3zmNEKLLWWoe heyH/AIATeXg7C8S2+vcNbdvwqp9zkddI8KBFe/3UyWWvI3CEbck/zfiEoS7DIyNYQhD bHiC0dQ9k9bRqK8v1OJO2xljgqpZVtwZXclAFdvMsE2EgTEVf+SATFzeJ00im6Z+nWSs POm7xXJDr1l/+NYmafKjJOKgVdLb72MpWGt/s0PRXNgf8Qjzi80lWnrLIfXilH3N4WPk Dd6aaB6qkLaFFvcTGQXa2Zm5brqaKUkSbCJTrojO3uSKCjFHMqcmHVvWX6E4fogzs7vf 6GDw== X-Gm-Message-State: AOAM530wNRpAoVj7wnbk/6UAo4wi7KOSiUa280dgK9960D91ox0ew4G3 NICiCMQ6PpEkIZMyCDXo4QJhuyA+AlTWuw== X-Google-Smtp-Source: ABdhPJzKHdkGNIM2lAHFgW1c2wtqj/oeoUD3MHxxIr5u9luoMTqGIhUr9rMwRj5AL1m4DK98Wz8P5Q== X-Received: by 2002:a50:eb96:: with SMTP id y22mr35053051edr.116.1605857051204; Thu, 19 Nov 2020 23:24:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:10 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:39 +0100 Message-Id: <20201120072116.818090-7-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 006/162] avcodec/tscc2: Make VLC tables static 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" Also use a named constant for the number of bits of the VLC tables. Signed-off-by: Andreas Rheinhardt --- Now using ff_thread_once(). libavcodec/tscc2.c | 73 ++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 41 deletions(-) diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index 17eb2c854f..13e7a41a31 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -26,6 +26,8 @@ #include +#include "libavutil/thread.h" + #define BITSTREAM_READER_LE #include "avcodec.h" #include "bytestream.h" @@ -34,6 +36,8 @@ #include "mathops.h" #include "tscc2data.h" +#define TSCC2_VLC_BITS 9 + typedef struct TSCC2Context { AVCodecContext *avctx; AVFrame *pic; @@ -43,52 +47,43 @@ typedef struct TSCC2Context { int q[2][3]; GetBitContext gb; - VLC dc_vlc, nc_vlc[NUM_VLC_SETS], ac_vlc[NUM_VLC_SETS]; int block[16]; } TSCC2Context; -static av_cold void free_vlcs(TSCC2Context *c) -{ - int i; +static VLC dc_vlc, nc_vlc[NUM_VLC_SETS], ac_vlc[NUM_VLC_SETS]; - ff_free_vlc(&c->dc_vlc); - for (i = 0; i < NUM_VLC_SETS; i++) { - ff_free_vlc(c->nc_vlc + i); - ff_free_vlc(c->ac_vlc + i); - } +static av_cold void tscc2_init_vlc(VLC *vlc, int *offset, int nb_codes, + const uint8_t *lens, const void *syms, + int sym_length) +{ + static VLC_TYPE vlc_buf[15442][2]; + + vlc->table = &vlc_buf[*offset]; + vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; + ff_init_vlc_from_lengths(vlc, TSCC2_VLC_BITS, nb_codes, + lens, 1, syms, sym_length, sym_length, 0, + INIT_VLC_STATIC_OVERLONG | INIT_VLC_OUTPUT_LE, NULL); + *offset += vlc->table_size; } -static av_cold int init_vlcs(TSCC2Context *c) +static av_cold void tscc2_init_vlcs(void) { const uint16_t *ac_vlc_syms = tscc2_ac_vlc_syms; const uint8_t *ac_vlc_lens = tscc2_ac_vlc_lens; - int i, ret; + int i, offset = 0; - ret = ff_init_vlc_from_lengths(&c->dc_vlc, 9, DC_VLC_COUNT, - tscc2_dc_vlc_lens, 1, - tscc2_dc_vlc_syms, 2, 2, - 0, INIT_VLC_OUTPUT_LE, c->avctx); - if (ret) - return ret; + tscc2_init_vlc(&dc_vlc, &offset, DC_VLC_COUNT, + tscc2_dc_vlc_lens, tscc2_dc_vlc_syms, 2); for (i = 0; i < NUM_VLC_SETS; i++) { - ret = ff_init_vlc_from_lengths(c->nc_vlc + i, 9, 16, - tscc2_nc_vlc_lens[i], 1, - tscc2_nc_vlc_syms[i], 1, 1, - 0, INIT_VLC_OUTPUT_LE, c->avctx); - if (ret) - return ret; - ret = ff_init_vlc_from_lengths(c->ac_vlc + i, 9, tscc2_ac_vlc_sizes[i], - ac_vlc_lens, 1, - ac_vlc_syms, 2, 2, - 0, INIT_VLC_OUTPUT_LE, c->avctx); - if (ret) - return ret; + tscc2_init_vlc(&nc_vlc[i], &offset, 16, + tscc2_nc_vlc_lens[i], tscc2_nc_vlc_syms[i], 1); + + tscc2_init_vlc(&ac_vlc[i], &offset, tscc2_ac_vlc_sizes[i], + ac_vlc_lens, ac_vlc_syms, 2); ac_vlc_lens += tscc2_ac_vlc_sizes[i]; ac_vlc_syms += tscc2_ac_vlc_sizes[i]; } - - return 0; } #define DEQUANT(val, q) (((q) * (val) + 0x80) >> 8) @@ -154,7 +149,7 @@ static int tscc2_decode_mb(TSCC2Context *c, int *q, int vlc_set, if (!(j | k)) { dc = get_bits(gb, 8); } else { - dc = get_vlc2(gb, c->dc_vlc.table, 9, 2); + dc = get_vlc2(gb, dc_vlc.table, TSCC2_VLC_BITS, 2); if (dc == 0x100) dc = get_bits(gb, 8); } @@ -162,12 +157,12 @@ static int tscc2_decode_mb(TSCC2Context *c, int *q, int vlc_set, prev_dc = dc; c->block[0] = dc; - nc = get_vlc2(gb, c->nc_vlc[vlc_set].table, 9, 1); + nc = get_vlc2(gb, nc_vlc[vlc_set].table, TSCC2_VLC_BITS, 1); bpos = 1; memset(c->block + 1, 0, 15 * sizeof(*c->block)); for (l = 0; l < nc; l++) { - ac = get_vlc2(gb, c->ac_vlc[vlc_set].table, 9, 2); + ac = get_vlc2(gb, ac_vlc[vlc_set].table, TSCC2_VLC_BITS, 2); if (ac == 0x1000) ac = get_bits(gb, 12); bpos += ac & 0xF; @@ -330,7 +325,6 @@ static av_cold int tscc2_decode_end(AVCodecContext *avctx) av_frame_free(&c->pic); av_freep(&c->slice_quants); - free_vlcs(c); return 0; } @@ -338,17 +332,12 @@ static av_cold int tscc2_decode_end(AVCodecContext *avctx) static av_cold int tscc2_decode_init(AVCodecContext *avctx) { TSCC2Context * const c = avctx->priv_data; - int ret; + static AVOnce init_static_once = AV_ONCE_INIT; c->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_YUV444P; - if ((ret = init_vlcs(c)) < 0) { - av_log(avctx, AV_LOG_ERROR, "Cannot initialise VLCs\n"); - return ret; - } - c->mb_width = FFALIGN(avctx->width, 16) >> 4; c->mb_height = FFALIGN(avctx->height, 8) >> 3; c->slice_quants = av_malloc(c->mb_width * c->mb_height); @@ -361,6 +350,8 @@ static av_cold int tscc2_decode_init(AVCodecContext *avctx) if (!c->pic) return AVERROR(ENOMEM); + ff_thread_once(&init_static_once, tscc2_init_vlcs); + return 0; } From patchwork Fri Nov 20 07:18:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23751 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 9BA9744A644 for ; Fri, 20 Nov 2020 09:24:20 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7F59268B9B2; Fri, 20 Nov 2020 09:24:20 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C5CA768B99F for ; Fri, 20 Nov 2020 09:24:12 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id a16so11511042ejj.5 for ; Thu, 19 Nov 2020 23:24:12 -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=WqFHj4lIBHtzs2092zA7cqBT0Pr0Zpr/mSZwY5TYFWU=; b=Q+gR/28tg8xfrtLi3B38RaB8YB+mdGNp0ihYFZBc3QSwRVNJABBW3Hc0hLakuW1Ud5 YsmlUzCRLYV+3BmAQioeCytKRvZLRi0/pwY/YcSMs23+dyUSnqs2ZsuVMHyIUbmuWkzx 7bVmb72rLjKlNLlqGA4KGjWnv3//RMjuCTR7q457cYL4x5LtBmh60VudnafA/1VaLkoi REPTYK2KNwzs3eK4CAaiduzojZ/+LUL0qCiwiz6QfAxpUwR5Zsls21Pv/dJCOneYaxxB 0uWFCusfaOtusd0V95L1tZcIFZb6avO0FSD1RqS7YNrSEzQzXlUpBZ/B8Nf5VLqcnz/J MtsA== 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=WqFHj4lIBHtzs2092zA7cqBT0Pr0Zpr/mSZwY5TYFWU=; b=lFRIboKkBtU5YtoyTe08amCOWmVJ2pKdfm6+PR0XFOZNS6S4R3wFGMQFqzqqEZWga3 E1q4R4w3pvTwSj4ja92r97F7VmGXE//5RiIlcDS4pjdj62puB5EC0XAZfSyb/JciL7S0 nsIrYGK7BvGHtHK+poZWj4H2Q+0KW16HH+dC6tdreroj0ynwTMJnYbrrDOxRZIX6yZrz KZwHQ/3U4Qk02tWk6B8HZWUyjgE0NJhF4JIsNuyymtv9MWfa4ZJYXq/4O1xb/gYlX7Mf /YEsfvbZ3Zrw702uuOJl88gf+tWTs0ErW33FikeyBknjN6BxhKRoeO6xnqeHmsuYd2dQ qsQg== X-Gm-Message-State: AOAM5336Ysz1jcQXNXqnicSuZmM+wueXa6ks2mK4OSVJZ732y4mDlCWD sS+1jfUJwfNXjKGVr7jpkSbt/c3ItMhD7w== X-Google-Smtp-Source: ABdhPJzd2PCK8v3wqGkEqstIyoG0tTZeqXTBaU/84GEZZHCUf/4nuEh5AvNtU/wXy7brS+bI1gjWGQ== X-Received: by 2002:a17:906:4698:: with SMTP id a24mr33244472ejr.90.1605857052071; Thu, 19 Nov 2020 23:24:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:11 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:40 +0100 Message-Id: <20201120072116.818090-8-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 007/162] avcodec/cllc: Improve creating 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" One can offload the computation of the codes to ff_init_vlc_from_lengths(); this also improves performance: The number of decicycles for one call to read_code_table() decreased from 198343 to 148338 with the sample sample-cllc-rgb.avi from the FATE suite; it has been looped 100 times and the test repeated ten times to test it sufficiently often. Signed-off-by: Andreas Rheinhardt --- libavcodec/cllc.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/libavcodec/cllc.c b/libavcodec/cllc.c index 8b1bc75faa..837e04f173 100644 --- a/libavcodec/cllc.c +++ b/libavcodec/cllc.c @@ -46,11 +46,9 @@ static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc) { uint8_t symbols[256]; uint8_t bits[256]; - uint16_t codes[256]; - int num_lens, num_codes, num_codes_sum, prefix; + int num_lens, num_codes, num_codes_sum; int i, j, count; - prefix = 0; count = 0; num_codes_sum = 0; @@ -74,19 +72,13 @@ static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc) for (j = 0; j < num_codes; j++) { symbols[count] = get_bits(gb, 8); bits[count] = i + 1; - codes[count] = prefix++; count++; } - if (prefix > (65535 - 256)/2) { - return AVERROR_INVALIDDATA; - } - - prefix <<= 1; } - return ff_init_vlc_sparse(vlc, VLC_BITS, count, bits, 1, 1, - codes, 2, 2, symbols, 1, 1, 0); + return ff_init_vlc_from_lengths(vlc, VLC_BITS, count, bits, 1, + symbols, 1, 1, 0, 0, ctx->avctx); } /* From patchwork Fri Nov 20 07:18:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23752 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 9119244A644 for ; Fri, 20 Nov 2020 09:24:21 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5A19068B9B9; Fri, 20 Nov 2020 09:24:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E734768B9AC for ; Fri, 20 Nov 2020 09:24:13 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id 7so11517635ejm.0 for ; Thu, 19 Nov 2020 23:24:13 -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=sjcVtiurTCBhciIlqJSOcRZliYDRUwK2BJ+EBO6G6Lg=; b=KTp8a4g0p3vgjxQckTJBMItzdLmJ08uEw0BXoa9okNWkAKUGE8ebrknNZ6Kb2uX5vh 1hFtQLOEEf2NwrVCvcVqPb1PMH0C0mh7HZ2AkhASeGu5wiPqzfZbrQ+ctkzuU8YGp5bL mYHRHHzx1zpzWFjykaUM/1CktPOXyQVwZy6YvfHN3HrNT3PWl8uvGPkTEaBNe4WM7W0S MybCTU5CKHnItoAt9Qsr55Lp0kjqbvYXh2Wu25IvmB6uzwfxmmZ35QHgnZJMKebHCNtg XiqUjEY0Tg5Du6ggUiDQK39BdPExxFxsKoObseflP8PdCaBLonszyDlqQu/vGZi1Wpkx hN2A== 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=sjcVtiurTCBhciIlqJSOcRZliYDRUwK2BJ+EBO6G6Lg=; b=CgWxq8Wm8tnLNAkb53YjsRoLBUQ8uFLZr0XOLZ6/XUiCx0xKU1kIMzrXvFt8ioTpR8 XlfQsbBlEx1JbTBYSRtDhBfDAWxzaG8OXAerUwq2M6i/dKhiE1BYfyUKj86/LytVH3a9 17Aawzx61UEz1RQ7iBa+8Ec4JsL+6k2QoGBxQPBB3q6UvgFdfBL52OCCuHf3jOzWj7wd lXWdVBU4UNkl7elYlCCy9q8WXG8WfbbfJQN0/Gyav1d/6aTgRzFWZRTvlvV+ok1j6056 1YegPAVJ6anxpdBi65bhGZrRu4Z46xF7nifXHTpiG4cATjOUO41GyZ9Ucwe91EN9pll6 aQfw== X-Gm-Message-State: AOAM533zI6Hv/yuq5qcOrnn1qv6mfWatPhXfnwyYjRCuk4Byh7lZl7xY fFkgbAf/qAI1kct3CgjflS+0xu/fC0Xb7A== X-Google-Smtp-Source: ABdhPJz9iIN7D8uF+4SCubW2eauD2uCO9dQwDI3R1JaaNXYbfxY8JZHxkmWRX3V/ls4mFmJ4RujBWg== X-Received: by 2002:a17:906:35da:: with SMTP id p26mr31806919ejb.256.1605857053019; Thu, 19 Nov 2020 23:24:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:12 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:41 +0100 Message-Id: <20201120072116.818090-9-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 008/162] avcodec/smacker: Improve creating Huffman VLC tables 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 Smacker Huffman tables are already stored in a tree-like structure; in particular, they are naturally ordered from left to right in the tree and are therefore suitable to be initialized by ff_init_vlc_from_lengths() which avoids traversing the data twice in order to sort only the codes that are so long that they need into a subtable. This improves performance (and reduces codesize): For the sample from ticket #2425 the number of decicycles for parsing and creating the VLCs in smka_decode_frame() decreased from 412322 to 359152 (tested with 10 runs each looping 20 times over the file). Signed-off-by: Andreas Rheinhardt --- libavcodec/smacker.c | 46 +++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 6b1faec09e..871a76257a 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -62,14 +62,17 @@ typedef struct SmackVContext { int mmap_last[3], mclr_last[3], full_last[3], type_last[3]; } SmackVContext; +typedef struct HuffEntry { + uint8_t value; + uint8_t length; +} HuffEntry; + /** * Context used for code reconstructing */ typedef struct HuffContext { int current; - uint32_t bits[256]; - uint8_t lengths[256]; - uint8_t values[256]; + HuffEntry entries[256]; } HuffContext; /* common parameters used for decode_bigtree */ @@ -105,7 +108,7 @@ enum SmkBlockTypes { * Can read SMKTREE_DECODE_MAX_RECURSION before the first check; * does not overread gb on success. */ -static int smacker_decode_tree(GetBitContext *gb, HuffContext *hc, uint32_t prefix, int length) +static int smacker_decode_tree(GetBitContext *gb, HuffContext *hc, int length) { if (length > SMKTREE_DECODE_MAX_RECURSION || length > 3 * SMKTREE_BITS) { av_log(NULL, AV_LOG_ERROR, "Maximum tree recursion level exceeded.\n"); @@ -119,18 +122,15 @@ static int smacker_decode_tree(GetBitContext *gb, HuffContext *hc, uint32_t pref } if (get_bits_left(gb) < 8) return AVERROR_INVALIDDATA; - hc->bits[hc->current] = prefix; - hc->lengths[hc->current] = length; - hc->values[hc->current] = get_bits(gb, 8); - hc->current++; + hc->entries[hc->current++] = (HuffEntry){ get_bits(gb, 8), length }; return 0; } else { //Node int r; length++; - r = smacker_decode_tree(gb, hc, prefix, length); + r = smacker_decode_tree(gb, hc, length); if(r) return r; - return smacker_decode_tree(gb, hc, prefix | (1U << (length - 1)), length); + return smacker_decode_tree(gb, hc, length); } } @@ -216,22 +216,21 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int i ? "high" : "low"); continue; } - err = smacker_decode_tree(gb, &h, 0, 0); + err = smacker_decode_tree(gb, &h, 0); if (err < 0) goto error; skip_bits1(gb); if (h.current > 1) { - err = ff_init_vlc_sparse(&vlc[i], SMKTREE_BITS, h.current, - h.lengths, sizeof(*h.lengths), sizeof(*h.lengths), - h.bits, sizeof(*h.bits), sizeof(*h.bits), - h.values, sizeof(*h.values), sizeof(*h.values), - INIT_VLC_LE); + err = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current, + &h.entries[0].length, sizeof(*h.entries), + &h.entries[0].value, sizeof(*h.entries), 1, + 0, INIT_VLC_OUTPUT_LE, smk->avctx); if (err < 0) { av_log(smk->avctx, AV_LOG_ERROR, "Cannot build VLC table\n"); goto error; } } else - ctx.vals[i] = h.values[0]; + ctx.vals[i] = h.entries[0].value; } escapes[0] = get_bits(gb, 16); @@ -650,21 +649,20 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, HuffContext h; h.current = 0; skip_bits1(&gb); - if ((ret = smacker_decode_tree(&gb, &h, 0, 0)) < 0) + if ((ret = smacker_decode_tree(&gb, &h, 0)) < 0) goto error; skip_bits1(&gb); if (h.current > 1) { - ret = ff_init_vlc_sparse(&vlc[i], SMKTREE_BITS, h.current, - h.lengths, sizeof(*h.lengths), sizeof(*h.lengths), - h.bits, sizeof(*h.bits), sizeof(*h.bits), - h.values, sizeof(*h.values), sizeof(*h.values), - INIT_VLC_LE); + ret = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current, + &h.entries[0].length, sizeof(*h.entries), + &h.entries[0].value, sizeof(*h.entries), 1, + 0, INIT_VLC_OUTPUT_LE, avctx); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Cannot build VLC table\n"); goto error; } } else - values[i] = h.values[0]; + values[i] = h.entries[0].value; } /* this codec relies on wraparound instead of clipping audio */ if(bits) { //decode 16-bit data From patchwork Fri Nov 20 07:18:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23754 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 6564D44A644 for ; Fri, 20 Nov 2020 09:24:24 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1EA0D68B9D5; Fri, 20 Nov 2020 09:24:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A5FAF68B9B3 for ; Fri, 20 Nov 2020 09:24:14 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id 7so11517652ejm.0 for ; Thu, 19 Nov 2020 23:24:14 -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=4CzRgef8Lcs/eq/FncJhhR9588+J4hJNKsb4YzaGRkc=; b=EizEqqIg25zrPcSJDPgjWX1iuweQf1LGROdl1vwGNpHn2EL1ywTGNV9IuJCyOXeaPy iVIJI0vzevXVUI+fBPpO5VsbzaGXwMKC3fGihvGd4hGgo3TNO0kh0z2XO23cjcIJnl5c T4JGwFw+rYwx8mqiIaUf9EzYNa9pvCh8iJlLVQEpzvoMlNNaK8kk7M+z8vR3bAkiGooW q9s3PPVcdZ59Zquel8SNP8DMhyzHQqT8ZhPtX4ZyCZpI8ovfYWmQBALUgxx8z4pzv0rz 4OFYGh7kT7pTZfB7/8mChc3iFYPkRBYcgDDK+P64N14g6fi9MtSQcN+qaI3pkdt0vc5n 1KxA== 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=4CzRgef8Lcs/eq/FncJhhR9588+J4hJNKsb4YzaGRkc=; b=RGLL5dp1R1QttUv8yrwY6G2MOD+LaYDphzT/GHWjFFB740zT9jyNXx1+4ISaMf29Az H7ZVNAjHJmG9K5oZhL/Y8pv405xknCSeTCFS0BPZluuWyy1aOuRLKAeSGgKxZvOAKJoG 87b4kwwGhdpr1oJzbp1yhUmmjqVEt6/cXq0ISISxSt/OAxuPyqseEAVDKDPJGkrl/Z69 yr8bo88yoXY/Ub18FpxoOoWE4xAkWk57lSVYwxpaYi+/eOxHd91XxDJ5ovKSNFidAsMJ OtHC0LT+TZAV4uV95iYNdqITP11PeHq+77c74syY/zf/90sXr8n4nDScljWP2x55J0yZ 6gOw== X-Gm-Message-State: AOAM5328H2aUGyLjsf7F7ZOyioK6IF+nbX7BST3jvD1hkLiNxSjN4f5j 7W0+mEBD6hv4DcXLTCVTmfcYkZw07yPK5A== X-Google-Smtp-Source: ABdhPJyPbFI72VRH0eEwJFr5tJm9XkI1oK+zGqj/y1P+tkkbkhQDxr4niMejpN6t4//ovzPQQoCR+A== X-Received: by 2002:a17:906:b291:: with SMTP id q17mr31039445ejz.455.1605857053890; Thu, 19 Nov 2020 23:24:13 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:13 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:42 +0100 Message-Id: <20201120072116.818090-10-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 009/162] avcodec/smacker: Mark decoders as init-threadsafe 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" Both Smacker audio and video decoders don't use/modify any global state. Signed-off-by: Andreas Rheinhardt --- libavcodec/smacker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 871a76257a..8db33c9275 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -730,7 +730,7 @@ AVCodec ff_smacker_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; AVCodec ff_smackaud_decoder = { @@ -741,4 +741,5 @@ AVCodec ff_smackaud_decoder = { .init = smka_decode_init, .decode = smka_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Fri Nov 20 07:18:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23755 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 191FF44A644 for ; Fri, 20 Nov 2020 09:24:27 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E7D9968B9C8; Fri, 20 Nov 2020 09:24:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DA4D168B9B7 for ; Fri, 20 Nov 2020 09:24:20 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id k27so11452659ejs.10 for ; Thu, 19 Nov 2020 23:24:20 -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=EJficaKjJJOSHG3/M5WpXIaGjfXP7EUFIGMjVdbnFD8=; b=QD93E6cXFYxDA1KOmqlzygIYqkJgy+pLKEm8gdVnKto6yTx/ZMsIEdWRuQmZFa4o0i T1fwB8khtx3+7zJHEvGZ2i8XekxIrb+OEKEjZTs3jTVVT0YMwbkvDJxK6fV8OmGcXnqy POHeofYRKSoi1kjCu+Utw1VuJz/7AgyFBLhTlO2WYGTw+iTozPw/WGYIskDFNVW68um9 NCBh0I3lCuoARgiIOfezjAweYj2Y9clHxDZ7wFn/lTlhUrxc8bg3DK6YZI5t9Vg43QT3 F9z5/HNoQUtRW5v1EDYkpKGu1GU0aj2Z9dkOPkuffaw/GZjZGtmhwqVcdad903zdPZOQ TfyQ== 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=EJficaKjJJOSHG3/M5WpXIaGjfXP7EUFIGMjVdbnFD8=; b=EBDCHyFSCoMrFJgyx3HCFUKPZCtR6UbIR1jVMDfqMP7oqtoHkpBqyA1/r1yhYiyhyB EHVllFDcnHqS64VAJPDTacRKUKDmGqAScEwUDqquqbafxlQM9DnaOtZpUaBn//GfXmaj 5ioWnvs3ovxPPFhO5kKAZ8/Y2Eh9Jat0CA3EnKwo6CQv403nbTzOKEPoMTiPyHY47rvG VAt1AwmHY4YXxmyLqAO4xOajBIxNLawC3V3s36ndtUdmwbCaeiaUaAAnVLfxq+njCQnM 7RplyjIX6pQF9yd86o8jWoSl21EVKiP3sKwqtHc4aziM82Py3ialXEGwK1DeWskrFG5D jwrA== X-Gm-Message-State: AOAM5321V+CtFuIksZJi/NebYf1Qp7tnqY1MLTgptNW0YVSKFyikSnwM NWrL5LW0nsXK7syHFffFRt9KJ0+6FKQ5JQ== X-Google-Smtp-Source: ABdhPJy3fI0t61j4AdEhkxNkIERBvKa1OvU8cPczWaExxkFFB7iZUxkA5Afb3oa/NBI4UZ+ErxMCKA== X-Received: by 2002:a17:906:f0c3:: with SMTP id dk3mr21765718ejb.366.1605857056814; Thu, 19 Nov 2020 23:24:16 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:15 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:43 +0100 Message-Id: <20201120072116.818090-11-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 010/162] avcodec/on2avc: Use smaller tables for 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" The On2 audio decoder uses huge tables to initialize VLC tables. These tables (mostly) use symbols tables in addition to the codes tables and the lengths tables. This commit makes the codes tables redundant and removes them: If all tables are permuted so that the codes are ordered from left to right in the Huffman tree, the codes become redundant and can be easily calculated at runtime from the lengths (via ff_init_vlc_from_lengths()); this also avoids sorting the codes in ff_init_vlc_sparse()*. The symbols tables are always 16bit, the codes tables are 32bit, 16bit or (rarely) 8bit, the lengths tables are always 8bit. Even though some symbols tables have been used twice (which is no longer possible now because different permutations need to be performed on the code tables sharing the same symbol table in order to order them from left to right), this nevertheless saves about 28KB. *: If the initializations of the VLCs are repeated 2048 times (interleaved with calls to free the VLCs which have not been timed), the number of decicycles spent on each round of initializations improves from 27669656 to 7356159. Signed-off-by: Andreas Rheinhardt --- libavcodec/on2avc.c | 23 +- libavcodec/on2avcdata.c | 8050 +++++++++++---------------------------- libavcodec/on2avcdata.h | 6 +- 3 files changed, 2224 insertions(+), 5855 deletions(-) diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c index 60adc32b9f..2db42e2bf2 100644 --- a/libavcodec/on2avc.c +++ b/libavcodec/on2avc.c @@ -906,7 +906,7 @@ static av_cold void on2avc_free_vlcs(On2AVCContext *c) static av_cold int on2avc_decode_init(AVCodecContext *avctx) { On2AVCContext *c = avctx->priv_data; - int i; + int i, ret; if (avctx->channels > 2U) { avpriv_request_sample(avctx, "Decoding more than 2 channels"); @@ -956,25 +956,24 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) if (!c->fdsp) return AVERROR(ENOMEM); - if (init_vlc(&c->scale_diff, 9, ON2AVC_SCALE_DIFFS, - ff_on2avc_scale_diff_bits, 1, 1, - ff_on2avc_scale_diff_codes, 4, 4, 0)) { + 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); + if (ret < 0) goto vlc_fail; - } for (i = 1; i < 16; i++) { - int idx = i - 1, codes_size = ff_on2avc_cb_codes_sizes[idx]; - if (ff_init_vlc_sparse(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx], - ff_on2avc_cb_bits[idx], 1, 1, - ff_on2avc_cb_codes[idx], codes_size, codes_size, - ff_on2avc_cb_syms[idx], 2, 2, 0)) { + int idx = i - 1; + ret = ff_init_vlc_from_lengths(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx], + ff_on2avc_cb_bits[idx], 1, + ff_on2avc_cb_syms[idx], 2, 2, 0, 0, avctx); + if (ret < 0) goto vlc_fail; - } } return 0; vlc_fail: av_log(avctx, AV_LOG_ERROR, "Cannot init VLC\n"); - return AVERROR(ENOMEM); + return ret; } static av_cold int on2avc_decode_close(AVCodecContext *avctx) diff --git a/libavcodec/on2avcdata.c b/libavcodec/on2avcdata.c index 482cf5e5e9..52ede3f4da 100644 --- a/libavcodec/on2avcdata.c +++ b/libavcodec/on2avcdata.c @@ -110,5900 +110,2275 @@ const On2AVCMode ff_on2avc_modes_44[8] = { { 1, 49, on2avc_swb_start_long }, }; -const uint32_t ff_on2avc_scale_diff_codes[ON2AVC_SCALE_DIFFS] = { - 0x6FFFF, 0xBFFF2, 0xBFFF3, 0xBFFF4, 0xBFFF5, 0xBFFF6, - 0xBFFF7, 0xBFFF8, 0xBFFF9, 0xBFFFA, 0xBFFFB, 0xBFFFC, - 0xBFFFD, 0xBFFFE, 0xBFFFF, 0xDF9A0, 0xDF9A1, 0xDF9A2, - 0xDF9A3, 0xDF9A4, 0xDF9A5, 0xDF9A6, 0xDF9A7, 0xDF9A8, - 0xDF9A9, 0x37FFE, 0x6FCDE, 0x6FFFA, 0x0BFF7, 0x0B7FF, - 0x0DF9F, 0x05FF8, 0x0B7FE, 0x05FF9, 0x06FCE, 0x05BFE, - 0x037FE, 0x02DFE, 0x00DFA, 0x00DFE, 0x017FC, 0x00DBE, - 0x00B7E, 0x005FE, 0x0037D, 0x002DE, 0x0017E, 0x0016C, - 0x000DE, 0x000BE, 0x0006C, 0x0005A, 0x0003E, 0x00034, - 0x0002C, 0x0001F, 0x0000E, 0x0000E, 0x00006, 0x00002, - 0x00000, 0x00004, 0x0000A, 0x0000C, 0x0001E, 0x0001E, - 0x0002E, 0x00035, 0x0003F, 0x0005E, 0x0006E, 0x000DA, - 0x0016D, 0x0016E, 0x001B6, 0x002FE, 0x0036E, 0x0037C, - 0x005BE, 0x006DE, 0x006FE, 0x00DBF, 0x00DFB, 0x016FE, - 0x017FD, 0x01BFE, 0x01BF2, 0x02FFE, 0x06FCC, 0x05FFE, - 0x05FFA, 0x06FFE, 0x0BFF6, 0x0BFFE, 0x0DF9E, 0x00DF8, - 0x0DFFE, 0x37FFC, 0x6FFFB, 0x5FFF8, 0xDF9AA, 0xDF9AB, - 0xDF9AC, 0xDF9AD, 0xDF9AE, 0xDF9AF, 0xDF9B0, 0xDF9B1, - 0xDF9B2, 0xDF9B3, 0x6FFFE, 0xDF9B4, 0xDF9B5, 0xDF9B6, - 0xDF9B7, 0xDF9B8, 0xDF9B9, 0xDF9BA, 0xDF9BB, 0xDF9BE, - 0xDF9BF, +const uint8_t ff_on2avc_scale_diff_syms[ON2AVC_SCALE_DIFFS] = { + 60, 59, 63, 53, 67, 50, 71, 74, 76, 79, 41, 81, 70, 48, 77, + 44, 95, 86, 88, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 111, 112, 113, 114, 115, 116, + 117, 118, 26, 119, 120, 34, 94, 30, 38, 82, 80, 39, 85, 36, 91, + 96, 97, 27, 98, 25, 110, 0, 56, 65, 52, 68, 61, 62, 54, 51, + 47, 72, 73, 45, 78, 42, 83, 37, 35, 32, 29, 66, 69, 49, 46, + 75, 43, 40, 84, 31, 33, 90, 92, 28, 87, 89, 93, 99, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 58, 57, 64, + 55 }; const uint8_t ff_on2avc_scale_diff_bits[ON2AVC_SCALE_DIFFS] = { - 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, - 20, 20, 20, 21, 21, 21, - 21, 21, 21, 21, 21, 21, - 21, 19, 20, 20, 16, 16, - 17, 15, 16, 15, 16, 15, - 15, 14, 13, 13, 13, 13, - 12, 11, 11, 10, 9, 9, - 9, 8, 8, 7, 7, 7, - 6, 5, 5, 4, 3, 3, - 2, 3, 4, 5, 5, 6, - 6, 7, 7, 7, 8, 9, - 9, 9, 10, 10, 11, 11, - 11, 12, 12, 13, 13, 13, - 13, 14, 14, 14, 16, 15, - 15, 16, 16, 16, 17, 13, - 17, 19, 20, 19, 21, 21, - 21, 21, 21, 21, 21, 21, - 21, 21, 20, 21, 21, 21, - 21, 21, 21, 21, 21, 21, - 21, + 2, 3, 5, 7, 7, 8, 9, 10, 11, 12, 13, 13, 8, 9, 11, 11, 13, 14, 16, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 21, 21, 16, 17, 17, 13, 13, 12, 13, + 14, 15, 16, 17, 19, 20, 20, 19, 20, 20, 5, 6, 7, 7, 3, 4, 6, 7, 9, + 9, 9, 10, 11, 12, 13, 14, 15, 16, 16, 6, 7, 8, 9, 10, 11, 13, 13, 15, + 15, 15, 16, 16, 14, 15, 16, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 3, 4, 5, 5 }; -#define ON2AVC_CB1_2_CODES 41 -static const uint16_t on2avc_cb1_codes[ON2AVC_CB1_2_CODES] = { - 0x0000, 0x0022, 0x001C, 0x001B, 0x0024, 0x0030, - 0x0029, 0x0027, 0x0021, 0x002B, 0x002E, 0x0020, - 0x0026, 0x0033, 0x0031, 0x002C, 0x002A, 0x001E, - 0x0094, 0x01FF, 0x01F7, 0x012E, 0x001A, 0x01F5, - 0x007E, 0x012C, 0x01FC, 0x002D, 0x0032, 0x0028, - 0x002F, 0x001D, 0x01FD, 0x012D, 0x007C, 0x01F4, - 0x0023, 0x012F, 0x01F6, 0x01FE, 0x0095, -}; - -static const uint8_t on2avc_cb1_bits[ON2AVC_CB1_2_CODES] = { - 1, 6, 5, 5, 6, 6, - 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 5, - 8, 9, 9, 9, 5, 9, - 7, 9, 9, 6, 6, 6, - 6, 5, 9, 9, 7, 9, - 6, 9, 9, 9, 8, -}; - -static const uint16_t on2avc_cb1_2_syms[ON2AVC_CB1_2_CODES] = { - 0x0000, 0x0011, 0x001F, 0x00F1, 0x00FF, 0x0101, - 0x010F, 0x0110, 0x01F0, 0x0F01, 0x0F0F, 0x0F10, - 0x0FF0, 0x1001, 0x100F, 0x1010, 0x10F0, 0x1100, - 0x1111, 0x111F, 0x11F1, 0x11FF, 0x1F00, 0x1F11, - 0x1F1F, 0x1FF1, 0x1FFF, 0xF001, 0xF00F, 0xF010, - 0xF0F0, 0xF100, 0xF111, 0xF11F, 0xF1F1, 0xF1FF, - 0xFF00, 0xFF11, 0xFF1F, 0xFFF1, 0xFFFF, -}; - -static const uint8_t on2avc_cb2_codes[ON2AVC_CB1_2_CODES] = { - 0x06, 0x03, 0x1F, 0x1E, 0x00, 0x14, - 0x09, 0x0E, 0x0D, 0x0C, 0x15, 0x08, - 0x10, 0x0F, 0x04, 0x12, 0x07, 0x16, - 0x05, 0x2F, 0x17, 0x06, 0x1D, 0x2C, - 0x5E, 0x14, 0x16, 0x06, 0x11, 0x0A, - 0x13, 0x1C, 0x2D, 0x15, 0x5F, 0x2E, - 0x02, 0x07, 0x5D, 0x5C, 0x04, -}; - -static const uint8_t on2avc_cb2_bits[ON2AVC_CB1_2_CODES] = { - 3, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, - 7, 7, 7, 7, 5, 7, - 7, 7, 7, 5, 5, 5, - 5, 5, 7, 7, 7, 7, - 5, 7, 7, 7, 7, -}; - -#define ON2AVC_CB3_4_CODES 313 -static const uint32_t on2avc_cb3_codes[ON2AVC_CB3_4_CODES] = { - 0x00000, 0x00044, 0x00042, 0x00034, 0x0002E, 0x000CD, - 0x002DF, 0x0024A, 0x000CC, 0x0022E, 0x002D6, 0x00031, - 0x0003B, 0x00048, 0x00052, 0x00056, 0x001B8, 0x00160, - 0x001FA, 0x0015E, 0x0015C, 0x0014E, 0x0003C, 0x0010C, - 0x00166, 0x000CA, 0x0324C, 0x00FDA, 0x003DE, 0x002DB, - 0x0057F, 0x02C9E, 0x008BF, 0x0037F, 0x021DC, 0x00B1E, - 0x002DE, 0x002D2, 0x000C8, 0x014D6, 0x03576, 0x002CA, - 0x002CF, 0x003DB, 0x007FE, 0x01F7E, 0x005A3, 0x008BE, - 0x02D7E, 0x002D3, 0x0037E, 0x0004D, 0x0004C, 0x00041, - 0x0016A, 0x0010D, 0x0015D, 0x0011F, 0x00162, 0x0021E, - 0x00055, 0x00161, 0x001BE, 0x0004E, 0x0004A, 0x0004B, - 0x003EE, 0x00352, 0x0043A, 0x0033E, 0x0035C, 0x0036C, - 0x00050, 0x0032F, 0x003D6, 0x00039, 0x0067E, 0x00536, - 0x000FE, 0x001F4, 0x0036D, 0x007EF, 0x00CFE, 0x002D0, - 0x00F8C, 0x00D96, 0x001E9, 0x001F6, 0x00476, 0x00367, - 0x001F2, 0x01FF6, 0x016BB, 0x007FC, 0x00D5C, 0x00B24, - 0x00C92, 0x0014F, 0x01EA6, 0x01936, 0x00366, 0x0035E, - 0x00116, 0x00FBE, 0x01B5E, 0x0092F, 0x007EE, 0x00CEE, - 0x00B26, 0x0011E, 0x014DF, 0x035DE, 0x00030, 0x00473, - 0x005A2, 0x001BC, 0x000D6, 0x002DA, 0x00B5E, 0x007AA, - 0x002C8, 0x00D94, 0x00D97, 0x001AA, 0x001EE, 0x0003A, - 0x035DF, 0x03D4F, 0x0064F, 0x0064A, 0x02D73, 0x1ABBE, - 0x0B1CF, 0x00F8E, 0x06AFF, 0x0475E, 0x00472, 0x00596, - 0x003E7, 0x0036E, 0x00196, 0x0357E, 0x03F6E, 0x0324E, - 0x0324F, 0x0163B, 0x0192F, 0x001B4, 0x0326A, 0x02C9F, - 0x0021F, 0x0F8FF, 0x064D6, 0x007BE, 0x00DDF, 0x033BC, - 0x033BD, 0x06AEE, 0x00876, 0x07C7E, 0x0B1CE, 0x00D76, - 0x00DDC, 0x001EC, 0x0649B, 0x0B1CD, 0x00F8D, 0x007D6, - 0x01AEE, 0x0163F, 0x03E3E, 0x00A6A, 0x06D7E, 0x0DDDF, - 0x00F7E, 0x00DAE, 0x0036F, 0x00338, 0x0016C, 0x033BF, - 0x036BE, 0x01FF7, 0x01937, 0x01ABA, 0x014D7, 0x0014C, - 0x01F7F, 0x0475F, 0x00040, 0x07FFC, 0x03F6F, 0x00477, - 0x00496, 0x014DE, 0x0649A, 0x064D7, 0x02C9C, 0x0B1CC, - 0x1ABBF, 0x00648, 0x006BA, 0x00364, 0x0032E, 0x00126, - 0x03D4E, 0x02C72, 0x011D6, 0x01638, 0x01934, 0x02C9D, - 0x0016E, 0x021DD, 0x03DFF, 0x001F0, 0x07FFE, 0x043BF, - 0x00D5E, 0x00FAE, 0x0092E, 0x07FFF, 0x0F8FE, 0x02D7F, - 0x043BE, 0x06D7F, 0x008E9, 0x00FFA, 0x0021C, 0x06EEE, - 0x0D5DE, 0x00F57, 0x00CFF, 0x016BA, 0x07FFD, 0x06AFE, - 0x021DE, 0x0DDDE, 0x023AE, 0x00FAF, 0x006D6, 0x0037B, - 0x003E6, 0x001B9, 0x01F1E, 0x033BE, 0x0192E, 0x016BE, - 0x01FB6, 0x01BBA, 0x0019E, 0x03776, 0x03DFE, 0x00046, - 0x00051, 0x0004F, 0x003D7, 0x0033A, 0x00376, 0x00353, - 0x00356, 0x003EA, 0x00054, 0x00339, 0x003E2, 0x0002F, - 0x0064C, 0x00534, 0x00238, 0x001A8, 0x002C6, 0x00D95, - 0x00F52, 0x002CE, 0x007DE, 0x00B2F, 0x000D8, 0x001BA, - 0x0036A, 0x0035F, 0x00127, 0x01EFE, 0x016B8, 0x008EA, - 0x00CEC, 0x007EC, 0x00A6E, 0x00114, 0x01ABE, 0x00FFE, - 0x0037A, 0x0045E, 0x00124, 0x0163E, 0x02D72, 0x00CED, - 0x00B2E, 0x00C96, 0x007A8, 0x001FE, 0x0163A, 0x01FFE, - 0x00038, 0x0057E, 0x0064E, 0x001F8, 0x001E8, 0x002BE, - 0x00DDE, 0x00F56, 0x003DA, 0x00B25, 0x008E8, 0x001F9, - 0x00115, -}; - -static const uint8_t on2avc_cb3_bits[ON2AVC_CB3_4_CODES] = { - 1, 7, 7, 6, 6, 8, - 10, 10, 8, 10, 10, 6, - 6, 7, 7, 7, 9, 9, - 9, 9, 9, 9, 6, 9, - 9, 8, 14, 12, 10, 10, - 11, 14, 12, 10, 14, 12, - 10, 10, 8, 13, 14, 10, - 10, 10, 11, 13, 11, 12, - 14, 10, 10, 7, 7, 7, - 9, 9, 9, 9, 9, 10, - 7, 9, 9, 7, 7, 7, - 10, 10, 11, 10, 10, 10, - 7, 10, 10, 6, 11, 11, - 8, 9, 10, 11, 12, 10, - 12, 12, 9, 9, 11, 10, - 9, 13, 13, 11, 12, 12, - 12, 9, 13, 13, 10, 10, - 9, 12, 13, 12, 11, 12, - 12, 9, 13, 14, 6, 11, - 11, 9, 8, 10, 12, 11, - 10, 12, 12, 9, 9, 6, - 14, 14, 11, 11, 14, 17, - 16, 12, 15, 15, 11, 11, - 10, 10, 9, 14, 14, 14, - 14, 13, 13, 9, 14, 14, - 10, 16, 15, 11, 12, 14, - 14, 15, 12, 15, 16, 12, - 12, 9, 15, 16, 12, 11, - 13, 13, 14, 12, 15, 16, - 12, 12, 10, 10, 9, 14, - 14, 13, 13, 13, 13, 9, - 13, 15, 7, 15, 14, 11, - 11, 13, 15, 15, 14, 16, - 17, 11, 11, 10, 10, 9, - 14, 14, 13, 13, 13, 14, - 9, 14, 14, 9, 15, 15, - 12, 12, 12, 15, 16, 14, - 15, 15, 12, 12, 10, 15, - 16, 12, 12, 13, 15, 15, - 14, 16, 14, 12, 11, 10, - 10, 9, 13, 14, 13, 13, - 13, 13, 9, 14, 14, 7, - 7, 7, 10, 10, 10, 10, - 10, 10, 7, 10, 10, 6, - 11, 11, 10, 9, 10, 12, - 12, 10, 11, 12, 8, 9, - 10, 10, 9, 13, 13, 12, - 12, 11, 12, 9, 13, 12, - 10, 11, 9, 13, 14, 12, - 12, 12, 11, 9, 13, 13, - 6, 11, 11, 9, 9, 10, - 12, 12, 10, 12, 12, 9, - 9, -}; - -static const uint16_t on2avc_cb3_4_syms[ON2AVC_CB3_4_CODES] = { - 0x0000, 0x0002, 0x000E, 0x0011, 0x001F, 0x0020, - 0x0022, 0x002E, 0x00E0, 0x00E2, 0x00EE, 0x00F1, - 0x00FF, 0x0101, 0x010F, 0x0110, 0x0112, 0x011E, - 0x0121, 0x012F, 0x01E1, 0x01EF, 0x01F0, 0x01F2, - 0x01FE, 0x0200, 0x0202, 0x020E, 0x0211, 0x021F, - 0x0220, 0x0222, 0x022E, 0x02E0, 0x02E2, 0x02EE, - 0x02F1, 0x02FF, 0x0E00, 0x0E02, 0x0E0E, 0x0E11, - 0x0E1F, 0x0E20, 0x0E22, 0x0E2E, 0x0EE0, 0x0EE2, - 0x0EEE, 0x0EF1, 0x0EFF, 0x0F01, 0x0F0F, 0x0F10, - 0x0F12, 0x0F1E, 0x0F21, 0x0F2F, 0x0FE1, 0x0FEF, - 0x0FF0, 0x0FF2, 0x0FFE, 0x1001, 0x100F, 0x1010, - 0x1012, 0x101E, 0x1021, 0x102F, 0x10E1, 0x10EF, - 0x10F0, 0x10F2, 0x10FE, 0x1100, 0x1102, 0x110E, - 0x1111, 0x111F, 0x1120, 0x1122, 0x112E, 0x11E0, - 0x11E2, 0x11EE, 0x11F1, 0x11FF, 0x1201, 0x120F, - 0x1210, 0x1212, 0x121E, 0x1221, 0x122F, 0x12E1, - 0x12EF, 0x12F0, 0x12F2, 0x12FE, 0x1E01, 0x1E0F, - 0x1E10, 0x1E12, 0x1E1E, 0x1E21, 0x1E2F, 0x1EE1, - 0x1EEF, 0x1EF0, 0x1EF2, 0x1EFE, 0x1F00, 0x1F02, - 0x1F0E, 0x1F11, 0x1F1F, 0x1F20, 0x1F22, 0x1F2E, - 0x1FE0, 0x1FE2, 0x1FEE, 0x1FF1, 0x1FFF, 0x2000, - 0x2002, 0x200E, 0x2011, 0x201F, 0x2020, 0x2022, - 0x202E, 0x20E0, 0x20E2, 0x20EE, 0x20F1, 0x20FF, - 0x2101, 0x210F, 0x2110, 0x2112, 0x211E, 0x2121, - 0x212F, 0x21E1, 0x21EF, 0x21F0, 0x21F2, 0x21FE, - 0x2200, 0x2202, 0x220E, 0x2211, 0x221F, 0x2220, - 0x2222, 0x222E, 0x22E0, 0x22E2, 0x22EE, 0x22F1, - 0x22FF, 0x2E00, 0x2E02, 0x2E0E, 0x2E11, 0x2E1F, - 0x2E20, 0x2E22, 0x2E2E, 0x2EE0, 0x2EE2, 0x2EEE, - 0x2EF1, 0x2EFF, 0x2F01, 0x2F0F, 0x2F10, 0x2F12, - 0x2F1E, 0x2F21, 0x2F2F, 0x2FE1, 0x2FEF, 0x2FF0, - 0x2FF2, 0x2FFE, 0xE000, 0xE002, 0xE00E, 0xE011, - 0xE01F, 0xE020, 0xE022, 0xE02E, 0xE0E0, 0xE0E2, - 0xE0EE, 0xE0F1, 0xE0FF, 0xE101, 0xE10F, 0xE110, - 0xE112, 0xE11E, 0xE121, 0xE12F, 0xE1E1, 0xE1EF, - 0xE1F0, 0xE1F2, 0xE1FE, 0xE200, 0xE202, 0xE20E, - 0xE211, 0xE21F, 0xE220, 0xE222, 0xE22E, 0xE2E0, - 0xE2E2, 0xE2EE, 0xE2F1, 0xE2FF, 0xEE00, 0xEE02, - 0xEE0E, 0xEE11, 0xEE1F, 0xEE20, 0xEE22, 0xEE2E, - 0xEEE0, 0xEEE2, 0xEEEE, 0xEEF1, 0xEEFF, 0xEF01, - 0xEF0F, 0xEF10, 0xEF12, 0xEF1E, 0xEF21, 0xEF2F, - 0xEFE1, 0xEFEF, 0xEFF0, 0xEFF2, 0xEFFE, 0xF001, - 0xF00F, 0xF010, 0xF012, 0xF01E, 0xF021, 0xF02F, - 0xF0E1, 0xF0EF, 0xF0F0, 0xF0F2, 0xF0FE, 0xF100, - 0xF102, 0xF10E, 0xF111, 0xF11F, 0xF120, 0xF122, - 0xF12E, 0xF1E0, 0xF1E2, 0xF1EE, 0xF1F1, 0xF1FF, - 0xF201, 0xF20F, 0xF210, 0xF212, 0xF21E, 0xF221, - 0xF22F, 0xF2E1, 0xF2EF, 0xF2F0, 0xF2F2, 0xF2FE, - 0xFE01, 0xFE0F, 0xFE10, 0xFE12, 0xFE1E, 0xFE21, - 0xFE2F, 0xFEE1, 0xFEEF, 0xFEF0, 0xFEF2, 0xFEFE, - 0xFF00, 0xFF02, 0xFF0E, 0xFF11, 0xFF1F, 0xFF20, - 0xFF22, 0xFF2E, 0xFFE0, 0xFFE2, 0xFFEE, 0xFFF1, - 0xFFFF, -}; - -static const uint16_t on2avc_cb4_codes[ON2AVC_CB3_4_CODES] = { - 0x000A, 0x013B, 0x0127, 0x0004, 0x0015, 0x012C, - 0x065F, 0x08CD, 0x016A, 0x08E7, 0x06BA, 0x001B, - 0x001D, 0x0018, 0x000A, 0x0002, 0x00C0, 0x012B, - 0x00CE, 0x013C, 0x012A, 0x012D, 0x0020, 0x0128, - 0x0121, 0x00FC, 0x066B, 0x0472, 0x010A, 0x004E, - 0x06AE, 0x063F, 0x1ABF, 0x0B4E, 0x084E, 0x1ABE, - 0x010E, 0x0094, 0x00C8, 0x0464, 0x069A, 0x00C9, - 0x00FA, 0x041B, 0x2FDE, 0x08CB, 0x05B7, 0x1ABD, - 0x066A, 0x008D, 0x00F8, 0x0003, 0x001A, 0x001E, - 0x0120, 0x011E, 0x0138, 0x0125, 0x0170, 0x00C4, - 0x000B, 0x013E, 0x00C5, 0x000C, 0x000E, 0x001C, - 0x00FE, 0x009C, 0x010F, 0x0115, 0x009F, 0x008C, - 0x0008, 0x002E, 0x00CF, 0x001C, 0x0110, 0x002F, - 0x002C, 0x0002, 0x0116, 0x01FE, 0x032D, 0x00CB, - 0x030D, 0x02EC, 0x002E, 0x0037, 0x00CF, 0x0086, - 0x00C8, 0x032C, 0x031E, 0x01AC, 0x030C, 0x02ED, - 0x035C, 0x013A, 0x02FF, 0x02E2, 0x00BE, 0x00CE, - 0x0126, 0x0356, 0x034E, 0x0347, 0x025F, 0x0306, - 0x02DA, 0x0168, 0x02E7, 0x020F, 0x0016, 0x0081, - 0x0114, 0x0024, 0x001B, 0x010C, 0x03FE, 0x027F, - 0x0084, 0x02F9, 0x0237, 0x0000, 0x001A, 0x011A, - 0x05A6, 0x04A6, 0x00F9, 0x00CC, 0x05B6, 0x0BF6, - 0x0B96, 0x0446, 0x08CE, 0x007F, 0x002C, 0x000E, - 0x0080, 0x00C9, 0x00BA, 0x035E, 0x03EF, 0x0345, - 0x02FE, 0x02FB, 0x02E6, 0x00D2, 0x021C, 0x0238, - 0x06BB, 0x0B97, 0x007E, 0x01AA, 0x023A, 0x05BE, - 0x031D, 0x094E, 0x1ABC, 0x0948, 0x088E, 0x02E4, - 0x0273, 0x084C, 0x08CC, 0x094B, 0x02D2, 0x023B, - 0x043E, 0x2FDF, 0x063E, 0x109B, 0x08CA, 0x08E6, - 0x02DE, 0x02F4, 0x00D4, 0x002D, 0x00CA, 0x020E, - 0x0344, 0x02FD, 0x030F, 0x02EE, 0x02D6, 0x0123, - 0x02F7, 0x03ED, 0x009E, 0x05CA, 0x060E, 0x000D, - 0x004D, 0x0444, 0x043F, 0x094A, 0x05FA, 0x109A, - 0x0B4F, 0x00FD, 0x0117, 0x0096, 0x0082, 0x0122, - 0x025D, 0x0304, 0x034C, 0x027B, 0x035B, 0x02FC, - 0x00FC, 0x035F, 0x03EE, 0x088B, 0x0C1E, 0x088A, - 0x02F5, 0x0272, 0x17EE, 0x0C1F, 0x084F, 0x088F, - 0x069B, 0x0949, 0x023F, 0x02E3, 0x07FE, 0x041A, - 0x0B7E, 0x027A, 0x0336, 0x07FF, 0x08CF, 0x094F, - 0x065E, 0x0B7F, 0x02DD, 0x0212, 0x01FB, 0x00C6, - 0x0095, 0x00D0, 0x023E, 0x025C, 0x02FC, 0x032E, - 0x025E, 0x021E, 0x00BC, 0x021D, 0x035A, 0x0007, - 0x000F, 0x0006, 0x00C2, 0x000C, 0x00BD, 0x00CD, - 0x0113, 0x0118, 0x001D, 0x00CA, 0x008E, 0x0014, - 0x010D, 0x0085, 0x0001, 0x003E, 0x008F, 0x0236, - 0x030E, 0x00FF, 0x025E, 0x0337, 0x000A, 0x0026, - 0x010B, 0x009D, 0x012E, 0x025F, 0x02EF, 0x0305, - 0x02DC, 0x027E, 0x02FE, 0x0124, 0x034F, 0x003E, - 0x004F, 0x00BC, 0x016C, 0x02D7, 0x03EC, 0x02FA, - 0x02F8, 0x02F6, 0x01FA, 0x00CC, 0x02FF, 0x0334, - 0x001E, 0x004C, 0x0112, 0x0036, 0x0022, 0x00FE, - 0x031C, 0x0346, 0x0108, 0x020C, 0x001E, 0x0012, - 0x0026, -}; - -static const uint8_t on2avc_cb4_bits[ON2AVC_CB3_4_CODES] = { - 4, 9, 9, 6, 6, 9, - 11, 12, 9, 12, 11, 6, - 5, 6, 6, 6, 8, 9, - 8, 9, 9, 9, 6, 9, - 9, 9, 11, 11, 9, 9, - 11, 11, 13, 12, 12, 13, - 9, 9, 9, 11, 11, 9, - 9, 12, 14, 12, 11, 13, - 11, 9, 9, 6, 6, 6, - 9, 9, 9, 9, 9, 8, - 6, 9, 8, 6, 6, 6, - 8, 9, 9, 9, 9, 9, - 6, 9, 8, 5, 9, 9, - 6, 7, 9, 9, 10, 9, - 10, 10, 7, 6, 9, 9, - 8, 10, 10, 9, 10, 10, - 10, 9, 11, 10, 9, 9, - 9, 10, 10, 10, 10, 10, - 10, 9, 10, 11, 6, 9, - 9, 7, 7, 9, 10, 10, - 9, 10, 10, 7, 7, 9, - 11, 11, 9, 9, 11, 12, - 12, 11, 12, 12, 9, 9, - 9, 8, 8, 10, 11, 10, - 11, 10, 10, 8, 11, 10, - 11, 12, 12, 9, 10, 11, - 10, 12, 13, 12, 12, 10, - 10, 12, 12, 12, 10, 10, - 12, 14, 11, 13, 12, 12, - 10, 10, 8, 9, 8, 11, - 10, 11, 10, 10, 10, 9, - 10, 11, 9, 11, 11, 9, - 9, 11, 12, 12, 11, 13, - 12, 9, 9, 9, 9, 9, - 11, 10, 10, 10, 10, 11, - 8, 10, 11, 12, 12, 12, - 10, 10, 13, 12, 12, 12, - 11, 12, 10, 10, 11, 12, - 12, 10, 10, 11, 12, 12, - 11, 12, 10, 10, 9, 8, - 9, 8, 10, 11, 10, 10, - 11, 11, 8, 11, 10, 6, - 6, 6, 8, 9, 9, 9, - 9, 9, 6, 9, 9, 6, - 9, 9, 7, 6, 9, 10, - 10, 9, 10, 10, 7, 7, - 9, 9, 9, 11, 10, 10, - 10, 10, 10, 9, 10, 11, - 9, 9, 9, 10, 11, 10, - 10, 10, 9, 8, 10, 10, - 5, 9, 9, 6, 7, 9, - 10, 10, 9, 11, 10, 7, - 6, -}; - -#define ON2AVC_CB5_6_CODES 1201 -static const uint32_t on2avc_cb5_codes[ON2AVC_CB5_6_CODES] = { - 0x00000, 0x000D6, 0x000E2, 0x00044, 0x0009E, 0x0009A, - 0x0003A, 0x004E6, 0x00A29, 0x007FE, 0x0024A, 0x004EE, - 0x00496, 0x001EE, 0x001C8, 0x008FA, 0x0050F, 0x001EF, - 0x00486, 0x00906, 0x00904, 0x0003E, 0x00094, 0x000A6, - 0x00046, 0x00061, 0x0012A, 0x0020D, 0x00060, 0x00066, - 0x00452, 0x00692, 0x0087E, 0x00242, 0x0050C, 0x008BE, - 0x0024C, 0x0045A, 0x0025A, 0x001C6, 0x002EE, 0x00294, - 0x006CE, 0x001EC, 0x00492, 0x00690, 0x00055, 0x00474, - 0x0063E, 0x00524, 0x04802, 0x04DC5, 0x00DEF, 0x01A62, - 0x00E6A, 0x00A7F, 0x027FB, 0x034B5, 0x036C5, 0x00A3A, - 0x036C6, 0x0219B, 0x00296, 0x0090F, 0x027FA, 0x028C8, - 0x0052A, 0x0127E, 0x0598E, 0x034B4, 0x00C78, 0x0146E, - 0x00F5F, 0x00BAA, 0x00432, 0x0FF63, 0x0598F, 0x0091C, - 0x00257, 0x0240B, 0x014E6, 0x00E6B, 0x05173, 0x01647, - 0x007F9, 0x022F3, 0x04DC6, 0x022F2, 0x0087F, 0x036C7, - 0x01AB9, 0x00C79, 0x06944, 0x043C6, 0x0043E, 0x00218, - 0x031C4, 0x014E5, 0x0093E, 0x0FF62, 0x3FAE0, 0x00328, - 0x00228, 0x01428, 0x03FEA, 0x007A3, 0x034B3, 0x0D23B, - 0x00B29, 0x01AB8, 0x028C7, 0x0598D, 0x00B28, 0x0149B, - 0x0149A, 0x008EE, 0x027F9, 0x07FC0, 0x00CFE, 0x0025E, - 0x01CBB, 0x026EF, 0x00512, 0x0297B, 0x05172, 0x00D36, - 0x00FCA, 0x01EA5, 0x00D86, 0x01FC5, 0x031C3, 0x02CD6, - 0x00276, 0x01F8A, 0x04801, 0x00B2A, 0x00329, 0x00FC9, - 0x03F0C, 0x00D35, 0x01971, 0x04DC4, 0x036C4, 0x00A4F, - 0x00FEA, 0x01FC4, 0x0122A, 0x00058, 0x001CA, 0x0013A, - 0x0005E, 0x00054, 0x0053E, 0x0039E, 0x006C6, 0x00284, - 0x001C2, 0x0087A, 0x0020E, 0x0050E, 0x006F2, 0x00288, - 0x0029E, 0x00457, 0x006F9, 0x005D3, 0x00248, 0x008F7, - 0x00068, 0x0069D, 0x00497, 0x0005F, 0x0091D, 0x00738, - 0x00057, 0x0005A, 0x00A3E, 0x009CF, 0x00D3E, 0x00D87, - 0x00C6B, 0x00CBD, 0x003F6, 0x00A74, 0x00C6E, 0x0049C, - 0x012FE, 0x0137F, 0x00DBB, 0x010DA, 0x00CAB, 0x0127F, - 0x00056, 0x00A2A, 0x0083E, 0x00040, 0x00BAE, 0x00BA2, - 0x0012E, 0x006F0, 0x0096E, 0x0022C, 0x00FDE, 0x011EB, - 0x01ABE, 0x007EA, 0x014E7, 0x011F2, 0x00256, 0x009FC, - 0x0297C, 0x01C13, 0x006F4, 0x00B26, 0x0144E, 0x021EE, - 0x001C0, 0x00707, 0x00B3F, 0x00244, 0x00E0B, 0x02CD8, - 0x034B6, 0x00B2B, 0x00914, 0x027FD, 0x028CA, 0x01396, - 0x014EB, 0x01972, 0x01B71, 0x013BE, 0x00D9A, 0x00D3F, - 0x009C9, 0x014EA, 0x031C6, 0x022F5, 0x027FC, 0x0240D, - 0x0297D, 0x006F5, 0x02CD7, 0x0396A, 0x0018C, 0x04DC7, - 0x028CB, 0x007E7, 0x0D23C, 0x043C8, 0x008FC, 0x00C7A, - 0x031C7, 0x018EB, 0x0396B, 0x0D23D, 0x036C9, 0x01973, - 0x018EA, 0x07FC1, 0x08FD8, 0x01673, 0x0067C, 0x027FE, - 0x036C8, 0x004BE, 0x08FD9, 0x07FC2, 0x009B6, 0x00148, - 0x026F0, 0x05174, 0x0071C, 0x07279, 0x08FD7, 0x005D4, - 0x00E0A, 0x01A63, 0x01F8B, 0x0114E, 0x01ABA, 0x05990, - 0x043C7, 0x01BEE, 0x3FAE1, 0x1FE94, 0x01CBE, 0x006F3, - 0x018E7, 0x0240C, 0x006FA, 0x03967, 0x08FD6, 0x0045B, - 0x00DBA, 0x01A65, 0x03969, 0x00CFF, 0x0067E, 0x026F1, - 0x028C9, 0x022F4, 0x018D2, 0x01B70, 0x011EA, 0x00BBF, - 0x00B3E, 0x0144D, 0x00D3D, 0x0146F, 0x01A64, 0x01FFF, - 0x01B6F, 0x03968, 0x024EB, 0x00656, 0x031C5, 0x0727A, - 0x0003C, 0x00D22, 0x00D99, 0x0021A, 0x00706, 0x007EE, - 0x0013E, 0x00CBC, 0x01C12, 0x01A66, 0x0022E, 0x00E77, - 0x01672, 0x004D8, 0x006D3, 0x01CBF, 0x01ABB, 0x008BF, - 0x00E76, 0x01BEF, 0x01FC6, 0x001B2, 0x00736, 0x008FB, - 0x0021D, 0x000D7, 0x04804, 0x06948, 0x00D37, 0x0396E, - 0x06949, 0x0120A, 0x03F0F, 0x1437E, 0x043CB, 0x028D0, - 0x0A2BE, 0x08FDD, 0x05996, 0x022F6, 0x1FE96, 0x0FF64, - 0x026F2, 0x028CF, 0x04DCB, 0x03F0E, 0x00A3F, 0x05178, - 0x05995, 0x00BA3, 0x00A4A, 0x07FC8, 0x0727E, 0x007AA, - 0x003D0, 0x0599A, 0x02CDB, 0x034BB, 0x07FC9, 0x0D261, - 0x04805, 0x04806, 0x0727F, 0x022F7, 0x018FE, 0x0240F, - 0x02CDA, 0x031CB, 0x04DCC, 0x034BA, 0x036CB, 0x0052B, - 0x05997, 0x036CE, 0x00907, 0x08FDF, 0x043CD, 0x00E7E, - 0x0517A, 0x04DCD, 0x0197E, 0x0A2BF, 0x028D1, 0x04807, - 0x028D2, 0x04808, 0x0D262, 0x024ED, 0x01ABF, 0x072C0, - 0x1437F, 0x034BE, 0x05179, 0x144F0, 0x072C1, 0x029C1, - 0x08FDE, 0x043CC, 0x023AE, 0x00A3B, 0x1FE97, 0x08FE1, - 0x0142A, 0x006AC, 0x04809, 0x024EE, 0x00C7B, 0x3FAE3, - 0x08FE2, 0x01F8F, 0x0A2C0, 0x023AF, 0x08FE3, 0x02416, - 0x072C2, 0x0FF65, 0x00FCB, 0x08FE0, 0x144F1, 0x01EA6, - 0x00590, 0x04DCE, 0x0396F, 0x01FC7, 0x05991, 0x3FAE2, - 0x0096C, 0x00657, 0x034B8, 0x05992, 0x0240E, 0x0A2BC, - 0x08FDA, 0x0114F, 0x0727C, 0x06945, 0x05175, 0x01B72, - 0x0727B, 0x07FC3, 0x01472, 0x0A2BB, 0x0D23E, 0x00CBE, - 0x00636, 0x034B7, 0x043C9, 0x008AA, 0x08FDB, 0x0D23F, - 0x02852, 0x0727D, 0x05994, 0x00E3E, 0x031CA, 0x06947, - 0x04DC8, 0x02CD9, 0x1FE95, 0x0D260, 0x028CD, 0x024EC, - 0x04803, 0x07FC4, 0x01976, 0x028CC, 0x05993, 0x07FC5, - 0x027FF, 0x06946, 0x03FEB, 0x03F0D, 0x0096D, 0x08FDC, - 0x04DC9, 0x0097E, 0x003D3, 0x0A2BD, 0x0286E, 0x07FC6, - 0x07FC7, 0x034B9, 0x029C0, 0x01F8E, 0x04DCA, 0x05177, - 0x01977, 0x03FEE, 0x0297E, 0x028CE, 0x036CA, 0x05176, - 0x0297F, 0x00596, 0x02853, 0x043CA, 0x0090E, 0x144FA, - 0x0D26A, 0x008AB, 0x000CE, 0x072C3, 0x034BF, 0x02417, - 0x3FAF0, 0x3FAEF, 0x026F3, 0x1FEA0, 0x3FAF1, 0x1FE9F, - 0x0D269, 0x0FF6A, 0x1FE9D, 0x029C6, 0x3FAEE, 0x1FE9E, - 0x036CF, 0x001AA, 0x0480E, 0x0A2C7, 0x000A0, 0x07FCE, - 0x3FAF4, 0x008F8, 0x3FAF5, 0x144FB, 0x00A16, 0x024EF, - 0x04DD3, 0x0694E, 0x1FEA2, 0x3FAF7, 0x3FAF6, 0x0D26B, - 0x04DD2, 0x3FAF2, 0x1FEA1, 0x08FE6, 0x0122B, 0x08FE7, - 0x0480F, 0x00C6F, 0x0FF6B, 0x3FAF3, 0x008EF, 0x00C7E, - 0x3FAF8, 0x1FEA4, 0x00DF6, 0x00362, 0x0694F, 0x0599B, - 0x0142B, 0x1FEA6, 0x1FEA5, 0x03FEF, 0x07FCF, 0x1FEA7, - 0x3FAF9, 0x029C7, 0x0D26E, 0x144FE, 0x01C3E, 0x1FEA3, - 0x0A2CA, 0x01CE6, 0x0049E, 0x043CF, 0x04EFE, 0x0036B, - 0x3FAFE, 0x11F32, 0x01EAE, 0x1FEAA, 0x0D26F, 0x049D2, - 0x02EAE, 0x0356A, 0x08FEA, 0x07ABE, 0x08FEB, 0x3FAFF, - 0x1FEAB, 0x0292E, 0x144FF, 0x3FAFA, 0x08FE8, 0x01EA7, - 0x0B27A, 0x0A2CB, 0x0164E, 0x3FAFB, 0x08FE9, 0x021EF, - 0x00A76, 0x1FE9A, 0x144F2, 0x029C3, 0x3FAE8, 0x3FAE7, - 0x014EE, 0x03F12, 0x0D264, 0x08FE4, 0x0FF67, 0x1FE9B, - 0x144F3, 0x0FF66, 0x0D263, 0x3FAE5, 0x3FAE4, 0x029C2, - 0x031FE, 0x0A2C1, 0x1FE98, 0x01FD6, 0x3FAE6, 0x1FE99, - 0x01473, 0x00D9B, 0x144F5, 0x144F4, 0x00FD2, 0x0036A, - 0x043CE, 0x03F13, 0x0517B, 0x0D267, 0x144F6, 0x01756, - 0x0A2C2, 0x144F8, 0x144F7, 0x0480A, 0x0FF68, 0x0D265, - 0x01B73, 0x0D266, 0x3FAE9, 0x01A67, 0x00493, 0x0694B, - 0x0694A, 0x00082, 0x03F7E, 0x04DCF, 0x009B7, 0x3FAEB, - 0x1FE9C, 0x0071D, 0x028D3, 0x0D268, 0x0A2C5, 0x0A2C6, - 0x3FAED, 0x3FAEC, 0x08FE5, 0x07FCA, 0x3FAEA, 0x144F9, - 0x0A2C3, 0x00D3C, 0x07FCB, 0x0480B, 0x009CA, 0x0FF69, - 0x0A2C4, 0x0091E, 0x007EB, 0x1FE85, 0x0FF56, 0x0091F, - 0x0019E, 0x0693A, 0x0593E, 0x020FC, 0x1FE86, 0x0FF57, - 0x027F4, 0x0146A, 0x04BFC, 0x0CBF9, 0x0CBF8, 0x1FE83, - 0x3F7F5, 0x08F9E, 0x3F7F6, 0x1FE84, 0x036C0, 0x00098, - 0x0593C, 0x071F9, 0x0006E, 0x0593F, 0x03963, 0x00A3C, - 0x13BFD, 0x1FE89, 0x007F2, 0x00FD3, 0x03F08, 0x03D5E, - 0x034A9, 0x13BFF, 0x13BFE, 0x071FA, 0x011E8, 0x1FE87, - 0x3F7F7, 0x0FF58, 0x01B66, 0x07FB8, 0x05168, 0x0070E, - 0x0FF59, 0x1FE88, 0x009B3, 0x00BBC, 0x1FE8B, 0x3F7F8, - 0x00FE6, 0x004FC, 0x0CBFC, 0x03FE6, 0x022F0, 0x1FE8C, - 0x0CBFD, 0x01CE7, 0x08F9F, 0x0FF5A, 0x071FD, 0x1FE8A, - 0x071FB, 0x14378, 0x01AB4, 0x0CBFB, 0x0CBFA, 0x036C1, - 0x0037E, 0x05980, 0x071FC, 0x00D5E, 0x3F7FC, 0x08FD0, - 0x014EF, 0x3F7FE, 0x3F7FD, 0x01CFE, 0x01FBE, 0x05982, - 0x1437A, 0x04BFD, 0x1FE8E, 0x3F7FF, 0x071FF, 0x0FF5B, - 0x1FE8D, 0x3F7F9, 0x14379, 0x047F7, 0x05981, 0x071FE, - 0x014E2, 0x3F7FB, 0x3F7FA, 0x02CCE, 0x0037F, 0x0A27E, - 0x3D5FA, 0x02CCC, 0x1FE80, 0x1FD7E, 0x01496, 0x018E4, - 0x3D5FB, 0x05164, 0x070FD, 0x3D5FC, 0x11F33, 0x0277E, - 0x0FF54, 0x08F98, 0x07FB6, 0x070FC, 0x026E8, 0x07FB7, - 0x034A6, 0x0356B, 0x3D5F9, 0x3D5F8, 0x034A8, 0x0114C, - 0x3F7F0, 0x3D5FF, 0x00C74, 0x0024D, 0x05167, 0x049D3, - 0x0292F, 0x08F9C, 0x3F7F1, 0x01CB6, 0x03962, 0x070FF, - 0x08F9D, 0x08F9A, 0x3D5FD, 0x0A2B0, 0x024E8, 0x070FE, - 0x3D5FE, 0x01A5E, 0x00392, 0x08F9B, 0x05166, 0x00099, - 0x06939, 0x06938, 0x009B2, 0x0C7FE, 0x3F7F4, 0x007F7, - 0x011D6, 0x02EAF, 0x028BE, 0x071F8, 0x0C7FF, 0x1FE82, - 0x047F6, 0x06936, 0x3F7F3, 0x3F7F2, 0x1FE81, 0x026EA, - 0x0C7FC, 0x0B27B, 0x009FA, 0x0C7FD, 0x13BFC, 0x007A8, - 0x000D4, 0x08FD1, 0x0D234, 0x00D34, 0x07274, 0x05988, - 0x00F5C, 0x0516D, 0x0516E, 0x0516C, 0x036C3, 0x0A2B4, - 0x0D235, 0x036C2, 0x034AC, 0x0D233, 0x07FBA, 0x034AB, - 0x0A2B3, 0x1437D, 0x1437C, 0x00B3B, 0x07273, 0x0516B, - 0x00D84, 0x009FB, 0x0693F, 0x0598A, 0x007F8, 0x005D6, - 0x047FB, 0x024EA, 0x026EC, 0x0516F, 0x047FC, 0x031A7, - 0x01397, 0x026ED, 0x02975, 0x02CD1, 0x034AD, 0x07275, - 0x027F6, 0x05989, 0x043C1, 0x0693E, 0x00454, 0x034AE, - 0x043C2, 0x007F6, 0x0A2B7, 0x07FBB, 0x02408, 0x0598B, - 0x047FD, 0x01B6A, 0x04DC1, 0x0FF5F, 0x07FBC, 0x01B6B, - 0x07277, 0x0D236, 0x020FD, 0x01B68, 0x0A2B5, 0x0FF5E, - 0x02976, 0x043C3, 0x02977, 0x0A2B6, 0x012DE, 0x07276, - 0x03FE9, 0x01B69, 0x00A4C, 0x0FF60, 0x1FE93, 0x013BC, - 0x00592, 0x02978, 0x02CD3, 0x00D8E, 0x0D237, 0x05170, - 0x01FC1, 0x028C2, 0x06941, 0x0D238, 0x07278, 0x034AF, - 0x06940, 0x00E5E, 0x08FD2, 0x07FBD, 0x020FE, 0x007E6, - 0x043C4, 0x02CD2, 0x0166E, 0x0CBFF, 0x0CBFE, 0x00A5C, - 0x005D0, 0x026EB, 0x047F8, 0x01F88, 0x1FE90, 0x1FE8F, - 0x00C68, 0x021EC, 0x0A2B1, 0x0D230, 0x04BFE, 0x0693B, - 0x028BF, 0x028C0, 0x07270, 0x0FF5C, 0x00E08, 0x00360, - 0x0436C, 0x05983, 0x009BE, 0x0FF5D, 0x1FE91, 0x01A60, - 0x04BFF, 0x0A2B2, 0x0436E, 0x03F0A, 0x07FB9, 0x05984, - 0x01FC0, 0x1FE92, 0x1437B, 0x01646, 0x03F09, 0x0693C, - 0x027F5, 0x047F9, 0x034AA, 0x0D231, 0x0436D, 0x01AB6, - 0x047FA, 0x07271, 0x00CFA, 0x006CF, 0x07272, 0x05986, - 0x00B3A, 0x00654, 0x028C1, 0x0436F, 0x02CD0, 0x03FE8, - 0x05987, 0x043C0, 0x0146B, 0x02974, 0x031A6, 0x02CCF, - 0x03964, 0x04DC0, 0x0516A, 0x05985, 0x05169, 0x02406, - 0x003D6, 0x0D232, 0x0693D, 0x0005C, 0x006F6, 0x0086E, - 0x00062, 0x0005B, 0x006F1, 0x007E0, 0x00D98, 0x00BBE, - 0x00E72, 0x00D8F, 0x004DA, 0x0137B, 0x0137A, 0x00386, - 0x00A7E, 0x00C6A, 0x00CBA, 0x00F5E, 0x00F5D, 0x013BD, - 0x00064, 0x009CE, 0x008EC, 0x0003B, 0x00F56, 0x00CAA, - 0x00246, 0x008ED, 0x0086C, 0x001ED, 0x00C77, 0x0240A, - 0x01B6D, 0x0086F, 0x02CD5, 0x01FC3, 0x0073E, 0x005D2, - 0x01970, 0x014E4, 0x00456, 0x00B22, 0x0114D, 0x02198, - 0x00138, 0x0069C, 0x00737, 0x0020C, 0x00A4E, 0x04DC2, - 0x018E6, 0x00E1E, 0x006D2, 0x047FF, 0x02979, 0x01FFE, - 0x04800, 0x021ED, 0x028C6, 0x00917, 0x01671, 0x01CFF, - 0x00CFB, 0x00FE7, 0x00A1A, 0x0146D, 0x01670, 0x01B6E, - 0x0137E, 0x006D1, 0x01FFD, 0x028C5, 0x00176, 0x05171, - 0x0219A, 0x0023C, 0x0A2BA, 0x043C5, 0x006F8, 0x006DF, - 0x01EA4, 0x01CBA, 0x027F8, 0x0FF61, 0x08FD5, 0x0177B, - 0x02199, 0x0D23A, 0x03966, 0x0297A, 0x00A38, 0x0177A, - 0x01A61, 0x00597, 0x07FBF, 0x04DC3, 0x007F4, 0x00196, - 0x034B0, 0x03F0B, 0x008F6, 0x0598C, 0x08FD3, 0x003D2, - 0x006D0, 0x01FC2, 0x031C1, 0x026EE, 0x0A2B9, 0x0D239, - 0x0175F, 0x0175E, 0x031C0, 0x06942, 0x01FF6, 0x00A3D, - 0x0166F, 0x027F7, 0x009C8, 0x0A2B8, 0x07FBE, 0x00734, - 0x00FC6, 0x03965, 0x06943, 0x010CF, 0x006DE, 0x02CD4, - 0x08FD4, 0x034B2, 0x01CB8, 0x028C3, 0x01FFC, 0x0041E, - 0x0146C, 0x01B6C, 0x00C76, 0x00B3C, 0x010CE, 0x022F1, - 0x0144C, 0x012DF, 0x01436, 0x0073A, 0x034B1, 0x031C2, - 0x00042, 0x00DEE, 0x00B3D, 0x001CC, 0x00A17, 0x007E8, - 0x0021C, 0x00A28, 0x01CB9, 0x02409, 0x00916, 0x020FF, - 0x047FE, 0x00726, 0x00238, 0x011E9, 0x01AB7, 0x0071E, - 0x00FC8, 0x028C4, 0x00D85, 0x00239, 0x008EA, 0x007A2, - 0x0012C, -}; +#define ON2AVC_CB_1_2_CODES 41 +#define ON2AVC_CB_3_4_CODES 313 +#define ON2AVC_CB_5_6_CODES 1201 +#define ON2AVC_CB_7_8_CODES 3281 +#define ON2AVC_CB_9_10_CODES 121 +#define ON2AVC_CB_11_CODES 225 +#define ON2AVC_CB_12_CODES 441 +#define ON2AVC_CB_13_CODES 625 +#define ON2AVC_CB_14_CODES 729 +#define ON2AVC_CB_15_CODES 1089 -static const uint8_t on2avc_cb5_bits[ON2AVC_CB5_6_CODES] = { - 1, 8, 8, 7, 8, 8, - 6, 11, 12, 11, 10, 11, - 11, 9, 9, 12, 11, 9, - 11, 12, 12, 6, 8, 8, - 7, 7, 9, 10, 7, 7, - 11, 11, 12, 10, 11, 12, - 10, 11, 10, 9, 10, 10, - 11, 9, 11, 11, 7, 11, - 11, 11, 15, 15, 12, 13, - 12, 12, 14, 14, 14, 12, - 14, 14, 10, 12, 14, 14, - 11, 13, 15, 14, 12, 13, - 12, 12, 11, 16, 15, 12, - 10, 14, 13, 12, 15, 13, - 11, 14, 15, 14, 12, 14, - 13, 12, 15, 15, 11, 10, - 14, 13, 12, 16, 18, 10, - 10, 13, 14, 11, 14, 16, - 12, 13, 14, 15, 12, 13, - 13, 12, 14, 15, 12, 10, - 13, 14, 11, 14, 15, 12, - 12, 13, 12, 13, 14, 14, - 10, 13, 15, 12, 10, 12, - 14, 12, 13, 15, 14, 12, - 12, 13, 13, 7, 9, 9, - 7, 7, 11, 10, 11, 10, - 9, 12, 10, 11, 11, 10, - 10, 11, 11, 11, 10, 12, - 7, 11, 11, 7, 12, 11, - 7, 7, 12, 12, 12, 12, - 12, 12, 10, 12, 12, 11, - 13, 13, 12, 13, 12, 13, - 7, 12, 12, 7, 12, 12, - 9, 11, 12, 10, 12, 13, - 13, 11, 13, 13, 10, 12, - 14, 13, 11, 12, 13, 14, - 9, 11, 12, 10, 12, 14, - 14, 12, 12, 14, 14, 13, - 13, 13, 13, 13, 12, 12, - 12, 13, 14, 14, 14, 14, - 14, 11, 14, 14, 9, 15, - 14, 11, 16, 15, 12, 12, - 14, 13, 14, 16, 14, 13, - 13, 15, 16, 13, 11, 14, - 14, 11, 16, 15, 12, 9, - 14, 15, 11, 15, 16, 11, - 12, 13, 13, 13, 13, 15, - 15, 13, 18, 17, 13, 11, - 13, 14, 11, 14, 16, 11, - 12, 13, 14, 12, 11, 14, - 14, 14, 13, 13, 13, 12, - 12, 13, 12, 13, 13, 13, - 13, 14, 14, 11, 14, 15, - 6, 12, 12, 10, 11, 11, - 9, 12, 13, 13, 10, 12, - 13, 11, 11, 13, 13, 12, - 12, 13, 13, 9, 11, 12, - 10, 8, 15, 15, 12, 14, - 15, 13, 14, 17, 15, 14, - 16, 16, 15, 14, 17, 16, - 14, 14, 15, 14, 12, 15, - 15, 12, 12, 15, 15, 11, - 10, 15, 14, 14, 15, 16, - 15, 15, 15, 14, 13, 14, - 14, 14, 15, 14, 14, 11, - 15, 14, 12, 16, 15, 12, - 15, 15, 13, 16, 14, 15, - 14, 15, 16, 14, 13, 15, - 17, 14, 15, 17, 15, 14, - 16, 15, 14, 12, 17, 16, - 13, 11, 15, 14, 12, 18, - 16, 13, 16, 14, 16, 14, - 15, 16, 12, 16, 17, 13, - 11, 15, 14, 13, 15, 18, - 12, 11, 14, 15, 14, 16, - 16, 13, 15, 15, 15, 13, - 15, 15, 13, 16, 16, 12, - 11, 14, 15, 12, 16, 16, - 14, 15, 15, 12, 14, 15, - 15, 14, 17, 16, 14, 14, - 15, 15, 13, 14, 15, 15, - 14, 15, 14, 14, 12, 16, - 15, 12, 10, 16, 14, 15, - 15, 14, 14, 13, 15, 15, - 13, 14, 14, 14, 14, 15, - 14, 11, 14, 15, 12, 17, - 16, 12, 8, 15, 14, 14, - 18, 18, 14, 17, 18, 17, - 16, 16, 17, 14, 18, 17, - 14, 9, 15, 16, 8, 15, - 18, 12, 18, 17, 12, 14, - 15, 15, 17, 18, 18, 16, - 15, 18, 17, 16, 13, 16, - 15, 12, 16, 18, 12, 12, - 18, 17, 12, 10, 15, 15, - 13, 17, 17, 14, 15, 17, - 18, 14, 16, 17, 13, 17, - 16, 13, 11, 15, 15, 10, - 18, 17, 13, 17, 16, 15, - 14, 14, 16, 15, 16, 18, - 17, 14, 17, 18, 16, 13, - 16, 16, 13, 18, 16, 14, - 12, 17, 17, 14, 18, 18, - 13, 14, 16, 16, 16, 17, - 17, 16, 16, 18, 18, 14, - 14, 16, 17, 13, 18, 17, - 13, 12, 17, 17, 12, 10, - 15, 14, 15, 16, 17, 13, - 16, 17, 17, 15, 16, 16, - 13, 16, 18, 13, 11, 15, - 15, 8, 14, 15, 12, 18, - 17, 11, 14, 16, 16, 16, - 18, 18, 16, 15, 18, 17, - 16, 12, 15, 15, 12, 16, - 16, 12, 11, 17, 16, 12, - 9, 15, 15, 14, 17, 16, - 14, 13, 15, 16, 16, 17, - 18, 16, 18, 17, 14, 8, - 15, 15, 7, 15, 14, 12, - 17, 17, 11, 12, 14, 14, - 14, 17, 17, 15, 13, 17, - 18, 16, 13, 15, 15, 11, - 16, 17, 12, 12, 17, 18, - 12, 11, 16, 14, 14, 17, - 16, 13, 16, 16, 15, 17, - 15, 17, 13, 16, 16, 14, - 10, 15, 15, 12, 18, 16, - 13, 18, 18, 13, 13, 15, - 17, 15, 17, 18, 15, 16, - 17, 18, 17, 15, 15, 15, - 13, 18, 18, 14, 10, 16, - 18, 14, 17, 17, 13, 13, - 18, 15, 15, 18, 17, 14, - 16, 16, 15, 15, 14, 15, - 14, 14, 18, 18, 14, 13, - 18, 18, 12, 10, 15, 15, - 14, 16, 18, 13, 14, 15, - 16, 16, 18, 16, 14, 15, - 18, 13, 10, 16, 15, 8, - 15, 15, 12, 16, 18, 11, - 13, 14, 14, 15, 16, 17, - 15, 15, 18, 18, 17, 14, - 16, 16, 12, 16, 17, 11, - 8, 16, 16, 12, 15, 15, - 12, 15, 15, 15, 14, 16, - 16, 14, 14, 16, 15, 14, - 16, 17, 17, 12, 15, 15, - 12, 12, 15, 15, 11, 11, - 15, 14, 14, 15, 15, 14, - 13, 14, 14, 14, 14, 15, - 14, 15, 15, 15, 11, 14, - 15, 11, 16, 15, 14, 15, - 15, 13, 15, 16, 15, 13, - 15, 16, 14, 13, 16, 16, - 14, 15, 14, 16, 13, 15, - 14, 13, 12, 16, 17, 13, - 11, 14, 14, 12, 16, 15, - 13, 14, 15, 16, 15, 14, - 15, 12, 16, 15, 14, 11, - 15, 14, 13, 16, 16, 12, - 11, 14, 15, 13, 17, 17, - 12, 14, 16, 16, 15, 15, - 14, 14, 15, 16, 12, 10, - 15, 15, 12, 16, 17, 13, - 15, 16, 15, 14, 15, 15, - 13, 17, 17, 13, 14, 15, - 14, 15, 14, 16, 15, 13, - 15, 15, 12, 11, 15, 15, - 12, 11, 14, 15, 14, 14, - 15, 15, 13, 14, 14, 14, - 14, 15, 15, 15, 15, 14, - 10, 16, 15, 7, 11, 12, - 7, 7, 11, 11, 12, 12, - 12, 12, 11, 13, 13, 10, - 12, 12, 12, 12, 12, 13, - 7, 12, 12, 6, 12, 12, - 10, 12, 12, 9, 12, 14, - 13, 12, 14, 13, 11, 11, - 13, 13, 11, 12, 13, 14, - 9, 11, 11, 10, 12, 15, - 13, 12, 11, 15, 14, 13, - 15, 14, 14, 12, 13, 13, - 12, 12, 12, 13, 13, 13, - 13, 11, 13, 14, 9, 15, - 14, 10, 16, 15, 11, 11, - 13, 13, 14, 16, 16, 13, - 14, 16, 14, 14, 12, 13, - 13, 11, 15, 15, 11, 9, - 14, 14, 12, 15, 16, 10, - 11, 13, 14, 14, 16, 16, - 13, 13, 14, 15, 13, 12, - 13, 14, 12, 16, 15, 11, - 12, 14, 15, 13, 11, 14, - 16, 14, 13, 14, 13, 11, - 13, 13, 12, 12, 13, 14, - 13, 13, 13, 11, 14, 14, - 7, 12, 12, 9, 12, 11, - 10, 12, 13, 14, 12, 14, - 15, 11, 10, 13, 13, 11, - 12, 14, 12, 10, 12, 11, - 9, +static const uint8_t on2avc_cb1_bits[ON2AVC_CB_1_2_CODES] = { + 1, 6, 6, 6, 6, 6, 8, 8, 9, 9, 9, 9, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 7, 9, 9, 9, 9, 7, 9, + 9, 9, 9, }; -static const uint16_t on2avc_cb5_6_syms[ON2AVC_CB5_6_CODES] = { - 0x0000, 0x0002, 0x000E, 0x0011, 0x0013, 0x001D, - 0x001F, 0x0020, 0x0022, 0x002E, 0x0031, 0x0033, - 0x003D, 0x003F, 0x00D1, 0x00D3, 0x00DD, 0x00DF, - 0x00E0, 0x00E2, 0x00EE, 0x00F1, 0x00F3, 0x00FD, - 0x00FF, 0x0101, 0x0103, 0x010D, 0x010F, 0x0110, - 0x0112, 0x011E, 0x0121, 0x0123, 0x012D, 0x012F, - 0x0130, 0x0132, 0x013E, 0x01D0, 0x01D2, 0x01DE, - 0x01E1, 0x01E3, 0x01ED, 0x01EF, 0x01F0, 0x01F2, - 0x01FE, 0x0200, 0x0202, 0x020E, 0x0211, 0x0213, - 0x021D, 0x021F, 0x0220, 0x0222, 0x022E, 0x0231, - 0x0233, 0x023D, 0x023F, 0x02D1, 0x02D3, 0x02DD, - 0x02DF, 0x02E0, 0x02E2, 0x02EE, 0x02F1, 0x02F3, - 0x02FD, 0x02FF, 0x0301, 0x0303, 0x030D, 0x030F, - 0x0310, 0x0312, 0x031E, 0x0321, 0x0323, 0x032D, - 0x032F, 0x0330, 0x0332, 0x033E, 0x03D0, 0x03D2, - 0x03DE, 0x03E1, 0x03E3, 0x03ED, 0x03EF, 0x03F0, - 0x03F2, 0x03FE, 0x0D01, 0x0D03, 0x0D0D, 0x0D0F, - 0x0D10, 0x0D12, 0x0D1E, 0x0D21, 0x0D23, 0x0D2D, - 0x0D2F, 0x0D30, 0x0D32, 0x0D3E, 0x0DD0, 0x0DD2, - 0x0DDE, 0x0DE1, 0x0DE3, 0x0DED, 0x0DEF, 0x0DF0, - 0x0DF2, 0x0DFE, 0x0E00, 0x0E02, 0x0E0E, 0x0E11, - 0x0E13, 0x0E1D, 0x0E1F, 0x0E20, 0x0E22, 0x0E2E, - 0x0E31, 0x0E33, 0x0E3D, 0x0E3F, 0x0ED1, 0x0ED3, - 0x0EDD, 0x0EDF, 0x0EE0, 0x0EE2, 0x0EEE, 0x0EF1, - 0x0EF3, 0x0EFD, 0x0EFF, 0x0F01, 0x0F03, 0x0F0D, - 0x0F0F, 0x0F10, 0x0F12, 0x0F1E, 0x0F21, 0x0F23, - 0x0F2D, 0x0F2F, 0x0F30, 0x0F32, 0x0F3E, 0x0FD0, - 0x0FD2, 0x0FDE, 0x0FE1, 0x0FE3, 0x0FED, 0x0FEF, - 0x0FF0, 0x0FF2, 0x0FFE, 0x1001, 0x1003, 0x100D, - 0x100F, 0x1010, 0x1012, 0x101E, 0x1021, 0x1023, - 0x102D, 0x102F, 0x1030, 0x1032, 0x103E, 0x10D0, - 0x10D2, 0x10DE, 0x10E1, 0x10E3, 0x10ED, 0x10EF, - 0x10F0, 0x10F2, 0x10FE, 0x1100, 0x1102, 0x110E, - 0x1111, 0x1113, 0x111D, 0x111F, 0x1120, 0x1122, - 0x112E, 0x1131, 0x1133, 0x113D, 0x113F, 0x11D1, - 0x11D3, 0x11DD, 0x11DF, 0x11E0, 0x11E2, 0x11EE, - 0x11F1, 0x11F3, 0x11FD, 0x11FF, 0x1201, 0x1203, - 0x120D, 0x120F, 0x1210, 0x1212, 0x121E, 0x1221, - 0x1223, 0x122D, 0x122F, 0x1230, 0x1232, 0x123E, - 0x12D0, 0x12D2, 0x12DE, 0x12E1, 0x12E3, 0x12ED, - 0x12EF, 0x12F0, 0x12F2, 0x12FE, 0x1300, 0x1302, - 0x130E, 0x1311, 0x1313, 0x131D, 0x131F, 0x1320, - 0x1322, 0x132E, 0x1331, 0x1333, 0x133D, 0x133F, - 0x13D1, 0x13D3, 0x13DD, 0x13DF, 0x13E0, 0x13E2, - 0x13EE, 0x13F1, 0x13F3, 0x13FD, 0x13FF, 0x1D00, - 0x1D02, 0x1D0E, 0x1D11, 0x1D13, 0x1D1D, 0x1D1F, - 0x1D20, 0x1D22, 0x1D2E, 0x1D31, 0x1D33, 0x1D3D, - 0x1D3F, 0x1DD1, 0x1DD3, 0x1DDD, 0x1DDF, 0x1DE0, - 0x1DE2, 0x1DEE, 0x1DF1, 0x1DF3, 0x1DFD, 0x1DFF, - 0x1E01, 0x1E03, 0x1E0D, 0x1E0F, 0x1E10, 0x1E12, - 0x1E1E, 0x1E21, 0x1E23, 0x1E2D, 0x1E2F, 0x1E30, - 0x1E32, 0x1E3E, 0x1ED0, 0x1ED2, 0x1EDE, 0x1EE1, - 0x1EE3, 0x1EED, 0x1EEF, 0x1EF0, 0x1EF2, 0x1EFE, - 0x1F00, 0x1F02, 0x1F0E, 0x1F11, 0x1F13, 0x1F1D, - 0x1F1F, 0x1F20, 0x1F22, 0x1F2E, 0x1F31, 0x1F33, - 0x1F3D, 0x1F3F, 0x1FD1, 0x1FD3, 0x1FDD, 0x1FDF, - 0x1FE0, 0x1FE2, 0x1FEE, 0x1FF1, 0x1FF3, 0x1FFD, - 0x1FFF, 0x2000, 0x2002, 0x200E, 0x2011, 0x2013, - 0x201D, 0x201F, 0x2020, 0x2022, 0x202E, 0x2031, - 0x2033, 0x203D, 0x203F, 0x20D1, 0x20D3, 0x20DD, - 0x20DF, 0x20E0, 0x20E2, 0x20EE, 0x20F1, 0x20F3, - 0x20FD, 0x20FF, 0x2101, 0x2103, 0x210D, 0x210F, - 0x2110, 0x2112, 0x211E, 0x2121, 0x2123, 0x212D, - 0x212F, 0x2130, 0x2132, 0x213E, 0x21D0, 0x21D2, - 0x21DE, 0x21E1, 0x21E3, 0x21ED, 0x21EF, 0x21F0, - 0x21F2, 0x21FE, 0x2200, 0x2202, 0x220E, 0x2211, - 0x2213, 0x221D, 0x221F, 0x2220, 0x2222, 0x222E, - 0x2231, 0x2233, 0x223D, 0x223F, 0x22D1, 0x22D3, - 0x22DD, 0x22DF, 0x22E0, 0x22E2, 0x22EE, 0x22F1, - 0x22F3, 0x22FD, 0x22FF, 0x2301, 0x2303, 0x230D, - 0x230F, 0x2310, 0x2312, 0x231E, 0x2321, 0x2323, - 0x232D, 0x232F, 0x2330, 0x2332, 0x233E, 0x23D0, - 0x23D2, 0x23DE, 0x23E1, 0x23E3, 0x23ED, 0x23EF, - 0x23F0, 0x23F2, 0x23FE, 0x2D01, 0x2D03, 0x2D0D, - 0x2D0F, 0x2D10, 0x2D12, 0x2D1E, 0x2D21, 0x2D23, - 0x2D2D, 0x2D2F, 0x2D30, 0x2D32, 0x2D3E, 0x2DD0, - 0x2DD2, 0x2DDE, 0x2DE1, 0x2DE3, 0x2DED, 0x2DEF, - 0x2DF0, 0x2DF2, 0x2DFE, 0x2E00, 0x2E02, 0x2E0E, - 0x2E11, 0x2E13, 0x2E1D, 0x2E1F, 0x2E20, 0x2E22, - 0x2E2E, 0x2E31, 0x2E33, 0x2E3D, 0x2E3F, 0x2ED1, - 0x2ED3, 0x2EDD, 0x2EDF, 0x2EE0, 0x2EE2, 0x2EEE, - 0x2EF1, 0x2EF3, 0x2EFD, 0x2EFF, 0x2F01, 0x2F03, - 0x2F0D, 0x2F0F, 0x2F10, 0x2F12, 0x2F1E, 0x2F21, - 0x2F23, 0x2F2D, 0x2F2F, 0x2F30, 0x2F32, 0x2F3E, - 0x2FD0, 0x2FD2, 0x2FDE, 0x2FE1, 0x2FE3, 0x2FED, - 0x2FEF, 0x2FF0, 0x2FF2, 0x2FFE, 0x3001, 0x3003, - 0x300D, 0x300F, 0x3010, 0x3012, 0x301E, 0x3021, - 0x3023, 0x302D, 0x302F, 0x3030, 0x3032, 0x303E, - 0x30D0, 0x30D2, 0x30DE, 0x30E1, 0x30E3, 0x30ED, - 0x30EF, 0x30F0, 0x30F2, 0x30FE, 0x3100, 0x3102, - 0x310E, 0x3111, 0x3113, 0x311D, 0x311F, 0x3120, - 0x3122, 0x312E, 0x3131, 0x3133, 0x313D, 0x313F, - 0x31D1, 0x31D3, 0x31DD, 0x31DF, 0x31E0, 0x31E2, - 0x31EE, 0x31F1, 0x31F3, 0x31FD, 0x31FF, 0x3201, - 0x3203, 0x320D, 0x320F, 0x3210, 0x3212, 0x321E, - 0x3221, 0x3223, 0x322D, 0x322F, 0x3230, 0x3232, - 0x323E, 0x32D0, 0x32D2, 0x32DE, 0x32E1, 0x32E3, - 0x32ED, 0x32EF, 0x32F0, 0x32F2, 0x32FE, 0x3300, - 0x3302, 0x330E, 0x3311, 0x3313, 0x331D, 0x331F, - 0x3320, 0x3322, 0x332E, 0x3331, 0x3333, 0x333D, - 0x333F, 0x33D1, 0x33D3, 0x33DD, 0x33DF, 0x33E0, - 0x33E2, 0x33EE, 0x33F1, 0x33F3, 0x33FD, 0x33FF, - 0x3D00, 0x3D02, 0x3D0E, 0x3D11, 0x3D13, 0x3D1D, - 0x3D1F, 0x3D20, 0x3D22, 0x3D2E, 0x3D31, 0x3D33, - 0x3D3D, 0x3D3F, 0x3DD1, 0x3DD3, 0x3DDD, 0x3DDF, - 0x3DE0, 0x3DE2, 0x3DEE, 0x3DF1, 0x3DF3, 0x3DFD, - 0x3DFF, 0x3E01, 0x3E03, 0x3E0D, 0x3E0F, 0x3E10, - 0x3E12, 0x3E1E, 0x3E21, 0x3E23, 0x3E2D, 0x3E2F, - 0x3E30, 0x3E32, 0x3E3E, 0x3ED0, 0x3ED2, 0x3EDE, - 0x3EE1, 0x3EE3, 0x3EED, 0x3EEF, 0x3EF0, 0x3EF2, - 0x3EFE, 0x3F00, 0x3F02, 0x3F0E, 0x3F11, 0x3F13, - 0x3F1D, 0x3F1F, 0x3F20, 0x3F22, 0x3F2E, 0x3F31, - 0x3F33, 0x3F3D, 0x3F3F, 0x3FD1, 0x3FD3, 0x3FDD, - 0x3FDF, 0x3FE0, 0x3FE2, 0x3FEE, 0x3FF1, 0x3FF3, - 0x3FFD, 0x3FFF, 0xD001, 0xD003, 0xD00D, 0xD00F, - 0xD010, 0xD012, 0xD01E, 0xD021, 0xD023, 0xD02D, - 0xD02F, 0xD030, 0xD032, 0xD03E, 0xD0D0, 0xD0D2, - 0xD0DE, 0xD0E1, 0xD0E3, 0xD0ED, 0xD0EF, 0xD0F0, - 0xD0F2, 0xD0FE, 0xD100, 0xD102, 0xD10E, 0xD111, - 0xD113, 0xD11D, 0xD11F, 0xD120, 0xD122, 0xD12E, - 0xD131, 0xD133, 0xD13D, 0xD13F, 0xD1D1, 0xD1D3, - 0xD1DD, 0xD1DF, 0xD1E0, 0xD1E2, 0xD1EE, 0xD1F1, - 0xD1F3, 0xD1FD, 0xD1FF, 0xD201, 0xD203, 0xD20D, - 0xD20F, 0xD210, 0xD212, 0xD21E, 0xD221, 0xD223, - 0xD22D, 0xD22F, 0xD230, 0xD232, 0xD23E, 0xD2D0, - 0xD2D2, 0xD2DE, 0xD2E1, 0xD2E3, 0xD2ED, 0xD2EF, - 0xD2F0, 0xD2F2, 0xD2FE, 0xD300, 0xD302, 0xD30E, - 0xD311, 0xD313, 0xD31D, 0xD31F, 0xD320, 0xD322, - 0xD32E, 0xD331, 0xD333, 0xD33D, 0xD33F, 0xD3D1, - 0xD3D3, 0xD3DD, 0xD3DF, 0xD3E0, 0xD3E2, 0xD3EE, - 0xD3F1, 0xD3F3, 0xD3FD, 0xD3FF, 0xDD00, 0xDD02, - 0xDD0E, 0xDD11, 0xDD13, 0xDD1D, 0xDD1F, 0xDD20, - 0xDD22, 0xDD2E, 0xDD31, 0xDD33, 0xDD3D, 0xDD3F, - 0xDDD1, 0xDDD3, 0xDDDD, 0xDDDF, 0xDDE0, 0xDDE2, - 0xDDEE, 0xDDF1, 0xDDF3, 0xDDFD, 0xDDFF, 0xDE01, - 0xDE03, 0xDE0D, 0xDE0F, 0xDE10, 0xDE12, 0xDE1E, - 0xDE21, 0xDE23, 0xDE2D, 0xDE2F, 0xDE30, 0xDE32, - 0xDE3E, 0xDED0, 0xDED2, 0xDEDE, 0xDEE1, 0xDEE3, - 0xDEED, 0xDEEF, 0xDEF0, 0xDEF2, 0xDEFE, 0xDF00, - 0xDF02, 0xDF0E, 0xDF11, 0xDF13, 0xDF1D, 0xDF1F, - 0xDF20, 0xDF22, 0xDF2E, 0xDF31, 0xDF33, 0xDF3D, - 0xDF3F, 0xDFD1, 0xDFD3, 0xDFDD, 0xDFDF, 0xDFE0, - 0xDFE2, 0xDFEE, 0xDFF1, 0xDFF3, 0xDFFD, 0xDFFF, - 0xE000, 0xE002, 0xE00E, 0xE011, 0xE013, 0xE01D, - 0xE01F, 0xE020, 0xE022, 0xE02E, 0xE031, 0xE033, - 0xE03D, 0xE03F, 0xE0D1, 0xE0D3, 0xE0DD, 0xE0DF, - 0xE0E0, 0xE0E2, 0xE0EE, 0xE0F1, 0xE0F3, 0xE0FD, - 0xE0FF, 0xE101, 0xE103, 0xE10D, 0xE10F, 0xE110, - 0xE112, 0xE11E, 0xE121, 0xE123, 0xE12D, 0xE12F, - 0xE130, 0xE132, 0xE13E, 0xE1D0, 0xE1D2, 0xE1DE, - 0xE1E1, 0xE1E3, 0xE1ED, 0xE1EF, 0xE1F0, 0xE1F2, - 0xE1FE, 0xE200, 0xE202, 0xE20E, 0xE211, 0xE213, - 0xE21D, 0xE21F, 0xE220, 0xE222, 0xE22E, 0xE231, - 0xE233, 0xE23D, 0xE23F, 0xE2D1, 0xE2D3, 0xE2DD, - 0xE2DF, 0xE2E0, 0xE2E2, 0xE2EE, 0xE2F1, 0xE2F3, - 0xE2FD, 0xE2FF, 0xE301, 0xE303, 0xE30D, 0xE30F, - 0xE310, 0xE312, 0xE31E, 0xE321, 0xE323, 0xE32D, - 0xE32F, 0xE330, 0xE332, 0xE33E, 0xE3D0, 0xE3D2, - 0xE3DE, 0xE3E1, 0xE3E3, 0xE3ED, 0xE3EF, 0xE3F0, - 0xE3F2, 0xE3FE, 0xED01, 0xED03, 0xED0D, 0xED0F, - 0xED10, 0xED12, 0xED1E, 0xED21, 0xED23, 0xED2D, - 0xED2F, 0xED30, 0xED32, 0xED3E, 0xEDD0, 0xEDD2, - 0xEDDE, 0xEDE1, 0xEDE3, 0xEDED, 0xEDEF, 0xEDF0, - 0xEDF2, 0xEDFE, 0xEE00, 0xEE02, 0xEE0E, 0xEE11, - 0xEE13, 0xEE1D, 0xEE1F, 0xEE20, 0xEE22, 0xEE2E, - 0xEE31, 0xEE33, 0xEE3D, 0xEE3F, 0xEED1, 0xEED3, - 0xEEDD, 0xEEDF, 0xEEE0, 0xEEE2, 0xEEEE, 0xEEF1, - 0xEEF3, 0xEEFD, 0xEEFF, 0xEF01, 0xEF03, 0xEF0D, - 0xEF0F, 0xEF10, 0xEF12, 0xEF1E, 0xEF21, 0xEF23, - 0xEF2D, 0xEF2F, 0xEF30, 0xEF32, 0xEF3E, 0xEFD0, - 0xEFD2, 0xEFDE, 0xEFE1, 0xEFE3, 0xEFED, 0xEFEF, - 0xEFF0, 0xEFF2, 0xEFFE, 0xF001, 0xF003, 0xF00D, - 0xF00F, 0xF010, 0xF012, 0xF01E, 0xF021, 0xF023, - 0xF02D, 0xF02F, 0xF030, 0xF032, 0xF03E, 0xF0D0, - 0xF0D2, 0xF0DE, 0xF0E1, 0xF0E3, 0xF0ED, 0xF0EF, - 0xF0F0, 0xF0F2, 0xF0FE, 0xF100, 0xF102, 0xF10E, - 0xF111, 0xF113, 0xF11D, 0xF11F, 0xF120, 0xF122, - 0xF12E, 0xF131, 0xF133, 0xF13D, 0xF13F, 0xF1D1, - 0xF1D3, 0xF1DD, 0xF1DF, 0xF1E0, 0xF1E2, 0xF1EE, - 0xF1F1, 0xF1F3, 0xF1FD, 0xF1FF, 0xF201, 0xF203, - 0xF20D, 0xF20F, 0xF210, 0xF212, 0xF21E, 0xF221, - 0xF223, 0xF22D, 0xF22F, 0xF230, 0xF232, 0xF23E, - 0xF2D0, 0xF2D2, 0xF2DE, 0xF2E1, 0xF2E3, 0xF2ED, - 0xF2EF, 0xF2F0, 0xF2F2, 0xF2FE, 0xF300, 0xF302, - 0xF30E, 0xF311, 0xF313, 0xF31D, 0xF31F, 0xF320, - 0xF322, 0xF32E, 0xF331, 0xF333, 0xF33D, 0xF33F, - 0xF3D1, 0xF3D3, 0xF3DD, 0xF3DF, 0xF3E0, 0xF3E2, - 0xF3EE, 0xF3F1, 0xF3F3, 0xF3FD, 0xF3FF, 0xFD00, - 0xFD02, 0xFD0E, 0xFD11, 0xFD13, 0xFD1D, 0xFD1F, - 0xFD20, 0xFD22, 0xFD2E, 0xFD31, 0xFD33, 0xFD3D, - 0xFD3F, 0xFDD1, 0xFDD3, 0xFDDD, 0xFDDF, 0xFDE0, - 0xFDE2, 0xFDEE, 0xFDF1, 0xFDF3, 0xFDFD, 0xFDFF, - 0xFE01, 0xFE03, 0xFE0D, 0xFE0F, 0xFE10, 0xFE12, - 0xFE1E, 0xFE21, 0xFE23, 0xFE2D, 0xFE2F, 0xFE30, - 0xFE32, 0xFE3E, 0xFED0, 0xFED2, 0xFEDE, 0xFEE1, - 0xFEE3, 0xFEED, 0xFEEF, 0xFEF0, 0xFEF2, 0xFEFE, - 0xFF00, 0xFF02, 0xFF0E, 0xFF11, 0xFF13, 0xFF1D, - 0xFF1F, 0xFF20, 0xFF22, 0xFF2E, 0xFF31, 0xFF33, - 0xFF3D, 0xFF3F, 0xFFD1, 0xFFD3, 0xFFDD, 0xFFDF, - 0xFFE0, 0xFFE2, 0xFFEE, 0xFFF1, 0xFFF3, 0xFFFD, - 0xFFFF, +static const uint8_t on2avc_cb2_bits[ON2AVC_CB_1_2_CODES] = { + 5, 7, 7, 7, 7, 5, 5, 5, 7, 7, 7, 7, 5, 5, 5, 5, 5, 7, 7, + 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 3, 5, + 5, 5, 5, }; -static const uint32_t on2avc_cb6_codes[ON2AVC_CB5_6_CODES] = { - 0x0018, 0x0088, 0x0082, 0x0024, 0x05B4, 0x08DF, - 0x0044, 0x0197, 0x01DE, 0x021F, 0x0D77, 0x0A72, - 0x7E77, 0x0B8B, 0x03F1, 0x0433, 0x073F, 0x1E5C, - 0x016A, 0x01C5, 0x00D2, 0x0062, 0x0CE4, 0x0096, - 0x0020, 0x0052, 0x00B7, 0x0127, 0x003A, 0x0041, - 0x00CC, 0x01B6, 0x0124, 0x07D3, 0x01AE, 0x01C4, - 0x00DA, 0x03D8, 0x03F3, 0x1638, 0x03F2, 0x12FC, - 0x01E2, 0x0DBC, 0x026C, 0x008A, 0x0054, 0x01A6, - 0x0195, 0x0164, 0x01E2, 0x026D, 0x0051, 0x049F, - 0x01B3, 0x01E0, 0x01B4, 0x026E, 0x07DE, 0x0129, - 0x0292, 0x0DBD, 0x013E, 0x00F3, 0x05B5, 0x09A6, - 0x01FB, 0x02CF, 0x01FF, 0x037C, 0x004A, 0x067E, - 0x016B, 0x002A, 0x09A7, 0x10EE, 0x1639, 0x0135, - 0x0CCA, 0x016A, 0x011B, 0x03EE, 0x07A2, 0x0D7E, - 0x028F, 0x0FE2, 0x07DA, 0x0357, 0x92F6, 0x0F31, - 0x0217, 0x036A, 0x0CE5, 0x07A1, 0x0229, 0x03D9, - 0x0377, 0x00B7, 0x01A6, 0x0655, 0x012E, 0x002B, - 0x002E, 0x00F2, 0x06F2, 0x02D0, 0x0F98, 0x07A0, - 0x009C, 0x0332, 0x0014, 0x01BD, 0x017E, 0x0331, - 0x0371, 0x025B, 0x0498, 0x161F, 0x039E, 0x0654, - 0x00C2, 0x06BA, 0x0140, 0x021E, 0x02F8, 0x01B4, - 0x0134, 0x03FF, 0x0066, 0x0477, 0x01DF, 0x01FE, - 0x0A14, 0x029E, 0x0356, 0x038F, 0x035A, 0x3CB3, - 0x01B2, 0x016A, 0x011A, 0x00B6, 0x02DE, 0x01DD, - 0x017C, 0x0376, 0x002F, 0x0039, 0x03D7, 0x01BE, - 0x0056, 0x0050, 0x017C, 0x01CC, 0x0034, 0x0B3E, - 0x0499, 0x0014, 0x08DE, 0x037B, 0x03EB, 0x08BF, - 0x186E, 0x050F, 0x0030, 0x0169, 0x07F2, 0x00F6, - 0x0042, 0x0198, 0x00BC, 0x002E, 0x023A, 0x01E3, - 0x0036, 0x004C, 0x012E, 0x01A1, 0x007D, 0x00C3, - 0x0392, 0x0063, 0x0F33, 0x016C, 0x01A7, 0x0E77, - 0x01DF, 0x0177, 0x0032, 0x03FE, 0x0322, 0x01AC, - 0x0030, 0x017E, 0x011E, 0x0022, 0x01FB, 0x012A, - 0x002B, 0x0068, 0x00D4, 0x006E, 0x0015, 0x001C, - 0x00E5, 0x01A9, 0x0436, 0x053F, 0x05AE, 0x00B2, - 0x072A, 0x02EA, 0x008E, 0x0175, 0x02BE, 0x018E, - 0x0002, 0x005E, 0x01D6, 0x0055, 0x006A, 0x07F3, - 0x02F9, 0x01D4, 0x016E, 0x03AB, 0x00FF, 0x003C, - 0x0192, 0x01D6, 0x0256, 0x0137, 0x0148, 0x022A, - 0x039C, 0x016D, 0x0116, 0x038A, 0x033E, 0x0156, - 0x03CF, 0x004B, 0x00E6, 0x018F, 0x1E5D, 0x03DA, - 0x0292, 0x0108, 0x06F5, 0x03DB, 0x0092, 0x0178, - 0x014A, 0x03FF, 0x03EE, 0x0A79, 0x0A16, 0x00F7, - 0x01B5, 0x0A15, 0x0D7F, 0x02FA, 0x01E4, 0x0157, - 0x01E2, 0x0185, 0x057E, 0x07DB, 0x0098, 0x0DBE, - 0x019A, 0x05FE, 0x003B, 0x03F5, 0x01BF, 0x01E4, - 0x011E, 0x001B, 0x03AA, 0x0337, 0x1F9C, 0x0942, - 0x05AB, 0x0430, 0x24BF, 0x163A, 0x037E, 0x014E, - 0x00F4, 0x0217, 0x0059, 0x0F32, 0x03F4, 0x01F2, - 0x0031, 0x0136, 0x05C6, 0x0076, 0x0006, 0x02FE, - 0x03FB, 0x009D, 0x013F, 0x002E, 0x02E6, 0x00AD, - 0x0234, 0x021E, 0x0253, 0x012A, 0x0346, 0x029A, - 0x012B, 0x021C, 0x02DA, 0x0004, 0x013C, 0x00F5, - 0x004E, 0x017D, 0x01F8, 0x0006, 0x01FA, 0x01F9, - 0x007A, 0x0067, 0x033B, 0x033A, 0x0586, 0x05C7, - 0x05FF, 0x00C8, 0x014B, 0x024F, 0x02C5, 0x00E7, - 0x014C, 0x035C, 0x00A2, 0x006A, 0x01F3, 0x0071, - 0x005E, 0x0084, 0x063A, 0x03EF, 0x0064, 0x02FE, - 0x0255, 0x003A, 0x061A, 0x0333, 0x037F, 0x00FE, - 0x115B, 0x0F9A, 0x00A6, 0x027D, 0x0B5F, 0x013F, - 0x029E, 0x0293, 0x07B6, 0x000F, 0x0196, 0x02FB, - 0x033F, 0x01FE, 0x019E, 0x01B3, 0x037F, 0x00C4, - 0x00DE, 0x02D2, 0x007A, 0x03CA, 0x01E3, 0x02F7, - 0x00AE, 0x05AF, 0x02FF, 0x026F, 0x00CA, 0x0356, - 0x02C7, 0x02D1, 0x0256, 0x006B, 0x0141, 0x012C, - 0x03BE, 0x0026, 0x00F0, 0x03A3, 0x02D6, 0x005F, - 0x00FF, 0x03F2, 0x00AE, 0x0257, 0x01FE, 0x035E, - 0x01B6, 0x00EE, 0x0658, 0x008F, 0x0232, 0x0657, - 0x12FD, 0x00AF, 0x00E6, 0x0426, 0x0666, 0x009E, - 0x0467, 0x003F, 0x014A, 0x02D3, 0x12FE, 0x099A, - 0x03BF, 0x00DD, 0x04DF, 0x009F, 0x00B8, 0x0863, - 0x06F7, 0x01B8, 0x0346, 0x0179, 0x0FE3, 0x0667, - 0x0659, 0x01CE, 0x00B3, 0x0372, 0x065A, 0x025E, - 0x01AA, 0x0276, 0x027E, 0x02DB, 0x0CE6, 0x115A, - 0x02E7, 0x0139, 0x03DA, 0x01FA, 0x021C, 0x0943, - 0x0862, 0x011F, 0x08B6, 0x07E6, 0x029F, 0x00E5, - 0x0656, 0x049A, 0x000E, 0x0F99, 0x06F6, 0x00DC, - 0x00EC, 0x014B, 0x0230, 0x04A2, 0x0016, 0x02EB, - 0x03AE, 0x02DF, 0x01AA, 0x033E, 0x0196, 0x092E, - 0x06F3, 0x00E7, 0x0B5E, 0x03F2, 0x0086, 0x0347, - 0x022A, 0x0A17, 0x01EF, 0x067F, 0x004A, 0x037E, - 0x02EE, 0x015E, 0x0696, 0x006A, 0x01CD, 0x0077, - 0x073F, 0x0016, 0x01E3, 0x012E, 0x00DB, 0x03BD, - 0x0496, 0x01C6, 0x0323, 0x005E, 0x02F6, 0x027C, - 0x0235, 0x0231, 0x00DA, 0x01EB, 0x0232, 0x02C6, - 0x01F2, 0x016F, 0x02C6, 0x036B, 0x0050, 0x0AFE, - 0x0F9B, 0x00C6, 0x014E, 0x02BC, 0x01CA, 0x027F, - 0x07A5, 0x0DE1, 0x01F1, 0x039E, 0x0DE2, 0x1E5E, - 0x065E, 0x0DE0, 0x115F, 0x00F7, 0x02AB, 0x116E, - 0x019B, 0x04CE, 0x00D3, 0x01C7, 0x02D6, 0x01F3, - 0x016F, 0x014E, 0x05B7, 0x0FA3, 0x0118, 0x025F, - 0x017E, 0x0437, 0x049B, 0x05AE, 0x497A, 0x0D2E, - 0x05B6, 0x1E5F, 0x0DE3, 0x0512, 0x031A, 0x01F2, - 0x007E, 0x015C, 0x035E, 0x04CF, 0x01C8, 0x0194, - 0x12FF, 0x1F7F, 0x00E0, 0x01A2, 0x012F, 0x0087, - 0x014C, 0x0643, 0x0D5E, 0x017F, 0x07A6, 0x0513, - 0x0D5F, 0x022B, 0x065F, 0x03F6, 0x022E, 0x03F7, - 0x0642, 0x036E, 0x00D0, 0x01CB, 0x0378, 0x125EE, - 0x035F, 0x014F, 0x035F, 0x116F, 0x0A4F, 0x0102, - 0x032A, 0x0173, 0x0536, 0x03A7, 0x075E, 0x1F9F, - 0x163B, 0x14DA, 0x526E, 0x165F, 0x0A6E, 0x0596, - 0x07A7, 0x042A, 0x0172, 0x19C2, 0x07E6, 0x04A3, - 0x0327, 0x02A8, 0x07A3, 0x046E, 0x012F, 0x2EFF, - 0x01D7, 0x0266, 0x0BBE, 0x066E, 0x186F, 0x0A73, - 0x1336, 0x02A9, 0x0373, 0x017F, 0x1F9E, 0x0B62, - 0x03A6, 0x0DBF, 0x035B, 0x063B, 0x053B, 0x10EF, - 0x016E, 0x011B, 0x115D, 0x115C, 0x00F2, 0x0176, - 0x0393, 0x034A, 0x0107, 0x115E, 0x0B63, 0x023F, - 0x002A, 0x0CE7, 0x0A7A, 0x06FA, 0x06FB, 0x02AA, - 0x02C2, 0x065B, 0x07A4, 0x02D4, 0x0130, 0x0106, - 0x01FB, 0x0B3F, 0x01B7, 0x00F6, 0x0056, 0x053F, - 0x0126, 0x0048, 0x0233, 0x017D, 0x00A4, 0x08BE, - 0x165E, 0x165D, 0x0A7B, 0x0427, 0x078F, 0x1F7E, - 0x0641, 0x02E4, 0x01E6, 0x01DA, 0x00F8, 0x043A, - 0x02BE, 0x011C, 0x006F, 0x036D, 0x19C3, 0x0020, - 0x06AE, 0x0372, 0x0288, 0x00C0, 0x079D, 0x036E, - 0x0117, 0x02FB, 0x0538, 0x06F2, 0x12F9, 0x1337, - 0x1E58, 0x0214, 0x005E, 0x0CE0, 0x01EE, 0x0A6E, - 0x0215, 0x01C2, 0x12FA, 0x033A, 0x009A, 0x0174, - 0x0CE2, 0x09A1, 0x00FE, 0x0250, 0x02CA, 0x035E, - 0x03A2, 0x0D7D, 0x2EFE, 0x02E8, 0x24BE, 0x1F7C, - 0x10EC, 0x04A2, 0x0052, 0x010D, 0x0277, 0x003A, - 0x0CDE, 0x0A6F, 0x0086, 0x00E4, 0x12FB, 0x14DE, - 0x009E, 0x0062, 0x03CA, 0x03BC, 0x02CA, 0x14DF, - 0x0FE0, 0x030C, 0x03F0, 0x06F3, 0x0796, 0x0B1E, - 0x05B0, 0x15FE, 0x013A, 0x0CDF, 0x079E, 0x01E2, - 0x0166, 0x02BD, 0x0151, 0x0153, 0x0650, 0x0940, - 0x010F, 0x3CB2, 0x10ED, 0x057E, 0x03D4, 0x029E, - 0x0358, 0x06F4, 0x7E76, 0x017C, 0x15FF, 0x047D, - 0x1158, 0x3F3A, 0x0CE3, 0x005F, 0x043A, 0x032F, - 0x010E, 0x1E5A, 0x0A4C, 0x0152, 0x125EF, 0x0B88, - 0x057F, 0x059E, 0x042B, 0x2936, 0x0138, 0x03A1, - 0x03C6, 0x0E56, 0x12F8, 0x149A, 0x526F, 0x0F2E, - 0x079C, 0x02FA, 0x0476, 0x0267, 0x0636, 0x03A0, - 0x014E, 0x0092, 0x0D7C, 0x05AF, 0x010C, 0x011C, - 0x0A10, 0x177E, 0x0131, 0x09A0, 0x03EA, 0x02C2, - 0x02D6, 0x0B89, 0x032E, 0x01E8, 0x0F30, 0x01BA, - 0x0532, 0x0A6C, 0x0F6E, 0x04CC, 0x008E, 0x036C, - 0x0E57, 0x00D6, 0x0162, 0x0024, 0x0252, 0x0F6F, - 0x01AE, 0x0150, 0x0038, 0x07CE, 0x01BB, 0x01F6, - 0x026A, 0x038B, 0x01DB, 0x07CF, 0x14DB, 0x24BC, - 0x0272, 0x053E, 0x073E, 0x078E, 0x0C36, 0x0176, - 0x032B, 0x017A, 0x0190, 0x0CCB, 0x047C, 0x0170, - 0x0054, 0x03EC, 0x049D, 0x0197, 0x043B, 0x0432, - 0x0192, 0x026A, 0x01F0, 0x0076, 0x0216, 0x0A11, - 0x1F7D, 0x02C4, 0x0298, 0x1159, 0x0A4E, 0x0116, - 0x00E4, 0x0216, 0x029A, 0x000F, 0x04DA, 0x04D2, - 0x002B, 0x0011, 0x049E, 0x045A, 0x01BF, 0x01EF, - 0x03CE, 0x01F8, 0x026E, 0x0466, 0x02DC, 0x0168, - 0x030E, 0x00B4, 0x01C3, 0x03CC, 0x028D, 0x01AE, - 0x038E, 0x01B0, 0x0664, 0x0119, 0x01BE, 0x035B, - 0x035F, 0x028E, 0x0A78, 0x01DE, 0x0397, 0x03FE, - 0x01B1, 0x028E, 0x07D2, 0x09A2, 0x033C, 0x02C1, - 0x0FA0, 0x0359, 0x031E, 0x00C1, 0x03D6, 0x0A12, - 0x01C4, 0x0330, 0x075F, 0x0B1F, 0x025A, 0x027B, - 0x04DB, 0x02E5, 0x01FA, 0x036F, 0x0A13, 0x02BB, - 0x00FA, 0x01D4, 0x01F8, 0x018A, 0x161E, 0x0E75, - 0x026B, 0x05B3, 0x01BC, 0x05B2, 0x09A3, 0x0424, - 0x047E, 0x01EE, 0x0FE1, 0x161D, 0x024C, 0x017E, - 0x026B, 0x01DC, 0x00A5, 0x0F2F, 0x161C, 0x028B, - 0x0196, 0x0168, 0x01EF, 0x0394, 0x0E74, 0x013C, - 0x00C9, 0x032E, 0x0941, 0x0D76, 0x050C, 0x0228, - 0x006C, 0x0236, 0x0D2F, 0x0156, 0x00D2, 0x0B8A, - 0x0148, 0x028A, 0x028B, 0x033B, 0x0214, 0x01E9, - 0x03C2, 0x049C, 0x02BA, 0x02E9, 0x028C, 0x01FC, - 0x0103, 0x0B5C, 0x050D, 0x031C, 0x0268, 0x0651, - 0x013A, 0x013B, 0x0118, 0x03D5, 0x0252, 0x0044, - 0x0637, 0x01D2, 0x000E, 0x00F0, 0x0323, 0x02C3, - 0x019A, 0x016C, 0x0046, 0x03E3, 0x024A, 0x00AC, - 0x0269, 0x02C0, 0x0396, 0x027A, 0x0253, 0x0273, - 0x073E, 0x0322, 0x003A, 0x025E, 0x0336, 0x0257, - 0x00D6, 0x0026, 0x03C3, 0x0034, 0x019A, 0x00FB, - 0x0038, 0x0040, 0x0096, 0x01F0, 0x0184, 0x021A, - 0x003E, 0x0042, 0x050E, 0x03CE, 0x035E, 0x0FA1, - 0x017B, 0x02CD, 0x0058, 0x0326, 0x00E4, 0x002E, - 0x004F, 0x000C, 0x0164, 0x0048, 0x0048, 0x0194, - 0x0074, 0x006E, 0x0070, 0x006C, 0x01A4, 0x00A3, - 0x034F, 0x011E, 0x0374, 0x0157, 0x0138, 0x011D, - 0x03CF, 0x033D, 0x0132, 0x0050, 0x023E, 0x005A, - 0x0076, 0x01EC, 0x005D, 0x0008, 0x004C, 0x024E, - 0x0154, 0x001E, 0x01C6, 0x0027, 0x00FE, 0x01EA, - 0x02CE, 0x01DD, 0x02CB, 0x035A, 0x0318, 0x013E, - 0x009B, 0x0288, 0x0339, 0x024D, 0x031F, 0x0128, - 0x00B6, 0x0028, 0x028A, 0x0289, 0x029F, 0x01FD, - 0x029A, 0x00F6, 0x0FA2, 0x0347, 0x0080, 0x01A8, - 0x028F, 0x0326, 0x0327, 0x0370, 0x165C, 0x043F, - 0x0375, 0x013D, 0x1E5B, 0x04DE, 0x0155, 0x00D8, - 0x0319, 0x0096, 0x0640, 0x07E7, 0x007C, 0x0652, - 0x0373, 0x05DE, 0x00CF, 0x0E76, 0x0653, 0x01A0, - 0x0160, 0x0169, 0x01D5, 0x05AA, 0x053A, 0x0B5D, - 0x0254, 0x079A, 0x0533, 0x0425, 0x053E, 0x00A6, - 0x030F, 0x01A2, 0x00B0, 0x04A3, 0x079F, 0x011A, - 0x01EE, 0x02CC, 0x045E, 0x005C, 0x0024, 0x022C, - 0x001A, 0x0338, 0x0132, 0x026C, 0x004E, 0x047F, - 0x01B2, 0x0113, 0x043E, 0x0336, 0x00F0, 0x02CE, - 0x0112, 0x018B, 0x0010, 0x0114, 0x01BE, 0x03FA, - 0x002A, 0x00FA, 0x0033, 0x0060, 0x0146, 0x01DC, - 0x0000, 0x0025, 0x037A, 0x034E, 0x012E, 0x029B, - 0x079B, 0x00E6, 0x03CD, 0x02DD, 0x0117, 0x017A, - 0x002C, 0x03E2, 0x003E, 0x0070, 0x00CE, 0x00B1, - 0x003B, +static const uint8_t on2avc_cb3_bits[ON2AVC_CB_3_4_CODES] = { + 1, 7, 7, 7, 9, 9, 10, 11, 12, 14, 14, 14, 15, 15, 10, 10, 7, 9, 9, + 9, 10, 11, 12, 12, 7, 10, 11, 11, 12, 12, 12, 13, 14, 15, 15, 11, 11, 9, + 9, 7, 9, 10, 11, 12, 12, 9, 9, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, + 11, 12, 13, 13, 11, 12, 13, 13, 9, 9, 7, 7, 7, 9, 9, 9, 10, 11, 11, + 9, 9, 9, 10, 13, 14, 16, 16, 16, 16, 13, 13, 12, 13, 13, 10, 12, 12, 12, + 14, 14, 14, 14, 10, 11, 12, 12, 9, 10, 10, 10, 11, 11, 10, 10, 9, 10, 13, + 14, 14, 13, 13, 12, 13, 14, 14, 9, 10, 10, 9, 10, 10, 6, 6, 6, 6, 8, + 11, 12, 14, 15, 15, 14, 14, 11, 12, 13, 13, 11, 13, 14, 15, 15, 13, 13, 11, + 11, 8, 9, 10, 10, 8, 8, 10, 10, 10, 12, 12, 12, 14, 14, 14, 14, 9, 10, + 11, 12, 12, 6, 9, 10, 10, 9, 10, 12, 13, 14, 15, 16, 17, 17, 12, 13, 14, + 15, 15, 8, 10, 11, 12, 13, 14, 14, 10, 10, 8, 10, 12, 12, 12, 12, 10, 10, + 9, 10, 11, 12, 13, 14, 15, 15, 10, 10, 10, 10, 9, 9, 9, 10, 12, 13, 14, + 15, 16, 16, 12, 12, 9, 10, 10, 9, 10, 10, 6, 6, 6, 6, 6, 9, 9, 11, + 12, 13, 14, 14, 11, 12, 12, 10, 10, 9, 10, 10, 9, 10, 11, 12, 13, 14, 14, + 9, 10, 12, 12, 12, 13, 14, 15, 16, 16, 9, 10, 10, 9, 10, 11, 12, 12, 9, + 10, 11, 12, 13, 13, 9, 9, 9, 11, 12, 13, 14, 14, 11, 11, 8, 9, 11, 12, + 13, 13, 11, 12, 13, 15, 15, 15, 15, }; -static const uint8_t on2avc_cb6_bits[ON2AVC_CB5_6_CODES] = { - 7, 10, 10, 7, 12, 12, - 7, 10, 11, 11, 12, 15, - 17, 12, 13, 11, 15, 13, - 10, 11, 11, 7, 13, 13, - 7, 7, 12, 12, 7, 7, - 9, 9, 9, 11, 10, 9, - 12, 12, 13, 13, 13, 13, - 9, 12, 10, 10, 7, 9, - 9, 10, 12, 11, 10, 11, - 11, 9, 11, 11, 11, 11, - 12, 12, 13, 11, 12, 12, - 10, 11, 12, 12, 10, 11, - 11, 10, 12, 14, 13, 11, - 12, 12, 11, 10, 13, 14, - 10, 12, 12, 12, 16, 12, - 12, 10, 13, 13, 13, 12, - 11, 11, 11, 13, 14, 13, - 13, 11, 11, 10, 13, 13, - 11, 12, 12, 13, 16, 12, - 14, 10, 13, 13, 10, 13, - 11, 11, 10, 11, 11, 9, - 11, 11, 10, 11, 12, 12, - 13, 12, 12, 10, 13, 14, - 12, 11, 11, 12, 11, 9, - 11, 11, 10, 7, 12, 13, - 7, 7, 9, 9, 10, 12, - 13, 10, 12, 10, 10, 12, - 13, 12, 10, 10, 11, 9, - 7, 9, 9, 7, 10, 10, - 7, 7, 9, 9, 10, 11, - 10, 10, 12, 11, 11, 12, - 11, 11, 10, 10, 10, 9, - 7, 9, 9, 7, 9, 9, - 7, 10, 10, 7, 10, 10, - 11, 10, 11, 11, 11, 10, - 11, 12, 10, 9, 10, 10, - 8, 10, 9, 7, 10, 11, - 11, 9, 9, 10, 10, 10, - 10, 11, 10, 11, 10, 10, - 10, 11, 11, 10, 11, 11, - 10, 10, 11, 10, 13, 12, - 11, 10, 13, 12, 10, 11, - 11, 10, 11, 12, 13, 12, - 11, 13, 14, 11, 10, 11, - 11, 9, 13, 12, 10, 12, - 11, 11, 10, 13, 13, 9, - 11, 11, 10, 11, 15, 13, - 11, 11, 14, 13, 11, 10, - 11, 11, 10, 12, 13, 9, - 10, 11, 11, 10, 10, 10, - 10, 11, 11, 11, 10, 11, - 10, 10, 10, 11, 10, 10, - 11, 11, 10, 10, 10, 11, - 7, 9, 9, 8, 9, 9, - 7, 10, 10, 10, 11, 11, - 11, 10, 10, 12, 11, 10, - 9, 10, 10, 7, 9, 10, - 7, 10, 11, 11, 10, 11, - 11, 10, 11, 12, 12, 12, - 13, 13, 12, 11, 13, 13, - 11, 11, 11, 11, 9, 11, - 11, 9, 9, 12, 11, 9, - 9, 10, 11, 10, 11, 11, - 11, 11, 11, 11, 11, 11, - 11, 10, 11, 11, 10, 9, - 10, 10, 11, 12, 11, 10, - 12, 11, 10, 11, 10, 12, - 11, 11, 13, 11, 10, 13, - 13, 11, 12, 12, 11, 11, - 11, 11, 10, 10, 13, 13, - 10, 10, 11, 11, 10, 12, - 13, 10, 12, 11, 12, 11, - 13, 13, 10, 14, 13, 10, - 10, 11, 11, 10, 13, 13, - 10, 10, 10, 11, 10, 13, - 12, 10, 12, 12, 12, 12, - 13, 13, 11, 13, 13, 10, - 10, 11, 11, 11, 12, 12, - 10, 11, 11, 10, 12, 12, - 11, 11, 13, 12, 11, 10, - 13, 13, 10, 11, 12, 12, - 10, 11, 11, 11, 9, 12, - 11, 10, 9, 11, 11, 10, - 11, 11, 10, 12, 11, 11, - 10, 11, 11, 10, 11, 11, - 10, 9, 10, 10, 9, 12, - 13, 9, 13, 10, 11, 11, - 13, 14, 11, 14, 14, 13, - 13, 14, 13, 11, 13, 13, - 11, 12, 11, 11, 13, 11, - 11, 9, 12, 12, 9, 11, - 11, 11, 13, 14, 15, 12, - 12, 13, 14, 12, 10, 11, - 11, 9, 13, 12, 9, 10, - 13, 13, 10, 9, 11, 11, - 10, 12, 13, 11, 13, 12, - 13, 13, 13, 13, 10, 13, - 12, 10, 10, 11, 10, 17, - 13, 13, 11, 13, 14, 11, - 11, 11, 12, 12, 11, 15, - 13, 13, 17, 14, 13, 12, - 13, 13, 11, 14, 13, 11, - 10, 13, 13, 11, 14, 14, - 11, 12, 12, 11, 13, 15, - 14, 13, 14, 16, 15, 13, - 12, 12, 13, 11, 14, 14, - 11, 10, 13, 13, 10, 9, - 10, 10, 11, 13, 13, 10, - 13, 13, 12, 13, 13, 13, - 10, 13, 13, 10, 10, 11, - 11, 12, 11, 11, 9, 12, - 12, 9, 11, 11, 11, 12, - 14, 14, 12, 12, 14, 13, - 12, 10, 11, 11, 9, 12, - 12, 9, 10, 14, 14, 9, - 12, 11, 11, 11, 13, 14, - 11, 17, 14, 13, 13, 14, - 13, 11, 14, 13, 11, 12, - 11, 11, 13, 11, 11, 9, - 13, 12, 9, 10, 11, 10, - 12, 14, 14, 12, 14, 13, - 14, 12, 11, 11, 11, 9, - 12, 12, 9, 10, 13, 14, - 10, 10, 11, 10, 10, 14, - 12, 10, 13, 13, 12, 12, - 12, 13, 10, 12, 13, 10, - 9, 10, 11, 11, 13, 13, - 11, 14, 14, 11, 12, 13, - 13, 13, 17, 16, 13, 13, - 13, 16, 13, 12, 11, 13, - 11, 13, 14, 11, 17, 12, - 13, 11, 13, 16, 11, 12, - 13, 12, 13, 15, 17, 13, - 13, 17, 11, 12, 11, 12, - 11, 11, 14, 14, 11, 10, - 13, 13, 10, 12, 10, 11, - 10, 12, 13, 10, 12, 13, - 13, 12, 12, 12, 11, 14, - 12, 10, 9, 11, 11, 12, - 11, 11, 10, 12, 13, 9, - 10, 10, 11, 12, 13, 14, - 12, 12, 15, 14, 12, 11, - 11, 11, 9, 12, 13, 9, - 10, 11, 11, 9, 11, 11, - 9, 11, 11, 12, 11, 13, - 13, 11, 12, 13, 14, 12, - 12, 12, 12, 10, 11, 11, - 10, 10, 11, 11, 9, 9, - 10, 10, 10, 11, 11, 10, - 10, 11, 11, 11, 11, 12, - 10, 11, 11, 11, 9, 10, - 10, 11, 12, 12, 10, 11, - 11, 10, 11, 12, 11, 10, - 12, 13, 10, 11, 12, 13, - 11, 12, 11, 12, 10, 11, - 11, 10, 10, 14, 13, 10, - 10, 11, 11, 10, 13, 12, - 10, 12, 13, 12, 12, 12, - 13, 10, 12, 13, 10, 10, - 11, 11, 11, 13, 13, 10, - 10, 11, 11, 10, 12, 13, - 10, 12, 13, 12, 12, 13, - 11, 10, 12, 12, 10, 12, - 11, 11, 11, 11, 12, 10, - 10, 11, 10, 12, 11, 12, - 11, 13, 12, 10, 11, 13, - 11, 11, 11, 12, 10, 10, - 11, 11, 10, 9, 11, 11, - 9, 9, 10, 10, 10, 11, - 11, 10, 10, 11, 11, 12, - 11, 11, 11, 11, 11, 10, - 9, 11, 10, 7, 10, 10, - 7, 7, 9, 9, 9, 10, - 11, 10, 12, 11, 11, 12, - 11, 11, 10, 10, 11, 10, - 7, 10, 9, 7, 10, 9, - 7, 10, 10, 7, 9, 10, - 10, 10, 11, 12, 10, 10, - 11, 11, 10, 10, 10, 11, - 7, 9, 10, 8, 10, 12, - 11, 10, 9, 11, 10, 10, - 11, 11, 10, 10, 10, 11, - 11, 10, 10, 10, 10, 11, - 11, 10, 10, 10, 13, 12, - 11, 12, 12, 12, 10, 10, - 11, 11, 11, 14, 14, 11, - 11, 13, 13, 11, 11, 11, - 10, 10, 12, 12, 10, 13, - 11, 11, 10, 12, 13, 9, - 10, 11, 11, 11, 14, 13, - 11, 11, 13, 12, 11, 11, - 10, 11, 10, 12, 13, 10, - 9, 11, 11, 10, 10, 10, - 11, 10, 11, 11, 11, 13, - 11, 11, 11, 10, 10, 10, - 11, 10, 10, 9, 10, 10, - 7, 9, 10, 7, 9, 9, - 8, 10, 10, 10, 10, 12, - 11, 10, 11, 11, 12, 10, - 10, 10, 10, 7, 10, 10, - 7, +static const uint8_t on2avc_cb4_bits[ON2AVC_CB_3_4_CODES] = { + 7, 7, 7, 9, 9, 9, 10, 11, 12, 12, 6, 6, 6, 7, 9, 9, 9, 9, 6, + 6, 6, 7, 9, 9, 9, 9, 6, 6, 6, 7, 7, 6, 6, 9, 9, 9, 11, 12, + 12, 11, 11, 9, 9, 9, 11, 11, 11, 12, 12, 7, 9, 9, 9, 9, 7, 9, 9, + 9, 11, 11, 11, 11, 7, 9, 9, 9, 9, 6, 6, 6, 7, 9, 9, 9, 11, 11, + 11, 11, 6, 9, 9, 9, 9, 9, 9, 9, 9, 6, 6, 6, 6, 6, 9, 9, 9, + 11, 11, 11, 11, 9, 9, 9, 9, 6, 9, 10, 12, 13, 13, 12, 12, 9, 9, 9, + 9, 9, 9, 9, 11, 12, 12, 11, 12, 12, 9, 9, 9, 9, 9, 9, 9, 11, 12, + 12, 12, 12, 12, 12, 9, 10, 10, 10, 11, 12, 12, 10, 10, 9, 10, 10, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 12, 12, 12, 12, 11, 12, 12, 9, 9, 9, 9, 9, + 10, 10, 6, 9, 10, 10, 9, 9, 9, 10, 10, 9, 10, 10, 4, 6, 9, 10, 11, + 12, 12, 9, 10, 10, 9, 10, 11, 11, 10, 10, 10, 11, 12, 12, 9, 10, 10, 10, + 11, 12, 12, 10, 10, 8, 10, 10, 10, 10, 8, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 11, 12, 13, 14, 14, 10, 10, 8, 10, 10, 10, 11, 12, 12, 8, 10, 10, 10, + 10, 8, 8, 8, 10, 10, 10, 11, 11, 8, 8, 8, 10, 10, 10, 11, 11, 8, 10, + 11, 11, 10, 10, 8, 8, 8, 10, 10, 10, 10, 8, 10, 11, 11, 10, 10, 8, 9, + 10, 11, 13, 13, 13, 13, 9, 10, 10, 10, 11, 11, 10, 10, 6, 6, 5, 5, 5, + 6, 8, 9, 9, 8, 9, 10, 11, 11, }; -#define ON2AVC_CB7_8_CODES 3281 -static const uint32_t on2avc_cb7_codes[ON2AVC_CB7_8_CODES] = { - 0x00000, 0x000EA, 0x000E6, 0x000F4, 0x000F6, 0x00047, - 0x003E2, 0x004A7, 0x00044, 0x004D3, 0x0082A, 0x0026E, - 0x0020E, 0x008A5, 0x02603, 0x02895, 0x049B0, 0x02894, - 0x007BE, 0x0069E, 0x01154, 0x01153, 0x0095F, 0x0038E, - 0x004AC, 0x0128E, 0x00E5E, 0x00992, 0x02A84, 0x0386A, - 0x03F6F, 0x01C54, 0x005D4, 0x00AFB, 0x001BE, 0x00258, - 0x00A59, 0x00043, 0x004A6, 0x004D7, 0x00040, 0x0006C, - 0x007FF, 0x00D39, 0x0005B, 0x00066, 0x0034A, 0x00124, - 0x004B6, 0x00626, 0x0071F, 0x014A3, 0x014A2, 0x0083E, - 0x032D4, 0x049B3, 0x0045E, 0x00ED5, 0x02896, 0x00ABA, - 0x0107B, 0x009EC, 0x0082C, 0x0082B, 0x00D38, 0x0072B, - 0x004FC, 0x049B2, 0x050B1, 0x003FE, 0x009EB, 0x049B1, - 0x00966, 0x00F75, 0x03F70, 0x007BC, 0x00054, 0x00394, - 0x000E8, 0x0052F, 0x0057A, 0x00458, 0x0FB4B, 0x01C55, - 0x00948, 0x032D6, 0x00ED6, 0x0A05F, 0x050B3, 0x00BBD, - 0x0197E, 0x024FC, 0x020C6, 0x0094A, 0x0386B, 0x1F2FF, - 0x050B4, 0x0A060, 0x0FB4C, 0x009ED, 0x02A85, 0x0FB4D, - 0x02605, 0x00ABB, 0x009A2, 0x0145B, 0x0A05D, 0x03F71, - 0x00BFF, 0x1F2FE, 0x0FB49, 0x0FB48, 0x050B2, 0x01155, - 0x01FD6, 0x032D5, 0x00976, 0x02604, 0x00A5A, 0x0A05E, - 0x0FB4A, 0x00DB9, 0x0A063, 0x1F307, 0x0FB4F, 0x1F306, - 0x049B4, 0x0FB50, 0x0FB51, 0x050B6, 0x1F308, 0x050B7, - 0x1F30A, 0x1F309, 0x0A064, 0x1F30B, 0x0A066, 0x06535, - 0x020C7, 0x0A065, 0x032D7, 0x0FB52, 0x02897, 0x0077A, - 0x03F72, 0x0FB4E, 0x050B5, 0x0076E, 0x1F301, 0x1F302, - 0x06533, 0x01FD7, 0x1F300, 0x0A061, 0x1F304, 0x1F303, - 0x07E54, 0x024FD, 0x1F305, 0x06534, 0x02606, 0x0A062, - 0x007C0, 0x0A06A, 0x1F30F, 0x0FB54, 0x0386D, 0x009E6, - 0x1F310, 0x06538, 0x00DBA, 0x014A4, 0x050B9, 0x1F311, - 0x0A06B, 0x0128F, 0x07E55, 0x1F312, 0x0FB55, 0x01C56, - 0x07E56, 0x0FB56, 0x1F313, 0x050BA, 0x01C57, 0x02608, - 0x0A067, 0x1F30D, 0x1F30C, 0x02607, 0x0386C, 0x0A069, - 0x0A068, 0x01557, 0x00ED7, 0x06536, 0x1F30E, 0x0FB53, - 0x02609, 0x007BF, 0x050B8, 0x06537, 0x00DE5, 0x00392, - 0x03F69, 0x0A055, 0x0FB3C, 0x0A054, 0x00AB7, 0x050AB, - 0x0FB3D, 0x00CE6, 0x009E8, 0x014A1, 0x049A8, 0x1F2ED, - 0x02890, 0x009E9, 0x049A9, 0x1F2EE, 0x032D1, 0x020C4, - 0x049AA, 0x0A056, 0x0FB3E, 0x0FB3F, 0x0A051, 0x0A052, - 0x0A053, 0x0FB39, 0x0A050, 0x0096E, 0x0FB3A, 0x1F2EB, - 0x029FE, 0x007FE, 0x0128D, 0x049A7, 0x1F2EC, 0x07E50, - 0x00E36, 0x03867, 0x0FB3B, 0x006EA, 0x03F6B, 0x1F2F4, - 0x1F2F3, 0x03868, 0x049AB, 0x1F2F6, 0x029FF, 0x1F2F5, - 0x0A05A, 0x07E52, 0x1F2F7, 0x07E51, 0x03F6C, 0x1F2FA, - 0x07E53, 0x025FF, 0x1F2F8, 0x1F2F9, 0x009A0, 0x06532, - 0x0FB45, 0x024FB, 0x008B9, 0x01D7D, 0x0FB40, 0x01FD3, - 0x0FB42, 0x0A058, 0x050AC, 0x0A057, 0x0FB41, 0x0A059, - 0x1F2F0, 0x1F2EF, 0x0FB43, 0x03F6A, 0x0FB44, 0x020C5, - 0x1F2F1, 0x1F2F2, 0x004FE, 0x02601, 0x00A58, 0x01FD5, - 0x049AD, 0x00A46, 0x02A80, 0x050AD, 0x009E5, 0x01B56, - 0x02A81, 0x00A36, 0x01556, 0x032D3, 0x02A82, 0x0FB47, - 0x1F2FD, 0x050AE, 0x004BA, 0x00A6B, 0x03F6D, 0x049AE, - 0x01317, 0x009A1, 0x00AB8, 0x02891, 0x03869, 0x01FD4, - 0x049AC, 0x1F2FB, 0x0FB46, 0x0A05B, 0x02600, 0x032D2, - 0x0137E, 0x01C53, 0x02892, 0x00BFE, 0x0A05C, 0x1F2FC, - 0x00CE7, 0x00058, 0x00FF7, 0x009EA, 0x00068, 0x00060, - 0x004D2, 0x004BD, 0x000EE, 0x003A4, 0x006E2, 0x0137F, - 0x0197D, 0x006EB, 0x050B0, 0x03F6E, 0x00E37, 0x00316, - 0x02893, 0x004CB, 0x006EE, 0x01152, 0x008AE, 0x0067E, - 0x00991, 0x0145A, 0x00AB9, 0x049AF, 0x02A83, 0x00A6C, - 0x0045F, 0x02602, 0x006E1, 0x050AF, 0x012D2, 0x0073F, - 0x00061, 0x00526, 0x004D6, 0x0013E, 0x003AE, 0x0005E, - 0x01D7E, 0x0289F, 0x00059, 0x0006A, 0x0082D, 0x00F77, - 0x009EE, 0x006E3, 0x00D3F, 0x1F32B, 0x02A8B, 0x00D3E, - 0x032DE, 0x0FB60, 0x02A8C, 0x020CC, 0x03874, 0x0045B, - 0x00DE8, 0x0082E, 0x00636, 0x012D6, 0x049B9, 0x0260C, - 0x01157, 0x06540, 0x0A073, 0x02504, 0x0289D, 0x050C2, - 0x00AFE, 0x0260D, 0x0289E, 0x00A6F, 0x0004E, 0x006EF, - 0x0099C, 0x00EDA, 0x0062E, 0x00048, 0x00A3A, 0x01292, - 0x013C2, 0x00A72, 0x0012A, 0x028A0, 0x02507, 0x00174, - 0x00DE9, 0x00ABF, 0x00EDE, 0x01146, 0x013C3, 0x032E1, - 0x049BA, 0x03875, 0x03876, 0x00824, 0x0077B, 0x032E2, - 0x01050, 0x00677, 0x00EDB, 0x0145C, 0x02505, 0x032DF, - 0x019C0, 0x050C3, 0x06541, 0x0A074, 0x032E0, 0x00A37, - 0x02506, 0x00ABE, 0x00E78, 0x02A8D, 0x001B4, 0x02A8E, - 0x01D7F, 0x001A4, 0x00DEA, 0x1F32F, 0x050C5, 0x009EF, - 0x00977, 0x020CD, 0x01B60, 0x019C3, 0x017DE, 0x0131A, - 0x0260F, 0x0A075, 0x01C5C, 0x0FB61, 0x07E62, 0x00E79, - 0x02610, 0x0A076, 0x014A7, 0x02611, 0x009FA, 0x007C1, - 0x0145D, 0x1F32C, 0x049BB, 0x019C1, 0x06543, 0x1F32D, - 0x06544, 0x01FD8, 0x06542, 0x01B5E, 0x06545, 0x1F32E, - 0x019C2, 0x005F4, 0x0260E, 0x050C4, 0x01B5F, 0x01C5B, - 0x032E3, 0x1F339, 0x1F33A, 0x1F338, 0x0FB63, 0x028A1, - 0x1F33B, 0x0FB64, 0x049BC, 0x0A07A, 0x1F33C, 0x0A07B, - 0x032E4, 0x07E63, 0x1F33E, 0x07E64, 0x1F33D, 0x0FB65, - 0x028A2, 0x02612, 0x02613, 0x050C6, 0x00967, 0x0155A, - 0x03F78, 0x1F330, 0x0A077, 0x03877, 0x0A078, 0x1F333, - 0x1F331, 0x1F332, 0x03878, 0x1F335, 0x1F336, 0x06546, - 0x1F334, 0x06547, 0x1F337, 0x0A079, 0x0FB62, 0x006FE, - 0x1F342, 0x0FB69, 0x008A7, 0x009FB, 0x1F343, 0x1F344, - 0x050C7, 0x0654A, 0x020CF, 0x1F345, 0x020CE, 0x01FD9, - 0x028A5, 0x0A07C, 0x0A07D, 0x050C8, 0x013C6, 0x03F7A, - 0x0A07E, 0x0387B, 0x01C5D, 0x03879, 0x06548, 0x1F33F, - 0x028A3, 0x00DBE, 0x03F79, 0x1F340, 0x0FB66, 0x028A4, - 0x008B2, 0x0FB67, 0x0387A, 0x0131B, 0x005D5, 0x06549, - 0x1F341, 0x0FB68, 0x0155B, 0x00DE6, 0x07E59, 0x1F318, - 0x00266, 0x00823, 0x01B57, 0x0FB58, 0x1F319, 0x0386F, - 0x01B58, 0x02899, 0x050BB, 0x00DBB, 0x01B59, 0x032D9, - 0x050BC, 0x1F31A, 0x03F74, 0x032DA, 0x0A06D, 0x06539, - 0x03870, 0x0386E, 0x1F315, 0x1F314, 0x024FE, 0x0176A, - 0x032D8, 0x0A06C, 0x1F316, 0x07E57, 0x014A5, 0x049B5, - 0x07E58, 0x00D3A, 0x0075B, 0x02898, 0x1F317, 0x0FB57, - 0x03F73, 0x01B5A, 0x0FB5B, 0x050BE, 0x1F31F, 0x0FB5A, - 0x0653B, 0x1F320, 0x0FB5C, 0x07E5C, 0x07E5D, 0x1F322, - 0x050BF, 0x0A06F, 0x1F321, 0x0FB5D, 0x1F325, 0x1F323, - 0x1F324, 0x01C58, 0x00ED8, 0x0289A, 0x1F326, 0x03F77, - 0x013C0, 0x0653A, 0x03F75, 0x1F31B, 0x024FF, 0x03F76, - 0x0FB59, 0x07E5A, 0x0A06E, 0x02500, 0x07E5B, 0x02A86, - 0x050BD, 0x1F31C, 0x032DB, 0x1F31E, 0x1F31D, 0x049B6, - 0x00C49, 0x1F329, 0x1F328, 0x00BBE, 0x008A6, 0x03871, - 0x01B5B, 0x02A88, 0x01558, 0x020C9, 0x0FB5F, 0x049B7, - 0x014A6, 0x07E5F, 0x1F32A, 0x0197F, 0x01B5C, 0x03872, - 0x00726, 0x01156, 0x02501, 0x0104F, 0x00C48, 0x032DC, - 0x0653C, 0x0176B, 0x1F327, 0x0653D, 0x0289B, 0x07E5E, - 0x0FB5E, 0x0176E, 0x0A071, 0x0A070, 0x0260A, 0x00993, - 0x020C8, 0x0176F, 0x02A87, 0x0289C, 0x00042, 0x00CE8, - 0x01C5A, 0x00F76, 0x008BA, 0x001C8, 0x02A8A, 0x02503, - 0x00136, 0x00A6E, 0x020CB, 0x00A5B, 0x008AF, 0x00ED9, - 0x03873, 0x0653F, 0x07E61, 0x050C1, 0x007A9, 0x0067F, - 0x013C1, 0x01559, 0x00D3B, 0x00DE7, 0x01B5D, 0x050C0, - 0x0260B, 0x02A89, 0x0653E, 0x0A072, 0x07E60, 0x049B8, - 0x00A6D, 0x02502, 0x00E5F, 0x012D3, 0x020CA, 0x0015D, - 0x032DD, 0x01C59, 0x0018E, 0x000E0, 0x07E77, 0x07E78, - 0x07E76, 0x049C5, 0x00BEA, 0x0A090, 0x0A08F, 0x00A3B, - 0x03F80, 0x0655A, 0x0655B, 0x050D1, 0x0A091, 0x1F37E, - 0x1F37F, 0x1F37C, 0x1F37D, 0x0FB77, 0x0655D, 0x050D2, - 0x1F380, 0x0655C, 0x02618, 0x049C3, 0x1F379, 0x0A08D, - 0x07E72, 0x07E73, 0x1F37B, 0x1F37A, 0x0A08E, 0x0145E, - 0x06558, 0x06559, 0x07E74, 0x049C4, 0x0083F, 0x07E75, - 0x0FB76, 0x007AA, 0x008A8, 0x1F382, 0x0FB7B, 0x007AB, - 0x004B2, 0x050D5, 0x07E7C, 0x07E7B, 0x032E8, 0x0261A, - 0x07E7D, 0x1F383, 0x03F81, 0x1F384, 0x0655F, 0x0FB7C, - 0x0A094, 0x0A095, 0x020D3, 0x1F385, 0x050D6, 0x050D7, - 0x01B61, 0x0FB78, 0x07E79, 0x028A7, 0x07E7A, 0x0A092, - 0x1F381, 0x050D3, 0x0FB79, 0x032E7, 0x0655E, 0x0A093, - 0x01DA2, 0x0053B, 0x02619, 0x050D4, 0x0FB7A, 0x020D2, - 0x0094B, 0x0A09A, 0x0FB7F, 0x0FB7E, 0x03884, 0x00C4A, - 0x0FB80, 0x1F38B, 0x019C6, 0x032E9, 0x01C5F, 0x0FB82, - 0x1F38C, 0x0FB81, 0x050D9, 0x07E7E, 0x1F38D, 0x1F38E, - 0x03885, 0x050DB, 0x07E7F, 0x06562, 0x050DA, 0x00E7A, - 0x02A92, 0x1F386, 0x0A096, 0x06560, 0x06561, 0x1F389, - 0x1F387, 0x1F388, 0x050D8, 0x0A098, 0x0FB7D, 0x02A93, - 0x0A097, 0x01FDC, 0x1F38A, 0x0A099, 0x020D4, 0x07E82, - 0x0FB89, 0x1F394, 0x07E81, 0x0A09E, 0x0FB8B, 0x1F395, - 0x07E83, 0x0FB8A, 0x028A8, 0x1F397, 0x1F396, 0x0A09F, - 0x0FB8C, 0x03F82, 0x049C6, 0x1F398, 0x1F399, 0x06563, - 0x02508, 0x03886, 0x07E84, 0x012E6, 0x0A09B, 0x1F38F, - 0x032EA, 0x0FB85, 0x1F390, 0x0FB86, 0x0FB83, 0x0FB84, - 0x0A09C, 0x1F392, 0x1F391, 0x0FB87, 0x02A94, 0x1F393, - 0x0A09D, 0x07E80, 0x0FB88, 0x006B6, 0x1F39D, 0x1F39E, - 0x0A0A1, 0x0A0A2, 0x0155E, 0x1F39F, 0x0A0A3, 0x02509, - 0x020D5, 0x0A0A4, 0x1F3A0, 0x07E86, 0x06564, 0x01FDE, - 0x0FB90, 0x049C8, 0x06565, 0x050DE, 0x0A0A6, 0x07E87, - 0x0A0A5, 0x06566, 0x00E7B, 0x049C7, 0x1F39A, 0x0A0A0, - 0x050DC, 0x00DEC, 0x07E85, 0x0FB8D, 0x01FDD, 0x00CE9, - 0x050DD, 0x0FB8E, 0x1F39B, 0x03F83, 0x0051F, 0x1F39C, - 0x0FB8F, 0x01293, 0x009A3, 0x049BE, 0x1F34E, 0x1F34D, - 0x0654B, 0x0115A, 0x0A07F, 0x0654C, 0x00A47, 0x01C5E, - 0x049BF, 0x1F350, 0x1F34F, 0x0387C, 0x07E67, 0x1F351, - 0x07E66, 0x02A8F, 0x1F353, 0x07E68, 0x1F354, 0x1F352, - 0x0A080, 0x00BBF, 0x1F347, 0x1F348, 0x1F346, 0x0FB6A, - 0x032E5, 0x07E65, 0x1F349, 0x006E4, 0x012D7, 0x049BD, - 0x1F34A, 0x0FB6B, 0x050C9, 0x00DEB, 0x1F34C, 0x1F34B, - 0x0052E, 0x07E6A, 0x1F35F, 0x1F35E, 0x0A081, 0x0387D, - 0x1F361, 0x0654F, 0x1F360, 0x0A082, 0x0387E, 0x1F363, - 0x1F362, 0x050CA, 0x0A084, 0x1F365, 0x03F7D, 0x0A083, - 0x1F364, 0x032E6, 0x1F366, 0x0A085, 0x06550, 0x020D0, - 0x1F356, 0x1F355, 0x00A73, 0x1F357, 0x1F358, 0x1F359, - 0x07E69, 0x0654D, 0x1F35B, 0x0FB6C, 0x1F35A, 0x0654E, - 0x03F7B, 0x1F35D, 0x03F7C, 0x0FB6D, 0x1F35C, 0x009AA, - 0x03880, 0x1F36B, 0x0A086, 0x1F36A, 0x01FDA, 0x1F36C, - 0x0A087, 0x01051, 0x049C2, 0x0FB71, 0x07E6E, 0x0A088, - 0x03F7E, 0x06553, 0x1F36E, 0x1F36D, 0x06552, 0x028A6, - 0x02A90, 0x0A089, 0x1F36F, 0x03881, 0x0074A, 0x049C0, - 0x0FB6F, 0x0FB6E, 0x02614, 0x0FB70, 0x1F368, 0x1F367, - 0x07E6B, 0x0387F, 0x049C1, 0x07E6C, 0x06551, 0x050CB, - 0x014AA, 0x07E6D, 0x1F369, 0x02615, 0x0072C, 0x1F373, - 0x1F372, 0x008BB, 0x00450, 0x07E70, 0x1F375, 0x1F374, - 0x050CE, 0x03882, 0x1F376, 0x0FB74, 0x02617, 0x1F377, - 0x1F378, 0x07E71, 0x06557, 0x0FB75, 0x050CF, 0x050D0, - 0x0A08C, 0x03883, 0x02A91, 0x06555, 0x050CC, 0x06554, - 0x0A08A, 0x1F370, 0x050CD, 0x06556, 0x0FB72, 0x02616, - 0x07E6F, 0x0A08B, 0x01FDB, 0x0053A, 0x03F7F, 0x0FB73, - 0x1F371, 0x020D1, 0x01FE0, 0x1F3F9, 0x1F3F8, 0x02A98, - 0x00C4E, 0x0A0B6, 0x0FBB1, 0x1F3FA, 0x0FBB0, 0x1F3FC, - 0x1F3FD, 0x1F3FB, 0x0A0B7, 0x1F400, 0x1F401, 0x1F402, - 0x1F3FE, 0x1F3FF, 0x1F404, 0x1F405, 0x0FBB2, 0x1F403, - 0x1F3EF, 0x1F3F0, 0x1F3ED, 0x1F3EE, 0x1F3F3, 0x1F3F4, - 0x0FBAB, 0x1F3F1, 0x1F3F2, 0x0A0B5, 0x1F3F6, 0x1F3F5, - 0x0FBAC, 0x01052, 0x0FBAF, 0x1F3F7, 0x0FBAD, 0x0FBAE, - 0x004BC, 0x1F40D, 0x1F40E, 0x1F40C, 0x0FBB8, 0x049CC, - 0x1F410, 0x1F40F, 0x03F87, 0x0A0B9, 0x0A0BA, 0x1F412, - 0x0FBB9, 0x1F411, 0x1F415, 0x1F416, 0x1F413, 0x1F414, - 0x1F418, 0x0A0BB, 0x0FBBA, 0x1F417, 0x07E95, 0x07E93, - 0x1F406, 0x1F407, 0x0A0B8, 0x07E92, 0x0FBB5, 0x1F408, - 0x0FBB3, 0x0FBB4, 0x07E94, 0x0FBB7, 0x1F409, 0x0FBB6, - 0x03F86, 0x01DA3, 0x1F40B, 0x1F40A, 0x019C7, 0x06572, - 0x1F421, 0x1F420, 0x0250F, 0x00DBF, 0x1F422, 0x1F423, - 0x0FBBE, 0x050E2, 0x049CD, 0x1F425, 0x1F424, 0x07E97, - 0x1F427, 0x0FBC0, 0x1F428, 0x0FBBF, 0x1F426, 0x1F42A, - 0x1F42B, 0x1F429, 0x0A0C0, 0x013C7, 0x0A0BD, 0x1F419, - 0x0A0BC, 0x1F41C, 0x1F41D, 0x1F41E, 0x1F41A, 0x1F41B, - 0x0FBBC, 0x1F41F, 0x06571, 0x0FBBB, 0x01FE1, 0x0FBBD, - 0x0A0BF, 0x0A0BE, 0x07E96, 0x0FBC6, 0x1F437, 0x1F438, - 0x1F435, 0x1F436, 0x0A0C3, 0x1F43A, 0x1F439, 0x0FBC7, - 0x1F43B, 0x0FBC9, 0x0FBCA, 0x0FBC8, 0x07E99, 0x0A0C4, - 0x07E9A, 0x1F43C, 0x1F43D, 0x1F43E, 0x0A0C5, 0x050E4, - 0x0FBCB, 0x0FBCC, 0x050E3, 0x07E98, 0x0FBC2, 0x1F42C, - 0x0FBC1, 0x1F42F, 0x1F430, 0x1F42D, 0x1F42E, 0x0A0C1, - 0x1F432, 0x1F433, 0x0FBC3, 0x1F431, 0x0FBC5, 0x1F434, - 0x0FBC4, 0x0A0C2, 0x00AF6, 0x1F444, 0x0FBCF, 0x0261C, - 0x014AB, 0x0A0C8, 0x1F446, 0x1F445, 0x06573, 0x0261D, - 0x1F448, 0x1F447, 0x02A99, 0x0FBD1, 0x0A0C9, 0x1F449, - 0x0FBD0, 0x06574, 0x1F44C, 0x049CF, 0x1F44A, 0x1F44B, - 0x032EC, 0x1F440, 0x1F43F, 0x07E9B, 0x01B62, 0x0388A, - 0x1F441, 0x07E9C, 0x0A0C6, 0x00D6A, 0x0A0C7, 0x0FBCD, - 0x049CE, 0x00EDF, 0x0FBCE, 0x1F443, 0x1F442, 0x07E9D, - 0x03888, 0x0FB91, 0x1F3A8, 0x00E96, 0x00CEA, 0x0FB93, - 0x0FB94, 0x0FB92, 0x1F3A9, 0x03889, 0x0FB95, 0x0A0A7, - 0x0155F, 0x050E0, 0x0A0A8, 0x1F3AB, 0x1F3AA, 0x07E89, - 0x07E8A, 0x0A0AA, 0x0FB96, 0x0A0A9, 0x06567, 0x1F3A2, - 0x1F3A1, 0x02A95, 0x0250A, 0x06568, 0x1F3A4, 0x1F3A3, - 0x050DF, 0x02A96, 0x1F3A5, 0x06569, 0x00C4B, 0x00AFF, - 0x03887, 0x1F3A7, 0x1F3A6, 0x07E88, 0x0261B, 0x1F3BC, - 0x1F3BD, 0x1F3BA, 0x1F3BB, 0x0656C, 0x0FB97, 0x1F3BE, - 0x0656B, 0x1F3C0, 0x0FB98, 0x1F3C1, 0x07E8C, 0x1F3BF, - 0x1F3C2, 0x0FB9A, 0x0FB99, 0x0A0AC, 0x0656D, 0x0FB9B, - 0x1F3C4, 0x1F3C3, 0x07E8D, 0x049C9, 0x0A0AB, 0x1F3AE, - 0x1F3AC, 0x1F3AD, 0x1F3B1, 0x1F3B2, 0x1F3AF, 0x1F3B0, - 0x1F3B5, 0x1F3B6, 0x1F3B7, 0x1F3B3, 0x1F3B4, 0x0656A, - 0x1F3B9, 0x1F3B8, 0x07E8B, 0x03F84, 0x1F3CF, 0x1F3CE, - 0x032EB, 0x0250B, 0x0FB9E, 0x0A0AF, 0x1F3D0, 0x0A0AE, - 0x0A0B1, 0x1F3D1, 0x0A0B0, 0x049CA, 0x1F3D3, 0x1F3D4, - 0x0FBA0, 0x0FB9F, 0x1F3D2, 0x0FBA1, 0x0A0B2, 0x1F3D5, - 0x07E90, 0x07E8E, 0x1F3C6, 0x1F3C5, 0x0656E, 0x1F3C7, - 0x1F3C8, 0x0656F, 0x07E8F, 0x0FB9C, 0x0A0AD, 0x0FB9D, - 0x1F3C9, 0x050E1, 0x01FDF, 0x1F3CC, 0x1F3CD, 0x1F3CA, - 0x1F3CB, 0x00410, 0x0FBA9, 0x1F3DF, 0x1F3DE, 0x0FBA8, - 0x02A97, 0x1F3E1, 0x1F3E0, 0x0250E, 0x0FBAA, 0x1F3E3, - 0x1F3E4, 0x07E91, 0x1F3E2, 0x1F3E7, 0x1F3E8, 0x1F3E5, - 0x1F3E6, 0x1F3EA, 0x1F3EB, 0x1F3EC, 0x1F3E9, 0x0A0B4, - 0x03F85, 0x0FBA4, 0x1F3D6, 0x0FBA2, 0x0FBA3, 0x1F3D8, - 0x0FBA6, 0x1F3D7, 0x0FBA5, 0x1F3DB, 0x0A0B3, 0x1F3DC, - 0x1F3D9, 0x1F3DA, 0x049CB, 0x0FBA7, 0x1F3DD, 0x06570, - 0x0014C, 0x1F4A6, 0x1F4A7, 0x1F4A5, 0x0FBE7, 0x00DEF, - 0x1F4A9, 0x1F4A8, 0x01166, 0x050EB, 0x050EC, 0x1F4AB, - 0x1F4AA, 0x0A0D7, 0x0FBE8, 0x1F4AD, 0x1F4AC, 0x0A0D8, - 0x0A0D9, 0x1F4B0, 0x1F4B1, 0x1F4AE, 0x1F4AF, 0x0FBE6, - 0x1F49C, 0x1F49D, 0x1F49B, 0x0FBE5, 0x07EA2, 0x1F49F, - 0x1F49E, 0x0A0D6, 0x019F6, 0x1F4A1, 0x1F4A2, 0x1F4A0, - 0x050EA, 0x01C9E, 0x1F4A4, 0x1F4A3, 0x0133A, 0x00E4E, - 0x1F4BE, 0x1F4BD, 0x00BEE, 0x001AE, 0x050EE, 0x1F4C0, - 0x1F4BF, 0x050ED, 0x020DA, 0x1F4C2, 0x1F4C1, 0x050EF, - 0x0FBEB, 0x1F4C3, 0x1F4C4, 0x0FBE9, 0x0FBEA, 0x1F4C6, - 0x1F4C7, 0x1F4C5, 0x0A0DC, 0x1F4B4, 0x1F4B5, 0x1F4B2, - 0x1F4B3, 0x03F8A, 0x1F4B7, 0x1F4B8, 0x1F4B6, 0x0A0DA, - 0x02A9B, 0x1F4BA, 0x1F4B9, 0x0145F, 0x004AD, 0x0A0DB, - 0x1F4BC, 0x1F4BB, 0x03F8B, 0x003A6, 0x0A0DE, 0x1F4D1, - 0x1F4D0, 0x0FBED, 0x00DCA, 0x0FBEE, 0x1F4D2, 0x00EFE, - 0x02096, 0x0A0DF, 0x1F4D4, 0x1F4D3, 0x07EA6, 0x0FBEF, - 0x1F4D6, 0x1F4D5, 0x0A0E0, 0x1F4D9, 0x1F4DA, 0x1F4DB, - 0x1F4D7, 0x1F4D8, 0x07EA3, 0x1F4CA, 0x1F4CB, 0x1F4C8, - 0x1F4C9, 0x0388E, 0x0FBEC, 0x1F4CC, 0x049D8, 0x00CEB, - 0x0657A, 0x0A0DD, 0x1F4CD, 0x049D9, 0x00521, 0x1F4CF, - 0x1F4CE, 0x00CFA, 0x01B67, 0x1F4E4, 0x1F4E3, 0x032EF, - 0x00292, 0x0FBF2, 0x1F4E6, 0x1F4E5, 0x0FBF1, 0x014D2, - 0x0A0E5, 0x0A0E4, 0x028AA, 0x1F4E9, 0x0657F, 0x1F4EA, - 0x1F4E7, 0x1F4E8, 0x1F4ED, 0x1F4EE, 0x1F4EB, 0x1F4EC, - 0x0412E, 0x1F4DC, 0x0A0E1, 0x0A0E2, 0x049DA, 0x1F4DE, - 0x1F4DF, 0x1F4DD, 0x0657B, 0x01B66, 0x1F4E0, 0x0FBF0, - 0x0388F, 0x00522, 0x0A0E3, 0x1F4E2, 0x1F4E1, 0x0657E, - 0x007C2, 0x0A0EB, 0x1F4F8, 0x1F4F7, 0x0FBF5, 0x00F7A, - 0x1F4F9, 0x0FBF6, 0x020DB, 0x028AB, 0x1F4FB, 0x1F4FC, - 0x1F4FA, 0x0FBF7, 0x01DFE, 0x0BEFA, 0x1F4FD, 0x07EA7, - 0x1F502, 0x13FC2, 0x1F503, 0x1F4FE, 0x1F4FF, 0x1F4F1, - 0x0FBF3, 0x1F4F2, 0x1F4EF, 0x1F4F0, 0x02576, 0x0A0E7, - 0x1F4F3, 0x0A0E6, 0x07092, 0x0FBF4, 0x1F4F5, 0x1F4F4, - 0x049DB, 0x0096F, 0x1F4F6, 0x0A0EA, 0x02623, 0x006FF, - 0x1F45C, 0x1F45D, 0x1F45B, 0x07E9E, 0x03F88, 0x1F45F, - 0x1F45E, 0x020D7, 0x06575, 0x1F462, 0x0FBD2, 0x1F460, - 0x1F461, 0x1F464, 0x0FBD4, 0x0FBD3, 0x1F463, 0x1F467, - 0x1F468, 0x1F469, 0x1F465, 0x1F466, 0x1F44F, 0x1F450, - 0x1F451, 0x1F44D, 0x1F44E, 0x1F453, 0x1F454, 0x1F452, - 0x020D6, 0x0388B, 0x1F457, 0x1F458, 0x1F455, 0x1F456, - 0x028A9, 0x1F45A, 0x1F459, 0x00DED, 0x020D8, 0x1F472, - 0x1F471, 0x0261F, 0x006F0, 0x0FBD6, 0x1F474, 0x1F473, - 0x050E5, 0x049D3, 0x0FBD7, 0x1F475, 0x015EE, 0x1F477, - 0x0A0CD, 0x1F478, 0x1F476, 0x050E6, 0x1F47A, 0x1F47B, - 0x1F479, 0x0A0CE, 0x0A0CB, 0x1F46A, 0x0A0CA, 0x0261E, - 0x049D0, 0x0A0CC, 0x1F46C, 0x1F46B, 0x06576, 0x049D1, - 0x1F46E, 0x1F46D, 0x01FE2, 0x004DE, 0x049D2, 0x1F470, - 0x1F46F, 0x0FBD5, 0x00376, 0x0FBDB, 0x0FBDC, 0x1F482, - 0x0A0D0, 0x00C5E, 0x1F484, 0x1F483, 0x00BEB, 0x020D9, - 0x06578, 0x1F486, 0x1F485, 0x07E9F, 0x0A0D1, 0x1F487, - 0x07EA0, 0x050E8, 0x1F488, 0x0FBDF, 0x1F489, 0x0FBDD, - 0x0FBDE, 0x050E7, 0x0A0CF, 0x1F47D, 0x1F47C, 0x0FBD8, - 0x06577, 0x1F47F, 0x1F47E, 0x032ED, 0x012BA, 0x03F89, - 0x0FBD9, 0x1F480, 0x032EE, 0x00C4F, 0x1F481, 0x0FBDA, - 0x01B63, 0x00DEE, 0x0FBE1, 0x1F491, 0x0115B, 0x001CE, - 0x049D6, 0x1F493, 0x1F492, 0x0A0D4, 0x049D7, 0x1F495, - 0x1F494, 0x02A9A, 0x0A0D5, 0x0FBE3, 0x1F497, 0x1F496, - 0x0FBE2, 0x0FBE4, 0x1F49A, 0x1F498, 0x1F499, 0x049D4, - 0x1F48A, 0x0A0D2, 0x0FBE0, 0x049D5, 0x0A0D3, 0x1F48C, - 0x1F48B, 0x07EA1, 0x01FE3, 0x1F48E, 0x1F48D, 0x02622, - 0x00520, 0x050E9, 0x1F490, 0x1F48F, 0x06579, 0x0018A, - 0x09FE6, 0x1F0E6, 0x1F0E5, 0x0459C, 0x00DCB, 0x1F0E7, - 0x0FA96, 0x012D0, 0x020A6, 0x1F0E9, 0x1F0EA, 0x1F0E8, - 0x0FA97, 0x09FE7, 0x1F0EC, 0x1F0EB, 0x06370, 0x09FE8, - 0x1F0EE, 0x1F0EF, 0x0FA98, 0x1F0ED, 0x1F0DC, 0x1F0DD, - 0x1F0DE, 0x1F0DA, 0x1F0DB, 0x1F0DF, 0x1F0E0, 0x0FA93, - 0x0FA94, 0x0507C, 0x1F0E2, 0x1F0E3, 0x1F0E1, 0x0507B, - 0x00AAE, 0x1F0E4, 0x0FA95, 0x00F5D, 0x00DB4, 0x0FA9C, - 0x1F0F9, 0x00FF2, 0x003AC, 0x1F0FB, 0x1F0FC, 0x1F0FA, - 0x029E0, 0x025CF, 0x1F0FE, 0x1F0FD, 0x029E1, 0x029E2, - 0x09FE9, 0x1F180, 0x1F0FF, 0x07E04, 0x0FA9D, 0x1F183, - 0x1F181, 0x1F182, 0x0FA9A, 0x1F0F1, 0x0FA99, 0x1F0F0, - 0x0384C, 0x1F0F3, 0x1F0F4, 0x1F0F2, 0x0FA9B, 0x019F7, - 0x1F0F6, 0x1F0F5, 0x02878, 0x0018C, 0x06371, 0x1F0F8, - 0x1F0F7, 0x07E03, 0x002FC, 0x0507E, 0x1F18E, 0x1F18D, - 0x06373, 0x00D2C, 0x1F190, 0x1F18F, 0x01356, 0x01357, - 0x0FAA0, 0x1F192, 0x1F191, 0x0507F, 0x02879, 0x1F194, - 0x1F193, 0x0384D, 0x1F197, 0x0FAA1, 0x0FAA2, 0x1F195, - 0x1F196, 0x1F186, 0x1F187, 0x1F188, 0x1F184, 0x1F185, - 0x0507D, 0x1F189, 0x0FA9E, 0x06372, 0x020A7, 0x07E05, - 0x1F18B, 0x1F18A, 0x09FEA, 0x00AF8, 0x0FA9F, 0x1F18C, - 0x00A30, 0x0106F, 0x1F19F, 0x1F19E, 0x01AD6, 0x005F6, - 0x1F1A1, 0x1F1A2, 0x1F1A0, 0x0FAA8, 0x0099E, 0x0FAA9, - 0x1F1A3, 0x06375, 0x0459E, 0x07E07, 0x1F1A6, 0x1F1A4, - 0x1F1A5, 0x09FEC, 0x0FAAA, 0x1F1A7, 0x09FEB, 0x0FAA4, - 0x1F199, 0x1F198, 0x0FAA3, 0x0FAA6, 0x0459D, 0x1F19B, - 0x1F19A, 0x0FAA5, 0x01C49, 0x07E06, 0x1F19C, 0x03F56, - 0x0077E, 0x05080, 0x1F19D, 0x0FAA7, 0x06374, 0x008A2, - 0x1F1B3, 0x1F1B4, 0x0FAAE, 0x1F1B2, 0x00AB0, 0x1F1B6, - 0x1F1B5, 0x04980, 0x0384E, 0x0FAAF, 0x1F1B8, 0x1F1B7, - 0x06377, 0x04981, 0x1F1BA, 0x1F1B9, 0x07E09, 0x07E0A, - 0x1F1BC, 0x1F1BD, 0x1F1BB, 0x0FAB0, 0x1F1AA, 0x1F1AB, - 0x1F1AC, 0x1F1A8, 0x1F1A9, 0x0FAAC, 0x07E08, 0x0FAAB, - 0x1F1AD, 0x029E3, 0x06376, 0x0FAAD, 0x1F1AE, 0x1F1AF, - 0x0459F, 0x1F1B1, 0x1F1B0, 0x01AD7, 0x00822, 0x1DFF2, - 0x1DFF3, 0x1DFF1, 0x0FA82, 0x03F52, 0x1DFF5, 0x1DFF4, - 0x00BF6, 0x062F8, 0x07DFD, 0x1DFF7, 0x1DFF6, 0x09FE0, - 0x062F9, 0x1DFF9, 0x1DFF8, 0x029A6, 0x0FA83, 0x1DFFC, - 0x1DFFD, 0x1DFFA, 0x1DFFB, 0x13FC3, 0x17DF6, 0x17DF7, - 0x0FA80, 0x0412F, 0x05074, 0x1C24C, 0x05F7C, 0x05F7E, - 0x03848, 0x05F7F, 0x1C24E, 0x1C24D, 0x07DFC, 0x01FC6, - 0x1DFF0, 0x1C24F, 0x02577, 0x029A7, 0x1EF67, 0x1EF66, - 0x024EE, 0x003BE, 0x0FA88, 0x1EF69, 0x1EF68, 0x062FA, - 0x0384B, 0x1EF6B, 0x1EF6A, 0x015EF, 0x05076, 0x0FA89, - 0x1EF6D, 0x1EF6C, 0x07E00, 0x1EF6F, 0x0FA8A, 0x1EF6E, - 0x062FB, 0x1EF60, 0x0FA84, 0x1DFFE, 0x1DFFF, 0x07DFE, - 0x0FA85, 0x1EF62, 0x1EF61, 0x03F54, 0x0384A, 0x1EF63, - 0x0FA86, 0x00E30, 0x002EC, 0x0FA87, 0x1EF65, 0x1EF64, - 0x07DFF, 0x002FE, 0x09FE3, 0x1EF7C, 0x1EF7B, 0x07E01, - 0x0095C, 0x1EF7E, 0x1EF7D, 0x01456, 0x0133B, 0x05077, - 0x1F0C0, 0x1EF7F, 0x062FD, 0x05078, 0x1F0C2, 0x1F0C1, - 0x01C46, 0x03F55, 0x1F0C4, 0x1F0C5, 0x1F0C3, 0x0FA8D, - 0x1EF72, 0x1EF73, 0x1EF74, 0x1EF70, 0x1EF71, 0x062FC, - 0x1EF75, 0x0FA8B, 0x09FE2, 0x0154E, 0x1EF78, 0x0FA8C, - 0x1EF76, 0x1EF77, 0x00F5C, 0x1EF7A, 0x1EF79, 0x00DB2, - 0x0106E, 0x1F0D3, 0x1F0D2, 0x00ED0, 0x0045A, 0x07E02, - 0x0FA8F, 0x1F0D4, 0x1F0D5, 0x01C48, 0x0FA91, 0x0FA90, - 0x025CE, 0x032BE, 0x062FF, 0x1F0D7, 0x1F0D6, 0x0FA92, - 0x09FE5, 0x1F0D9, 0x1F0D8, 0x09FE4, 0x1F0C8, 0x1F0C9, - 0x1F0C6, 0x1F0C7, 0x05079, 0x1F0CB, 0x1F0CC, 0x1F0CA, - 0x0FA8E, 0x0507A, 0x1F0CE, 0x1F0CD, 0x024EF, 0x0018F, - 0x1F0D0, 0x1F0D1, 0x1F0CF, 0x062FE, 0x04986, 0x1F211, - 0x1F210, 0x029E5, 0x0149C, 0x09FFF, 0x1F212, 0x0FAD5, - 0x0FAD6, 0x0FAD8, 0x1F214, 0x1F213, 0x0FAD7, 0x0A000, - 0x0A001, 0x1F216, 0x1F215, 0x0FAD9, 0x0A003, 0x0FADA, - 0x1F217, 0x0A002, 0x0FAD1, 0x1F205, 0x1F203, 0x1F204, - 0x1F207, 0x1F208, 0x1F209, 0x1F206, 0x0FAD2, 0x1F20C, - 0x0FAD3, 0x1F20A, 0x1F20B, 0x00E31, 0x0FAD4, 0x1F20F, - 0x1F20D, 0x1F20E, 0x003BC, 0x1F221, 0x0FADD, 0x1F21F, - 0x1F220, 0x01D2E, 0x1F223, 0x1F222, 0x0384F, 0x0A007, - 0x1F225, 0x1F226, 0x07E18, 0x1F224, 0x1F229, 0x1F22A, - 0x1F227, 0x1F228, 0x01ADD, 0x0A009, 0x1F22B, 0x0A008, - 0x04987, 0x0FADC, 0x07E16, 0x1F218, 0x0FADB, 0x07E15, - 0x1F21B, 0x1F21C, 0x1F219, 0x1F21A, 0x0637A, 0x0A005, - 0x0A006, 0x07E17, 0x0A004, 0x025F0, 0x1F21E, 0x1F21D, - 0x01ADC, 0x05088, 0x1F235, 0x1F234, 0x05087, 0x01978, - 0x1F238, 0x07E1A, 0x1F236, 0x1F237, 0x07E1C, 0x1F239, - 0x0FAE2, 0x07E1B, 0x1F23B, 0x0A00D, 0x1F23C, 0x1F23A, - 0x0FAE3, 0x01979, 0x0A00E, 0x1F23D, 0x04989, 0x1F22E, - 0x1F22F, 0x1F22C, 0x1F22D, 0x1F231, 0x0A00A, 0x1F232, - 0x0FADE, 0x1F230, 0x04988, 0x0FADF, 0x1F233, 0x07E19, - 0x01ADE, 0x0A00C, 0x0FAE1, 0x0FAE0, 0x0A00B, 0x032C2, - 0x1F249, 0x1F24A, 0x1F248, 0x0A010, 0x05089, 0x1F24C, - 0x0A011, 0x1F24B, 0x0A012, 0x0FAEA, 0x1F24E, 0x0508A, - 0x1F24D, 0x0A014, 0x1F250, 0x0A013, 0x1F24F, 0x029E6, - 0x07E1D, 0x1F253, 0x1F251, 0x1F252, 0x0FAE4, 0x0FAE5, - 0x0FAE6, 0x1F23E, 0x1F23F, 0x1F242, 0x0A00F, 0x1F240, - 0x1F241, 0x0FAE8, 0x1F244, 0x1F245, 0x0FAE7, 0x1F243, - 0x0FAE9, 0x1F247, 0x1F246, 0x03850, 0x01286, 0x1F25E, - 0x1F25D, 0x03851, 0x00D2D, 0x1F260, 0x1F261, 0x1F25F, - 0x07E1E, 0x00A68, 0x1F262, 0x0A015, 0x0637C, 0x0508C, - 0x0498A, 0x1F265, 0x1F263, 0x1F264, 0x03852, 0x0FAEE, - 0x1F266, 0x0A016, 0x0FAEB, 0x0FAEC, 0x1F254, 0x1F255, - 0x1F258, 0x0637B, 0x1F259, 0x1F256, 0x1F257, 0x032C3, - 0x0FAED, 0x0508B, 0x03F59, 0x01310, 0x032C4, 0x1F25C, - 0x1F25A, 0x1F25B, 0x04982, 0x09FEE, 0x1F1C4, 0x00FF3, - 0x01457, 0x06378, 0x1F1C6, 0x1F1C5, 0x0FAB4, 0x0287B, - 0x0FAB6, 0x0FAB5, 0x00FF6, 0x03F57, 0x0FAB7, 0x09FEF, - 0x1F1C7, 0x05083, 0x09FF0, 0x1F1C8, 0x0FAB8, 0x01FC8, - 0x09FED, 0x0FAB2, 0x0FAB1, 0x1F1BE, 0x07E0B, 0x05081, - 0x0FAB3, 0x1F1BF, 0x024F0, 0x0287A, 0x1F1C1, 0x1F1C0, - 0x01FC7, 0x00E5A, 0x05082, 0x1F1C3, 0x1F1C2, 0x07E0C, - 0x032C0, 0x0FABE, 0x0FABF, 0x1F1D1, 0x1F1D2, 0x07E10, - 0x1F1D5, 0x1F1D3, 0x1F1D4, 0x0FAC2, 0x0FAC3, 0x1F1D6, - 0x0FAC0, 0x0FAC1, 0x1F1D9, 0x1F1DA, 0x1F1D7, 0x1F1D8, - 0x05085, 0x09FF2, 0x1F1DC, 0x1F1DB, 0x0FAC4, 0x0FAB9, - 0x0FABA, 0x1F1CA, 0x07E0D, 0x1F1C9, 0x1F1CB, 0x1F1CC, - 0x07E0E, 0x0FABB, 0x0FABD, 0x1F1CD, 0x1F1CE, 0x0FABC, - 0x09FF1, 0x07E0F, 0x1F1D0, 0x1F1CF, 0x05084, 0x0287C, - 0x1F1E6, 0x1F1E5, 0x03F58, 0x0287D, 0x09FF6, 0x1F1E9, - 0x1F1E7, 0x1F1E8, 0x07E13, 0x09FF8, 0x1F1EA, 0x09FF7, - 0x1F1ED, 0x09FF9, 0x0FAC8, 0x1F1EB, 0x1F1EC, 0x09FFB, - 0x04984, 0x09FFA, 0x04983, 0x09FF3, 0x1F1DE, 0x1F1DD, - 0x07E11, 0x1F1DF, 0x1F1E0, 0x0FAC6, 0x09FF4, 0x0FAC5, - 0x07E12, 0x1F1E2, 0x1F1E1, 0x05086, 0x00ED2, 0x09FF5, - 0x1F1E4, 0x1F1E3, 0x0FAC7, 0x004D4, 0x1F1F9, 0x1F1FA, - 0x09FFC, 0x0FACD, 0x029E4, 0x0FACE, 0x1F1FB, 0x0287E, - 0x09FFD, 0x0FAD0, 0x1F1FC, 0x0FACF, 0x06379, 0x1F1FE, - 0x1F1FF, 0x1F1FD, 0x09FFE, 0x04985, 0x07E14, 0x1F202, - 0x1F200, 0x1F201, 0x1F1EF, 0x1F1F0, 0x1F1F1, 0x1F1EE, - 0x0FAC9, 0x1F1F3, 0x1F1F4, 0x1F1F2, 0x0FACA, 0x032C1, - 0x1F1F6, 0x0FACC, 0x1F1F5, 0x0FACB, 0x01C9F, 0x1F1F8, - 0x1F1F7, 0x01FC9, 0x000EC, 0x0650B, 0x0650C, 0x07E2B, - 0x029EC, 0x00DB6, 0x0FB04, 0x1F298, 0x0098C, 0x01FCC, - 0x0650D, 0x07E2C, 0x0FB05, 0x0FB06, 0x0FB08, 0x1F29A, - 0x1F299, 0x0FB07, 0x00ED3, 0x05094, 0x1F29B, 0x07E2D, - 0x0FB09, 0x03855, 0x06508, 0x0FB02, 0x1F292, 0x0FB01, - 0x1F295, 0x1F296, 0x1F293, 0x1F294, 0x05093, 0x0FB03, - 0x0650A, 0x07E2A, 0x06509, 0x00BB6, 0x0A02B, 0x1F297, - 0x00A54, 0x00708, 0x1F2A2, 0x1F2A1, 0x007A8, 0x004CA, - 0x029EE, 0x07E2F, 0x05095, 0x0197B, 0x01C4A, 0x0A02D, - 0x07E30, 0x01FCD, 0x0FB0C, 0x0650F, 0x0FB0D, 0x1F2A3, - 0x0650E, 0x01D78, 0x06510, 0x07E31, 0x07E32, 0x04993, - 0x07E2E, 0x0A02C, 0x03F5D, 0x1F29E, 0x1F29F, 0x03856, - 0x1F29C, 0x1F29D, 0x03857, 0x0FB0A, 0x1F2A0, 0x029ED, - 0x004B8, 0x024F5, 0x03F5E, 0x0FB0B, 0x03858, 0x008AC, - 0x0FB13, 0x07E35, 0x0FB12, 0x06512, 0x01C4C, 0x07E36, - 0x0FB14, 0x01550, 0x02882, 0x07E37, 0x07E38, 0x06513, - 0x05096, 0x06514, 0x0A032, 0x1F2A7, 0x1F2A8, 0x006E7, - 0x032CA, 0x1F2A9, 0x0FB15, 0x029EF, 0x07E34, 0x0A02E, - 0x0A02F, 0x0FB0E, 0x07E33, 0x0FB10, 0x06511, 0x1F2A4, - 0x0FB0F, 0x04994, 0x02881, 0x0A031, 0x0A030, 0x0FB11, - 0x01289, 0x1F2A6, 0x1F2A5, 0x01C4B, 0x05098, 0x1F2AE, - 0x1F2AD, 0x07E3A, 0x06519, 0x1F2AF, 0x1F2B0, 0x0FB19, - 0x0A038, 0x05099, 0x1F2B2, 0x1F2B1, 0x07E3B, 0x0FB1A, - 0x1F2B4, 0x1F2B5, 0x04995, 0x1F2B3, 0x0149D, 0x03F60, - 0x0FB1B, 0x025F2, 0x0A033, 0x06516, 0x06515, 0x03F5F, - 0x0A035, 0x1F2AA, 0x07E39, 0x0A034, 0x0FB16, 0x06517, - 0x1F2AC, 0x1F2AB, 0x0FB17, 0x05097, 0x0A036, 0x0A037, - 0x0FB18, 0x06518, 0x0031A, 0x0A03C, 0x1F2BA, 0x1F2B9, - 0x07E3F, 0x0057E, 0x0FB1C, 0x1F2BB, 0x00F5E, 0x01551, - 0x025F3, 0x1F2BC, 0x07E40, 0x04996, 0x00BB8, 0x1F2BD, - 0x04997, 0x0385A, 0x00E32, 0x0651D, 0x1F2BF, 0x1F2BE, - 0x07E41, 0x0651A, 0x0A03A, 0x1F2B7, 0x1F2B6, 0x0A039, - 0x03859, 0x07E3D, 0x07E3C, 0x0509A, 0x029F0, 0x0651C, - 0x0A03B, 0x0651B, 0x07E3E, 0x0096A, 0x1F2B8, 0x0509B, - 0x01D79, 0x0073E, 0x0A01C, 0x1F26B, 0x1F26A, 0x0FAF0, - 0x01312, 0x0FAF1, 0x1F26C, 0x0074E, 0x00DE2, 0x0637D, - 0x0FAF2, 0x1F26D, 0x029E9, 0x025F1, 0x0508D, 0x1F26E, - 0x0072A, 0x01288, 0x1F270, 0x1F271, 0x1F26F, 0x0637E, - 0x1F267, 0x0A018, 0x0498B, 0x0A017, 0x029E7, 0x0A019, - 0x0A01A, 0x1F268, 0x029E8, 0x0175C, 0x0287F, 0x0A01B, - 0x1F269, 0x03F5A, 0x02880, 0x0498C, 0x0FAEF, 0x00DB5, - 0x07E1F, 0x1F27B, 0x1F27A, 0x0FAF4, 0x024F1, 0x1F27E, - 0x0A01F, 0x1F27C, 0x1F27D, 0x0FAF5, 0x1F280, 0x1F27F, - 0x06502, 0x0FAF6, 0x1F282, 0x07E21, 0x07E20, 0x1F281, - 0x029EA, 0x07E23, 0x07E22, 0x0154F, 0x0637F, 0x06500, - 0x0498D, 0x0FAF3, 0x1F272, 0x1F273, 0x0A01D, 0x0508E, - 0x032C5, 0x1F275, 0x1F276, 0x1F274, 0x06501, 0x03853, - 0x0A01E, 0x1F279, 0x1F277, 0x1F278, 0x0074F, 0x03854, - 0x032C7, 0x0FAFA, 0x1F286, 0x029EB, 0x07E25, 0x0A024, - 0x024F3, 0x01FCA, 0x0508F, 0x032C8, 0x1F287, 0x0A025, - 0x07E26, 0x0A026, 0x1F288, 0x1F289, 0x006E6, 0x0498E, - 0x1F28B, 0x1F28A, 0x032C9, 0x032C6, 0x0A021, 0x0A022, - 0x0A020, 0x03F5B, 0x1F283, 0x1F284, 0x06503, 0x0FAF7, - 0x024F2, 0x07E24, 0x1F285, 0x0FAF8, 0x01313, 0x01ADF, - 0x0FAF9, 0x0A023, 0x00AB1, 0x0055E, 0x1F28F, 0x1F28E, - 0x00972, 0x005FA, 0x024F4, 0x0FAFE, 0x1F290, 0x04990, - 0x020BC, 0x0FAFF, 0x1F291, 0x01D2F, 0x04991, 0x0A02A, - 0x05092, 0x0A029, 0x0FB00, 0x04992, 0x06507, 0x06506, - 0x01FCB, 0x03F5C, 0x05090, 0x06504, 0x0A027, 0x1F28C, - 0x1F28D, 0x07E28, 0x07E27, 0x0A028, 0x05091, 0x0FAFC, - 0x0FAFB, 0x0197A, 0x003D6, 0x0FAFD, 0x07E29, 0x0498F, - 0x06505, 0x00056, 0x020C0, 0x02888, 0x0005C, 0x0005A, - 0x0071E, 0x00CE4, 0x00A32, 0x005D6, 0x00A34, 0x0288A, - 0x02889, 0x00A33, 0x049A2, 0x0A046, 0x01D7A, 0x025F9, - 0x0A045, 0x01315, 0x01316, 0x07E4B, 0x01458, 0x00676, - 0x00F71, 0x01B51, 0x006FD, 0x07E4A, 0x06529, 0x01768, - 0x00AB3, 0x07E49, 0x009E4, 0x03F64, 0x050A1, 0x00DE3, - 0x00064, 0x008B8, 0x00AB4, 0x00BBB, 0x007FA, 0x0003C, - 0x009E7, 0x00AFA, 0x01459, 0x00AB5, 0x001AF, 0x03862, - 0x0288C, 0x0019E, 0x00BFD, 0x01C51, 0x0149F, 0x00F73, - 0x029FA, 0x07E4C, 0x0A047, 0x1F2D4, 0x03863, 0x00F74, - 0x01B52, 0x01B53, 0x050A2, 0x0137D, 0x006E8, 0x008A4, - 0x029F9, 0x00E33, 0x006E0, 0x03F65, 0x049A3, 0x1F2D3, - 0x03861, 0x00A35, 0x0197C, 0x00F72, 0x012D1, 0x0288B, - 0x0015C, 0x01FCF, 0x049A4, 0x001A6, 0x00BBC, 0x1F2D5, - 0x0A048, 0x00AB6, 0x0075A, 0x020C2, 0x03864, 0x0104E, - 0x050A5, 0x01D7B, 0x0A049, 0x1F2D6, 0x024F8, 0x0652B, - 0x1F2D7, 0x03865, 0x025FA, 0x07E4E, 0x014A0, 0x0652C, - 0x029FC, 0x00E5D, 0x00CE5, 0x0288D, 0x0098F, 0x006E9, - 0x0FB2C, 0x0652A, 0x01C52, 0x0104D, 0x0FB2B, 0x0128B, - 0x050A3, 0x07E4D, 0x029FB, 0x00990, 0x01FD0, 0x024F7, - 0x050A4, 0x020C1, 0x01B54, 0x1F2DD, 0x0FB30, 0x0FB2E, - 0x0FB2F, 0x049A6, 0x1F2DF, 0x1F2DE, 0x0288E, 0x029FD, - 0x0FB31, 0x025FD, 0x07E4F, 0x1F2E0, 0x0652E, 0x1F2E2, - 0x1F2E1, 0x0A04D, 0x0128C, 0x03F67, 0x0FB33, 0x0FB32, - 0x01B55, 0x025FC, 0x03F66, 0x0652D, 0x025FB, 0x0083C, - 0x1F2DA, 0x0FB2D, 0x1F2D8, 0x1F2D9, 0x0A04B, 0x050A6, - 0x050A7, 0x024F9, 0x0A04A, 0x0A04C, 0x1F2DC, 0x1F2DB, - 0x049A5, 0x00538, 0x0FB35, 0x0FB34, 0x01147, 0x0051E, - 0x03866, 0x0A04F, 0x1F2E7, 0x024FA, 0x002BC, 0x1F2E8, - 0x0FB36, 0x00DE4, 0x01555, 0x050AA, 0x1F2E9, 0x0FB37, - 0x0288F, 0x01FD2, 0x1F2EA, 0x0FB38, 0x032D0, 0x0652F, - 0x1F2E3, 0x020C3, 0x01FD1, 0x025FE, 0x03F68, 0x0A04E, - 0x06530, 0x01769, 0x01D7C, 0x1F2E4, 0x050A8, 0x00ED4, - 0x0099F, 0x050A9, 0x1F2E6, 0x1F2E5, 0x06531, 0x00F5F, - 0x0FB20, 0x0FB1F, 0x006B4, 0x0067C, 0x029F1, 0x1F2C2, - 0x1F2C1, 0x032CB, 0x0149E, 0x0509E, 0x1F2C3, 0x00A6A, - 0x00E5B, 0x025F4, 0x0FB21, 0x1F2C4, 0x1F2C5, 0x02883, - 0x0651F, 0x0FB22, 0x03F61, 0x0509C, 0x04998, 0x0FB1D, - 0x07E42, 0x0175D, 0x0107A, 0x0A03D, 0x07E43, 0x04999, - 0x01B50, 0x0509D, 0x0651E, 0x0104A, 0x0137C, 0x0499A, - 0x0FB1E, 0x1F2C0, 0x07E44, 0x0385C, 0x07E45, 0x0A040, - 0x1F2CA, 0x1F2CB, 0x032CC, 0x1F2CD, 0x1F2CC, 0x0385D, - 0x02884, 0x06523, 0x03F63, 0x1F2CE, 0x0FB24, 0x0FB25, - 0x1F2D1, 0x1F2CF, 0x1F2D0, 0x00F70, 0x07E46, 0x0FB26, - 0x1F2D2, 0x0499C, 0x03F62, 0x0095E, 0x01C4D, 0x0499B, - 0x00BF7, 0x06520, 0x1F2C6, 0x0FB23, 0x0A03E, 0x0A03F, - 0x1F2C7, 0x025F5, 0x0385B, 0x06521, 0x0509F, 0x1F2C9, - 0x1F2C8, 0x06522, 0x00AF9, 0x0A042, 0x0FB27, 0x00A56, - 0x006DE, 0x029F2, 0x029F3, 0x032CD, 0x032CE, 0x02886, - 0x0385E, 0x07E48, 0x0175F, 0x050A0, 0x0FB29, 0x01C4F, - 0x029F4, 0x0FB28, 0x01553, 0x0A043, 0x025F6, 0x01314, - 0x006FC, 0x0098E, 0x02885, 0x01552, 0x0A041, 0x06525, - 0x0128A, 0x020BD, 0x06524, 0x01C4E, 0x07E47, 0x0499D, - 0x00CE2, 0x0071A, 0x06526, 0x01FCE, 0x0175E, 0x024F6, - 0x00046, 0x009E2, 0x01C50, 0x00DB7, 0x00BB9, 0x00188, - 0x06527, 0x0499E, 0x0017C, 0x00D2F, 0x025F7, 0x00BBA, - 0x00DB8, 0x02887, 0x049A1, 0x06528, 0x0499F, 0x049A0, - 0x0104C, 0x020BF, 0x0FB2A, 0x029F8, 0x025F8, 0x00A31, - 0x0051C, 0x01554, 0x029F5, 0x00BFC, 0x032CF, 0x0A044, - 0x0385F, 0x029F6, 0x00AB2, 0x020BE, 0x00E5C, 0x00A57, - 0x00D2E, 0x001AC, 0x029F7, 0x03860, 0x00125, +static const uint8_t on2avc_cb5_bits[ON2AVC_CB_5_6_CODES] = { + 1, 7, 8, 10, 10, 10, 11, 12, 14, 14, 14, 14, 7, 10, 11, 14, 14, 14, 14, + 13, 13, 10, 12, 13, 15, 15, 15, 15, 12, 12, 10, 10, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 14, 14, 14, 14, 11, 12, 12, 7, + 10, 11, 13, 13, 13, 13, 11, 12, 12, 11, 11, 10, 11, 11, 10, 14, 14, 14, 14, + 14, 14, 14, 14, 12, 12, 7, 10, 10, 11, 12, 13, 14, 14, 12, 12, 12, 12, 10, + 13, 13, 13, 13, 12, 12, 12, 13, 16, 17, 17, 16, 16, 16, 16, 16, 16, 12, 12, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 14, 14, 14, + 14, 14, 14, 14, 14, 12, 13, 14, 14, 12, 12, 10, 11, 12, 12, 10, 12, 13, 13, + 12, 12, 10, 12, 12, 12, 12, 10, 11, 11, 10, 11, 11, 10, 10, 11, 14, 15, 15, + 14, 14, 14, 14, 14, 14, 11, 12, 13, 13, 8, 9, 10, 10, 9, 10, 12, 12, 12, + 13, 13, 9, 10, 11, 12, 13, 15, 15, 15, 15, 8, 8, 8, 11, 12, 12, 11, 12, + 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, + 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 12, 13, 13, 9, 12, 12, + 12, 13, 13, 11, 12, 12, 9, 10, 11, 13, 13, 13, 14, 15, 17, 17, 17, 17, 8, + 9, 11, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 8, 10, + 13, 14, 14, 13, 13, 12, 12, 11, 12, 13, 14, 17, 17, 17, 17, 17, 17, 17, 17, + 11, 11, 10, 11, 13, 13, 13, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 16, 17, 17, 12, 12, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 9, 11, 12, + 13, 14, 14, 12, 13, 13, 12, 12, 10, 11, 11, 10, 12, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 8, 14, 14, 14, 14, 13, 14, 14, 13, 13, 13, 13, 12, + 13, 13, 12, 13, 13, 10, 11, 12, 12, 7, 7, 7, 7, 7, 11, 12, 13, 13, 11, + 12, 13, 15, 16, 16, 15, 15, 12, 12, 12, 12, 11, 11, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, + 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, + 13, 13, 13, 12, 12, 12, 12, 12, 12, 7, 7, 7, 11, 12, 12, 11, 11, 11, 12, + 13, 14, 14, 11, 12, 13, 13, 9, 10, 12, 13, 13, 12, 12, 7, 7, 7, 7, 7, + 9, 12, 13, 14, 14, 12, 12, 11, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 13, + 14, 14, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 11, 12, 13, 14, 16, 16, + 16, 16, 7, 10, 10, 11, 12, 12, 11, 11, 9, 13, 13, 13, 13, 12, 13, 13, 12, + 12, 12, 13, 16, 16, 16, 16, 16, 16, 16, 16, 7, 8, 9, 11, 12, 12, 11, 12, + 12, 7, 11, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, + 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 13, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 11, + 11, 12, 12, 12, 12, 8, 9, 11, 13, 14, 14, 13, 13, 13, 13, 13, 13, 12, 13, + 13, 8, 8, 10, 12, 12, 12, 12, 10, 11, 12, 12, 9, 12, 12, 12, 12, 11, 11, + 11, 11, 11, 11, 10, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, + 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 11, 11, 7, + 11, 11, 11, 11, 11, 11, 11, 12, 12, 11, 11, 11, 12, 13, 13, 10, 10, 9, 12, + 13, 13, 12, 12, 11, 11, 9, 10, 11, 12, 13, 15, 15, 15, 15, 8, 9, 11, 11, + 11, 12, 15, 15, 15, 15, 15, 15, 15, 15, 9, 10, 11, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 15, 15, 15, 15, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 13, 14, 14, 13, 13, 13, 13, 12, 13, 13, 9, 11, 12, + 12, 11, 11, 11, 12, 13, 13, 11, 12, 12, 10, 11, 12, 13, 13, 6, 6, 6, 10, + 11, 11, 10, 10, 11, 13, 13, 13, 13, 11, 12, 13, 14, 15, 18, 18, 18, 18, 18, + 18, 18, 18, 10, 12, 12, 12, 12, 9, 9, 9, 9, 6, 11, 14, 14, 14, 14, 14, + 14, 14, 14, 13, 14, 14, 13, 13, 12, 13, 13, 12, 12, 12, 12, 11, 11, 11, 12, + 12, 11, 11, 10, 11, 12, 13, 14, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 13, 13, 13, 13, 13, 13, 13, 13, 11, 12, 12, 11, 12, 13, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 18, 18, 11, 11, 11, 11, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, + 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 14, 14, 14, 14, 13, 14, 14, 11, + 13, 13, 13, 13, }; -static const uint8_t on2avc_cb7_bits[ON2AVC_CB7_8_CODES] = { - 1, 8, 8, 8, 8, 7, - 10, 11, 7, 11, 12, 10, - 10, 12, 14, 14, 15, 14, - 11, 11, 13, 13, 12, 10, - 11, 13, 12, 12, 14, 14, - 14, 13, 11, 12, 9, 10, - 12, 7, 11, 11, 7, 7, - 11, 12, 7, 7, 10, 9, - 11, 11, 11, 13, 13, 12, - 14, 15, 11, 12, 14, 12, - 13, 12, 12, 12, 12, 11, - 11, 15, 15, 10, 12, 15, - 12, 12, 14, 11, 7, 10, - 8, 11, 11, 11, 16, 13, - 12, 14, 12, 16, 15, 12, - 13, 14, 14, 12, 14, 17, - 15, 16, 16, 12, 14, 16, - 14, 12, 12, 13, 16, 14, - 12, 17, 16, 16, 15, 13, - 13, 14, 12, 14, 12, 16, - 16, 12, 16, 17, 16, 17, - 15, 16, 16, 15, 17, 15, - 17, 17, 16, 17, 16, 15, - 14, 16, 14, 16, 14, 11, - 14, 16, 15, 11, 17, 17, - 15, 13, 17, 16, 17, 17, - 15, 14, 17, 15, 14, 16, - 11, 16, 17, 16, 14, 12, - 17, 15, 12, 13, 15, 17, - 16, 13, 15, 17, 16, 13, - 15, 16, 17, 15, 13, 14, - 16, 17, 17, 14, 14, 16, - 16, 13, 12, 15, 17, 16, - 14, 11, 15, 15, 12, 10, - 14, 16, 16, 16, 12, 15, - 16, 12, 12, 13, 15, 17, - 14, 12, 15, 17, 14, 14, - 15, 16, 16, 16, 16, 16, - 16, 16, 16, 12, 16, 17, - 14, 11, 13, 15, 17, 15, - 12, 14, 16, 11, 14, 17, - 17, 14, 15, 17, 14, 17, - 16, 15, 17, 15, 14, 17, - 15, 14, 17, 17, 12, 15, - 16, 14, 12, 13, 16, 13, - 16, 16, 15, 16, 16, 16, - 17, 17, 16, 14, 16, 14, - 17, 17, 11, 14, 12, 13, - 15, 12, 14, 15, 12, 13, - 14, 12, 13, 14, 14, 16, - 17, 15, 11, 12, 14, 15, - 13, 12, 12, 14, 14, 13, - 15, 17, 16, 16, 14, 14, - 13, 13, 14, 12, 16, 17, - 12, 7, 12, 12, 7, 7, - 11, 11, 8, 10, 11, 13, - 13, 11, 15, 14, 12, 10, - 14, 11, 11, 13, 12, 11, - 12, 13, 12, 15, 14, 12, - 11, 14, 11, 15, 13, 11, - 7, 11, 11, 9, 10, 7, - 13, 14, 7, 7, 12, 12, - 12, 11, 12, 17, 14, 12, - 14, 16, 14, 14, 14, 11, - 12, 12, 11, 13, 15, 14, - 13, 15, 16, 14, 14, 15, - 12, 14, 14, 12, 7, 11, - 12, 12, 11, 7, 12, 13, - 13, 12, 9, 14, 14, 9, - 12, 12, 12, 13, 13, 14, - 15, 14, 14, 12, 11, 14, - 13, 11, 12, 13, 14, 14, - 13, 15, 15, 16, 14, 12, - 14, 12, 12, 14, 9, 14, - 13, 9, 12, 17, 15, 12, - 12, 14, 13, 13, 13, 13, - 14, 16, 13, 16, 15, 12, - 14, 16, 13, 14, 12, 11, - 13, 17, 15, 13, 15, 17, - 15, 13, 15, 13, 15, 17, - 13, 11, 14, 15, 13, 13, - 14, 17, 17, 17, 16, 14, - 17, 16, 15, 16, 17, 16, - 14, 15, 17, 15, 17, 16, - 14, 14, 14, 15, 12, 13, - 14, 17, 16, 14, 16, 17, - 17, 17, 14, 17, 17, 15, - 17, 15, 17, 16, 16, 11, - 17, 16, 12, 12, 17, 17, - 15, 15, 14, 17, 14, 13, - 14, 16, 16, 15, 13, 14, - 16, 14, 13, 14, 15, 17, - 14, 12, 14, 17, 16, 14, - 12, 16, 14, 13, 11, 15, - 17, 16, 13, 12, 15, 17, - 10, 12, 13, 16, 17, 14, - 13, 14, 15, 12, 13, 14, - 15, 17, 14, 14, 16, 15, - 14, 14, 17, 17, 14, 13, - 14, 16, 17, 15, 13, 15, - 15, 12, 11, 14, 17, 16, - 14, 13, 16, 15, 17, 16, - 15, 17, 16, 15, 15, 17, - 15, 16, 17, 16, 17, 17, - 17, 13, 12, 14, 17, 14, - 13, 15, 14, 17, 14, 14, - 16, 15, 16, 14, 15, 14, - 15, 17, 14, 17, 17, 15, - 12, 17, 17, 12, 12, 14, - 13, 14, 13, 14, 16, 15, - 13, 15, 17, 13, 13, 14, - 11, 13, 14, 13, 12, 14, - 15, 13, 17, 15, 14, 15, - 16, 13, 16, 16, 14, 12, - 14, 13, 14, 14, 7, 12, - 13, 12, 12, 9, 14, 14, - 9, 12, 14, 12, 12, 12, - 14, 15, 15, 15, 11, 11, - 13, 13, 12, 12, 13, 15, - 14, 14, 15, 16, 15, 15, - 12, 14, 12, 13, 14, 9, - 14, 13, 9, 8, 15, 15, - 15, 15, 12, 16, 16, 12, - 14, 15, 15, 15, 16, 17, - 17, 17, 17, 16, 15, 15, - 17, 15, 14, 15, 17, 16, - 15, 15, 17, 17, 16, 13, - 15, 15, 15, 15, 12, 15, - 16, 11, 12, 17, 16, 11, - 11, 15, 15, 15, 14, 14, - 15, 17, 14, 17, 15, 16, - 16, 16, 14, 17, 15, 15, - 13, 16, 15, 14, 15, 16, - 17, 15, 16, 14, 15, 16, - 13, 11, 14, 15, 16, 14, - 12, 16, 16, 16, 14, 12, - 16, 17, 13, 14, 13, 16, - 17, 16, 15, 15, 17, 17, - 14, 15, 15, 15, 15, 12, - 14, 17, 16, 15, 15, 17, - 17, 17, 15, 16, 16, 14, - 16, 13, 17, 16, 14, 15, - 16, 17, 15, 16, 16, 17, - 15, 16, 14, 17, 17, 16, - 16, 14, 15, 17, 17, 15, - 14, 14, 15, 13, 16, 17, - 14, 16, 17, 16, 16, 16, - 16, 17, 17, 16, 14, 17, - 16, 15, 16, 11, 17, 17, - 16, 16, 13, 17, 16, 14, - 14, 16, 17, 15, 15, 13, - 16, 15, 15, 15, 16, 15, - 16, 15, 12, 15, 17, 16, - 15, 12, 15, 16, 13, 12, - 15, 16, 17, 14, 11, 17, - 16, 13, 12, 15, 17, 17, - 15, 13, 16, 15, 12, 13, - 15, 17, 17, 14, 15, 17, - 15, 14, 17, 15, 17, 17, - 16, 12, 17, 17, 17, 16, - 14, 15, 17, 11, 13, 15, - 17, 16, 15, 12, 17, 17, - 11, 15, 17, 17, 16, 14, - 17, 15, 17, 16, 14, 17, - 17, 15, 16, 17, 14, 16, - 17, 14, 17, 16, 15, 14, - 17, 17, 12, 17, 17, 17, - 15, 15, 17, 16, 17, 15, - 14, 17, 14, 16, 17, 12, - 14, 17, 16, 17, 13, 17, - 16, 13, 15, 16, 15, 16, - 14, 15, 17, 17, 15, 14, - 14, 16, 17, 14, 11, 15, - 16, 16, 14, 16, 17, 17, - 15, 14, 15, 15, 15, 15, - 13, 15, 17, 14, 11, 17, - 17, 12, 11, 15, 17, 17, - 15, 14, 17, 16, 14, 17, - 17, 15, 15, 16, 15, 15, - 16, 14, 14, 15, 15, 15, - 16, 17, 15, 15, 16, 14, - 15, 16, 13, 11, 14, 16, - 17, 14, 13, 17, 17, 14, - 12, 16, 16, 17, 16, 17, - 17, 17, 16, 17, 17, 17, - 17, 17, 17, 17, 16, 17, - 17, 17, 17, 17, 17, 17, - 16, 17, 17, 16, 17, 17, - 16, 13, 16, 17, 16, 16, - 11, 17, 17, 17, 16, 15, - 17, 17, 14, 16, 16, 17, - 16, 17, 17, 17, 17, 17, - 17, 16, 16, 17, 15, 15, - 17, 17, 16, 15, 16, 17, - 16, 16, 15, 16, 17, 16, - 14, 13, 17, 17, 13, 15, - 17, 17, 14, 12, 17, 17, - 16, 15, 15, 17, 17, 15, - 17, 16, 17, 16, 17, 17, - 17, 17, 16, 13, 16, 17, - 16, 17, 17, 17, 17, 17, - 16, 17, 15, 16, 13, 16, - 16, 16, 15, 16, 17, 17, - 17, 17, 16, 17, 17, 16, - 17, 16, 16, 16, 15, 16, - 15, 17, 17, 17, 16, 15, - 16, 16, 15, 15, 16, 17, - 16, 17, 17, 17, 17, 16, - 17, 17, 16, 17, 16, 17, - 16, 16, 12, 17, 16, 14, - 13, 16, 17, 17, 15, 14, - 17, 17, 14, 16, 16, 17, - 16, 15, 17, 15, 17, 17, - 14, 17, 17, 15, 13, 14, - 17, 15, 16, 12, 16, 16, - 15, 12, 16, 17, 17, 15, - 14, 16, 17, 12, 12, 16, - 16, 16, 17, 14, 16, 16, - 13, 15, 16, 17, 17, 15, - 15, 16, 16, 16, 15, 17, - 17, 14, 14, 15, 17, 17, - 15, 14, 17, 15, 12, 12, - 14, 17, 17, 15, 14, 17, - 17, 17, 17, 15, 16, 17, - 15, 17, 16, 17, 15, 17, - 17, 16, 16, 16, 15, 16, - 17, 17, 15, 15, 16, 17, - 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 15, - 17, 17, 15, 14, 17, 17, - 14, 14, 16, 16, 17, 16, - 16, 17, 16, 15, 17, 17, - 16, 16, 17, 16, 16, 17, - 15, 15, 17, 17, 15, 17, - 17, 15, 15, 16, 16, 16, - 17, 15, 13, 17, 17, 17, - 17, 11, 16, 17, 17, 16, - 14, 17, 17, 14, 16, 17, - 17, 15, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 16, - 14, 16, 17, 16, 16, 17, - 16, 17, 16, 17, 16, 17, - 17, 17, 15, 16, 17, 15, - 9, 17, 17, 17, 16, 12, - 17, 17, 13, 15, 15, 17, - 17, 16, 16, 17, 17, 16, - 16, 17, 17, 17, 17, 16, - 17, 17, 17, 16, 15, 17, - 17, 16, 13, 17, 17, 17, - 15, 13, 17, 17, 13, 12, - 17, 17, 12, 9, 15, 17, - 17, 15, 14, 17, 17, 15, - 16, 17, 17, 16, 16, 17, - 17, 17, 16, 17, 17, 17, - 17, 14, 17, 17, 17, 16, - 14, 17, 17, 13, 11, 16, - 17, 17, 14, 10, 16, 17, - 17, 16, 12, 16, 17, 12, - 14, 16, 17, 17, 15, 16, - 17, 17, 16, 17, 17, 17, - 17, 17, 15, 17, 17, 17, - 17, 14, 16, 17, 15, 12, - 15, 16, 17, 15, 11, 17, - 17, 12, 13, 17, 17, 14, - 10, 16, 17, 17, 16, 13, - 16, 16, 14, 17, 15, 17, - 17, 17, 17, 17, 17, 17, - 15, 17, 16, 16, 15, 17, - 17, 17, 15, 13, 17, 16, - 14, 11, 16, 17, 17, 15, - 11, 16, 17, 17, 16, 12, - 17, 16, 14, 14, 17, 17, - 17, 16, 13, 16, 17, 15, - 17, 17, 17, 17, 17, 17, - 16, 17, 17, 17, 14, 16, - 17, 16, 15, 16, 17, 17, - 15, 12, 17, 16, 14, 11, - 17, 17, 17, 15, 14, 17, - 17, 14, 15, 17, 16, 17, - 17, 17, 16, 16, 17, 17, - 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, - 14, 14, 17, 17, 17, 17, - 14, 17, 17, 12, 14, 17, - 17, 14, 11, 16, 17, 17, - 15, 15, 16, 17, 13, 17, - 16, 17, 17, 15, 17, 17, - 17, 16, 16, 17, 16, 14, - 15, 16, 17, 17, 15, 15, - 17, 17, 13, 11, 15, 17, - 17, 16, 10, 16, 16, 17, - 16, 12, 17, 17, 12, 14, - 15, 17, 17, 15, 16, 17, - 15, 15, 17, 16, 17, 16, - 16, 15, 16, 17, 17, 16, - 15, 17, 17, 14, 13, 14, - 16, 17, 14, 12, 17, 16, - 13, 12, 16, 17, 13, 9, - 15, 17, 17, 16, 15, 17, - 17, 14, 16, 16, 17, 17, - 16, 16, 17, 17, 17, 15, - 17, 16, 16, 15, 16, 17, - 17, 15, 13, 17, 17, 14, - 11, 15, 17, 17, 15, 9, - 16, 17, 17, 15, 12, 17, - 16, 13, 14, 17, 17, 17, - 16, 16, 17, 17, 15, 16, - 17, 17, 16, 17, 17, 17, - 17, 17, 17, 17, 17, 16, - 16, 15, 17, 17, 17, 15, - 12, 17, 16, 12, 12, 16, - 17, 12, 10, 17, 17, 17, - 14, 14, 17, 17, 14, 14, - 16, 17, 17, 15, 16, 17, - 17, 17, 16, 17, 16, 17, - 14, 17, 17, 17, 16, 13, - 17, 17, 14, 9, 15, 17, - 17, 15, 10, 15, 17, 17, - 15, 12, 17, 17, 13, 13, - 16, 17, 17, 15, 14, 17, - 17, 14, 17, 16, 16, 17, - 17, 17, 17, 17, 17, 17, - 15, 17, 16, 15, 14, 15, - 17, 17, 16, 12, 16, 17, - 12, 13, 17, 17, 13, 11, - 17, 17, 17, 16, 12, 16, - 17, 15, 15, 15, 17, 17, - 17, 16, 16, 17, 16, 16, - 17, 17, 16, 16, 15, 17, - 17, 16, 13, 15, 17, 14, - 11, 15, 17, 16, 15, 12, - 17, 17, 16, 17, 12, 17, - 17, 15, 14, 16, 17, 17, - 15, 15, 17, 17, 15, 15, - 17, 17, 17, 16, 17, 17, - 17, 17, 17, 16, 15, 16, - 17, 14, 15, 16, 17, 17, - 15, 17, 17, 13, 12, 17, - 17, 17, 16, 14, 17, 17, - 12, 15, 15, 17, 17, 16, - 15, 17, 17, 14, 16, 17, - 17, 17, 17, 17, 17, 17, - 16, 15, 15, 17, 15, 15, - 14, 15, 17, 17, 15, 13, - 17, 17, 14, 14, 17, 17, - 14, 10, 16, 17, 17, 15, - 14, 17, 17, 13, 15, 16, - 17, 17, 15, 17, 16, 17, - 15, 17, 16, 17, 17, 15, - 16, 17, 17, 14, 14, 17, - 16, 12, 10, 16, 17, 17, - 15, 10, 16, 17, 17, 15, - 12, 17, 17, 13, 13, 15, - 17, 17, 15, 15, 17, 17, - 13, 14, 17, 17, 17, 16, - 17, 17, 17, 17, 17, 15, - 17, 16, 16, 13, 17, 16, - 17, 17, 12, 17, 17, 12, - 13, 17, 17, 12, 11, 15, - 16, 17, 17, 13, 16, 16, - 14, 14, 15, 17, 17, 16, - 16, 17, 17, 16, 17, 17, - 17, 17, 15, 17, 17, 17, - 16, 15, 17, 17, 14, 9, - 17, 17, 17, 15, 15, 17, - 17, 14, 13, 16, 17, 16, - 16, 16, 17, 17, 16, 16, - 16, 17, 17, 16, 16, 16, - 17, 16, 16, 17, 17, 17, - 17, 17, 17, 17, 16, 17, - 16, 17, 17, 12, 16, 17, - 17, 17, 10, 17, 16, 17, - 17, 13, 17, 17, 14, 16, - 17, 17, 15, 17, 17, 17, - 17, 17, 13, 16, 17, 16, - 15, 16, 15, 17, 16, 15, - 17, 17, 17, 17, 15, 16, - 16, 15, 16, 14, 17, 17, - 13, 15, 17, 17, 15, 13, - 17, 15, 17, 17, 15, 17, - 16, 15, 17, 16, 17, 17, - 16, 13, 16, 17, 15, 17, - 17, 17, 17, 17, 16, 17, - 16, 17, 15, 16, 17, 15, - 13, 16, 16, 16, 16, 14, - 17, 17, 17, 16, 15, 17, - 16, 17, 16, 16, 17, 15, - 17, 16, 17, 16, 17, 14, - 15, 17, 17, 17, 16, 16, - 16, 17, 17, 17, 16, 17, - 17, 16, 17, 17, 16, 17, - 16, 17, 17, 14, 13, 17, - 17, 14, 12, 17, 17, 17, - 15, 12, 17, 16, 15, 15, - 15, 17, 17, 17, 14, 16, - 17, 16, 16, 16, 17, 17, - 17, 15, 17, 17, 17, 14, - 16, 15, 14, 13, 14, 17, - 17, 17, 15, 16, 17, 12, - 13, 15, 17, 17, 16, 14, - 16, 16, 12, 14, 16, 16, - 17, 15, 16, 17, 16, 13, - 16, 16, 16, 17, 15, 15, - 16, 17, 14, 14, 17, 17, - 13, 12, 15, 17, 17, 15, - 14, 16, 16, 17, 17, 15, - 17, 17, 17, 16, 16, 17, - 16, 16, 17, 17, 17, 17, - 15, 16, 17, 17, 16, 16, - 16, 17, 15, 17, 17, 17, - 15, 16, 16, 17, 17, 16, - 16, 15, 17, 17, 15, 14, - 17, 17, 14, 14, 16, 17, - 17, 17, 15, 16, 17, 16, - 17, 16, 16, 17, 17, 16, - 15, 16, 15, 16, 17, 17, - 15, 17, 17, 16, 16, 16, - 15, 17, 17, 15, 12, 16, - 17, 17, 16, 11, 17, 17, - 16, 16, 14, 16, 17, 14, - 16, 16, 17, 16, 15, 17, - 17, 17, 16, 15, 15, 17, - 17, 17, 17, 17, 17, 17, - 16, 17, 17, 17, 16, 14, - 17, 16, 17, 16, 13, 17, - 17, 13, 8, 15, 15, 15, - 14, 12, 16, 17, 12, 13, - 15, 15, 16, 16, 16, 17, - 17, 16, 12, 15, 17, 15, - 16, 14, 15, 16, 17, 16, - 17, 17, 17, 17, 15, 16, - 15, 15, 15, 12, 16, 17, - 12, 11, 17, 17, 11, 11, - 14, 15, 15, 13, 13, 16, - 15, 13, 16, 15, 16, 17, - 15, 13, 15, 15, 15, 15, - 15, 16, 14, 17, 17, 14, - 17, 17, 14, 16, 17, 14, - 11, 14, 14, 16, 14, 12, - 16, 15, 16, 15, 13, 15, - 16, 13, 14, 15, 15, 15, - 15, 15, 16, 17, 17, 11, - 14, 17, 16, 14, 15, 16, - 16, 16, 15, 16, 15, 17, - 16, 15, 14, 16, 16, 16, - 13, 17, 17, 13, 15, 17, - 17, 15, 15, 17, 17, 16, - 16, 15, 17, 17, 15, 16, - 17, 17, 15, 17, 13, 14, - 16, 14, 16, 15, 15, 14, - 16, 17, 15, 16, 16, 15, - 17, 17, 16, 15, 16, 16, - 16, 15, 10, 16, 17, 17, - 15, 11, 16, 17, 12, 13, - 14, 17, 15, 15, 12, 17, - 15, 14, 12, 15, 17, 17, - 15, 15, 16, 17, 17, 16, - 14, 15, 15, 15, 14, 15, - 16, 15, 15, 12, 17, 15, - 13, 11, 16, 17, 17, 16, - 13, 16, 17, 11, 12, 15, - 16, 17, 14, 14, 15, 17, - 11, 13, 17, 17, 17, 15, - 17, 16, 15, 16, 14, 16, - 16, 17, 14, 13, 14, 16, - 17, 14, 14, 15, 16, 12, - 15, 17, 17, 16, 14, 17, - 16, 17, 17, 16, 17, 17, - 15, 16, 17, 15, 15, 17, - 14, 15, 15, 13, 15, 15, - 15, 16, 17, 17, 16, 15, - 14, 17, 17, 17, 15, 14, - 16, 17, 17, 17, 11, 14, - 14, 16, 17, 14, 15, 16, - 14, 13, 15, 14, 17, 16, - 15, 16, 17, 17, 11, 15, - 17, 17, 14, 14, 16, 16, - 16, 14, 17, 17, 15, 16, - 14, 15, 17, 16, 13, 13, - 16, 16, 12, 11, 17, 17, - 12, 11, 14, 16, 17, 15, - 14, 16, 17, 13, 15, 16, - 15, 16, 16, 15, 15, 15, - 13, 14, 15, 15, 16, 17, - 17, 15, 15, 16, 15, 16, - 16, 13, 10, 16, 15, 15, - 15, 7, 14, 14, 7, 7, - 11, 12, 12, 11, 12, 14, - 14, 12, 15, 16, 13, 14, - 16, 13, 13, 15, 13, 11, - 12, 13, 11, 15, 15, 13, - 12, 15, 12, 14, 15, 12, - 7, 12, 12, 12, 11, 6, - 12, 12, 13, 12, 9, 14, - 14, 9, 12, 13, 13, 12, - 14, 15, 16, 17, 14, 12, - 13, 13, 15, 13, 11, 12, - 14, 12, 11, 14, 15, 17, - 14, 12, 13, 12, 13, 14, - 9, 13, 15, 9, 12, 17, - 16, 12, 11, 14, 14, 13, - 15, 13, 16, 17, 14, 15, - 17, 14, 14, 15, 13, 15, - 14, 12, 12, 14, 12, 11, - 16, 15, 13, 13, 16, 13, - 15, 15, 14, 12, 13, 14, - 15, 14, 13, 17, 16, 16, - 16, 15, 17, 17, 14, 14, - 16, 14, 15, 17, 15, 17, - 17, 16, 13, 14, 16, 16, - 13, 14, 14, 15, 14, 12, - 17, 16, 17, 17, 16, 15, - 15, 14, 16, 16, 17, 17, - 15, 11, 16, 16, 13, 11, - 14, 16, 17, 14, 10, 17, - 16, 12, 13, 15, 17, 16, - 14, 13, 17, 16, 14, 15, - 17, 14, 13, 14, 14, 16, - 15, 13, 13, 17, 15, 12, - 12, 15, 17, 17, 15, 12, - 16, 16, 11, 11, 14, 17, - 17, 14, 13, 15, 17, 12, - 12, 14, 16, 17, 17, 14, - 15, 16, 14, 15, 15, 16, - 15, 13, 13, 16, 15, 15, - 13, 15, 15, 13, 13, 15, - 16, 17, 15, 14, 15, 16, - 17, 17, 14, 17, 17, 14, - 14, 15, 14, 17, 16, 16, - 17, 17, 17, 12, 15, 16, - 17, 15, 14, 12, 13, 15, - 12, 15, 17, 16, 16, 16, - 17, 14, 14, 15, 15, 17, - 17, 15, 12, 16, 16, 12, - 11, 14, 14, 14, 14, 14, - 14, 15, 13, 15, 16, 13, - 14, 16, 13, 16, 14, 13, - 11, 12, 14, 13, 16, 15, - 13, 14, 15, 13, 15, 15, - 12, 11, 15, 13, 13, 14, - 7, 12, 13, 12, 12, 9, - 15, 15, 9, 12, 14, 12, - 12, 14, 15, 15, 15, 15, - 13, 14, 16, 14, 14, 12, - 11, 13, 14, 12, 14, 16, - 14, 14, 12, 14, 12, 12, - 12, 9, 14, 14, 9, +static const uint8_t on2avc_cb6_bits[ON2AVC_CB_5_6_CODES] = { + 8, 10, 12, 13, 13, 12, 13, 14, 16, 17, 17, 16, 16, 10, 11, 11, 8, 10, 11, + 11, 10, 10, 10, 10, 11, 12, 13, 14, 14, 11, 11, 10, 10, 10, 11, 12, 12, 8, + 10, 11, 12, 12, 10, 11, 11, 8, 10, 10, 10, 11, 13, 13, 13, 13, 10, 11, 12, + 13, 13, 10, 10, 10, 11, 12, 12, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 12, + 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 10, 12, 12, 12, 13, + 14, 15, 15, 10, 10, 10, 11, 12, 12, 10, 11, 12, 12, 9, 10, 11, 11, 10, 13, + 13, 13, 13, 12, 12, 10, 11, 11, 10, 11, 12, 12, 10, 10, 10, 11, 11, 11, 11, + 11, 11, 10, 10, 11, 11, 11, 14, 15, 15, 14, 14, 13, 13, 10, 13, 13, 13, 13, + 12, 12, 11, 11, 11, 11, 10, 10, 11, 12, 13, 14, 14, 11, 11, 10, 10, 10, 10, + 11, 11, 11, 11, 10, 10, 10, 11, 12, 13, 13, 10, 10, 10, 11, 11, 10, 13, 13, + 13, 13, 12, 13, 13, 11, 12, 12, 11, 11, 10, 10, 10, 10, 11, 11, 11, 11, 9, + 10, 11, 12, 12, 11, 12, 13, 14, 14, 11, 11, 11, 11, 11, 11, 10, 10, 13, 13, + 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 10, 11, 11, 10, 11, 11, 10, 12, 13, + 13, 12, 12, 11, 11, 11, 11, 10, 11, 11, 10, 11, 11, 11, 11, 11, 11, 10, 11, + 13, 13, 13, 13, 9, 10, 13, 13, 13, 13, 12, 12, 11, 11, 11, 11, 10, 11, 11, + 10, 11, 12, 12, 11, 11, 11, 11, 11, 12, 12, 11, 11, 10, 11, 11, 9, 10, 10, + 11, 12, 14, 15, 16, 17, 17, 14, 14, 11, 11, 12, 13, 13, 12, 12, 11, 12, 12, + 11, 11, 11, 11, 11, 11, 11, 11, 9, 10, 11, 12, 13, 13, 10, 10, 10, 10, 11, + 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 12, 12, 12, 12, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 7, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 12, 13, 13, 12, 12, 12, 12, 11, 11, 10, 10, 10, 11, 12, 12, 10, 11, 11, + 10, 11, 12, 12, 10, 11, 12, 14, 14, 14, 14, 11, 11, 11, 11, 11, 11, 11, 11, + 10, 10, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 10, 11, + 11, 11, 11, 11, 11, 10, 11, 11, 10, 10, 12, 12, 12, 12, 11, 12, 12, 11, 11, + 11, 11, 10, 11, 11, 11, 11, 11, 11, 10, 11, 11, 10, 11, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, + 11, 11, 10, 10, 11, 12, 13, 15, 16, 17, 17, 15, 15, 11, 11, 10, 10, 7, 10, + 12, 12, 12, 12, 11, 11, 11, 11, 9, 11, 12, 14, 14, 14, 14, 11, 11, 7, 11, + 11, 11, 11, 10, 10, 10, 10, 10, 10, 7, 13, 13, 13, 13, 12, 12, 11, 11, 11, + 11, 11, 11, 9, 10, 11, 11, 10, 10, 10, 12, 13, 14, 14, 12, 12, 11, 11, 11, + 11, 11, 11, 11, 11, 10, 10, 10, 11, 11, 10, 11, 11, 11, 11, 11, 11, 10, 10, + 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 11, 12, 12, 11, 11, 11, 11, + 11, 11, 10, 11, 11, 10, 10, 10, 11, 12, 13, 14, 14, 10, 11, 12, 12, 7, 7, + 10, 11, 11, 11, 11, 11, 11, 10, 11, 12, 14, 14, 14, 14, 11, 11, 11, 11, 10, + 10, 10, 11, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11, + 11, 7, 9, 10, 11, 11, 11, 11, 11, 11, 10, 11, 11, 7, 9, 10, 10, 9, 10, + 10, 12, 12, 12, 12, 11, 11, 10, 11, 11, 10, 11, 11, 10, 10, 9, 10, 11, 11, + 13, 14, 14, 13, 13, 13, 13, 13, 13, 11, 11, 11, 11, 11, 11, 7, 10, 10, 10, + 11, 12, 13, 13, 9, 10, 11, 11, 7, 10, 11, 11, 11, 11, 11, 11, 9, 10, 11, + 11, 7, 7, 7, 7, 9, 10, 10, 10, 11, 12, 13, 13, 11, 11, 11, 11, 10, 10, + 10, 10, 9, 10, 10, 9, 10, 13, 13, 13, 13, 12, 12, 9, 11, 12, 12, 11, 11, + 10, 11, 12, 12, 10, 10, 9, 10, 11, 11, 7, 7, 7, 11, 12, 12, 11, 11, 10, + 11, 11, 10, 11, 11, 10, 11, 11, 7, 9, 10, 13, 13, 13, 13, 13, 13, 13, 13, + 10, 11, 12, 13, 13, 10, 11, 12, 12, 9, 10, 11, 11, 10, 10, 10, 11, 12, 12, + 9, 10, 11, 11, 9, 10, 10, 7, 9, 10, 11, 12, 14, 15, 16, 17, 17, 14, 14, + 10, 10, 11, 11, 11, 11, 10, 11, 11, 10, 10, 9, 10, 10, 9, 10, 10, 9, 10, + 13, 13, 13, 13, 13, 13, 13, 13, 7, 12, 12, 12, 12, 11, 12, 12, 10, 10, 10, + 11, 11, 10, 11, 11, 7, 7, 7, 10, 10, 10, 10, 9, 10, 10, 7, 9, 10, 12, + 13, 13, 12, 12, 9, 12, 12, 12, 12, 11, 11, 7, 7, 7, 9, 10, 10, 10, 10, + 10, 11, 12, 13, 13, 10, 10, 10, 11, 13, 13, 13, 13, 9, 10, 13, 13, 13, 13, + 12, 12, 9, 10, 10, 9, 10, 11, 12, 12, 10, 10, 10, 10, 10, 11, 11, 10, 11, + 11, 9, 10, 10, 9, 9, 9, 12, 12, 12, 12, 11, 11, 10, 10, 10, 10, 9, 9, + 9, 10, 11, 12, 13, 14, 14, 7, 9, 9, 9, 10, 11, 11, 7, 9, 9, 10, 11, + 12, 13, 13, 10, 10, 7, 10, 10, 10, 11, 11, 10, 11, 11, 10, 10, 9, 10, 10, + 9, 10, 10, 9, 9, 9, 9, 9, 11, 12, 12, 11, 11, 9, 10, 11, 12, 12, 10, + 10, 10, 10, 9, 10, 11, 11, 9, 9, 9, 10, 10, 9, 10, 11, 12, 12, 9, 10, + 10, 7, 9, 10, 10, 10, 11, 12, 12, 10, 10, 7, 9, 10, 10, 9, 10, 12, 12, + 12, 12, 7, 10, 11, 11, 10, 10, 9, 9, 7, 9, 10, 10, 9, 10, 10, 9, 10, + 10, 10, 11, 12, 12, 10, 10, 9, 9, 10, 12, 12, 12, 12, 10, 11, 11, 7, 9, + 10, 10, 9, 10, 11, 11, 7, 9, 9, 10, 10, 10, 10, 9, 10, 10, 9, 9, 9, + 10, 13, 14, 14, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 10, 10, 7, + 9, 10, 11, 12, 12, 9, 9, 9, 10, 10, 9, 9, 12, 12, 12, 12, 11, 11, 10, + 10, 9, 10, 11, 13, 13, 13, 13, 9, 9, 9, 9, 12, 12, 12, 12, 11, 11, 10, + 10, 9, 10, 10, }; -static const uint16_t on2avc_cb7_8_syms[ON2AVC_CB7_8_CODES] = { - 0x0000, 0x0002, 0x0004, 0x000C, 0x000E, 0x0011, - 0x0013, 0x001D, 0x001F, 0x0020, 0x0022, 0x0024, - 0x002C, 0x002E, 0x0031, 0x0033, 0x003D, 0x003F, - 0x0040, 0x0042, 0x0044, 0x004C, 0x004E, 0x00C0, - 0x00C2, 0x00C4, 0x00CC, 0x00CE, 0x00D1, 0x00D3, - 0x00DD, 0x00DF, 0x00E0, 0x00E2, 0x00E4, 0x00EC, - 0x00EE, 0x00F1, 0x00F3, 0x00FD, 0x00FF, 0x0101, - 0x0103, 0x010D, 0x010F, 0x0110, 0x0112, 0x0114, - 0x011C, 0x011E, 0x0121, 0x0123, 0x012D, 0x012F, - 0x0130, 0x0132, 0x0134, 0x013C, 0x013E, 0x0141, - 0x0143, 0x014D, 0x014F, 0x01C1, 0x01C3, 0x01CD, - 0x01CF, 0x01D0, 0x01D2, 0x01D4, 0x01DC, 0x01DE, - 0x01E1, 0x01E3, 0x01ED, 0x01EF, 0x01F0, 0x01F2, - 0x01F4, 0x01FC, 0x01FE, 0x0200, 0x0202, 0x0204, - 0x020C, 0x020E, 0x0211, 0x0213, 0x021D, 0x021F, - 0x0220, 0x0222, 0x0224, 0x022C, 0x022E, 0x0231, - 0x0233, 0x023D, 0x023F, 0x0240, 0x0242, 0x0244, - 0x024C, 0x024E, 0x02C0, 0x02C2, 0x02C4, 0x02CC, - 0x02CE, 0x02D1, 0x02D3, 0x02DD, 0x02DF, 0x02E0, - 0x02E2, 0x02E4, 0x02EC, 0x02EE, 0x02F1, 0x02F3, - 0x02FD, 0x02FF, 0x0301, 0x0303, 0x030D, 0x030F, - 0x0310, 0x0312, 0x0314, 0x031C, 0x031E, 0x0321, - 0x0323, 0x032D, 0x032F, 0x0330, 0x0332, 0x0334, - 0x033C, 0x033E, 0x0341, 0x0343, 0x034D, 0x034F, - 0x03C1, 0x03C3, 0x03CD, 0x03CF, 0x03D0, 0x03D2, - 0x03D4, 0x03DC, 0x03DE, 0x03E1, 0x03E3, 0x03ED, - 0x03EF, 0x03F0, 0x03F2, 0x03F4, 0x03FC, 0x03FE, - 0x0400, 0x0402, 0x0404, 0x040C, 0x040E, 0x0411, - 0x0413, 0x041D, 0x041F, 0x0420, 0x0422, 0x0424, - 0x042C, 0x042E, 0x0431, 0x0433, 0x043D, 0x043F, - 0x0440, 0x0442, 0x0444, 0x044C, 0x044E, 0x04C0, - 0x04C2, 0x04C4, 0x04CC, 0x04CE, 0x04D1, 0x04D3, - 0x04DD, 0x04DF, 0x04E0, 0x04E2, 0x04E4, 0x04EC, - 0x04EE, 0x04F1, 0x04F3, 0x04FD, 0x04FF, 0x0C00, - 0x0C02, 0x0C04, 0x0C0C, 0x0C0E, 0x0C11, 0x0C13, - 0x0C1D, 0x0C1F, 0x0C20, 0x0C22, 0x0C24, 0x0C2C, - 0x0C2E, 0x0C31, 0x0C33, 0x0C3D, 0x0C3F, 0x0C40, - 0x0C42, 0x0C44, 0x0C4C, 0x0C4E, 0x0CC0, 0x0CC2, - 0x0CC4, 0x0CCC, 0x0CCE, 0x0CD1, 0x0CD3, 0x0CDD, - 0x0CDF, 0x0CE0, 0x0CE2, 0x0CE4, 0x0CEC, 0x0CEE, - 0x0CF1, 0x0CF3, 0x0CFD, 0x0CFF, 0x0D01, 0x0D03, - 0x0D0D, 0x0D0F, 0x0D10, 0x0D12, 0x0D14, 0x0D1C, - 0x0D1E, 0x0D21, 0x0D23, 0x0D2D, 0x0D2F, 0x0D30, - 0x0D32, 0x0D34, 0x0D3C, 0x0D3E, 0x0D41, 0x0D43, - 0x0D4D, 0x0D4F, 0x0DC1, 0x0DC3, 0x0DCD, 0x0DCF, - 0x0DD0, 0x0DD2, 0x0DD4, 0x0DDC, 0x0DDE, 0x0DE1, - 0x0DE3, 0x0DED, 0x0DEF, 0x0DF0, 0x0DF2, 0x0DF4, - 0x0DFC, 0x0DFE, 0x0E00, 0x0E02, 0x0E04, 0x0E0C, - 0x0E0E, 0x0E11, 0x0E13, 0x0E1D, 0x0E1F, 0x0E20, - 0x0E22, 0x0E24, 0x0E2C, 0x0E2E, 0x0E31, 0x0E33, - 0x0E3D, 0x0E3F, 0x0E40, 0x0E42, 0x0E44, 0x0E4C, - 0x0E4E, 0x0EC0, 0x0EC2, 0x0EC4, 0x0ECC, 0x0ECE, - 0x0ED1, 0x0ED3, 0x0EDD, 0x0EDF, 0x0EE0, 0x0EE2, - 0x0EE4, 0x0EEC, 0x0EEE, 0x0EF1, 0x0EF3, 0x0EFD, - 0x0EFF, 0x0F01, 0x0F03, 0x0F0D, 0x0F0F, 0x0F10, - 0x0F12, 0x0F14, 0x0F1C, 0x0F1E, 0x0F21, 0x0F23, - 0x0F2D, 0x0F2F, 0x0F30, 0x0F32, 0x0F34, 0x0F3C, - 0x0F3E, 0x0F41, 0x0F43, 0x0F4D, 0x0F4F, 0x0FC1, - 0x0FC3, 0x0FCD, 0x0FCF, 0x0FD0, 0x0FD2, 0x0FD4, - 0x0FDC, 0x0FDE, 0x0FE1, 0x0FE3, 0x0FED, 0x0FEF, - 0x0FF0, 0x0FF2, 0x0FF4, 0x0FFC, 0x0FFE, 0x1001, - 0x1003, 0x100D, 0x100F, 0x1010, 0x1012, 0x1014, - 0x101C, 0x101E, 0x1021, 0x1023, 0x102D, 0x102F, - 0x1030, 0x1032, 0x1034, 0x103C, 0x103E, 0x1041, - 0x1043, 0x104D, 0x104F, 0x10C1, 0x10C3, 0x10CD, - 0x10CF, 0x10D0, 0x10D2, 0x10D4, 0x10DC, 0x10DE, - 0x10E1, 0x10E3, 0x10ED, 0x10EF, 0x10F0, 0x10F2, - 0x10F4, 0x10FC, 0x10FE, 0x1100, 0x1102, 0x1104, - 0x110C, 0x110E, 0x1111, 0x1113, 0x111D, 0x111F, - 0x1120, 0x1122, 0x1124, 0x112C, 0x112E, 0x1131, - 0x1133, 0x113D, 0x113F, 0x1140, 0x1142, 0x1144, - 0x114C, 0x114E, 0x11C0, 0x11C2, 0x11C4, 0x11CC, - 0x11CE, 0x11D1, 0x11D3, 0x11DD, 0x11DF, 0x11E0, - 0x11E2, 0x11E4, 0x11EC, 0x11EE, 0x11F1, 0x11F3, - 0x11FD, 0x11FF, 0x1201, 0x1203, 0x120D, 0x120F, - 0x1210, 0x1212, 0x1214, 0x121C, 0x121E, 0x1221, - 0x1223, 0x122D, 0x122F, 0x1230, 0x1232, 0x1234, - 0x123C, 0x123E, 0x1241, 0x1243, 0x124D, 0x124F, - 0x12C1, 0x12C3, 0x12CD, 0x12CF, 0x12D0, 0x12D2, - 0x12D4, 0x12DC, 0x12DE, 0x12E1, 0x12E3, 0x12ED, - 0x12EF, 0x12F0, 0x12F2, 0x12F4, 0x12FC, 0x12FE, - 0x1300, 0x1302, 0x1304, 0x130C, 0x130E, 0x1311, - 0x1313, 0x131D, 0x131F, 0x1320, 0x1322, 0x1324, - 0x132C, 0x132E, 0x1331, 0x1333, 0x133D, 0x133F, - 0x1340, 0x1342, 0x1344, 0x134C, 0x134E, 0x13C0, - 0x13C2, 0x13C4, 0x13CC, 0x13CE, 0x13D1, 0x13D3, - 0x13DD, 0x13DF, 0x13E0, 0x13E2, 0x13E4, 0x13EC, - 0x13EE, 0x13F1, 0x13F3, 0x13FD, 0x13FF, 0x1401, - 0x1403, 0x140D, 0x140F, 0x1410, 0x1412, 0x1414, - 0x141C, 0x141E, 0x1421, 0x1423, 0x142D, 0x142F, - 0x1430, 0x1432, 0x1434, 0x143C, 0x143E, 0x1441, - 0x1443, 0x144D, 0x144F, 0x14C1, 0x14C3, 0x14CD, - 0x14CF, 0x14D0, 0x14D2, 0x14D4, 0x14DC, 0x14DE, - 0x14E1, 0x14E3, 0x14ED, 0x14EF, 0x14F0, 0x14F2, - 0x14F4, 0x14FC, 0x14FE, 0x1C01, 0x1C03, 0x1C0D, - 0x1C0F, 0x1C10, 0x1C12, 0x1C14, 0x1C1C, 0x1C1E, - 0x1C21, 0x1C23, 0x1C2D, 0x1C2F, 0x1C30, 0x1C32, - 0x1C34, 0x1C3C, 0x1C3E, 0x1C41, 0x1C43, 0x1C4D, - 0x1C4F, 0x1CC1, 0x1CC3, 0x1CCD, 0x1CCF, 0x1CD0, - 0x1CD2, 0x1CD4, 0x1CDC, 0x1CDE, 0x1CE1, 0x1CE3, - 0x1CED, 0x1CEF, 0x1CF0, 0x1CF2, 0x1CF4, 0x1CFC, - 0x1CFE, 0x1D00, 0x1D02, 0x1D04, 0x1D0C, 0x1D0E, - 0x1D11, 0x1D13, 0x1D1D, 0x1D1F, 0x1D20, 0x1D22, - 0x1D24, 0x1D2C, 0x1D2E, 0x1D31, 0x1D33, 0x1D3D, - 0x1D3F, 0x1D40, 0x1D42, 0x1D44, 0x1D4C, 0x1D4E, - 0x1DC0, 0x1DC2, 0x1DC4, 0x1DCC, 0x1DCE, 0x1DD1, - 0x1DD3, 0x1DDD, 0x1DDF, 0x1DE0, 0x1DE2, 0x1DE4, - 0x1DEC, 0x1DEE, 0x1DF1, 0x1DF3, 0x1DFD, 0x1DFF, - 0x1E01, 0x1E03, 0x1E0D, 0x1E0F, 0x1E10, 0x1E12, - 0x1E14, 0x1E1C, 0x1E1E, 0x1E21, 0x1E23, 0x1E2D, - 0x1E2F, 0x1E30, 0x1E32, 0x1E34, 0x1E3C, 0x1E3E, - 0x1E41, 0x1E43, 0x1E4D, 0x1E4F, 0x1EC1, 0x1EC3, - 0x1ECD, 0x1ECF, 0x1ED0, 0x1ED2, 0x1ED4, 0x1EDC, - 0x1EDE, 0x1EE1, 0x1EE3, 0x1EED, 0x1EEF, 0x1EF0, - 0x1EF2, 0x1EF4, 0x1EFC, 0x1EFE, 0x1F00, 0x1F02, - 0x1F04, 0x1F0C, 0x1F0E, 0x1F11, 0x1F13, 0x1F1D, - 0x1F1F, 0x1F20, 0x1F22, 0x1F24, 0x1F2C, 0x1F2E, - 0x1F31, 0x1F33, 0x1F3D, 0x1F3F, 0x1F40, 0x1F42, - 0x1F44, 0x1F4C, 0x1F4E, 0x1FC0, 0x1FC2, 0x1FC4, - 0x1FCC, 0x1FCE, 0x1FD1, 0x1FD3, 0x1FDD, 0x1FDF, - 0x1FE0, 0x1FE2, 0x1FE4, 0x1FEC, 0x1FEE, 0x1FF1, - 0x1FF3, 0x1FFD, 0x1FFF, 0x2000, 0x2002, 0x2004, - 0x200C, 0x200E, 0x2011, 0x2013, 0x201D, 0x201F, - 0x2020, 0x2022, 0x2024, 0x202C, 0x202E, 0x2031, - 0x2033, 0x203D, 0x203F, 0x2040, 0x2042, 0x2044, - 0x204C, 0x204E, 0x20C0, 0x20C2, 0x20C4, 0x20CC, - 0x20CE, 0x20D1, 0x20D3, 0x20DD, 0x20DF, 0x20E0, - 0x20E2, 0x20E4, 0x20EC, 0x20EE, 0x20F1, 0x20F3, - 0x20FD, 0x20FF, 0x2101, 0x2103, 0x210D, 0x210F, - 0x2110, 0x2112, 0x2114, 0x211C, 0x211E, 0x2121, - 0x2123, 0x212D, 0x212F, 0x2130, 0x2132, 0x2134, - 0x213C, 0x213E, 0x2141, 0x2143, 0x214D, 0x214F, - 0x21C1, 0x21C3, 0x21CD, 0x21CF, 0x21D0, 0x21D2, - 0x21D4, 0x21DC, 0x21DE, 0x21E1, 0x21E3, 0x21ED, - 0x21EF, 0x21F0, 0x21F2, 0x21F4, 0x21FC, 0x21FE, - 0x2200, 0x2202, 0x2204, 0x220C, 0x220E, 0x2211, - 0x2213, 0x221D, 0x221F, 0x2220, 0x2222, 0x2224, - 0x222C, 0x222E, 0x2231, 0x2233, 0x223D, 0x223F, - 0x2240, 0x2242, 0x2244, 0x224C, 0x224E, 0x22C0, - 0x22C2, 0x22C4, 0x22CC, 0x22CE, 0x22D1, 0x22D3, - 0x22DD, 0x22DF, 0x22E0, 0x22E2, 0x22E4, 0x22EC, - 0x22EE, 0x22F1, 0x22F3, 0x22FD, 0x22FF, 0x2301, - 0x2303, 0x230D, 0x230F, 0x2310, 0x2312, 0x2314, - 0x231C, 0x231E, 0x2321, 0x2323, 0x232D, 0x232F, - 0x2330, 0x2332, 0x2334, 0x233C, 0x233E, 0x2341, - 0x2343, 0x234D, 0x234F, 0x23C1, 0x23C3, 0x23CD, - 0x23CF, 0x23D0, 0x23D2, 0x23D4, 0x23DC, 0x23DE, - 0x23E1, 0x23E3, 0x23ED, 0x23EF, 0x23F0, 0x23F2, - 0x23F4, 0x23FC, 0x23FE, 0x2400, 0x2402, 0x2404, - 0x240C, 0x240E, 0x2411, 0x2413, 0x241D, 0x241F, - 0x2420, 0x2422, 0x2424, 0x242C, 0x242E, 0x2431, - 0x2433, 0x243D, 0x243F, 0x2440, 0x2442, 0x2444, - 0x244C, 0x244E, 0x24C0, 0x24C2, 0x24C4, 0x24CC, - 0x24CE, 0x24D1, 0x24D3, 0x24DD, 0x24DF, 0x24E0, - 0x24E2, 0x24E4, 0x24EC, 0x24EE, 0x24F1, 0x24F3, - 0x24FD, 0x24FF, 0x2C00, 0x2C02, 0x2C04, 0x2C0C, - 0x2C0E, 0x2C11, 0x2C13, 0x2C1D, 0x2C1F, 0x2C20, - 0x2C22, 0x2C24, 0x2C2C, 0x2C2E, 0x2C31, 0x2C33, - 0x2C3D, 0x2C3F, 0x2C40, 0x2C42, 0x2C44, 0x2C4C, - 0x2C4E, 0x2CC0, 0x2CC2, 0x2CC4, 0x2CCC, 0x2CCE, - 0x2CD1, 0x2CD3, 0x2CDD, 0x2CDF, 0x2CE0, 0x2CE2, - 0x2CE4, 0x2CEC, 0x2CEE, 0x2CF1, 0x2CF3, 0x2CFD, - 0x2CFF, 0x2D01, 0x2D03, 0x2D0D, 0x2D0F, 0x2D10, - 0x2D12, 0x2D14, 0x2D1C, 0x2D1E, 0x2D21, 0x2D23, - 0x2D2D, 0x2D2F, 0x2D30, 0x2D32, 0x2D34, 0x2D3C, - 0x2D3E, 0x2D41, 0x2D43, 0x2D4D, 0x2D4F, 0x2DC1, - 0x2DC3, 0x2DCD, 0x2DCF, 0x2DD0, 0x2DD2, 0x2DD4, - 0x2DDC, 0x2DDE, 0x2DE1, 0x2DE3, 0x2DED, 0x2DEF, - 0x2DF0, 0x2DF2, 0x2DF4, 0x2DFC, 0x2DFE, 0x2E00, - 0x2E02, 0x2E04, 0x2E0C, 0x2E0E, 0x2E11, 0x2E13, - 0x2E1D, 0x2E1F, 0x2E20, 0x2E22, 0x2E24, 0x2E2C, - 0x2E2E, 0x2E31, 0x2E33, 0x2E3D, 0x2E3F, 0x2E40, - 0x2E42, 0x2E44, 0x2E4C, 0x2E4E, 0x2EC0, 0x2EC2, - 0x2EC4, 0x2ECC, 0x2ECE, 0x2ED1, 0x2ED3, 0x2EDD, - 0x2EDF, 0x2EE0, 0x2EE2, 0x2EE4, 0x2EEC, 0x2EEE, - 0x2EF1, 0x2EF3, 0x2EFD, 0x2EFF, 0x2F01, 0x2F03, - 0x2F0D, 0x2F0F, 0x2F10, 0x2F12, 0x2F14, 0x2F1C, - 0x2F1E, 0x2F21, 0x2F23, 0x2F2D, 0x2F2F, 0x2F30, - 0x2F32, 0x2F34, 0x2F3C, 0x2F3E, 0x2F41, 0x2F43, - 0x2F4D, 0x2F4F, 0x2FC1, 0x2FC3, 0x2FCD, 0x2FCF, - 0x2FD0, 0x2FD2, 0x2FD4, 0x2FDC, 0x2FDE, 0x2FE1, - 0x2FE3, 0x2FED, 0x2FEF, 0x2FF0, 0x2FF2, 0x2FF4, - 0x2FFC, 0x2FFE, 0x3001, 0x3003, 0x300D, 0x300F, - 0x3010, 0x3012, 0x3014, 0x301C, 0x301E, 0x3021, - 0x3023, 0x302D, 0x302F, 0x3030, 0x3032, 0x3034, - 0x303C, 0x303E, 0x3041, 0x3043, 0x304D, 0x304F, - 0x30C1, 0x30C3, 0x30CD, 0x30CF, 0x30D0, 0x30D2, - 0x30D4, 0x30DC, 0x30DE, 0x30E1, 0x30E3, 0x30ED, - 0x30EF, 0x30F0, 0x30F2, 0x30F4, 0x30FC, 0x30FE, - 0x3100, 0x3102, 0x3104, 0x310C, 0x310E, 0x3111, - 0x3113, 0x311D, 0x311F, 0x3120, 0x3122, 0x3124, - 0x312C, 0x312E, 0x3131, 0x3133, 0x313D, 0x313F, - 0x3140, 0x3142, 0x3144, 0x314C, 0x314E, 0x31C0, - 0x31C2, 0x31C4, 0x31CC, 0x31CE, 0x31D1, 0x31D3, - 0x31DD, 0x31DF, 0x31E0, 0x31E2, 0x31E4, 0x31EC, - 0x31EE, 0x31F1, 0x31F3, 0x31FD, 0x31FF, 0x3201, - 0x3203, 0x320D, 0x320F, 0x3210, 0x3212, 0x3214, - 0x321C, 0x321E, 0x3221, 0x3223, 0x322D, 0x322F, - 0x3230, 0x3232, 0x3234, 0x323C, 0x323E, 0x3241, - 0x3243, 0x324D, 0x324F, 0x32C1, 0x32C3, 0x32CD, - 0x32CF, 0x32D0, 0x32D2, 0x32D4, 0x32DC, 0x32DE, - 0x32E1, 0x32E3, 0x32ED, 0x32EF, 0x32F0, 0x32F2, - 0x32F4, 0x32FC, 0x32FE, 0x3300, 0x3302, 0x3304, - 0x330C, 0x330E, 0x3311, 0x3313, 0x331D, 0x331F, - 0x3320, 0x3322, 0x3324, 0x332C, 0x332E, 0x3331, - 0x3333, 0x333D, 0x333F, 0x3340, 0x3342, 0x3344, - 0x334C, 0x334E, 0x33C0, 0x33C2, 0x33C4, 0x33CC, - 0x33CE, 0x33D1, 0x33D3, 0x33DD, 0x33DF, 0x33E0, - 0x33E2, 0x33E4, 0x33EC, 0x33EE, 0x33F1, 0x33F3, - 0x33FD, 0x33FF, 0x3401, 0x3403, 0x340D, 0x340F, - 0x3410, 0x3412, 0x3414, 0x341C, 0x341E, 0x3421, - 0x3423, 0x342D, 0x342F, 0x3430, 0x3432, 0x3434, - 0x343C, 0x343E, 0x3441, 0x3443, 0x344D, 0x344F, - 0x34C1, 0x34C3, 0x34CD, 0x34CF, 0x34D0, 0x34D2, - 0x34D4, 0x34DC, 0x34DE, 0x34E1, 0x34E3, 0x34ED, - 0x34EF, 0x34F0, 0x34F2, 0x34F4, 0x34FC, 0x34FE, - 0x3C01, 0x3C03, 0x3C0D, 0x3C0F, 0x3C10, 0x3C12, - 0x3C14, 0x3C1C, 0x3C1E, 0x3C21, 0x3C23, 0x3C2D, - 0x3C2F, 0x3C30, 0x3C32, 0x3C34, 0x3C3C, 0x3C3E, - 0x3C41, 0x3C43, 0x3C4D, 0x3C4F, 0x3CC1, 0x3CC3, - 0x3CCD, 0x3CCF, 0x3CD0, 0x3CD2, 0x3CD4, 0x3CDC, - 0x3CDE, 0x3CE1, 0x3CE3, 0x3CED, 0x3CEF, 0x3CF0, - 0x3CF2, 0x3CF4, 0x3CFC, 0x3CFE, 0x3D00, 0x3D02, - 0x3D04, 0x3D0C, 0x3D0E, 0x3D11, 0x3D13, 0x3D1D, - 0x3D1F, 0x3D20, 0x3D22, 0x3D24, 0x3D2C, 0x3D2E, - 0x3D31, 0x3D33, 0x3D3D, 0x3D3F, 0x3D40, 0x3D42, - 0x3D44, 0x3D4C, 0x3D4E, 0x3DC0, 0x3DC2, 0x3DC4, - 0x3DCC, 0x3DCE, 0x3DD1, 0x3DD3, 0x3DDD, 0x3DDF, - 0x3DE0, 0x3DE2, 0x3DE4, 0x3DEC, 0x3DEE, 0x3DF1, - 0x3DF3, 0x3DFD, 0x3DFF, 0x3E01, 0x3E03, 0x3E0D, - 0x3E0F, 0x3E10, 0x3E12, 0x3E14, 0x3E1C, 0x3E1E, - 0x3E21, 0x3E23, 0x3E2D, 0x3E2F, 0x3E30, 0x3E32, - 0x3E34, 0x3E3C, 0x3E3E, 0x3E41, 0x3E43, 0x3E4D, - 0x3E4F, 0x3EC1, 0x3EC3, 0x3ECD, 0x3ECF, 0x3ED0, - 0x3ED2, 0x3ED4, 0x3EDC, 0x3EDE, 0x3EE1, 0x3EE3, - 0x3EED, 0x3EEF, 0x3EF0, 0x3EF2, 0x3EF4, 0x3EFC, - 0x3EFE, 0x3F00, 0x3F02, 0x3F04, 0x3F0C, 0x3F0E, - 0x3F11, 0x3F13, 0x3F1D, 0x3F1F, 0x3F20, 0x3F22, - 0x3F24, 0x3F2C, 0x3F2E, 0x3F31, 0x3F33, 0x3F3D, - 0x3F3F, 0x3F40, 0x3F42, 0x3F44, 0x3F4C, 0x3F4E, - 0x3FC0, 0x3FC2, 0x3FC4, 0x3FCC, 0x3FCE, 0x3FD1, - 0x3FD3, 0x3FDD, 0x3FDF, 0x3FE0, 0x3FE2, 0x3FE4, - 0x3FEC, 0x3FEE, 0x3FF1, 0x3FF3, 0x3FFD, 0x3FFF, - 0x4000, 0x4002, 0x4004, 0x400C, 0x400E, 0x4011, - 0x4013, 0x401D, 0x401F, 0x4020, 0x4022, 0x4024, - 0x402C, 0x402E, 0x4031, 0x4033, 0x403D, 0x403F, - 0x4040, 0x4042, 0x4044, 0x404C, 0x404E, 0x40C0, - 0x40C2, 0x40C4, 0x40CC, 0x40CE, 0x40D1, 0x40D3, - 0x40DD, 0x40DF, 0x40E0, 0x40E2, 0x40E4, 0x40EC, - 0x40EE, 0x40F1, 0x40F3, 0x40FD, 0x40FF, 0x4101, - 0x4103, 0x410D, 0x410F, 0x4110, 0x4112, 0x4114, - 0x411C, 0x411E, 0x4121, 0x4123, 0x412D, 0x412F, - 0x4130, 0x4132, 0x4134, 0x413C, 0x413E, 0x4141, - 0x4143, 0x414D, 0x414F, 0x41C1, 0x41C3, 0x41CD, - 0x41CF, 0x41D0, 0x41D2, 0x41D4, 0x41DC, 0x41DE, - 0x41E1, 0x41E3, 0x41ED, 0x41EF, 0x41F0, 0x41F2, - 0x41F4, 0x41FC, 0x41FE, 0x4200, 0x4202, 0x4204, - 0x420C, 0x420E, 0x4211, 0x4213, 0x421D, 0x421F, - 0x4220, 0x4222, 0x4224, 0x422C, 0x422E, 0x4231, - 0x4233, 0x423D, 0x423F, 0x4240, 0x4242, 0x4244, - 0x424C, 0x424E, 0x42C0, 0x42C2, 0x42C4, 0x42CC, - 0x42CE, 0x42D1, 0x42D3, 0x42DD, 0x42DF, 0x42E0, - 0x42E2, 0x42E4, 0x42EC, 0x42EE, 0x42F1, 0x42F3, - 0x42FD, 0x42FF, 0x4301, 0x4303, 0x430D, 0x430F, - 0x4310, 0x4312, 0x4314, 0x431C, 0x431E, 0x4321, - 0x4323, 0x432D, 0x432F, 0x4330, 0x4332, 0x4334, - 0x433C, 0x433E, 0x4341, 0x4343, 0x434D, 0x434F, - 0x43C1, 0x43C3, 0x43CD, 0x43CF, 0x43D0, 0x43D2, - 0x43D4, 0x43DC, 0x43DE, 0x43E1, 0x43E3, 0x43ED, - 0x43EF, 0x43F0, 0x43F2, 0x43F4, 0x43FC, 0x43FE, - 0x4400, 0x4402, 0x4404, 0x440C, 0x440E, 0x4411, - 0x4413, 0x441D, 0x441F, 0x4420, 0x4422, 0x4424, - 0x442C, 0x442E, 0x4431, 0x4433, 0x443D, 0x443F, - 0x4440, 0x4442, 0x4444, 0x444C, 0x444E, 0x44C0, - 0x44C2, 0x44C4, 0x44CC, 0x44CE, 0x44D1, 0x44D3, - 0x44DD, 0x44DF, 0x44E0, 0x44E2, 0x44E4, 0x44EC, - 0x44EE, 0x44F1, 0x44F3, 0x44FD, 0x44FF, 0x4C00, - 0x4C02, 0x4C04, 0x4C0C, 0x4C0E, 0x4C11, 0x4C13, - 0x4C1D, 0x4C1F, 0x4C20, 0x4C22, 0x4C24, 0x4C2C, - 0x4C2E, 0x4C31, 0x4C33, 0x4C3D, 0x4C3F, 0x4C40, - 0x4C42, 0x4C44, 0x4C4C, 0x4C4E, 0x4CC0, 0x4CC2, - 0x4CC4, 0x4CCC, 0x4CCE, 0x4CD1, 0x4CD3, 0x4CDD, - 0x4CDF, 0x4CE0, 0x4CE2, 0x4CE4, 0x4CEC, 0x4CEE, - 0x4CF1, 0x4CF3, 0x4CFD, 0x4CFF, 0x4D01, 0x4D03, - 0x4D0D, 0x4D0F, 0x4D10, 0x4D12, 0x4D14, 0x4D1C, - 0x4D1E, 0x4D21, 0x4D23, 0x4D2D, 0x4D2F, 0x4D30, - 0x4D32, 0x4D34, 0x4D3C, 0x4D3E, 0x4D41, 0x4D43, - 0x4D4D, 0x4D4F, 0x4DC1, 0x4DC3, 0x4DCD, 0x4DCF, - 0x4DD0, 0x4DD2, 0x4DD4, 0x4DDC, 0x4DDE, 0x4DE1, - 0x4DE3, 0x4DED, 0x4DEF, 0x4DF0, 0x4DF2, 0x4DF4, - 0x4DFC, 0x4DFE, 0x4E00, 0x4E02, 0x4E04, 0x4E0C, - 0x4E0E, 0x4E11, 0x4E13, 0x4E1D, 0x4E1F, 0x4E20, - 0x4E22, 0x4E24, 0x4E2C, 0x4E2E, 0x4E31, 0x4E33, - 0x4E3D, 0x4E3F, 0x4E40, 0x4E42, 0x4E44, 0x4E4C, - 0x4E4E, 0x4EC0, 0x4EC2, 0x4EC4, 0x4ECC, 0x4ECE, - 0x4ED1, 0x4ED3, 0x4EDD, 0x4EDF, 0x4EE0, 0x4EE2, - 0x4EE4, 0x4EEC, 0x4EEE, 0x4EF1, 0x4EF3, 0x4EFD, - 0x4EFF, 0x4F01, 0x4F03, 0x4F0D, 0x4F0F, 0x4F10, - 0x4F12, 0x4F14, 0x4F1C, 0x4F1E, 0x4F21, 0x4F23, - 0x4F2D, 0x4F2F, 0x4F30, 0x4F32, 0x4F34, 0x4F3C, - 0x4F3E, 0x4F41, 0x4F43, 0x4F4D, 0x4F4F, 0x4FC1, - 0x4FC3, 0x4FCD, 0x4FCF, 0x4FD0, 0x4FD2, 0x4FD4, - 0x4FDC, 0x4FDE, 0x4FE1, 0x4FE3, 0x4FED, 0x4FEF, - 0x4FF0, 0x4FF2, 0x4FF4, 0x4FFC, 0x4FFE, 0xC000, - 0xC002, 0xC004, 0xC00C, 0xC00E, 0xC011, 0xC013, - 0xC01D, 0xC01F, 0xC020, 0xC022, 0xC024, 0xC02C, - 0xC02E, 0xC031, 0xC033, 0xC03D, 0xC03F, 0xC040, - 0xC042, 0xC044, 0xC04C, 0xC04E, 0xC0C0, 0xC0C2, - 0xC0C4, 0xC0CC, 0xC0CE, 0xC0D1, 0xC0D3, 0xC0DD, - 0xC0DF, 0xC0E0, 0xC0E2, 0xC0E4, 0xC0EC, 0xC0EE, - 0xC0F1, 0xC0F3, 0xC0FD, 0xC0FF, 0xC101, 0xC103, - 0xC10D, 0xC10F, 0xC110, 0xC112, 0xC114, 0xC11C, - 0xC11E, 0xC121, 0xC123, 0xC12D, 0xC12F, 0xC130, - 0xC132, 0xC134, 0xC13C, 0xC13E, 0xC141, 0xC143, - 0xC14D, 0xC14F, 0xC1C1, 0xC1C3, 0xC1CD, 0xC1CF, - 0xC1D0, 0xC1D2, 0xC1D4, 0xC1DC, 0xC1DE, 0xC1E1, - 0xC1E3, 0xC1ED, 0xC1EF, 0xC1F0, 0xC1F2, 0xC1F4, - 0xC1FC, 0xC1FE, 0xC200, 0xC202, 0xC204, 0xC20C, - 0xC20E, 0xC211, 0xC213, 0xC21D, 0xC21F, 0xC220, - 0xC222, 0xC224, 0xC22C, 0xC22E, 0xC231, 0xC233, - 0xC23D, 0xC23F, 0xC240, 0xC242, 0xC244, 0xC24C, - 0xC24E, 0xC2C0, 0xC2C2, 0xC2C4, 0xC2CC, 0xC2CE, - 0xC2D1, 0xC2D3, 0xC2DD, 0xC2DF, 0xC2E0, 0xC2E2, - 0xC2E4, 0xC2EC, 0xC2EE, 0xC2F1, 0xC2F3, 0xC2FD, - 0xC2FF, 0xC301, 0xC303, 0xC30D, 0xC30F, 0xC310, - 0xC312, 0xC314, 0xC31C, 0xC31E, 0xC321, 0xC323, - 0xC32D, 0xC32F, 0xC330, 0xC332, 0xC334, 0xC33C, - 0xC33E, 0xC341, 0xC343, 0xC34D, 0xC34F, 0xC3C1, - 0xC3C3, 0xC3CD, 0xC3CF, 0xC3D0, 0xC3D2, 0xC3D4, - 0xC3DC, 0xC3DE, 0xC3E1, 0xC3E3, 0xC3ED, 0xC3EF, - 0xC3F0, 0xC3F2, 0xC3F4, 0xC3FC, 0xC3FE, 0xC400, - 0xC402, 0xC404, 0xC40C, 0xC40E, 0xC411, 0xC413, - 0xC41D, 0xC41F, 0xC420, 0xC422, 0xC424, 0xC42C, - 0xC42E, 0xC431, 0xC433, 0xC43D, 0xC43F, 0xC440, - 0xC442, 0xC444, 0xC44C, 0xC44E, 0xC4C0, 0xC4C2, - 0xC4C4, 0xC4CC, 0xC4CE, 0xC4D1, 0xC4D3, 0xC4DD, - 0xC4DF, 0xC4E0, 0xC4E2, 0xC4E4, 0xC4EC, 0xC4EE, - 0xC4F1, 0xC4F3, 0xC4FD, 0xC4FF, 0xCC00, 0xCC02, - 0xCC04, 0xCC0C, 0xCC0E, 0xCC11, 0xCC13, 0xCC1D, - 0xCC1F, 0xCC20, 0xCC22, 0xCC24, 0xCC2C, 0xCC2E, - 0xCC31, 0xCC33, 0xCC3D, 0xCC3F, 0xCC40, 0xCC42, - 0xCC44, 0xCC4C, 0xCC4E, 0xCCC0, 0xCCC2, 0xCCC4, - 0xCCCC, 0xCCCE, 0xCCD1, 0xCCD3, 0xCCDD, 0xCCDF, - 0xCCE0, 0xCCE2, 0xCCE4, 0xCCEC, 0xCCEE, 0xCCF1, - 0xCCF3, 0xCCFD, 0xCCFF, 0xCD01, 0xCD03, 0xCD0D, - 0xCD0F, 0xCD10, 0xCD12, 0xCD14, 0xCD1C, 0xCD1E, - 0xCD21, 0xCD23, 0xCD2D, 0xCD2F, 0xCD30, 0xCD32, - 0xCD34, 0xCD3C, 0xCD3E, 0xCD41, 0xCD43, 0xCD4D, - 0xCD4F, 0xCDC1, 0xCDC3, 0xCDCD, 0xCDCF, 0xCDD0, - 0xCDD2, 0xCDD4, 0xCDDC, 0xCDDE, 0xCDE1, 0xCDE3, - 0xCDED, 0xCDEF, 0xCDF0, 0xCDF2, 0xCDF4, 0xCDFC, - 0xCDFE, 0xCE00, 0xCE02, 0xCE04, 0xCE0C, 0xCE0E, - 0xCE11, 0xCE13, 0xCE1D, 0xCE1F, 0xCE20, 0xCE22, - 0xCE24, 0xCE2C, 0xCE2E, 0xCE31, 0xCE33, 0xCE3D, - 0xCE3F, 0xCE40, 0xCE42, 0xCE44, 0xCE4C, 0xCE4E, - 0xCEC0, 0xCEC2, 0xCEC4, 0xCECC, 0xCECE, 0xCED1, - 0xCED3, 0xCEDD, 0xCEDF, 0xCEE0, 0xCEE2, 0xCEE4, - 0xCEEC, 0xCEEE, 0xCEF1, 0xCEF3, 0xCEFD, 0xCEFF, - 0xCF01, 0xCF03, 0xCF0D, 0xCF0F, 0xCF10, 0xCF12, - 0xCF14, 0xCF1C, 0xCF1E, 0xCF21, 0xCF23, 0xCF2D, - 0xCF2F, 0xCF30, 0xCF32, 0xCF34, 0xCF3C, 0xCF3E, - 0xCF41, 0xCF43, 0xCF4D, 0xCF4F, 0xCFC1, 0xCFC3, - 0xCFCD, 0xCFCF, 0xCFD0, 0xCFD2, 0xCFD4, 0xCFDC, - 0xCFDE, 0xCFE1, 0xCFE3, 0xCFED, 0xCFEF, 0xCFF0, - 0xCFF2, 0xCFF4, 0xCFFC, 0xCFFE, 0xD001, 0xD003, - 0xD00D, 0xD00F, 0xD010, 0xD012, 0xD014, 0xD01C, - 0xD01E, 0xD021, 0xD023, 0xD02D, 0xD02F, 0xD030, - 0xD032, 0xD034, 0xD03C, 0xD03E, 0xD041, 0xD043, - 0xD04D, 0xD04F, 0xD0C1, 0xD0C3, 0xD0CD, 0xD0CF, - 0xD0D0, 0xD0D2, 0xD0D4, 0xD0DC, 0xD0DE, 0xD0E1, - 0xD0E3, 0xD0ED, 0xD0EF, 0xD0F0, 0xD0F2, 0xD0F4, - 0xD0FC, 0xD0FE, 0xD100, 0xD102, 0xD104, 0xD10C, - 0xD10E, 0xD111, 0xD113, 0xD11D, 0xD11F, 0xD120, - 0xD122, 0xD124, 0xD12C, 0xD12E, 0xD131, 0xD133, - 0xD13D, 0xD13F, 0xD140, 0xD142, 0xD144, 0xD14C, - 0xD14E, 0xD1C0, 0xD1C2, 0xD1C4, 0xD1CC, 0xD1CE, - 0xD1D1, 0xD1D3, 0xD1DD, 0xD1DF, 0xD1E0, 0xD1E2, - 0xD1E4, 0xD1EC, 0xD1EE, 0xD1F1, 0xD1F3, 0xD1FD, - 0xD1FF, 0xD201, 0xD203, 0xD20D, 0xD20F, 0xD210, - 0xD212, 0xD214, 0xD21C, 0xD21E, 0xD221, 0xD223, - 0xD22D, 0xD22F, 0xD230, 0xD232, 0xD234, 0xD23C, - 0xD23E, 0xD241, 0xD243, 0xD24D, 0xD24F, 0xD2C1, - 0xD2C3, 0xD2CD, 0xD2CF, 0xD2D0, 0xD2D2, 0xD2D4, - 0xD2DC, 0xD2DE, 0xD2E1, 0xD2E3, 0xD2ED, 0xD2EF, - 0xD2F0, 0xD2F2, 0xD2F4, 0xD2FC, 0xD2FE, 0xD300, - 0xD302, 0xD304, 0xD30C, 0xD30E, 0xD311, 0xD313, - 0xD31D, 0xD31F, 0xD320, 0xD322, 0xD324, 0xD32C, - 0xD32E, 0xD331, 0xD333, 0xD33D, 0xD33F, 0xD340, - 0xD342, 0xD344, 0xD34C, 0xD34E, 0xD3C0, 0xD3C2, - 0xD3C4, 0xD3CC, 0xD3CE, 0xD3D1, 0xD3D3, 0xD3DD, - 0xD3DF, 0xD3E0, 0xD3E2, 0xD3E4, 0xD3EC, 0xD3EE, - 0xD3F1, 0xD3F3, 0xD3FD, 0xD3FF, 0xD401, 0xD403, - 0xD40D, 0xD40F, 0xD410, 0xD412, 0xD414, 0xD41C, - 0xD41E, 0xD421, 0xD423, 0xD42D, 0xD42F, 0xD430, - 0xD432, 0xD434, 0xD43C, 0xD43E, 0xD441, 0xD443, - 0xD44D, 0xD44F, 0xD4C1, 0xD4C3, 0xD4CD, 0xD4CF, - 0xD4D0, 0xD4D2, 0xD4D4, 0xD4DC, 0xD4DE, 0xD4E1, - 0xD4E3, 0xD4ED, 0xD4EF, 0xD4F0, 0xD4F2, 0xD4F4, - 0xD4FC, 0xD4FE, 0xDC01, 0xDC03, 0xDC0D, 0xDC0F, - 0xDC10, 0xDC12, 0xDC14, 0xDC1C, 0xDC1E, 0xDC21, - 0xDC23, 0xDC2D, 0xDC2F, 0xDC30, 0xDC32, 0xDC34, - 0xDC3C, 0xDC3E, 0xDC41, 0xDC43, 0xDC4D, 0xDC4F, - 0xDCC1, 0xDCC3, 0xDCCD, 0xDCCF, 0xDCD0, 0xDCD2, - 0xDCD4, 0xDCDC, 0xDCDE, 0xDCE1, 0xDCE3, 0xDCED, - 0xDCEF, 0xDCF0, 0xDCF2, 0xDCF4, 0xDCFC, 0xDCFE, - 0xDD00, 0xDD02, 0xDD04, 0xDD0C, 0xDD0E, 0xDD11, - 0xDD13, 0xDD1D, 0xDD1F, 0xDD20, 0xDD22, 0xDD24, - 0xDD2C, 0xDD2E, 0xDD31, 0xDD33, 0xDD3D, 0xDD3F, - 0xDD40, 0xDD42, 0xDD44, 0xDD4C, 0xDD4E, 0xDDC0, - 0xDDC2, 0xDDC4, 0xDDCC, 0xDDCE, 0xDDD1, 0xDDD3, - 0xDDDD, 0xDDDF, 0xDDE0, 0xDDE2, 0xDDE4, 0xDDEC, - 0xDDEE, 0xDDF1, 0xDDF3, 0xDDFD, 0xDDFF, 0xDE01, - 0xDE03, 0xDE0D, 0xDE0F, 0xDE10, 0xDE12, 0xDE14, - 0xDE1C, 0xDE1E, 0xDE21, 0xDE23, 0xDE2D, 0xDE2F, - 0xDE30, 0xDE32, 0xDE34, 0xDE3C, 0xDE3E, 0xDE41, - 0xDE43, 0xDE4D, 0xDE4F, 0xDEC1, 0xDEC3, 0xDECD, - 0xDECF, 0xDED0, 0xDED2, 0xDED4, 0xDEDC, 0xDEDE, - 0xDEE1, 0xDEE3, 0xDEED, 0xDEEF, 0xDEF0, 0xDEF2, - 0xDEF4, 0xDEFC, 0xDEFE, 0xDF00, 0xDF02, 0xDF04, - 0xDF0C, 0xDF0E, 0xDF11, 0xDF13, 0xDF1D, 0xDF1F, - 0xDF20, 0xDF22, 0xDF24, 0xDF2C, 0xDF2E, 0xDF31, - 0xDF33, 0xDF3D, 0xDF3F, 0xDF40, 0xDF42, 0xDF44, - 0xDF4C, 0xDF4E, 0xDFC0, 0xDFC2, 0xDFC4, 0xDFCC, - 0xDFCE, 0xDFD1, 0xDFD3, 0xDFDD, 0xDFDF, 0xDFE0, - 0xDFE2, 0xDFE4, 0xDFEC, 0xDFEE, 0xDFF1, 0xDFF3, - 0xDFFD, 0xDFFF, 0xE000, 0xE002, 0xE004, 0xE00C, - 0xE00E, 0xE011, 0xE013, 0xE01D, 0xE01F, 0xE020, - 0xE022, 0xE024, 0xE02C, 0xE02E, 0xE031, 0xE033, - 0xE03D, 0xE03F, 0xE040, 0xE042, 0xE044, 0xE04C, - 0xE04E, 0xE0C0, 0xE0C2, 0xE0C4, 0xE0CC, 0xE0CE, - 0xE0D1, 0xE0D3, 0xE0DD, 0xE0DF, 0xE0E0, 0xE0E2, - 0xE0E4, 0xE0EC, 0xE0EE, 0xE0F1, 0xE0F3, 0xE0FD, - 0xE0FF, 0xE101, 0xE103, 0xE10D, 0xE10F, 0xE110, - 0xE112, 0xE114, 0xE11C, 0xE11E, 0xE121, 0xE123, - 0xE12D, 0xE12F, 0xE130, 0xE132, 0xE134, 0xE13C, - 0xE13E, 0xE141, 0xE143, 0xE14D, 0xE14F, 0xE1C1, - 0xE1C3, 0xE1CD, 0xE1CF, 0xE1D0, 0xE1D2, 0xE1D4, - 0xE1DC, 0xE1DE, 0xE1E1, 0xE1E3, 0xE1ED, 0xE1EF, - 0xE1F0, 0xE1F2, 0xE1F4, 0xE1FC, 0xE1FE, 0xE200, - 0xE202, 0xE204, 0xE20C, 0xE20E, 0xE211, 0xE213, - 0xE21D, 0xE21F, 0xE220, 0xE222, 0xE224, 0xE22C, - 0xE22E, 0xE231, 0xE233, 0xE23D, 0xE23F, 0xE240, - 0xE242, 0xE244, 0xE24C, 0xE24E, 0xE2C0, 0xE2C2, - 0xE2C4, 0xE2CC, 0xE2CE, 0xE2D1, 0xE2D3, 0xE2DD, - 0xE2DF, 0xE2E0, 0xE2E2, 0xE2E4, 0xE2EC, 0xE2EE, - 0xE2F1, 0xE2F3, 0xE2FD, 0xE2FF, 0xE301, 0xE303, - 0xE30D, 0xE30F, 0xE310, 0xE312, 0xE314, 0xE31C, - 0xE31E, 0xE321, 0xE323, 0xE32D, 0xE32F, 0xE330, - 0xE332, 0xE334, 0xE33C, 0xE33E, 0xE341, 0xE343, - 0xE34D, 0xE34F, 0xE3C1, 0xE3C3, 0xE3CD, 0xE3CF, - 0xE3D0, 0xE3D2, 0xE3D4, 0xE3DC, 0xE3DE, 0xE3E1, - 0xE3E3, 0xE3ED, 0xE3EF, 0xE3F0, 0xE3F2, 0xE3F4, - 0xE3FC, 0xE3FE, 0xE400, 0xE402, 0xE404, 0xE40C, - 0xE40E, 0xE411, 0xE413, 0xE41D, 0xE41F, 0xE420, - 0xE422, 0xE424, 0xE42C, 0xE42E, 0xE431, 0xE433, - 0xE43D, 0xE43F, 0xE440, 0xE442, 0xE444, 0xE44C, - 0xE44E, 0xE4C0, 0xE4C2, 0xE4C4, 0xE4CC, 0xE4CE, - 0xE4D1, 0xE4D3, 0xE4DD, 0xE4DF, 0xE4E0, 0xE4E2, - 0xE4E4, 0xE4EC, 0xE4EE, 0xE4F1, 0xE4F3, 0xE4FD, - 0xE4FF, 0xEC00, 0xEC02, 0xEC04, 0xEC0C, 0xEC0E, - 0xEC11, 0xEC13, 0xEC1D, 0xEC1F, 0xEC20, 0xEC22, - 0xEC24, 0xEC2C, 0xEC2E, 0xEC31, 0xEC33, 0xEC3D, - 0xEC3F, 0xEC40, 0xEC42, 0xEC44, 0xEC4C, 0xEC4E, - 0xECC0, 0xECC2, 0xECC4, 0xECCC, 0xECCE, 0xECD1, - 0xECD3, 0xECDD, 0xECDF, 0xECE0, 0xECE2, 0xECE4, - 0xECEC, 0xECEE, 0xECF1, 0xECF3, 0xECFD, 0xECFF, - 0xED01, 0xED03, 0xED0D, 0xED0F, 0xED10, 0xED12, - 0xED14, 0xED1C, 0xED1E, 0xED21, 0xED23, 0xED2D, - 0xED2F, 0xED30, 0xED32, 0xED34, 0xED3C, 0xED3E, - 0xED41, 0xED43, 0xED4D, 0xED4F, 0xEDC1, 0xEDC3, - 0xEDCD, 0xEDCF, 0xEDD0, 0xEDD2, 0xEDD4, 0xEDDC, - 0xEDDE, 0xEDE1, 0xEDE3, 0xEDED, 0xEDEF, 0xEDF0, - 0xEDF2, 0xEDF4, 0xEDFC, 0xEDFE, 0xEE00, 0xEE02, - 0xEE04, 0xEE0C, 0xEE0E, 0xEE11, 0xEE13, 0xEE1D, - 0xEE1F, 0xEE20, 0xEE22, 0xEE24, 0xEE2C, 0xEE2E, - 0xEE31, 0xEE33, 0xEE3D, 0xEE3F, 0xEE40, 0xEE42, - 0xEE44, 0xEE4C, 0xEE4E, 0xEEC0, 0xEEC2, 0xEEC4, - 0xEECC, 0xEECE, 0xEED1, 0xEED3, 0xEEDD, 0xEEDF, - 0xEEE0, 0xEEE2, 0xEEE4, 0xEEEC, 0xEEEE, 0xEEF1, - 0xEEF3, 0xEEFD, 0xEEFF, 0xEF01, 0xEF03, 0xEF0D, - 0xEF0F, 0xEF10, 0xEF12, 0xEF14, 0xEF1C, 0xEF1E, - 0xEF21, 0xEF23, 0xEF2D, 0xEF2F, 0xEF30, 0xEF32, - 0xEF34, 0xEF3C, 0xEF3E, 0xEF41, 0xEF43, 0xEF4D, - 0xEF4F, 0xEFC1, 0xEFC3, 0xEFCD, 0xEFCF, 0xEFD0, - 0xEFD2, 0xEFD4, 0xEFDC, 0xEFDE, 0xEFE1, 0xEFE3, - 0xEFED, 0xEFEF, 0xEFF0, 0xEFF2, 0xEFF4, 0xEFFC, - 0xEFFE, 0xF001, 0xF003, 0xF00D, 0xF00F, 0xF010, - 0xF012, 0xF014, 0xF01C, 0xF01E, 0xF021, 0xF023, - 0xF02D, 0xF02F, 0xF030, 0xF032, 0xF034, 0xF03C, - 0xF03E, 0xF041, 0xF043, 0xF04D, 0xF04F, 0xF0C1, - 0xF0C3, 0xF0CD, 0xF0CF, 0xF0D0, 0xF0D2, 0xF0D4, - 0xF0DC, 0xF0DE, 0xF0E1, 0xF0E3, 0xF0ED, 0xF0EF, - 0xF0F0, 0xF0F2, 0xF0F4, 0xF0FC, 0xF0FE, 0xF100, - 0xF102, 0xF104, 0xF10C, 0xF10E, 0xF111, 0xF113, - 0xF11D, 0xF11F, 0xF120, 0xF122, 0xF124, 0xF12C, - 0xF12E, 0xF131, 0xF133, 0xF13D, 0xF13F, 0xF140, - 0xF142, 0xF144, 0xF14C, 0xF14E, 0xF1C0, 0xF1C2, - 0xF1C4, 0xF1CC, 0xF1CE, 0xF1D1, 0xF1D3, 0xF1DD, - 0xF1DF, 0xF1E0, 0xF1E2, 0xF1E4, 0xF1EC, 0xF1EE, - 0xF1F1, 0xF1F3, 0xF1FD, 0xF1FF, 0xF201, 0xF203, - 0xF20D, 0xF20F, 0xF210, 0xF212, 0xF214, 0xF21C, - 0xF21E, 0xF221, 0xF223, 0xF22D, 0xF22F, 0xF230, - 0xF232, 0xF234, 0xF23C, 0xF23E, 0xF241, 0xF243, - 0xF24D, 0xF24F, 0xF2C1, 0xF2C3, 0xF2CD, 0xF2CF, - 0xF2D0, 0xF2D2, 0xF2D4, 0xF2DC, 0xF2DE, 0xF2E1, - 0xF2E3, 0xF2ED, 0xF2EF, 0xF2F0, 0xF2F2, 0xF2F4, - 0xF2FC, 0xF2FE, 0xF300, 0xF302, 0xF304, 0xF30C, - 0xF30E, 0xF311, 0xF313, 0xF31D, 0xF31F, 0xF320, - 0xF322, 0xF324, 0xF32C, 0xF32E, 0xF331, 0xF333, - 0xF33D, 0xF33F, 0xF340, 0xF342, 0xF344, 0xF34C, - 0xF34E, 0xF3C0, 0xF3C2, 0xF3C4, 0xF3CC, 0xF3CE, - 0xF3D1, 0xF3D3, 0xF3DD, 0xF3DF, 0xF3E0, 0xF3E2, - 0xF3E4, 0xF3EC, 0xF3EE, 0xF3F1, 0xF3F3, 0xF3FD, - 0xF3FF, 0xF401, 0xF403, 0xF40D, 0xF40F, 0xF410, - 0xF412, 0xF414, 0xF41C, 0xF41E, 0xF421, 0xF423, - 0xF42D, 0xF42F, 0xF430, 0xF432, 0xF434, 0xF43C, - 0xF43E, 0xF441, 0xF443, 0xF44D, 0xF44F, 0xF4C1, - 0xF4C3, 0xF4CD, 0xF4CF, 0xF4D0, 0xF4D2, 0xF4D4, - 0xF4DC, 0xF4DE, 0xF4E1, 0xF4E3, 0xF4ED, 0xF4EF, - 0xF4F0, 0xF4F2, 0xF4F4, 0xF4FC, 0xF4FE, 0xFC01, - 0xFC03, 0xFC0D, 0xFC0F, 0xFC10, 0xFC12, 0xFC14, - 0xFC1C, 0xFC1E, 0xFC21, 0xFC23, 0xFC2D, 0xFC2F, - 0xFC30, 0xFC32, 0xFC34, 0xFC3C, 0xFC3E, 0xFC41, - 0xFC43, 0xFC4D, 0xFC4F, 0xFCC1, 0xFCC3, 0xFCCD, - 0xFCCF, 0xFCD0, 0xFCD2, 0xFCD4, 0xFCDC, 0xFCDE, - 0xFCE1, 0xFCE3, 0xFCED, 0xFCEF, 0xFCF0, 0xFCF2, - 0xFCF4, 0xFCFC, 0xFCFE, 0xFD00, 0xFD02, 0xFD04, - 0xFD0C, 0xFD0E, 0xFD11, 0xFD13, 0xFD1D, 0xFD1F, - 0xFD20, 0xFD22, 0xFD24, 0xFD2C, 0xFD2E, 0xFD31, - 0xFD33, 0xFD3D, 0xFD3F, 0xFD40, 0xFD42, 0xFD44, - 0xFD4C, 0xFD4E, 0xFDC0, 0xFDC2, 0xFDC4, 0xFDCC, - 0xFDCE, 0xFDD1, 0xFDD3, 0xFDDD, 0xFDDF, 0xFDE0, - 0xFDE2, 0xFDE4, 0xFDEC, 0xFDEE, 0xFDF1, 0xFDF3, - 0xFDFD, 0xFDFF, 0xFE01, 0xFE03, 0xFE0D, 0xFE0F, - 0xFE10, 0xFE12, 0xFE14, 0xFE1C, 0xFE1E, 0xFE21, - 0xFE23, 0xFE2D, 0xFE2F, 0xFE30, 0xFE32, 0xFE34, - 0xFE3C, 0xFE3E, 0xFE41, 0xFE43, 0xFE4D, 0xFE4F, - 0xFEC1, 0xFEC3, 0xFECD, 0xFECF, 0xFED0, 0xFED2, - 0xFED4, 0xFEDC, 0xFEDE, 0xFEE1, 0xFEE3, 0xFEED, - 0xFEEF, 0xFEF0, 0xFEF2, 0xFEF4, 0xFEFC, 0xFEFE, - 0xFF00, 0xFF02, 0xFF04, 0xFF0C, 0xFF0E, 0xFF11, - 0xFF13, 0xFF1D, 0xFF1F, 0xFF20, 0xFF22, 0xFF24, - 0xFF2C, 0xFF2E, 0xFF31, 0xFF33, 0xFF3D, 0xFF3F, - 0xFF40, 0xFF42, 0xFF44, 0xFF4C, 0xFF4E, 0xFFC0, - 0xFFC2, 0xFFC4, 0xFFCC, 0xFFCE, 0xFFD1, 0xFFD3, - 0xFFDD, 0xFFDF, 0xFFE0, 0xFFE2, 0xFFE4, 0xFFEC, - 0xFFEE, 0xFFF1, 0xFFF3, 0xFFFD, 0xFFFF, +static const uint8_t on2avc_cb7_bits[ON2AVC_CB_7_8_CODES] = { + 1, 7, 11, 12, 12, 12, 13, 14, 15, 15, 13, 13, 13, 13, 13, 13, 13, 14, 14, + 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, + 13, 10, 12, 13, 13, 12, 12, 7, 7, 7, 11, 12, 13, 13, 12, 12, 12, 12, 12, + 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 11, 12, 13, 15, 15, 15, 15, 11, + 11, 12, 12, 12, 12, 11, 11, 7, 7, 7, 9, 9, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 13, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 11, 11, + 9, 11, 11, 12, 13, 14, 14, 12, 12, 10, 11, 12, 12, 13, 13, 13, 13, 12, 13, + 13, 11, 12, 12, 11, 12, 13, 14, 14, 11, 12, 12, 11, 11, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 13, 14, 14, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, + 12, 12, 12, 12, 11, 11, 10, 12, 13, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11, + 12, 13, 13, 11, 11, 9, 10, 11, 13, 13, 13, 13, 7, 13, 13, 13, 13, 12, 13, + 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 9, 11, 12, 12, 11, 16, + 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, + 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, + 12, 12, 12, 11, 12, 12, 11, 11, 11, 11, 11, 12, 12, 10, 11, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 11, 11, + 9, 12, 13, 14, 14, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 11, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 7, 9, 9, 10, 11, + 12, 13, 13, 12, 12, 12, 12, 11, 12, 12, 7, 7, 7, 7, 7, 9, 11, 11, 11, + 13, 13, 13, 13, 10, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, + 12, 7, 9, 11, 12, 12, 11, 12, 13, 15, 16, 17, 17, 15, 15, 10, 11, 12, 12, + 10, 12, 12, 12, 12, 7, 7, 9, 12, 12, 12, 12, 11, 12, 12, 9, 10, 11, 12, + 15, 15, 15, 15, 15, 15, 15, 15, 9, 10, 11, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 9, 9, 7, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 14, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, + 13, 13, 13, 13, 7, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, + 12, 11, 11, 9, 11, 12, 13, 13, 11, 11, 7, 9, 10, 12, 12, 12, 12, 9, 12, + 12, 12, 12, 11, 12, 12, 7, 9, 11, 12, 13, 13, 11, 13, 13, 13, 13, 9, 9, + 7, 9, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 11, + 11, 11, 11, 12, 12, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 9, 11, 11, 11, 11, 8, 11, 14, 15, + 17, 17, 17, 17, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 12, 12, 12, 12, 11, 12, 12, 10, 11, 11, 9, 10, 11, 12, 13, 13, 10, + 11, 11, 11, 12, 12, 12, 12, 12, 12, 8, 9, 12, 12, 12, 12, 11, 11, 8, 10, + 11, 12, 13, 13, 10, 11, 11, 8, 10, 11, 11, 10, 13, 13, 13, 13, 13, 13, 13, + 13, 8, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 8, + 10, 11, 11, 10, 11, 12, 13, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 6, 8, 11, 11, 11, 11, 10, 12, 12, 12, 12, 8, 12, 12, 12, + 12, 12, 12, 12, 12, 11, 12, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 11, 11, 11, 11, 11, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 10, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 17, + 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 12, 12, 11, 12, 12, 10, 11, 11, }; -static const uint16_t on2avc_cb8_codes[ON2AVC_CB7_8_CODES] = { - 0x028C, 0x05E6, 0xFAD9, 0x7DEF, 0x06CE, 0x004C, - 0x0178, 0x0A1D, 0x00AE, 0x046E, 0x03D5, 0x3F58, - 0x0EAA, 0x0233, 0x1A6A, 0x271F, 0x05CE, 0x0179, - 0x02FB, 0x0029, 0x237D, 0x7DF0, 0x03BA, 0xFAD6, - 0xFAD7, 0x7DEE, 0xFAD5, 0x0081, 0x033C, 0x1A69, - 0xFAD8, 0x05A1, 0x01F1, 0x063D, 0x237C, 0x003E, - 0x0323, 0x010C, 0x05A3, 0x05A2, 0x0051, 0x019D, - 0xFADB, 0x0EAB, 0x00AA, 0x003E, 0x01A6, 0x7DF2, - 0x0058, 0x01F1, 0x029B, 0x03C0, 0x122D, 0x0075, - 0x3F5A, 0x0B98, 0x0005, 0x058B, 0x0D68, 0x013F, - 0x00D0, 0x05CF, 0x01C0, 0x03BB, 0x046F, 0xFADA, - 0x01A0, 0x0972, 0x122C, 0x3F59, 0x0766, 0x05A4, - 0x00ED, 0x05A5, 0x0D67, 0x03D0, 0x0046, 0x01FF, - 0x7DF1, 0x00D6, 0x017C, 0x0034, 0x08B5, 0x0234, - 0x237E, 0x0033, 0x0083, 0x0B99, 0x0EAC, 0x0202, - 0x0714, 0x0715, 0x01C3, 0x05A6, 0x0324, 0x13EC, - 0x02F8, 0x7DF3, 0x13EB, 0x0140, 0x0470, 0x04F8, - 0x0007, 0x0377, 0x0208, 0x04A3, 0x13EA, 0x0006, - 0x0188, 0x033D, 0x122E, 0x1A6B, 0x0A1E, 0x0126, - 0x03C1, 0x05E7, 0x05D0, 0x04F7, 0x03DB, 0x033E, - 0x122F, 0x0082, 0x1A6F, 0x2380, 0x05D2, 0x0009, - 0x05A9, 0x1A70, 0x1233, 0x05A7, 0x05A8, 0x0975, - 0x2381, 0x1234, 0x0788, 0x2720, 0x1235, 0x05D3, - 0xFADD, 0x3F5B, 0x0789, 0x0D69, 0xFADE, 0xFADF, - 0x01C4, 0x0EAD, 0x0EA1, 0x1230, 0x0008, 0x13ED, - 0x1A6C, 0xFADC, 0x1231, 0x0973, 0x1232, 0x1A6D, - 0x13EE, 0x1A6E, 0x0974, 0x237F, 0x05D1, 0x033F, - 0x0267, 0x078A, 0xFAE3, 0xFAE2, 0x0B9A, 0x00FC, - 0x0EAE, 0x05D6, 0x0325, 0x0326, 0x0B9B, 0x3F5F, - 0x3F5E, 0x0471, 0x02F9, 0xFAE4, 0x1A72, 0x03C2, - 0x05D7, 0x2721, 0x3F60, 0xFAE5, 0x2382, 0xFAE0, - 0x7DF5, 0xFAE1, 0x7DF4, 0x000A, 0x0235, 0x3F5C, - 0x1A71, 0x0716, 0x036C, 0x0767, 0x05D4, 0x3F5D, - 0x0717, 0x01BF, 0x000B, 0x05D5, 0x0243, 0xFAD0, - 0x04F6, 0x7DE5, 0xFACF, 0x0E9E, 0x0074, 0x271A, - 0x1A61, 0x015B, 0x0046, 0x06CA, 0x237A, 0x7DE6, - 0x0070, 0x1A62, 0x1227, 0x7DE7, 0x0032, 0xFAD1, - 0x05CA, 0x7DE8, 0x237B, 0x13E6, 0x05C8, 0x1226, - 0x2377, 0x2719, 0x3F54, 0x3F55, 0x13E5, 0x2378, - 0x03BF, 0x05C9, 0x01C0, 0x7DE4, 0x7DE3, 0x0A19, - 0x0045, 0x1A60, 0x2379, 0x021B, 0x271C, 0x13E7, - 0x271B, 0x1A67, 0x059D, 0x0EA6, 0x0EA7, 0x0174, - 0x0EA5, 0x0A1A, 0x1FFD, 0x033A, 0x0E9F, 0x3F57, - 0x122B, 0xFAD2, 0x0D64, 0x05CC, 0x06CB, 0x1FFE, - 0x059E, 0x02F7, 0x1228, 0x7DE9, 0x059B, 0x096C, - 0x1A63, 0x1A64, 0x1A65, 0x1229, 0x0EA3, 0x059C, - 0x096D, 0x05CB, 0x003C, 0x1A66, 0x0D63, 0x3F56, - 0x122A, 0x0EA4, 0x0712, 0x0232, 0x13E8, 0x061E, - 0x08B4, 0x016E, 0x0176, 0x033B, 0x0028, 0x05E5, - 0x061F, 0x0000, 0x0376, 0x0071, 0x096F, 0x7DEB, - 0x0001, 0x05CD, 0xFAD3, 0x0186, 0x0EA9, 0x13E9, - 0x06CD, 0x7DEA, 0x0340, 0x271D, 0x0175, 0x01C1, - 0x0D65, 0x1FFF, 0x0B97, 0x0EA8, 0x06CC, 0x0375, - 0x05E4, 0x08B3, 0x05E3, 0x0341, 0x0EA0, 0x096E, - 0x03CF, 0x0056, 0x0970, 0x1A68, 0x029A, 0x010A, - 0x00A8, 0x01CA, 0x7DED, 0x00A5, 0x001E, 0x05A0, - 0x0D66, 0x0047, 0x0971, 0x0A1C, 0x02CE, 0xFAD4, - 0x0004, 0x010F, 0x271E, 0x0415, 0x0212, 0x019F, - 0x7DEC, 0x01C2, 0x0187, 0x059F, 0x0A1B, 0x0527, - 0x0002, 0x003D, 0x0041, 0x0177, 0x0713, 0x010E, - 0x0102, 0x02CF, 0x00CA, 0x0003, 0x01BF, 0x0120, - 0x05DE, 0x0043, 0x01D0, 0x018C, 0x00AB, 0x029F, - 0x03DF, 0x03C5, 0x0247, 0x08BB, 0x0013, 0x03D2, - 0x0015, 0x0EB0, 0x02FA, 0x05E8, 0x0014, 0x0EB1, - 0x0476, 0x1A78, 0x01F4, 0x06D1, 0x017C, 0x0042, - 0x063F, 0x0011, 0x0012, 0x01C7, 0x04FB, 0x1A77, - 0x01AA, 0x04FC, 0x0A21, 0x021D, 0x01EE, 0x02BC, - 0x01C2, 0x021E, 0x00AA, 0x00D6, 0x021F, 0x016F, - 0x0077, 0x01AB, 0x00AC, 0x0073, 0x078D, 0x00AF, - 0x002E, 0x0220, 0x0086, 0x0103, 0x0086, 0x0127, - 0x0BA0, 0x05DF, 0x0EA5, 0x03D3, 0x05E0, 0x017D, - 0xFAE7, 0x015A, 0x03C6, 0x0768, 0xFAE6, 0x3F65, - 0x01F3, 0x0B9F, 0x0016, 0x0EA4, 0x078C, 0x02BD, - 0x004D, 0x0116, 0x037A, 0x0076, 0x0056, 0x058E, - 0x06D2, 0x0014, 0x009F, 0x0A23, 0x0346, 0x014E, - 0x02BF, 0x00A7, 0x0528, 0x0378, 0x0106, 0x01C3, - 0x017E, 0x0044, 0x03C7, 0x097F, 0x04A5, 0x020B, - 0x05E9, 0x0A24, 0x03D9, 0x0661, 0x0660, 0x014F, - 0x02BE, 0x023B, 0x04FD, 0x0313, 0x0017, 0x08BC, - 0x0769, 0x0622, 0x0D6C, 0x03D7, 0x01C8, 0x0A22, - 0x01AB, 0x0203, 0x076A, 0x03D8, 0x02D1, 0x00A6, - 0x05E3, 0x1A79, 0x1A7A, 0x0981, 0x05B1, 0x04FF, - 0x0982, 0x0348, 0x0128, 0x08BD, 0x0D6D, 0x13F4, - 0x05B2, 0x0624, 0x05B3, 0x0EB2, 0x2729, 0x1237, - 0x05B4, 0x0129, 0x0349, 0x2386, 0x0019, 0x04FE, - 0x05B0, 0xFAE8, 0x3F66, 0x0623, 0x05E1, 0x05E2, - 0x3F67, 0x0980, 0x0347, 0x0BA1, 0x0046, 0x0045, - 0x0EA6, 0x01C9, 0x0018, 0x13F3, 0x078E, 0x0152, - 0x0983, 0x1238, 0x272B, 0x01F2, 0x028F, 0x05E5, - 0x3F69, 0x0418, 0x02FC, 0x017F, 0x0EB3, 0x00EF, - 0x0790, 0x0791, 0x1239, 0x05E6, 0x05E7, 0x1A7C, - 0x034A, 0x001A, 0x0984, 0x05B5, 0x272A, 0x1A7B, - 0x0EA7, 0x0529, 0x02FB, 0x2387, 0x3F68, 0x078F, - 0x006D, 0x0D6E, 0x05B6, 0x039F, 0x014E, 0x058F, - 0x13F5, 0x05E4, 0x020C, 0x0342, 0x1A73, 0x7DF7, - 0x2724, 0x0082, 0x0209, 0x1A74, 0x05DB, 0x03D6, - 0x001F, 0x0B9C, 0x04F9, 0x0096, 0x03C3, 0x0620, - 0x7DF9, 0x7DF8, 0x0EA2, 0x000C, 0x2725, 0x3F61, - 0x0977, 0x0976, 0x2723, 0x05D8, 0x2722, 0x058C, - 0x08B6, 0x05D9, 0x2383, 0x0236, 0x036D, 0x0A1F, - 0x05AA, 0x019C, 0x01C0, 0x0327, 0x05DA, 0x7DF6, - 0x02CF, 0x05DD, 0x0341, 0x05AE, 0x0EAF, 0x2384, - 0x0342, 0x13F0, 0x000D, 0x08B7, 0x000E, 0x003F, - 0x097B, 0x0343, 0x0D6A, 0x1A75, 0x000F, 0x3F63, - 0x05AF, 0x06CF, 0x06D0, 0x2385, 0x13F1, 0x058D, - 0x0237, 0x05AB, 0x7DFA, 0x0EA3, 0x03C4, 0x13EF, - 0x05DC, 0x2726, 0x1236, 0x017A, 0x0978, 0x05AD, - 0x05AC, 0x0340, 0x0238, 0x097A, 0x3F62, 0x0979, - 0x03DE, 0x0010, 0x0345, 0x002A, 0x03D1, 0x01A7, - 0x01F2, 0x009E, 0x020A, 0x0189, 0x0D6B, 0x03C6, - 0x00EE, 0x0A20, 0x017B, 0x04FA, 0x0472, 0x0040, - 0x00CB, 0x08B9, 0x02D0, 0x029E, 0x0020, 0x0344, - 0x0239, 0x02D0, 0x0B9D, 0x023A, 0x0B9E, 0x028D, - 0x03C5, 0x03BE, 0x08B8, 0x078B, 0x0337, 0x0246, - 0x004C, 0x0416, 0x0141, 0x04A4, 0x00E2, 0x0213, - 0x028E, 0x01A7, 0x021C, 0x00D4, 0x01C6, 0x0072, - 0x0067, 0x002B, 0x0473, 0x036F, 0x01E0, 0x036E, - 0x0041, 0x3F64, 0x097E, 0x0621, 0x02BB, 0x00D7, - 0x2728, 0x2727, 0x01C1, 0x0129, 0x0417, 0x13F2, - 0x097C, 0x0142, 0x097D, 0x1A76, 0x08BA, 0x063E, - 0x0100, 0x01AA, 0x018A, 0x00EA, 0x014D, 0x001E, - 0x01C5, 0x03C7, 0x0053, 0x05EC, 0x012D, 0x004C, - 0x0D71, 0x01D0, 0x0023, 0x0D72, 0x0185, 0x02D2, - 0x0719, 0x012F, 0x0502, 0x012E, 0x0A28, 0x098E, - 0x238B, 0x272D, 0x05EE, 0x05BE, 0x0130, 0xFAEE, - 0x272E, 0x0BA2, 0x05EB, 0x01CF, 0xFAED, 0x238A, - 0x01CE, 0x098C, 0x7DFD, 0x05BD, 0x004A, 0x0036, - 0x0037, 0x0628, 0x02FD, 0x048A, 0x017E, 0x004B, - 0x098D, 0x0153, 0x0216, 0x0D73, 0x1A82, 0x0042, - 0x017F, 0x026C, 0x020D, 0x0794, 0x0143, 0x007E, - 0x062A, 0x0798, 0x004F, 0x0EBA, 0x0BA4, 0x023E, - 0x05BF, 0x0EB9, 0x0592, 0x03CC, 0x004E, 0x018E, - 0x032C, 0x0629, 0x0BA3, 0x01F7, 0x0EB8, 0x004D, - 0x0990, 0x0350, 0x098F, 0x0343, 0x0023, 0x052B, - 0x004E, 0x0178, 0x04A6, 0x0291, 0x05ED, 0x00DC, - 0x032D, 0x0504, 0x0991, 0x0A29, 0x0593, 0x01F3, - 0x0A2A, 0x0505, 0x015B, 0x0666, 0x0087, 0x03DA, - 0x0BA5, 0x076D, 0x05C1, 0x03CD, 0x0024, 0x0992, - 0x04A7, 0x0131, 0x05C2, 0x272F, 0x01D1, 0x076B, - 0x076C, 0x1242, 0x05EF, 0x062B, 0x0EAE, 0x13FD, - 0x05C0, 0x0EBB, 0x023F, 0x0D74, 0x0503, 0x02FE, - 0x041A, 0x037B, 0x08BE, 0x0240, 0x0316, 0x0EBD, - 0x3F70, 0x0EBC, 0x0A2B, 0x0BA7, 0x0053, 0x05C5, - 0x13FE, 0x0506, 0x03CE, 0x0026, 0x0994, 0x0038, - 0x0027, 0x0132, 0x020E, 0x2731, 0x0EBE, 0x0796, - 0x018F, 0x05C6, 0x02FF, 0x0795, 0x1A83, 0x3F6E, - 0x0BA6, 0x0025, 0x1243, 0x3F6F, 0x004F, 0x2730, - 0x062C, 0x0993, 0x05C3, 0x05C4, 0x0051, 0x0052, - 0x0351, 0x062D, 0x0050, 0x01F6, 0x08BF, 0x3F71, - 0x238E, 0x05C7, 0x01F7, 0x05C8, 0x062E, 0x012A, - 0x032F, 0x0077, 0x1A86, 0x0EBF, 0x03DB, 0x04AA, - 0x0BA8, 0x13FF, 0x062F, 0xFAF2, 0x071A, 0x0054, - 0xFAF1, 0x2732, 0xFAF0, 0x238C, 0x238D, 0xFAEF, - 0x1A84, 0x0392, 0x1244, 0x0995, 0x0799, 0x007F, - 0x032E, 0x7DFE, 0x1A85, 0x05EE, 0x018A, 0x0996, - 0x0028, 0x0152, 0x025A, 0x0A25, 0x7DFC, 0x3F6B, - 0x023C, 0x018B, 0x05B7, 0x0180, 0x00FD, 0x01BA, - 0x05EA, 0x123D, 0x05E8, 0x002F, 0x0625, 0x05B9, - 0x05B8, 0x0477, 0x13F7, 0x0D6F, 0x3F6C, 0xFAEA, - 0x01CB, 0xFAE9, 0x0985, 0x2388, 0x7DFB, 0x034B, - 0x01CA, 0x0047, 0x123A, 0x3F6A, 0x017D, 0x0662, - 0x123C, 0x123B, 0x0379, 0x024A, 0x13F6, 0x1A7D, - 0x016A, 0x0EAA, 0x123F, 0xFAEC, 0x0EA9, 0x13FB, - 0x0182, 0x0792, 0x05BA, 0x0181, 0x0D70, 0x001F, - 0x001E, 0x05BB, 0x3F6D, 0x0020, 0x2389, 0x1240, - 0x0183, 0x0501, 0x1A7F, 0x06D6, 0x0663, 0x06D3, - 0x13F8, 0x034C, 0x0EB4, 0x123E, 0x1A7E, 0x13F9, - 0x001B, 0x05E9, 0x0EA8, 0x001C, 0xFAEB, 0x05EA, - 0x034D, 0x0500, 0x13FA, 0x001D, 0x0048, 0x0794, - 0x0075, 0x0795, 0x0793, 0x0074, 0x008A, 0x03C9, - 0x05EB, 0x0087, 0x0076, 0x012B, 0x012C, 0x037A, - 0x0718, 0x0022, 0x272C, 0x0988, 0x0EB5, 0x0328, - 0x03CA, 0x05EC, 0x0EAB, 0x06D7, 0x0021, 0x0664, - 0x1A80, 0x0986, 0x0419, 0x03C8, 0x034E, 0x0987, - 0x0626, 0x02FC, 0x00AE, 0x01CC, 0x023D, 0x012A, - 0x0021, 0x0A26, 0x05BC, 0x01F6, 0x0221, 0x0049, - 0x0EB6, 0x0042, 0x02D2, 0x00F2, 0x00AF, 0x0290, - 0x0043, 0x052A, 0x13FC, 0x0A27, 0x032A, 0x1241, - 0x0EB7, 0x0EAD, 0x034F, 0x0EAC, 0x0022, 0x05ED, - 0x0797, 0x032B, 0x0035, 0x0989, 0x0184, 0x037B, - 0x098A, 0x1A81, 0x098B, 0x0796, 0x01CD, 0x025B, - 0x03CB, 0x0627, 0x02DA, 0x010C, 0x02D1, 0x06EA, - 0x0665, 0x0329, 0x0D78, 0x7E05, 0x7E04, 0x140A, - 0x0EB3, 0x0ECF, 0x3F7C, 0x1256, 0x05FB, 0x05CF, - 0xFAFF, 0x3F7D, 0x0ED0, 0x7E06, 0x3F7E, 0x3F7F, - 0xFB00, 0x239B, 0x0ED2, 0x1257, 0x7E07, 0x0ED1, - 0x002D, 0x1255, 0x273A, 0x09A4, 0x239A, 0x0ECD, - 0x273B, 0x1A8C, 0x002E, 0x09A5, 0xFAFE, 0x273C, - 0x0BAF, 0x0BB0, 0x05CE, 0x09A6, 0x00D1, 0x0ECE, - 0x09A8, 0x0030, 0x1A8E, 0x0ED3, 0x09A7, 0x0667, - 0x1258, 0x2740, 0x0D79, 0x3F80, 0x0189, 0x09A9, - 0x0EB5, 0x0359, 0x0ED4, 0x125A, 0x239D, 0x1259, - 0x05D1, 0x0D7A, 0x7E0A, 0x7E09, 0x09AA, 0x273D, - 0x0EB4, 0x273E, 0x002F, 0x0354, 0x05FC, 0x239C, - 0x1A8D, 0x0355, 0x0357, 0x05D0, 0x0358, 0x0356, - 0x01D2, 0x0508, 0x7E08, 0x273F, 0x0302, 0x0ED7, - 0x239E, 0x3F84, 0x08C4, 0x01D3, 0x0BB1, 0x0509, - 0x239F, 0x0303, 0x0133, 0x035C, 0x125B, 0x03D1, - 0x0ED8, 0x035D, 0x035E, 0x2743, 0x2744, 0x09AD, - 0x018A, 0x0031, 0x09AC, 0x3F82, 0x2741, 0x3F81, - 0x035A, 0x3F83, 0x05FD, 0x09AB, 0x0ED5, 0x0ED6, - 0x0633, 0x2742, 0x0055, 0x08C3, 0x0636, 0x035B, - 0x05FE, 0x0D7B, 0x0039, 0xFB05, 0x7E0B, 0x7E0C, - 0x140D, 0x018B, 0x09AF, 0x2746, 0x0032, 0x0056, - 0x09B0, 0x03D2, 0x0A30, 0x2747, 0x0057, 0x0EDA, - 0x050A, 0x125E, 0x0033, 0x2748, 0x0D7C, 0x03D3, - 0x3F85, 0x0034, 0xFB01, 0x140B, 0xFB02, 0x05FF, - 0x125C, 0xFB03, 0x125D, 0x1A8F, 0x0600, 0x05D2, - 0x0602, 0x2745, 0x0601, 0x0ED9, 0x1A90, 0xFB04, - 0x140C, 0x09AE, 0x033A, 0x7E0F, 0x23A2, 0x0A31, - 0x0EB6, 0x0058, 0x3F8A, 0x23A3, 0x01D6, 0x04AB, - 0x0059, 0x0EDB, 0x02D3, 0x018C, 0x04C6, 0x1260, - 0x3F8B, 0x125F, 0x1261, 0x071E, 0x7E10, 0x2749, - 0x140E, 0x3F87, 0x3F86, 0x0035, 0x3F88, 0x3F89, - 0x7E0D, 0x23A0, 0x1A91, 0x0797, 0x0603, 0x1A92, - 0x050B, 0x066A, 0x0306, 0x7E0E, 0x23A1, 0x079B, - 0x0BAA, 0x3F73, 0x7E01, 0x0292, 0x0216, 0x0998, - 0x1247, 0x2390, 0x0301, 0x0999, 0x1400, 0x1A87, - 0x041E, 0x1401, 0x0EC1, 0x2391, 0x3F74, 0x0A2C, - 0x1248, 0x3F75, 0x05C9, 0x0EC2, 0x2733, 0x238F, - 0xFAF3, 0xFAF4, 0x0EC0, 0x0997, 0x3F72, 0xFAF5, - 0x1245, 0x08C0, 0x0BA9, 0x1246, 0x020F, 0x041B, - 0x0186, 0x7E00, 0x7DFF, 0x0300, 0xFAFA, 0x2734, - 0x05F2, 0x124D, 0x2395, 0x099A, 0x2735, 0x3F77, - 0x0EC4, 0x0EC5, 0x1403, 0x0EC6, 0x1402, 0x1A89, - 0x3F78, 0x05F5, 0x05F3, 0x05F4, 0x2736, 0x1404, - 0x7E02, 0x124E, 0x0D75, 0x0029, 0x2392, 0xFAF7, - 0xFAF6, 0x0EC3, 0x1249, 0x2394, 0x2393, 0x05F0, - 0xFAF8, 0x124B, 0x124C, 0x124A, 0x3F76, 0x05CA, - 0x05F1, 0xFAF9, 0x1A88, 0x0187, 0x05F7, 0x124F, - 0x0631, 0x0D76, 0x0EAF, 0x2737, 0x0BAC, 0x099D, - 0x0A2D, 0x1250, 0x1407, 0x0BAD, 0x3F7A, 0x2396, - 0x2397, 0x0353, 0x1A8B, 0x08C2, 0x05CD, 0x099E, - 0x05CC, 0x0352, 0x002A, 0x05CB, 0x03CF, 0x1A8A, - 0x1405, 0x1406, 0x099B, 0x0EC7, 0x0630, 0x002B, - 0x3F79, 0x08C1, 0x0BAB, 0x0507, 0x05F6, 0x0EC8, - 0x099C, 0x0EB0, 0x0A2F, 0x0EB1, 0x2739, 0x09A1, - 0x03D0, 0x1252, 0x7E03, 0x0241, 0x0188, 0x0EB2, - 0x0BAE, 0x05FA, 0x09A2, 0x1254, 0x2398, 0xFAFB, - 0x1253, 0x2399, 0x0ECC, 0xFAFD, 0xFAFC, 0x09A3, - 0x1408, 0x09A0, 0x05F8, 0x3F7B, 0x099F, 0x0D77, - 0x1409, 0x002C, 0x0EC9, 0x0ECB, 0x0A2E, 0x1251, - 0x0ECA, 0x079A, 0x071B, 0x05F9, 0x2738, 0x0632, - 0x002E, 0x0012, 0x7E25, 0xFB1C, 0x0262, 0x001C, - 0x03D6, 0x018E, 0x007C, 0x0342, 0x052E, 0x7E26, - 0xFB1D, 0x01D7, 0x0D7F, 0x126A, 0x2756, 0x09B6, - 0xFB20, 0x3F97, 0xFB21, 0xFB1E, 0xFB1F, 0x23AF, - 0xFB19, 0xFB1A, 0x23AE, 0x7E24, 0x1A95, 0x2755, - 0x2754, 0x05D7, 0x050D, 0x0EE3, 0xFB1B, 0x0EE2, - 0x0BB5, 0x00E3, 0x08CB, 0x05D8, 0x01B9, 0x00E7, - 0x1412, 0x1A96, 0x015A, 0x009A, 0x007B, 0xFB24, - 0x3F99, 0x026D, 0x0026, 0x0EE5, 0x0EE4, 0x0222, - 0x05D9, 0x0D82, 0x7E28, 0x3F9A, 0x0A36, 0xFB25, - 0xFB26, 0x23B1, 0x7E29, 0x126B, 0x7E27, 0x23B0, - 0xFB22, 0x1411, 0x0BB6, 0x3F98, 0x126C, 0x09B7, - 0x02C2, 0x0442, 0x0A33, 0x012B, 0x01C1, 0x0034, - 0xFB23, 0x126D, 0x03DF, 0x0084, 0x0EB7, 0x23B2, - 0x7E2A, 0x052F, 0x018D, 0x0B16, 0x7E2B, 0x01A2, - 0x0736, 0x00F3, 0x060F, 0x003B, 0x003B, 0x081A, - 0x003F, 0x1416, 0x003E, 0x3F9D, 0x126E, 0x7E2E, - 0x7E2C, 0x7E2D, 0x2757, 0x060E, 0xFB28, 0xFB27, - 0x3F9B, 0x050E, 0x0EE6, 0x018F, 0x05DA, 0x0136, - 0x071F, 0xFB29, 0x1413, 0x0137, 0x3F9C, 0x0EE7, - 0x05DB, 0x02DB, 0x05EF, 0x23B5, 0x0EBB, 0x0243, - 0xFB2D, 0x0307, 0xFB2E, 0x275A, 0x0293, 0x041F, - 0x0686, 0x3F9E, 0x0217, 0x0612, 0x05FA, 0x23B6, - 0x7E2F, 0x1A97, 0x275B, 0x0613, 0xFB2F, 0x7E30, - 0xFB2A, 0x23B4, 0x126F, 0x23B3, 0x1270, 0x2758, - 0xFB2B, 0x0610, 0x0BB7, 0x03D7, 0x2759, 0x0916, - 0x050F, 0x0EBA, 0x0BF6, 0xFB2C, 0x0611, 0x00D3, - 0x2C5E, 0x7E36, 0xFB34, 0xFB33, 0x3FA2, 0xFB35, - 0x2FDE, 0x1417, 0x0A37, 0x3FA3, 0x02A2, 0x7E37, - 0xFB36, 0x005E, 0x058A, 0x076F, 0x0886, 0x005F, - 0xFB3B, 0x0686, 0x0342, 0xFB37, 0xFB3A, 0x3F9F, - 0x3FA0, 0xFB31, 0xFB30, 0x23B7, 0x3FA1, 0x23BB, - 0x23BA, 0x1271, 0x0D83, 0x1036, 0x7E32, 0x1272, - 0x7E31, 0x7E33, 0x162E, 0x1273, 0xFB32, 0xFB0C, - 0x1262, 0xFB0D, 0xFB0B, 0x3F8F, 0x0037, 0x1263, - 0x3F90, 0x0EDD, 0x0038, 0x05D3, 0xFB0E, 0x23A7, - 0x0606, 0x1265, 0x3F91, 0x1264, 0x0039, 0xFB0F, - 0x7E14, 0xFB10, 0x274A, 0x274B, 0xFB07, 0xFB08, - 0x23A5, 0xFB06, 0x23A4, 0x0EDC, 0xFB0A, 0xFB09, - 0x7E11, 0x0036, 0x0605, 0x3F8C, 0x7E12, 0x0604, - 0x3F8E, 0x23A6, 0x7E13, 0x3F8D, 0x03DE, 0x7E19, - 0x7E18, 0x0242, 0x0097, 0x08C5, 0xFB13, 0x7E1A, - 0x005A, 0x079B, 0x0607, 0x09B2, 0x033B, 0x05D4, - 0x09B3, 0xFB14, 0x23A8, 0x0637, 0x7E1B, 0x23AA, - 0x23A9, 0x0608, 0x274C, 0xFB12, 0xFB11, 0x7E15, - 0x1266, 0x140F, 0x1267, 0x7E16, 0x274D, 0x079E, - 0x274E, 0x0EDE, 0x066B, 0x09B1, 0x0D7D, 0x3F92, - 0x7E17, 0x079A, 0x002A, 0x00D2, 0x23AC, 0x23AB, - 0x02F2, 0x00B6, 0x0BB2, 0x05D5, 0x0066, 0x03A2, - 0x003A, 0x060B, 0x060A, 0x0317, 0x079F, 0x0362, - 0x2750, 0x050C, 0x3F95, 0x7E1D, 0x7E1E, 0xFB15, - 0x23AD, 0x274F, 0x3F93, 0x3F94, 0x7E1C, 0x0609, - 0x08C6, 0x0EE0, 0x0EDF, 0x035F, 0x0136, 0x076E, - 0x1A93, 0x1268, 0x0A32, 0x024B, 0x08C7, 0x1410, - 0x01EC, 0x0036, 0x0EE1, 0x0363, 0x0072, 0x0030, - 0x003E, 0x2753, 0x7E21, 0x00D7, 0x0117, 0x003A, - 0x0BB4, 0x0126, 0x018D, 0x05D6, 0x7E22, 0xFB16, - 0x0D7E, 0x060D, 0xFB18, 0xFB17, 0x7E23, 0x7E1F, - 0x2752, 0x1269, 0x2751, 0x09B4, 0x08CA, 0x1A94, - 0x3F96, 0x0BB3, 0x0107, 0x09B5, 0x005B, 0x03D6, - 0x00B0, 0x0101, 0x7E20, 0x060C, 0x03D7, 0x0032, - 0x04DE, 0xFA91, 0x7DA8, 0x088E, 0x0374, 0x7DA9, - 0x054E, 0x007A, 0x0223, 0x0152, 0x3F26, 0x7DAA, - 0x0610, 0x1A36, 0x13B3, 0x0E58, 0x1A35, 0x7DAD, - 0x3F27, 0x7DAE, 0x7DAB, 0x7DAC, 0xFA8D, 0x2347, - 0xFA8E, 0xFA8C, 0x7DA6, 0x3F24, 0x2348, 0x7DA7, - 0x0E4F, 0x02C8, 0x0376, 0xFA90, 0xFA8F, 0x0116, - 0x008A, 0x059A, 0x3F25, 0x0044, 0x00AC, 0x1A37, - 0x0153, 0x0066, 0x01DE, 0x049C, 0xFA96, 0x3F28, - 0x0370, 0x00EA, 0x054F, 0x3F29, 0x006B, 0x093C, - 0x0570, 0x11E2, 0x26E0, 0x1A38, 0x26E1, 0x234A, - 0x7DB1, 0x093D, 0x1FD7, 0x2349, 0x7DAF, 0x7DB0, - 0x0310, 0x0775, 0xFA93, 0xFA92, 0x13B4, 0x009A, - 0x0022, 0x093B, 0x020E, 0x002A, 0x003C, 0xFA95, - 0xFA94, 0x033C, 0x00A8, 0x00C9, 0x26E3, 0xFA99, - 0x051D, 0x00FA, 0x0154, 0x093E, 0x00DE, 0x0371, - 0x002E, 0xFA9A, 0x11E3, 0x0377, 0x0776, 0x7DB2, - 0x11E4, 0x11E5, 0x7DB3, 0x3F2B, 0xFA9B, 0x234E, - 0x11E6, 0x26E2, 0x059B, 0xFA98, 0xFA97, 0x234B, - 0x0A0D, 0x059C, 0x234C, 0x0571, 0x006C, 0x075C, - 0x234D, 0x3F2A, 0x06C2, 0x00FE, 0x0311, 0x059D, - 0x010A, 0x031C, 0x059E, 0x11E8, 0x0587, 0x2352, - 0x0312, 0x7DB6, 0xFA9E, 0x04DF, 0x1FD8, 0x11E9, - 0x093F, 0x0A0E, 0x0E5A, 0x11EA, 0x2353, 0x1FD9, - 0x0573, 0x11EB, 0x7DB7, 0xFA9F, 0x0E5B, 0xFA9C, - 0xFA9D, 0x7DB4, 0x234F, 0x0E59, 0x0572, 0x2351, - 0x2350, 0x11E7, 0x049D, 0x3F2D, 0x3F2C, 0x0023, - 0x010D, 0x088F, 0x7DB5, 0x26E4, 0x0611, 0xFAA4, - 0x1A39, 0xFAA5, 0xFAA3, 0x26E7, 0xFAA6, 0x3F2F, - 0x2356, 0x2357, 0x0940, 0x13B8, 0xFAA7, 0x7DBC, - 0x1FDA, 0x2358, 0xFAA8, 0x3F30, 0x26E8, 0xFAA9, - 0xFAAA, 0xFAAB, 0x2359, 0x7DBD, 0x7DB9, 0x2354, - 0x11EC, 0xFAA0, 0x7DB8, 0x13B5, 0x11ED, 0x2355, - 0x7DBA, 0x13B6, 0x13B7, 0x7DBB, 0xFAA1, 0x26E5, - 0x0612, 0x3F2E, 0x26E6, 0xFAA2, 0x7D9E, 0x0590, - 0x7D9F, 0xBF7D, 0x0D0F, 0x13AF, 0x0591, 0x1A1C, - 0x1FD3, 0x17EE, 0x0592, 0x3F1A, 0xBF7E, 0x11DC, - 0x0593, 0x206F, 0x7DA0, 0x3F1C, 0xBF7F, 0x1A1E, - 0x3F1D, 0x1A1D, 0x245C, 0x110E, 0x110F, 0x58BE, - 0x0220, 0x0150, 0x1FD2, 0x7D9C, 0x04DC, 0x05E6, - 0x0D0E, 0x001E, 0xBF7C, 0x58BF, 0x0B80, 0x054C, - 0x13AE, 0x206E, 0x02A3, 0x051C, 0x1A30, 0x245F, - 0x0466, 0x7DA1, 0x030A, 0x3F1F, 0xFA82, 0x088C, - 0x05E7, 0x04DD, 0x13B0, 0x0790, 0x1A31, 0x1FD4, - 0x13B1, 0x7DA2, 0x2638, 0x1A32, 0x2341, 0x2340, - 0x2639, 0x3F1E, 0xFA80, 0x0594, 0x11DE, 0x11DF, - 0x0596, 0x1A1F, 0x0595, 0x02C4, 0x051A, 0x0E4D, - 0x0E4C, 0x040C, 0x245E, 0x0464, 0xFA81, 0x245D, - 0x0222, 0x0074, 0x031A, 0x3F21, 0x263B, 0x06EB, - 0x0254, 0x0774, 0x0020, 0x0078, 0x0410, 0x02EE, - 0x13B2, 0xFA84, 0x06C0, 0x0A0A, 0x0E4E, 0x0597, - 0xFA85, 0xFA87, 0x0598, 0x11E0, 0xFA86, 0x263C, - 0x1FD5, 0x2343, 0xFA83, 0x3F20, 0x2342, 0x030B, - 0x263A, 0x0B81, 0x0586, 0x040E, 0x040F, 0x2345, - 0x2344, 0x02C6, 0x0130, 0x030C, 0x054D, 0x01BE, - 0x0132, 0x0599, 0x3F23, 0x00FA, 0x012E, 0x03CE, - 0xFA8B, 0x263E, 0x02C7, 0x006A, 0x093A, 0x0E6E, - 0x0182, 0x0021, 0x00C8, 0x1A33, 0x7DA5, 0x0E6F, - 0x1FD6, 0x1A34, 0x2346, 0x263F, 0x3F22, 0x7DA4, - 0xFA88, 0x7DA3, 0x030D, 0x0A0C, 0xFA89, 0x11E1, - 0x088D, 0x0256, 0x030F, 0x030E, 0x02F8, 0x0060, - 0x02B8, 0xFA8A, 0x263D, 0x0257, 0x13BE, 0x7DCD, - 0xFAB4, 0x0E83, 0x13BF, 0x015B, 0x26F8, 0x26F7, - 0x0B89, 0x0947, 0x3F39, 0x11F9, 0x13C0, 0x26F9, - 0x05AF, 0x11FC, 0x11FA, 0x11FB, 0x0E84, 0x11FE, - 0xFAB5, 0x11FD, 0x26F5, 0xFAB2, 0x235F, 0x05AC, - 0x26F6, 0x05AD, 0x7DCB, 0x7DCA, 0x2360, 0x0946, - 0x7DCC, 0xFAB3, 0x057A, 0x0318, 0x11F8, 0x05AE, - 0x2361, 0x0B88, 0x26FB, 0x1203, 0x1204, 0x0E85, - 0x0E86, 0x0D4F, 0x0E87, 0x0948, 0x0A10, 0x1FE2, - 0x057C, 0x1A3F, 0x0D50, 0x015D, 0x057D, 0x1205, - 0x1A40, 0x13C2, 0x26FC, 0x26FD, 0x1206, 0x3F3A, - 0x1A41, 0x1FE1, 0x0E8E, 0x26FA, 0xFAB6, 0x11FF, - 0x1201, 0x7DCE, 0x1200, 0x05B0, 0x13C1, 0x089E, - 0x0319, 0x015C, 0x057B, 0x070A, 0x1A3E, 0x1202, - 0x011D, 0x031A, 0x7DCF, 0x1209, 0x0E90, 0x015F, - 0x002B, 0x05B1, 0x0D54, 0x04E5, 0x0160, 0x05B2, - 0x13C4, 0x0E88, 0x1FE5, 0x1FE6, 0x2362, 0x3F3B, - 0x13C5, 0x26FF, 0x0161, 0x057E, 0x0779, 0x0D51, - 0x13C3, 0x1A42, 0x04E4, 0x1208, 0x1A44, 0x1FE3, - 0x1207, 0x1A43, 0x0225, 0x26FE, 0x1FE4, 0x015E, - 0x0D53, 0x002A, 0x0E8F, 0x0D52, 0x0778, 0x2701, - 0x2363, 0x3F3E, 0x1FE8, 0xFAB8, 0x13C9, 0x2365, - 0x2364, 0x031B, 0x120A, 0x0E8B, 0x05B8, 0x0E8A, - 0x13CA, 0x3F3F, 0x2702, 0x1FE9, 0x120B, 0x7DD0, - 0x094A, 0x2366, 0xFAB9, 0x13CB, 0x1A45, 0x13C7, - 0x05B3, 0xFAB7, 0x13C6, 0x3F3D, 0x05B4, 0x3F3C, - 0x1FE7, 0x05B5, 0x13C8, 0x0E89, 0x1A46, 0x1A47, - 0x05B6, 0x05B7, 0x2700, 0x0949, 0x0122, 0x05B9, - 0x2704, 0x031D, 0x0469, 0x094C, 0xFABA, 0x120F, - 0x1A48, 0x0638, 0x1210, 0x13CC, 0x01B3, 0x3F42, - 0x1A49, 0xFABB, 0x3F41, 0x0E8C, 0x1A4A, 0x2367, - 0x3F43, 0x094D, 0x2703, 0x094B, 0x7DD1, 0x3F40, - 0x031C, 0x0226, 0x1FEA, 0x7DD2, 0x120C, 0x03DA, - 0x0B8A, 0x120D, 0x002C, 0x03CC, 0x04E6, 0x7DD3, - 0x120E, 0x089F, 0x04E2, 0x059F, 0xFAAD, 0x0117, - 0x0137, 0x0613, 0x235C, 0x3F31, 0x0899, 0x02EF, - 0x0025, 0x0942, 0x0468, 0x0E8C, 0x0A0F, 0x13BA, - 0x7DBE, 0x13B9, 0x05A0, 0x7DC0, 0x26EB, 0x7DBF, - 0x235A, 0x235B, 0x0372, 0x0313, 0x0941, 0x0898, - 0x26E9, 0x0574, 0x02C9, 0x051E, 0x0024, 0x1FDB, - 0x0467, 0x0791, 0x04E1, 0x26EA, 0xFAAC, 0x04E0, - 0x3F34, 0x0E5D, 0x26ED, 0xFAAE, 0x1FDC, 0x0575, - 0x0314, 0x7DC4, 0x1FDD, 0x1FDE, 0x05A1, 0x0E5E, - 0x26EE, 0x26EF, 0x7DC5, 0x11EE, 0xFAAF, 0x3F35, - 0x11EF, 0x26F0, 0x7DC6, 0xFAB0, 0x05A2, 0x7DC1, - 0x0E5C, 0x7DC2, 0x00CA, 0x01B0, 0x235D, 0x3F32, - 0x075E, 0x0B82, 0x0155, 0x0156, 0x3F33, 0x26EC, - 0x0708, 0x0B83, 0x1A3B, 0x7DC3, 0x1A3A, 0x089B, - 0x11F2, 0x05A5, 0x0E5F, 0x0027, 0x01B2, 0x089C, - 0x26F3, 0x0B85, 0x0157, 0x011C, 0x0944, 0x0577, - 0x7DC8, 0x13BB, 0x089D, 0x05A6, 0x0315, 0x0E8D, - 0xFAB1, 0x1A3C, 0x03AC, 0x0576, 0x7DC7, 0x0B84, - 0x05A3, 0x26F1, 0x26F2, 0x05A4, 0x0224, 0x0943, - 0x0D4C, 0x11F0, 0x1FDF, 0x089A, 0x02F0, 0x0D4D, - 0x0026, 0x11F1, 0x0777, 0x0E82, 0x0029, 0x05A8, - 0x1A3D, 0x0028, 0x00CB, 0x0159, 0x11F6, 0x0709, - 0x0614, 0x04E3, 0x015A, 0x0578, 0x0B87, 0x1FE0, - 0x05AA, 0x7DC9, 0x05A9, 0x05AB, 0x0579, 0x11F7, - 0x3F38, 0x0945, 0x13BC, 0x26F4, 0x235E, 0x3F36, - 0x0158, 0x05A7, 0x3F37, 0x0E80, 0x11F3, 0x13BD, - 0x0B86, 0x0E81, 0x0316, 0x0317, 0x0D4E, 0x11F5, - 0x11F4, 0x075F, 0x06C3, 0x08A6, 0x0B8D, 0x0584, - 0x022A, 0x02CA, 0x13D5, 0x0E93, 0x0217, 0x011F, - 0x0124, 0x0120, 0x0B8E, 0x06C4, 0x0326, 0x0327, - 0x05BC, 0x0B8F, 0xFAC1, 0x0955, 0x1217, 0x7DD9, - 0x0328, 0x0323, 0x0324, 0x2369, 0x7DD8, 0x0031, - 0x1FF3, 0x1216, 0xFAC0, 0x1215, 0x0032, 0x00CD, - 0x03AF, 0x0A12, 0x01BC, 0x0070, 0x0325, 0x0E92, - 0x038E, 0x02D7, 0x2708, 0x13D7, 0x0296, 0x039A, - 0x00FE, 0x070D, 0x01ED, 0x02D8, 0x0398, 0x077E, - 0x0167, 0x0244, 0x0329, 0x01BD, 0x0521, 0x022B, - 0x1A50, 0x0122, 0x08A9, 0x0A13, 0x05DD, 0x070C, - 0x04E9, 0x0033, 0x0121, 0x13D6, 0x0956, 0x08A7, - 0x0585, 0x0166, 0x0204, 0x08A8, 0x0586, 0x04A0, - 0x02CB, 0x003D, 0x0588, 0x0289, 0x03C2, 0x03B8, - 0x077F, 0x0587, 0x04EB, 0x00CF, 0x01A3, 0x13D9, - 0x0617, 0x01A2, 0x06C5, 0x0522, 0x03B9, 0x070E, - 0x0762, 0x08AA, 0x1A51, 0x0169, 0x03BA, 0x1218, - 0x0523, 0x04EC, 0x3F49, 0x0E96, 0x04EA, 0x02CA, - 0x0D59, 0x13D8, 0x03D2, 0x0E95, 0x0957, 0x0E94, - 0x0168, 0x0123, 0x031E, 0x0412, 0x032A, 0x00CE, - 0x039C, 0x0E95, 0x0D5A, 0x0071, 0x13DC, 0x7DDA, - 0x236C, 0x0E96, 0x13DD, 0x032C, 0x1A52, 0x0B90, - 0x0589, 0x032D, 0x2709, 0x1FF6, 0x058A, 0x1219, - 0x05BD, 0x058B, 0x0035, 0x270A, 0x05DE, 0x095A, - 0x1A53, 0x016B, 0x022C, 0x070F, 0x13DA, 0x0958, - 0x3F4A, 0x0588, 0x0D5B, 0x13DB, 0x236A, 0x0780, - 0x3F4B, 0x1FF4, 0x0959, 0x0034, 0x016A, 0x236B, - 0x1FF5, 0x032B, 0x270B, 0x02F3, 0xFAC4, 0x7DDC, - 0x1FF7, 0x0124, 0x095C, 0x016C, 0x0072, 0x016A, - 0x04EE, 0x270D, 0x270C, 0x022D, 0x04A1, 0x270E, - 0x0E97, 0x0618, 0xFAC5, 0x0E98, 0x3F4C, 0x236E, - 0x1A54, 0x05BF, 0x032E, 0x121A, 0xFAC2, 0x05BE, - 0x01EE, 0x04ED, 0x236D, 0x03BB, 0x0125, 0x00EC, - 0x7DDB, 0xFAC3, 0x05DF, 0x00C9, 0x08AB, 0x095B, - 0x013C, 0x01FE, 0x0B8B, 0xFABD, 0x7DD4, 0x0615, - 0x01EA, 0x0E91, 0x057F, 0x016E, 0x0156, 0x08A1, - 0x094E, 0x7DD5, 0x03D1, 0x01B6, 0x1FEC, 0x1FEB, - 0xFABE, 0x7DD6, 0x1212, 0x7DD7, 0xFABF, 0x1A4C, - 0x0E8D, 0x3F44, 0xFABC, 0x002D, 0x006A, 0x01B5, - 0x13CD, 0x08A0, 0x01B4, 0x03D0, 0x006B, 0x1211, - 0x3F45, 0x0227, 0x02FE, 0x077A, 0x1A4B, 0x014A, - 0x0E91, 0x1FED, 0x2705, 0x0162, 0x094F, 0x002E, - 0x04E8, 0x1FEE, 0x0A11, 0x0950, 0x0581, 0x1FEF, - 0x1FF0, 0x2706, 0x3F47, 0x1A4F, 0x0582, 0x05BA, - 0x002F, 0x031E, 0x13CF, 0x0760, 0x0580, 0x0E92, - 0x031D, 0x04E7, 0x1A4D, 0x1A4E, 0x0E8E, 0x01B7, - 0x02F1, 0x02F2, 0x3F46, 0x0E8F, 0x0616, 0x0D55, - 0x006C, 0x0E93, 0x0E90, 0x13CE, 0x049E, 0x0411, - 0x13D0, 0x08A2, 0x03AD, 0x02D3, 0x0228, 0x13D1, - 0x006D, 0x006D, 0x0792, 0x01B8, 0x077C, 0x0229, - 0x0320, 0x1FF1, 0x3F48, 0x0D56, 0x13D2, 0x01B9, - 0x2707, 0x2368, 0x0D57, 0x00CC, 0x0520, 0x1213, - 0x0163, 0x051F, 0x0951, 0x1214, 0x0E94, 0x0164, - 0x00FC, 0x070B, 0x077B, 0x0761, 0x00C6, 0x017A, - 0x031F, 0x0583, 0x01EE, 0x00D4, 0x0165, 0x0952, - 0x02C8, 0x00C8, 0x023A, 0x0030, 0x01EC, 0x00FD, - 0x02F9, 0x01BB, 0x0953, 0x01A0, 0x13D4, 0x08A5, - 0x0030, 0x08A4, 0x077D, 0x006E, 0x0D58, 0x0954, - 0x05DC, 0x0123, 0x0321, 0x01BA, 0x0288, 0x05BB, - 0x13D3, 0x0322, 0x03AE, 0x0B8C, 0x049F, 0x1FF2, - 0x08A3, 0x006E, 0x02D6, 0x006F, 0x011E, 0x0373, - 0x03BF, 0x01EA, 0x08AF, 0x0595, 0x0100, 0x0112, - 0x0050, 0x02B9, 0x014C, 0x01A4, 0x0258, 0x04F2, - 0x0596, 0x00A4, 0x13E1, 0x0124, 0x08B0, 0x04F3, - 0x0171, 0x0413, 0x2713, 0x0E9B, 0x046C, 0x00A2, - 0x0765, 0x05E0, 0x019C, 0x0964, 0x0335, 0x061C, - 0x3F4F, 0x0E9A, 0x009A, 0x0170, 0x0784, 0x003E, - 0x012F, 0x01A3, 0x023D, 0x01F0, 0x016B, 0x00A3, - 0x023F, 0x03C4, 0x03D4, 0x0377, 0x0052, 0x01BE, - 0x0031, 0x0012, 0x0157, 0x021A, 0x0242, 0x039E, - 0x04A2, 0x05E1, 0x02F6, 0x1A5D, 0x0336, 0x0126, - 0x05E2, 0x2374, 0x05C4, 0x046D, 0x0311, 0x01A5, - 0x04F4, 0xFAC8, 0x023E, 0x0A17, 0x0D5F, 0x05C3, - 0x08B1, 0x009C, 0x02CD, 0x0299, 0x036A, 0x0376, - 0x006C, 0x0037, 0x0785, 0x0076, 0x0040, 0x0965, - 0x13E2, 0x02CC, 0x0259, 0x0414, 0x06C6, 0x01A6, - 0x033F, 0x0334, 0x0E9C, 0x0786, 0x0127, 0x0966, - 0x06C7, 0x063B, 0x0039, 0x0172, 0x0374, 0x003A, - 0x0597, 0x0128, 0x00FF, 0x0526, 0x2375, 0x0044, - 0x0337, 0x0B95, 0x0230, 0x7DDE, 0x0D60, 0x0185, - 0x0D61, 0x0038, 0x0321, 0x003F, 0x009D, 0x0101, - 0x03B9, 0x0312, 0x0969, 0x1A5E, 0x1220, 0x2714, - 0x003B, 0x0598, 0x2715, 0x1FFB, 0x08B2, 0x096A, - 0x0EA1, 0x7DDF, 0x1FFC, 0x0A18, 0x1A5F, 0x1222, - 0x1221, 0x0173, 0x0793, 0x061D, 0x096B, 0x7DE0, - 0x0787, 0x0231, 0x0711, 0x0EA0, 0xFAC9, 0x121D, - 0x05C5, 0x121F, 0x121E, 0x3F50, 0x0E9D, 0x0338, - 0x0968, 0x0967, 0x04F5, 0x0B96, 0x05C7, 0x05C6, - 0x03BE, 0x01B8, 0x1225, 0x1224, 0x02CE, 0x0160, - 0x0102, 0xFACD, 0x3F51, 0x0322, 0xFACE, 0x0339, - 0x059A, 0x019E, 0x063C, 0x01BF, 0x7DE2, 0x3F52, - 0x0D62, 0x2718, 0x3F53, 0x2717, 0x0EA2, 0x0599, - 0x13E3, 0xFACA, 0xFACB, 0x06C8, 0x06C9, 0xFACC, - 0x7DE1, 0x0125, 0x01BC, 0x13E4, 0x1223, 0x0336, - 0x02BA, 0x028B, 0x2716, 0x2376, 0x02CD, 0x013D, - 0x095E, 0x05C0, 0x0016, 0x016F, 0x0525, 0x2371, - 0x2370, 0x0205, 0x01C8, 0x058C, 0x0B91, 0x00E6, - 0x0639, 0x0330, 0x2372, 0x3F4D, 0x0763, 0x016E, - 0x121B, 0x1FF9, 0x058D, 0x016D, 0x1A55, 0x270F, - 0x13DE, 0xFAC6, 0x1FF8, 0x236F, 0x1A56, 0x04EF, - 0x0298, 0x0E99, 0x095D, 0x01BE, 0x02CC, 0x0524, - 0x032F, 0x7DDD, 0x0589, 0x095F, 0x03BC, 0x1A59, - 0x0E9A, 0x0E9B, 0x061A, 0x13E0, 0x0E9C, 0x08AD, - 0x0332, 0x0A15, 0x0591, 0x0D5D, 0x0590, 0x0960, - 0x2373, 0x2711, 0x1A5A, 0x058A, 0x006F, 0x3F4E, - 0x2712, 0x0764, 0x08AC, 0x05C1, 0xFAC7, 0x0331, - 0x1FFA, 0x13DF, 0x2710, 0x1A57, 0x0E97, 0x058E, - 0x0619, 0x0A14, 0x1A58, 0x0D5C, 0x0782, 0x058F, - 0x121C, 0x0781, 0x0210, 0x0594, 0x0962, 0x0080, - 0x0399, 0x03C3, 0x02F5, 0x0184, 0x028A, 0x046B, - 0x0963, 0x0B92, 0x0100, 0x1A5B, 0x0A16, 0x0E9D, - 0x03BD, 0x0B93, 0x01A4, 0x0333, 0x0783, 0x033E, - 0x00FE, 0x0592, 0x031F, 0x046A, 0x0593, 0x0961, - 0x04F0, 0x00FF, 0x02F4, 0x0073, 0x0E98, 0x04F1, - 0x033D, 0x0266, 0x02FF, 0x03D3, 0x0320, 0x0206, - 0x004E, 0x023C, 0x01EF, 0x0211, 0x0027, 0x000C, - 0x063A, 0x08AE, 0x008C, 0x03CE, 0x02D9, 0x02FA, - 0x01A2, 0x01A5, 0x061B, 0x0E9E, 0x05C2, 0x022F, - 0x039D, 0x01F0, 0x1A5C, 0x0E9F, 0x02CB, 0x03B8, - 0x014B, 0x0B94, 0x0E99, 0x013E, 0x016F, 0x0036, - 0x0334, 0x0D5E, 0x0310, 0x0207, 0x0044, 0x017B, - 0x00DF, 0x0042, 0x022E, 0x0710, 0x007E, +static const uint8_t on2avc_cb8_bits[ON2AVC_CB_7_8_CODES] = { + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 13, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 11, 11, 10, + 11, 11, 9, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, 11, 11, 11, 11, 9, 13, 14, + 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, 10, 11, 11, 11, 11, + 11, 11, 10, 11, 11, 10, 11, 12, 12, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, + 11, 11, 11, 10, 10, 11, 11, 11, 11, 9, 10, 11, 11, 10, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 11, 12, 12, 11, 11, 11, 11, 10, 11, 11, 10, 10, 9, 11, 11, 11, + 11, 11, 11, 11, 11, 10, 11, 11, 9, 10, 10, 12, 13, 14, 15, 15, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 10, 10, 9, 10, 11, 11, 9, 11, 11, 11, 11, 11, 11, 11, 11, 10, + 10, 9, 9, 10, 11, 13, 13, 13, 13, 10, 10, 9, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 11, 11, 11, 11, 11, 11, + 11, 10, 11, 11, 10, 10, 10, 10, 9, 9, 11, 12, 13, 15, 15, 15, 15, 11, 11, + 11, 11, 11, 11, 10, 11, 11, 10, 10, 9, 9, 10, 11, 12, 12, 10, 10, 7, 9, + 10, 12, 12, 12, 12, 9, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, + 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 10, 10, 10, 10, 10, 10, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, 10, 11, 11, 10, 10, 10, 10, 8, 9, + 10, 10, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 9, 10, 10, + 9, 10, 10, 9, 10, 10, 9, 9, 9, 11, 12, 13, 14, 15, 16, 16, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 10, 10, 7, 10, 11, + 12, 12, 10, 10, 10, 10, 10, 10, 8, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 10, 11, 11, 10, 10, 10, 11, + 12, 13, 13, 10, 10, 10, 10, 10, 10, 9, 10, 10, 9, 9, 7, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 9, 9, 10, 11, 13, + 13, 13, 13, 10, 13, 13, 13, 13, 13, 13, 13, 13, 9, 9, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 10, 11, 11, 10, 10, 10, 10, 9, 10, 10, 8, 9, 10, 10, 9, 10, 10, + 9, 11, 12, 13, 14, 14, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 10, 11, 11, 10, 10, 10, 10, 9, 10, 10, 9, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 12, 12, 12, 12, 9, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, + 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 10, + 10, 10, 10, 9, 10, 10, 10, 11, 12, 14, 14, 14, 14, 10, 10, 9, 10, 10, 9, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 10, 10, 10, 10, + 10, 10, 9, 9, 9, 10, 11, 14, 14, 14, 14, 14, 14, 14, 14, 9, 10, 10, 8, + 10, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 11, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 10, 11, 11, 10, 10, 10, 10, 9, 10, 10, 6, 8, 9, 9, + 10, 10, 10, 10, 10, 10, 10, 10, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 10, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 10, 10, 10, 10, + 10, 10, 9, 9, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 10, 10, 10, 10, 10, 11, 12, 13, 14, 16, 16, 16, 16, 10, 10, + 6, 10, 10, 10, 10, 9, 10, 10, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, 6, + 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 10, 10, 9, 9, 10, 10, 10, 10, + 10, 10, 10, 10, 9, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 10, 10, 10, 10, 9, + 9, 10, 11, 11, 10, 10, 9, 10, 10, 9, 9, 9, 9, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 7, 10, + 10, 10, 11, 12, 12, 10, 10, 10, 10, 9, 10, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, + 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 10, 10, 10, 10, 9, 10, 10, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, + 11, 11, 11, 10, 11, 11, 10, 10, 10, 10, 10, 10, 9, 10, 10, 9, 10, 10, 9, + 10, 10, 7, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, + 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, + 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, }; -static const uint8_t on2avc_cb8_bits[ON2AVC_CB7_8_CODES] = { - 11, 11, 16, 15, 11, 9, - 13, 12, 9, 11, 11, 14, - 13, 12, 13, 14, 14, 13, - 10, 11, 15, 15, 10, 16, - 16, 15, 16, 11, 13, 13, - 16, 13, 11, 11, 15, 13, - 11, 9, 13, 13, 10, 9, - 16, 13, 9, 10, 10, 15, - 10, 10, 10, 12, 14, 11, - 14, 12, 14, 11, 12, 11, - 12, 14, 10, 10, 11, 16, - 10, 13, 14, 14, 11, 13, - 11, 13, 12, 10, 10, 10, - 15, 10, 10, 12, 12, 12, - 15, 12, 11, 12, 13, 10, - 11, 11, 12, 13, 11, 13, - 12, 15, 13, 11, 11, 12, - 14, 11, 11, 11, 13, 14, - 11, 13, 14, 13, 12, 12, - 12, 11, 14, 12, 10, 13, - 14, 11, 13, 15, 14, 14, - 13, 13, 14, 13, 13, 13, - 15, 14, 12, 14, 14, 14, - 16, 14, 12, 12, 16, 16, - 12, 13, 12, 14, 14, 13, - 13, 16, 14, 13, 14, 13, - 13, 13, 13, 15, 14, 13, - 10, 12, 16, 16, 12, 10, - 13, 14, 11, 11, 12, 14, - 14, 11, 12, 16, 13, 12, - 14, 14, 14, 16, 15, 16, - 15, 16, 15, 14, 12, 14, - 13, 11, 10, 11, 14, 14, - 11, 9, 14, 14, 10, 16, - 12, 15, 16, 12, 11, 14, - 13, 9, 11, 11, 15, 15, - 12, 13, 14, 15, 12, 16, - 14, 15, 15, 13, 14, 14, - 15, 14, 14, 14, 13, 15, - 12, 14, 12, 15, 15, 12, - 11, 13, 15, 10, 14, 13, - 14, 13, 13, 13, 13, 13, - 13, 12, 13, 13, 12, 14, - 14, 16, 12, 14, 11, 13, - 13, 12, 14, 15, 13, 13, - 13, 13, 13, 14, 13, 13, - 13, 14, 13, 13, 12, 14, - 14, 13, 11, 12, 13, 12, - 12, 10, 13, 13, 11, 11, - 12, 14, 11, 12, 13, 15, - 14, 14, 16, 11, 13, 13, - 11, 15, 10, 14, 13, 12, - 12, 13, 12, 13, 11, 11, - 11, 12, 11, 10, 12, 13, - 10, 10, 13, 13, 10, 10, - 10, 10, 15, 11, 11, 13, - 12, 11, 13, 12, 11, 16, - 14, 10, 14, 11, 10, 10, - 15, 12, 11, 13, 12, 11, - 14, 13, 11, 13, 11, 10, - 9, 10, 10, 14, 10, 9, - 14, 13, 9, 9, 10, 10, - 10, 10, 10, 12, 14, 10, - 14, 13, 12, 11, 14, 13, - 11, 13, 9, 11, 13, 13, - 11, 14, 14, 12, 12, 13, - 10, 12, 12, 10, 9, 10, - 10, 10, 10, 9, 10, 10, - 11, 10, 8, 12, 12, 9, - 11, 10, 10, 11, 11, 12, - 12, 14, 12, 10, 14, 13, - 16, 10, 10, 11, 16, 14, - 11, 12, 14, 12, 12, 10, - 11, 10, 10, 11, 9, 11, - 11, 9, 11, 12, 13, 10, - 10, 11, 11, 11, 11, 10, - 13, 13, 10, 13, 11, 11, - 11, 12, 11, 11, 11, 10, - 10, 12, 12, 10, 14, 12, - 11, 12, 12, 11, 12, 12, - 11, 10, 11, 11, 11, 11, - 14, 13, 13, 13, 13, 12, - 13, 13, 12, 12, 12, 13, - 13, 12, 13, 13, 14, 14, - 13, 12, 13, 15, 14, 12, - 13, 16, 14, 12, 14, 14, - 14, 13, 13, 12, 13, 13, - 12, 12, 14, 13, 12, 10, - 13, 14, 14, 10, 11, 14, - 14, 11, 10, 13, 13, 11, - 12, 12, 14, 14, 14, 13, - 13, 14, 13, 13, 14, 13, - 12, 11, 12, 15, 14, 12, - 9, 12, 13, 10, 9, 11, - 13, 14, 11, 10, 13, 15, - 14, 10, 11, 13, 14, 11, - 11, 12, 12, 10, 12, 12, - 15, 15, 12, 14, 14, 14, - 13, 13, 14, 14, 14, 11, - 12, 14, 15, 12, 10, 12, - 13, 9, 9, 11, 14, 15, - 11, 14, 13, 13, 13, 15, - 13, 13, 14, 12, 14, 13, - 13, 13, 12, 13, 14, 14, - 13, 11, 11, 15, 13, 11, - 12, 13, 15, 12, 12, 13, - 14, 14, 14, 13, 13, 13, - 13, 13, 12, 13, 14, 13, - 10, 14, 13, 11, 10, 11, - 11, 11, 11, 11, 12, 12, - 11, 12, 13, 12, 11, 13, - 10, 12, 11, 10, 11, 13, - 12, 10, 12, 12, 12, 11, - 12, 10, 12, 12, 10, 10, - 11, 11, 11, 11, 9, 10, - 11, 10, 10, 9, 12, 12, - 9, 11, 11, 10, 9, 10, - 13, 14, 13, 12, 10, 10, - 14, 14, 10, 11, 11, 13, - 13, 11, 13, 13, 12, 11, - 10, 11, 11, 10, 10, 9, - 12, 12, 9, 11, 12, 13, - 12, 12, 11, 12, 13, 11, - 11, 12, 12, 12, 12, 13, - 15, 14, 14, 13, 12, 16, - 14, 12, 11, 12, 16, 15, - 12, 13, 15, 13, 13, 12, - 12, 12, 12, 11, 10, 13, - 13, 10, 10, 12, 13, 10, - 10, 10, 11, 11, 11, 11, - 12, 12, 11, 13, 12, 12, - 13, 13, 11, 12, 13, 11, - 11, 12, 12, 11, 13, 13, - 13, 13, 13, 10, 14, 11, - 11, 10, 11, 11, 11, 10, - 11, 12, 13, 12, 11, 10, - 12, 12, 10, 11, 10, 11, - 12, 11, 13, 12, 14, 13, - 11, 12, 13, 14, 12, 11, - 11, 14, 14, 12, 12, 13, - 13, 13, 12, 12, 12, 12, - 11, 10, 12, 12, 10, 13, - 14, 13, 12, 12, 13, 13, - 13, 12, 12, 14, 13, 12, - 14, 12, 11, 14, 13, 11, - 11, 13, 12, 11, 13, 14, - 12, 14, 14, 14, 13, 14, - 12, 13, 13, 13, 13, 13, - 13, 12, 13, 10, 12, 14, - 15, 13, 10, 13, 12, 11, - 11, 12, 13, 13, 11, 11, - 12, 13, 12, 16, 11, 13, - 16, 14, 16, 15, 15, 16, - 13, 11, 14, 13, 12, 11, - 11, 15, 13, 11, 9, 13, - 14, 11, 10, 12, 15, 14, - 12, 11, 13, 13, 10, 11, - 11, 14, 14, 11, 12, 13, - 13, 11, 13, 12, 14, 16, - 12, 16, 13, 15, 15, 13, - 12, 13, 14, 14, 10, 11, - 14, 14, 11, 10, 13, 13, - 9, 12, 14, 16, 12, 13, - 13, 12, 13, 13, 12, 14, - 14, 13, 14, 14, 15, 14, - 13, 12, 13, 11, 11, 11, - 13, 13, 13, 14, 13, 13, - 14, 14, 12, 14, 16, 14, - 13, 12, 13, 14, 13, 12, - 12, 12, 12, 12, 11, 12, - 14, 11, 12, 12, 12, 11, - 11, 14, 14, 13, 13, 11, - 12, 14, 12, 11, 14, 11, - 13, 13, 11, 12, 13, 13, - 12, 12, 11, 12, 12, 12, - 11, 12, 13, 11, 10, 13, - 13, 11, 10, 11, 11, 11, - 11, 11, 13, 12, 11, 14, - 13, 12, 13, 12, 11, 14, - 12, 11, 12, 13, 13, 11, - 13, 13, 13, 12, 12, 10, - 12, 12, 10, 10, 10, 11, - 11, 11, 12, 15, 15, 13, - 12, 13, 14, 14, 14, 13, - 16, 14, 13, 15, 14, 14, - 16, 15, 13, 14, 15, 13, - 14, 14, 14, 13, 15, 13, - 14, 13, 14, 13, 16, 14, - 12, 12, 13, 13, 12, 13, - 13, 14, 13, 13, 13, 11, - 14, 14, 12, 14, 13, 13, - 12, 13, 13, 14, 15, 14, - 13, 12, 15, 15, 13, 14, - 12, 14, 14, 13, 14, 15, - 13, 13, 13, 13, 13, 13, - 12, 12, 15, 14, 12, 13, - 15, 14, 12, 12, 12, 12, - 15, 12, 12, 13, 14, 12, - 13, 13, 13, 14, 14, 13, - 13, 14, 13, 14, 14, 14, - 13, 14, 14, 13, 13, 13, - 12, 14, 13, 12, 12, 13, - 14, 12, 12, 16, 15, 15, - 13, 13, 13, 14, 14, 13, - 13, 12, 12, 14, 13, 13, - 12, 14, 14, 14, 12, 12, - 14, 14, 16, 13, 16, 14, - 14, 16, 14, 13, 14, 13, - 14, 14, 14, 13, 13, 16, - 13, 13, 11, 15, 15, 12, - 12, 13, 14, 15, 12, 11, - 13, 13, 11, 13, 11, 14, - 14, 14, 14, 11, 15, 14, - 13, 14, 14, 14, 14, 14, - 15, 15, 13, 11, 14, 13, - 12, 11, 12, 15, 15, 12, - 12, 14, 15, 11, 11, 13, - 14, 15, 12, 13, 13, 13, - 11, 13, 13, 15, 14, 12, - 14, 14, 13, 13, 14, 15, - 16, 16, 13, 13, 14, 16, - 14, 12, 12, 14, 11, 11, - 13, 15, 15, 12, 16, 14, - 14, 14, 15, 13, 14, 14, - 13, 13, 13, 13, 13, 13, - 14, 14, 14, 14, 14, 13, - 15, 14, 12, 14, 15, 16, - 16, 13, 14, 15, 15, 14, - 16, 14, 14, 14, 14, 13, - 14, 16, 13, 13, 14, 14, - 12, 12, 12, 14, 12, 13, - 12, 14, 13, 12, 14, 15, - 15, 13, 13, 12, 13, 13, - 13, 13, 14, 13, 12, 13, - 13, 13, 13, 13, 12, 14, - 14, 12, 12, 12, 14, 13, - 13, 12, 12, 12, 14, 13, - 12, 14, 15, 12, 13, 12, - 12, 14, 13, 14, 15, 16, - 14, 15, 13, 16, 16, 13, - 13, 13, 14, 14, 13, 12, - 13, 14, 13, 13, 12, 14, - 13, 12, 11, 14, 14, 12, - 7, 10, 15, 16, 10, 7, - 12, 13, 7, 11, 11, 15, - 16, 12, 12, 14, 14, 13, - 16, 14, 16, 16, 16, 15, - 16, 16, 15, 15, 13, 14, - 14, 13, 12, 13, 16, 13, - 12, 9, 12, 13, 9, 9, - 13, 13, 9, 8, 10, 16, - 14, 10, 11, 13, 13, 10, - 13, 12, 15, 14, 12, 16, - 16, 15, 15, 14, 15, 15, - 16, 13, 12, 14, 14, 13, - 10, 13, 12, 11, 9, 11, - 16, 14, 11, 9, 12, 15, - 15, 11, 9, 13, 15, 9, - 11, 11, 14, 14, 12, 12, - 14, 13, 14, 14, 14, 15, - 15, 15, 14, 14, 16, 16, - 14, 12, 13, 13, 13, 11, - 11, 16, 13, 12, 14, 13, - 13, 10, 11, 15, 12, 12, - 16, 12, 16, 14, 11, 11, - 13, 14, 11, 14, 11, 15, - 15, 13, 14, 14, 16, 15, - 16, 15, 14, 15, 14, 14, - 16, 14, 12, 12, 14, 12, - 12, 12, 12, 16, 14, 12, - 15, 15, 16, 16, 14, 16, - 14, 13, 12, 14, 14, 15, - 16, 13, 12, 11, 14, 13, - 16, 12, 12, 16, 16, 14, - 14, 16, 16, 15, 14, 15, - 15, 14, 12, 13, 15, 14, - 15, 15, 14, 14, 16, 16, - 14, 16, 16, 14, 14, 14, - 14, 13, 14, 13, 16, 15, - 14, 14, 14, 14, 14, 16, - 15, 16, 14, 14, 16, 16, - 15, 16, 15, 13, 16, 16, - 15, 14, 14, 14, 15, 14, - 14, 15, 15, 14, 11, 15, - 15, 12, 10, 12, 16, 15, - 13, 11, 14, 13, 11, 13, - 13, 16, 15, 12, 15, 15, - 15, 14, 14, 16, 16, 15, - 14, 13, 14, 15, 14, 12, - 14, 13, 11, 13, 12, 14, - 15, 11, 9, 12, 15, 15, - 11, 9, 12, 13, 9, 10, - 12, 14, 14, 10, 12, 13, - 14, 12, 14, 15, 15, 16, - 15, 14, 14, 14, 15, 14, - 12, 13, 13, 13, 12, 11, - 13, 14, 12, 10, 12, 13, - 9, 7, 13, 13, 7, 6, - 9, 14, 15, 9, 10, 14, - 12, 9, 13, 13, 15, 16, - 12, 14, 16, 16, 15, 15, - 14, 14, 14, 13, 12, 13, - 14, 12, 11, 13, 13, 10, - 9, 10, 15, 14, 10, 6, - 12, 16, 15, 12, 10, 15, - 13, 10, 12, 13, 14, 15, - 12, 13, 13, 13, 13, 15, - 14, 15, 15, 15, 16, 15, - 16, 16, 15, 14, 15, 15, - 13, 11, 12, 16, 16, 12, - 9, 14, 14, 8, 9, 13, - 13, 8, 9, 11, 16, 14, - 11, 11, 13, 14, 11, 13, - 13, 14, 14, 13, 14, 15, - 15, 13, 13, 15, 15, 15, - 13, 12, 16, 16, 13, 10, - 13, 13, 10, 6, 11, 16, - 16, 10, 9, 12, 14, 16, - 11, 10, 13, 13, 10, 11, - 12, 16, 14, 12, 12, 15, - 14, 14, 15, 14, 16, 15, - 14, 14, 14, 16, 16, 15, - 12, 14, 15, 13, 11, 11, - 15, 14, 11, 9, 13, 14, - 9, 11, 14, 14, 11, 15, - 13, 15, 16, 12, 13, 14, - 13, 12, 13, 14, 15, 13, - 13, 14, 15, 16, 13, 16, - 16, 15, 15, 13, 13, 15, - 15, 14, 11, 14, 14, 13, - 10, 12, 15, 14, 12, 16, - 13, 16, 16, 14, 16, 14, - 15, 15, 13, 13, 16, 15, - 13, 15, 16, 14, 14, 16, - 16, 16, 15, 15, 15, 15, - 14, 16, 15, 13, 14, 15, - 15, 13, 13, 15, 16, 14, - 12, 14, 14, 16, 15, 14, - 15, 16, 13, 13, 14, 15, - 13, 13, 14, 14, 16, 14, - 14, 14, 15, 14, 16, 15, - 14, 15, 14, 15, 15, 16, - 12, 13, 13, 15, 12, 12, - 13, 13, 16, 16, 12, 13, - 13, 14, 14, 11, 13, 14, - 11, 15, 13, 14, 16, 12, - 12, 12, 13, 11, 13, 13, - 13, 15, 14, 13, 15, 15, - 14, 14, 16, 14, 14, 14, - 14, 15, 14, 11, 11, 13, - 13, 11, 14, 11, 16, 14, - 12, 9, 11, 14, 14, 11, - 10, 12, 13, 10, 11, 12, - 13, 16, 11, 12, 13, 14, - 16, 16, 14, 14, 16, 14, - 13, 15, 16, 14, 15, 13, - 14, 12, 11, 11, 11, 15, - 15, 11, 9, 13, 13, 9, - 9, 14, 14, 9, 9, 11, - 16, 14, 11, 11, 13, 12, - 11, 13, 12, 13, 15, 12, - 13, 13, 15, 14, 14, 15, - 16, 15, 13, 12, 16, 14, - 12, 10, 13, 13, 10, 8, - 10, 16, 14, 10, 13, 15, - 16, 13, 13, 13, 14, 14, - 12, 13, 14, 14, 13, 14, - 14, 14, 14, 14, 13, 14, - 16, 14, 14, 16, 15, 14, - 14, 14, 15, 15, 15, 13, - 15, 16, 13, 13, 14, 14, - 15, 12, 14, 14, 14, 13, - 13, 12, 13, 13, 12, 13, - 13, 13, 12, 13, 13, 14, - 13, 13, 14, 14, 14, 14, - 13, 13, 12, 14, 16, 14, - 14, 15, 14, 14, 13, 12, - 13, 13, 13, 11, 13, 14, - 12, 13, 15, 14, 12, 13, - 13, 14, 12, 12, 13, 14, - 13, 13, 13, 13, 15, 14, - 13, 14, 13, 13, 12, 12, - 13, 13, 12, 14, 13, 13, - 14, 13, 12, 14, 13, 13, - 12, 13, 12, 12, 12, 14, - 15, 14, 13, 16, 13, 15, - 15, 13, 14, 13, 14, 13, - 13, 14, 14, 13, 14, 15, - 13, 15, 16, 13, 13, 13, - 14, 16, 13, 14, 14, 14, - 13, 14, 13, 13, 13, 13, - 14, 14, 14, 13, 11, 14, - 14, 13, 11, 13, 16, 14, - 13, 11, 14, 13, 12, 14, - 13, 16, 14, 13, 13, 15, - 14, 13, 14, 13, 15, 14, - 13, 12, 13, 15, 14, 10, - 12, 14, 13, 10, 12, 15, - 14, 12, 12, 14, 16, 12, - 11, 12, 15, 14, 12, 12, - 13, 13, 11, 12, 12, 13, - 15, 13, 14, 15, 14, 15, - 15, 15, 11, 13, 13, 12, - 14, 13, 11, 11, 13, 13, - 11, 11, 12, 14, 16, 12, - 14, 13, 14, 16, 13, 13, - 13, 15, 13, 13, 14, 13, - 14, 14, 15, 14, 16, 14, - 14, 14, 15, 16, 14, 15, - 13, 15, 12, 12, 15, 14, - 11, 12, 13, 13, 14, 14, - 11, 12, 13, 15, 13, 12, - 14, 14, 13, 13, 12, 12, - 14, 12, 13, 12, 13, 13, - 15, 13, 12, 14, 13, 12, - 16, 13, 12, 13, 15, 12, - 14, 14, 14, 14, 12, 13, - 12, 14, 13, 12, 12, 12, - 13, 14, 12, 13, 13, 14, - 13, 13, 12, 13, 14, 11, - 12, 12, 13, 13, 12, 13, - 14, 15, 14, 14, 13, 14, - 14, 13, 13, 14, 15, 14, - 13, 14, 14, 13, 14, 13, - 12, 13, 13, 13, 12, 14, - 14, 11, 11, 12, 12, 13, - 12, 10, 13, 13, 10, 12, - 11, 12, 12, 11, 13, 13, - 14, 12, 16, 13, 14, 15, - 13, 13, 13, 15, 15, 13, - 13, 14, 16, 14, 13, 12, - 12, 12, 12, 11, 13, 13, - 10, 10, 14, 13, 10, 10, - 11, 11, 11, 10, 10, 12, - 13, 10, 13, 12, 11, 12, - 13, 12, 12, 12, 11, 11, - 12, 13, 12, 13, 13, 12, - 13, 13, 11, 12, 13, 11, - 10, 11, 11, 11, 10, 12, - 12, 13, 12, 12, 11, 13, - 12, 11, 11, 11, 12, 11, - 11, 12, 13, 13, 12, 14, - 11, 12, 14, 12, 12, 11, - 12, 13, 11, 12, 13, 13, - 13, 12, 11, 11, 13, 12, - 10, 13, 12, 11, 13, 15, - 15, 13, 13, 13, 13, 12, - 13, 13, 14, 13, 13, 14, - 14, 13, 13, 14, 11, 13, - 13, 13, 12, 11, 13, 13, - 14, 13, 12, 13, 15, 12, - 14, 13, 13, 13, 13, 15, - 13, 13, 14, 12, 16, 15, - 13, 9, 13, 13, 11, 10, - 12, 14, 14, 12, 11, 14, - 13, 12, 16, 13, 14, 15, - 13, 14, 13, 14, 16, 14, - 11, 12, 15, 12, 11, 11, - 15, 16, 11, 10, 12, 13, - 11, 10, 12, 16, 15, 12, - 11, 12, 13, 9, 10, 12, - 13, 15, 11, 12, 13, 13, - 16, 15, 14, 15, 16, 13, - 13, 14, 16, 13, 12, 12, - 13, 12, 12, 11, 12, 14, - 14, 12, 10, 12, 13, 10, - 13, 13, 14, 13, 13, 13, - 12, 13, 12, 13, 13, 13, - 13, 14, 14, 13, 13, 14, - 13, 13, 13, 11, 13, 12, - 11, 12, 13, 13, 13, 12, - 12, 12, 14, 13, 12, 12, - 12, 12, 13, 13, 11, 11, - 13, 12, 12, 10, 12, 13, - 11, 12, 11, 12, 12, 12, - 13, 13, 14, 12, 13, 12, - 14, 15, 12, 12, 11, 14, - 13, 11, 13, 14, 12, 13, - 11, 11, 12, 11, 10, 10, - 13, 13, 10, 10, 13, 13, - 10, 10, 10, 12, 11, 11, - 10, 12, 13, 11, 13, 12, - 13, 12, 12, 12, 12, 13, - 11, 11, 13, 12, 11, 14, - 13, 13, 12, 12, 11, 13, - 12, 11, 10, 11, 12, 11, - 10, 9, 12, 13, 9, 9, - 10, 10, 10, 10, 10, 12, - 13, 11, 13, 12, 12, 12, - 13, 11, 14, 12, 11, 10, - 11, 11, 10, 13, 13, 12, - 14, 12, 11, 13, 12, 11, - 9, 10, 10, 10, 10, 10, - 10, 10, 11, 10, 9, 12, - 12, 9, 10, 10, 10, 10, - 11, 11, 12, 13, 13, 11, - 11, 15, 14, 11, 10, 10, - 12, 16, 10, 12, 12, 14, - 12, 11, 10, 10, 10, 10, - 9, 13, 12, 9, 11, 13, - 13, 11, 10, 11, 11, 11, - 10, 10, 12, 12, 11, 13, - 11, 11, 13, 13, 11, 13, - 13, 11, 10, 11, 15, 10, - 13, 12, 12, 15, 12, 11, - 12, 13, 11, 11, 11, 11, - 10, 10, 13, 13, 14, 14, - 13, 13, 14, 13, 12, 13, - 13, 15, 13, 12, 13, 14, - 14, 13, 11, 12, 13, 15, - 12, 12, 11, 13, 16, 14, - 14, 14, 14, 14, 12, 13, - 13, 13, 12, 12, 14, 14, - 12, 9, 14, 14, 10, 9, - 11, 16, 14, 11, 16, 13, - 13, 10, 11, 12, 15, 14, - 12, 14, 14, 14, 13, 13, - 13, 16, 16, 11, 11, 16, - 15, 12, 9, 13, 14, 10, - 10, 11, 14, 15, 11, 11, - 13, 14, 10, 9, 11, 15, - 15, 11, 10, 13, 12, 9, - 11, 13, 15, 14, 11, 13, - 14, 13, 13, 13, 13, 14, - 13, 16, 13, 15, 13, 12, - 10, 13, 13, 10, 10, 11, - 13, 15, 11, 13, 12, 13, - 13, 13, 12, 13, 13, 12, - 13, 12, 13, 12, 13, 13, - 15, 14, 13, 11, 12, 14, - 14, 11, 12, 14, 16, 13, - 13, 13, 14, 13, 12, 13, - 12, 12, 13, 12, 12, 13, - 14, 12, 10, 13, 13, 11, - 10, 10, 12, 11, 11, 11, - 13, 12, 11, 13, 12, 13, - 12, 12, 11, 13, 12, 10, - 10, 13, 11, 11, 13, 13, - 12, 11, 12, 11, 12, 12, - 10, 10, 10, 11, 11, 11, - 9, 10, 11, 10, 11, 9, - 11, 12, 9, 10, 10, 10, - 10, 11, 12, 13, 14, 12, - 10, 11, 13, 13, 11, 10, - 10, 12, 12, 11, 13, 13, - 13, 12, 10, 11, 11, 10, - 10, 9, 12, 11, 8, +static const uint8_t on2avc_cb9_bits[ON2AVC_CB_9_10_CODES] = { + 1, 5, 8, 9, 10, 11, 11, 9, 10, 11, 11, 10, 12, 12, 12, 12, 11, 11, 11, + 11, 9, 10, 11, 12, 13, 13, 10, 11, 11, 10, 10, 8, 9, 11, 12, 12, 11, 11, + 5, 8, 9, 10, 10, 8, 9, 10, 10, 8, 8, 8, 9, 10, 11, 12, 12, 8, 9, + 9, 8, 9, 9, 8, 8, 8, 11, 12, 12, 11, 11, 10, 11, 11, 7, 8, 9, 10, + 10, 8, 8, 8, 9, 9, 5, 9, 10, 11, 11, 9, 10, 11, 11, 8, 9, 9, 8, + 8, 8, 8, 5, 5, 5, 9, 11, 12, 12, 11, 11, 9, 9, 8, 9, 10, 10, 8, + 8, 8, 9, 10, 10, 4, 4, }; -#define ON2AVC_CB9_10_CODES 121 -static const uint16_t on2avc_cb9_codes[ON2AVC_CB9_10_CODES] = { - 0x0000, 0x000F, 0x0098, 0x026E, 0x045C, 0x00A6, - 0x00AC, 0x045D, 0x027E, 0x009A, 0x0012, 0x000E, - 0x001A, 0x00DE, 0x022C, 0x053E, 0x00A2, 0x009E, - 0x0538, 0x01B2, 0x00BA, 0x0018, 0x00AD, 0x00BF, - 0x01BE, 0x037E, 0x05C6, 0x0132, 0x0112, 0x08B5, - 0x0457, 0x01B6, 0x00BC, 0x02AE, 0x022A, 0x045E, - 0x08B6, 0x08FA, 0x0147, 0x013E, 0x119F, 0x05C7, - 0x044F, 0x0170, 0x0456, 0x047F, 0x06C7, 0x0A72, - 0x0D8B, 0x0267, 0x0266, 0x0D8A, 0x08B7, 0x05CF, - 0x045F, 0x0054, 0x00A4, 0x0118, 0x0142, 0x0234, - 0x036F, 0x036E, 0x029E, 0x0156, 0x0114, 0x0088, - 0x00A0, 0x00A5, 0x00DA, 0x015F, 0x026F, 0x02E2, - 0x02E6, 0x0236, 0x015E, 0x0143, 0x00AA, 0x053A, - 0x0466, 0x04FE, 0x09FE, 0x119E, 0x0232, 0x0237, - 0x0A73, 0x09FF, 0x08B4, 0x046B, 0x02AF, 0x01B0, - 0x037F, 0x053F, 0x08FB, 0x0136, 0x0146, 0x08CE, - 0x05CE, 0x044E, 0x01B3, 0x008E, 0x00DD, 0x0226, - 0x047E, 0x06C6, 0x00AE, 0x011E, 0x06C4, 0x047C, - 0x0172, 0x00BE, 0x0010, 0x0016, 0x00BD, 0x0176, - 0x053B, 0x009D, 0x009C, 0x046A, 0x0177, 0x00DC, - 0x0019, +static const uint8_t on2avc_cb10_bits[ON2AVC_CB_9_10_CODES] = { + 9, 9, 9, 9, 8, 9, 9, 7, 8, 9, 9, 8, 9, 9, 8, 8, 8, 8, 8, + 8, 5, 6, 8, 8, 8, 8, 7, 8, 8, 7, 7, 7, 8, 9, 9, 7, 8, 8, + 7, 7, 7, 8, 9, 9, 6, 7, 7, 5, 6, 7, 7, 6, 7, 8, 9, 9, 6, + 6, 5, 6, 6, 5, 7, 7, 7, 7, 6, 7, 7, 6, 7, 8, 8, 5, 7, 7, + 7, 7, 5, 7, 8, 8, 8, 8, 8, 8, 5, 6, 7, 7, 6, 7, 8, 8, 6, + 7, 8, 8, 5, 6, 7, 8, 8, 7, 7, 8, 9, 9, 8, 8, 6, 7, 8, 8, + 6, 7, 8, 8, 6, 7, 7, }; -static const uint8_t on2avc_cb9_bits[ON2AVC_CB9_10_CODES] = { - 1, 4, 8, 10, 11, 8, - 8, 11, 10, 8, 5, 4, - 5, 8, 10, 11, 8, 8, - 11, 9, 8, 5, 8, 8, - 9, 10, 11, 9, 9, 12, - 11, 9, 8, 10, 10, 11, - 12, 12, 9, 9, 13, 11, - 11, 9, 11, 11, 11, 12, - 12, 10, 10, 12, 12, 11, - 11, 7, 8, 9, 9, 10, - 10, 10, 10, 9, 9, 8, - 8, 8, 8, 9, 10, 10, - 10, 10, 9, 9, 8, 11, - 11, 11, 12, 13, 10, 10, - 12, 12, 12, 11, 10, 9, - 10, 11, 12, 9, 9, 12, - 11, 11, 9, 8, 8, 10, - 11, 11, 8, 9, 11, 11, - 9, 8, 5, 5, 8, 9, - 11, 8, 8, 11, 9, 8, - 5, +static const uint8_t on2avc_cb11_bits[ON2AVC_CB_11_CODES] = { + 2, 10, 10, 10, 10, 9, 10, 11, 11, 10, 10, 10, 10, 9, 9, 9, 10, 11, 11, + 9, 10, 10, 10, 11, 12, 12, 10, 11, 11, 9, 9, 9, 10, 10, 9, 9, 8, 10, + 11, 11, 10, 10, 9, 10, 10, 10, 10, 10, 11, 11, 9, 10, 10, 9, 10, 10, 8, + 9, 10, 10, 9, 10, 11, 11, 9, 10, 10, 9, 10, 11, 11, 9, 10, 10, 9, 10, + 10, 10, 10, 10, 10, 8, 9, 10, 11, 11, 8, 9, 9, 9, 10, 10, 9, 10, 11, + 11, 9, 10, 10, 9, 10, 11, 11, 9, 10, 10, 9, 10, 10, 9, 10, 11, 11, 9, + 9, 9, 10, 10, 9, 9, 9, 9, 9, 10, 11, 11, 7, 9, 10, 10, 9, 9, 7, + 9, 10, 10, 10, 10, 10, 10, 5, 7, 7, 7, 7, 5, 5, 5, 9, 10, 10, 9, + 10, 10, 9, 9, 10, 11, 11, 10, 10, 7, 7, 9, 10, 10, 9, 10, 10, 8, 10, + 10, 10, 10, 9, 10, 10, 9, 9, 8, 9, 9, 7, 8, 10, 10, 10, 10, 7, 8, + 9, 10, 10, 7, 9, 10, 10, 9, 10, 10, 8, 8, 9, 9, 9, 10, 10, 7, 8, + 9, 10, 10, 8, 9, 10, 10, 9, 9, 9, 10, 10, 4, 4, 4, 4, }; -static const uint16_t on2avc_cb9_10_syms[ON2AVC_CB9_10_CODES] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0100, - 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x01FB, - 0x01FC, 0x01FD, 0x01FE, 0x01FF, 0x0200, 0x0201, - 0x0202, 0x0203, 0x0204, 0x0205, 0x02FB, 0x02FC, - 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302, - 0x0303, 0x0304, 0x0305, 0x03FB, 0x03FC, 0x03FD, - 0x03FE, 0x03FF, 0x0400, 0x0401, 0x0402, 0x0403, - 0x0404, 0x0405, 0x04FB, 0x04FC, 0x04FD, 0x04FE, - 0x04FF, 0x0500, 0x0501, 0x0502, 0x0503, 0x0504, - 0x0505, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF, - 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0xFB05, - 0xFBFB, 0xFBFC, 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, - 0xFC01, 0xFC02, 0xFC03, 0xFC04, 0xFC05, 0xFCFB, - 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF, 0xFD00, 0xFD01, - 0xFD02, 0xFD03, 0xFD04, 0xFD05, 0xFDFB, 0xFDFC, - 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, 0xFE01, 0xFE02, - 0xFE03, 0xFE04, 0xFE05, 0xFEFB, 0xFEFC, 0xFEFD, - 0xFEFE, 0xFEFF, 0xFF00, 0xFF01, 0xFF02, 0xFF03, - 0xFF04, 0xFF05, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE, - 0xFFFF, +static const uint8_t on2avc_cb12_bits[ON2AVC_CB_12_CODES] = { + 2, 10, 11, 11, 11, 12, 12, 11, 11, 10, 12, 12, 12, 12, 10, 11, 11, 12, 12, + 12, 12, 11, 11, 10, 11, 11, 10, 12, 13, 13, 12, 12, 10, 12, 12, 12, 12, 10, + 11, 12, 12, 10, 12, 12, 12, 12, 11, 12, 12, 11, 12, 12, 11, 11, 11, 11, 10, + 11, 11, 10, 10, 12, 12, 12, 12, 11, 12, 12, 10, 11, 12, 12, 10, 11, 11, 10, + 11, 11, 11, 12, 12, 11, 11, 10, 10, 10, 10, 10, 11, 12, 13, 13, 10, 11, 12, + 12, 12, 12, 12, 12, 11, 11, 10, 11, 11, 11, 12, 13, 13, 12, 12, 12, 12, 11, + 12, 12, 11, 11, 10, 11, 12, 12, 9, 10, 10, 10, 11, 12, 12, 11, 11, 11, 11, + 10, 11, 11, 10, 10, 9, 11, 11, 11, 11, 9, 10, 11, 11, 9, 10, 11, 13, 14, + 14, 13, 13, 8, 9, 12, 12, 12, 12, 11, 11, 9, 10, 11, 11, 9, 10, 11, 12, + 12, 8, 10, 11, 12, 12, 10, 11, 11, 10, 11, 12, 12, 10, 10, 11, 11, 11, 11, + 10, 11, 12, 12, 10, 11, 11, 11, 11, 11, 11, 9, 10, 11, 11, 8, 9, 10, 11, + 11, 5, 10, 11, 12, 12, 10, 11, 11, 9, 10, 10, 8, 10, 11, 12, 12, 10, 11, + 11, 11, 11, 11, 11, 10, 10, 9, 9, 9, 11, 12, 13, 13, 12, 12, 12, 12, 11, + 11, 11, 11, 10, 10, 5, 5, 5, 9, 10, 11, 12, 12, 11, 11, 11, 12, 12, 11, + 11, 11, 11, 10, 10, 10, 11, 11, 11, 11, 11, 11, 10, 12, 12, 12, 12, 11, 12, + 12, 11, 11, 10, 10, 9, 10, 10, 10, 11, 11, 11, 11, 11, 11, 10, 11, 12, 12, + 10, 11, 11, 7, 9, 9, 10, 11, 11, 10, 10, 7, 7, 7, 10, 11, 11, 10, 10, + 10, 10, 10, 11, 12, 12, 7, 7, 7, 7, 7, 10, 11, 12, 12, 10, 11, 11, 10, + 11, 11, 10, 11, 11, 7, 10, 10, 10, 10, 9, 10, 10, 7, 10, 10, 10, 11, 11, + 10, 10, 10, 11, 12, 12, 7, 10, 11, 11, 10, 11, 11, 9, 10, 10, 11, 11, 11, + 11, 11, 11, 11, 11, 9, 10, 11, 11, 10, 10, 10, 10, 9, 11, 11, 11, 11, 10, + 11, 11, 10, 11, 12, 12, 9, 10, 11, 11, 10, 11, 11, 10, 10, 10, 11, 12, 12, + 10, 11, 11, 10, 10, 10, 10, 9, 9, 10, 11, 11, 10, 10, 9, 11, 11, 11, 11, + 4, 4, 4, 4, }; -static const uint16_t on2avc_cb10_codes[ON2AVC_CB9_10_CODES] = { - 0x002E, 0x001A, 0x003C, 0x001F, 0x006E, 0x002E, - 0x00AE, 0x006F, 0x002A, 0x003E, 0x0014, 0x0016, - 0x0002, 0x000E, 0x004E, 0x00F7, 0x0042, 0x0027, - 0x00F6, 0x0046, 0x0014, 0x0008, 0x0032, 0x0016, - 0x0030, 0x0012, 0x0056, 0x0018, 0x005F, 0x00DE, - 0x006E, 0x0036, 0x001A, 0x0023, 0x003D, 0x003F, - 0x007A, 0x008E, 0x0071, 0x0006, 0x0012, 0x000F, - 0x0043, 0x003E, 0x00AE, 0x0001, 0x00AB, 0x00C7, - 0x0013, 0x000A, 0x0002, 0x01CA, 0x0003, 0x0000, - 0x000F, 0x0022, 0x0016, 0x002A, 0x007F, 0x001C, - 0x0036, 0x00AF, 0x00C6, 0x000E, 0x0010, 0x0006, - 0x008F, 0x001E, 0x0054, 0x000D, 0x00AA, 0x0056, - 0x00AC, 0x001D, 0x0076, 0x0013, 0x004F, 0x0057, - 0x00E6, 0x00EE, 0x000E, 0x01CB, 0x00AF, 0x000B, - 0x0007, 0x00EF, 0x00AD, 0x00E4, 0x0008, 0x005E, - 0x0070, 0x001E, 0x00DF, 0x000C, 0x007E, 0x00CE, - 0x0002, 0x001A, 0x003C, 0x0002, 0x0020, 0x003A, - 0x004D, 0x00CF, 0x0066, 0x0026, 0x002F, 0x001F, - 0x0022, 0x001B, 0x0012, 0x000E, 0x0017, 0x0062, - 0x00E7, 0x0019, 0x0014, 0x0006, 0x004C, 0x0012, - 0x000C, +static const uint8_t on2avc_cb13_bits[ON2AVC_CB_13_CODES] = { + 1, 8, 10, 10, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 13, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 12, 12, 9, 12, 12, 12, 12, 11, 12, 12, 8, 9, 10, 11, + 12, 12, 8, 8, 8, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 11, 12, 12, 11, 11, 10, 11, 12, 13, 13, 11, 11, 11, 11, 11, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 8, 8, 8, 13, 13, 13, 13, 13, 13, + 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 5, 8, 11, 12, 12, + 11, 11, 11, 11, 11, 12, 13, 14, 15, 16, 16, 10, 11, 11, 10, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 10, 11, 11, 8, 8, 11, 11, 11, 11, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 5, 5, 5, 11, 11, 11, 11, 10, 11, 11, 11, 11, + 11, 11, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, + 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 11, 11, 10, 11, 13, 14, 16, 16, 16, + 16, 13, 13, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 11, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 12, 12, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 11, 12, 12, 11, 11, 10, 11, 12, 15, 15, 15, 15, 14, 14, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 10, 11, 11, + 10, 11, 12, 13, 14, 15, 15, 11, 11, 11, 11, 11, 11, 11, 11, 10, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 11, 11, + 11, 11, 11, 11, 11, 10, 11, 11, 10, 10, 11, 12, 13, 13, 11, 11, 11, 11, 11, + 11, 10, 11, 11, 10, 10, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 5, 12, 12, + 12, 12, 11, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 11, + 12, 13, 14, 14, 10, 11, 11, 11, 11, 11, 11, 10, 11, 11, 10, 10, 10, 10, 10, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, + 10, 11, 11, 10, 10, 5, 5, 5, 7, 8, 10, 10, 11, 12, 14, 14, 14, 14, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 10, 10, 8, 9, 9, }; -static const uint8_t on2avc_cb10_bits[ON2AVC_CB9_10_CODES] = { - 6, 5, 6, 8, 9, 8, - 8, 9, 8, 6, 5, 5, - 5, 6, 7, 8, 7, 7, - 8, 7, 6, 5, 6, 6, - 6, 7, 8, 7, 7, 8, - 7, 6, 6, 8, 7, 7, - 7, 8, 7, 8, 9, 8, - 7, 7, 9, 9, 8, 8, - 9, 8, 9, 9, 9, 9, - 9, 8, 7, 7, 7, 8, - 8, 9, 8, 8, 7, 6, - 8, 7, 7, 8, 8, 9, - 8, 8, 7, 7, 7, 9, - 8, 8, 9, 9, 8, 8, - 9, 8, 8, 8, 8, 7, - 7, 8, 8, 8, 7, 8, - 8, 7, 7, 7, 6, 6, - 7, 8, 7, 7, 8, 7, - 6, 6, 5, 5, 6, 7, - 8, 7, 7, 9, 7, 6, - 5, +static const uint8_t on2avc_cb14_bits[ON2AVC_CB_14_CODES] = { + 1, 6, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 11, + 11, 11, 11, 11, 11, 11, 6, 8, 10, 11, 11, 10, 11, 12, 13, 13, 8, 11, 11, + 11, 11, 10, 10, 6, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 9, + 10, 10, 8, 8, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 5, 8, 10, 11, 11, 10, 11, + 12, 13, 13, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 5, 5, 5, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 10, 11, 11, 9, 10, 10, 9, 10, 10, 10, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 9, 10, 12, 12, 12, + 12, 9, 9, 9, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, + 10, 7, 9, 10, 10, 9, 9, 7, 9, 10, 10, 10, 10, 10, 10, 8, 9, 10, 11, + 11, 8, 9, 11, 11, 11, 11, 8, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 10, 10, 10, 10, 10, 10, 9, 10, 10, 9, 9, 9, 10, 10, 9, 9, 5, 9, + 9, 9, 9, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, }; -#define ON2AVC_CB11_CODES 225 -static const uint16_t on2avc_cb11_codes[ON2AVC_CB11_CODES] = { - 0x0000, 0x000E, 0x0056, 0x00CD, 0x0173, 0x0232, - 0x00C7, 0x014F, 0x01AA, 0x00BE, 0x026F, 0x0192, - 0x00BC, 0x0058, 0x000F, 0x000C, 0x0010, 0x004E, - 0x0082, 0x0142, 0x01BF, 0x0098, 0x015E, 0x0136, - 0x0086, 0x01BB, 0x014E, 0x00BA, 0x003E, 0x0012, - 0x0054, 0x0036, 0x0050, 0x008F, 0x014B, 0x0262, - 0x00AA, 0x015C, 0x013E, 0x00B7, 0x02BE, 0x0176, - 0x00A2, 0x0058, 0x003C, 0x00C2, 0x00A6, 0x008A, - 0x00B2, 0x0122, 0x02AC, 0x00CA, 0x012F, 0x014A, - 0x00DC, 0x02DE, 0x017A, 0x0134, 0x0092, 0x00B4, - 0x0166, 0x0148, 0x016E, 0x013F, 0x0134, 0x02FF, - 0x014F, 0x019E, 0x0267, 0x016C, 0x02A6, 0x02CE, - 0x013A, 0x010A, 0x0108, 0x026E, 0x02CB, 0x028E, - 0x02CF, 0x020F, 0x02DF, 0x010B, 0x02AD, 0x0227, - 0x018A, 0x04DB, 0x02A7, 0x02FE, 0x0236, 0x026C, - 0x00C6, 0x009C, 0x00C4, 0x00CE, 0x00D6, 0x0135, - 0x0156, 0x025A, 0x02FF, 0x0286, 0x015F, 0x0132, - 0x00D7, 0x00AC, 0x00A2, 0x0176, 0x0118, 0x0123, - 0x0157, 0x01BC, 0x02AE, 0x02EE, 0x04DA, 0x0467, - 0x033F, 0x0287, 0x0193, 0x0182, 0x013B, 0x0112, - 0x0133, 0x017D, 0x0117, 0x0186, 0x026E, 0x025B, - 0x02EF, 0x0466, 0x0316, 0x0237, 0x02F6, 0x01BA, - 0x015D, 0x012E, 0x015A, 0x014A, 0x008E, 0x00B6, - 0x0135, 0x0100, 0x017B, 0x028C, 0x033E, 0x0297, - 0x015B, 0x0102, 0x0140, 0x00D4, 0x00BA, 0x0088, - 0x02EE, 0x0283, 0x02BF, 0x020E, 0x02CE, 0x0317, - 0x0172, 0x0296, 0x026F, 0x0101, 0x02CF, 0x02F7, - 0x01BD, 0x02EF, 0x028F, 0x0263, 0x0164, 0x011A, - 0x0147, 0x0292, 0x02FE, 0x015E, 0x02AF, 0x01AB, - 0x0130, 0x02CA, 0x0183, 0x014E, 0x017C, 0x017E, - 0x00C8, 0x00AA, 0x009E, 0x0132, 0x0152, 0x0226, - 0x00CC, 0x017E, 0x0187, 0x00CB, 0x0293, 0x0106, - 0x00C0, 0x0087, 0x00BC, 0x005C, 0x003D, 0x005A, - 0x00A8, 0x0103, 0x028D, 0x00A4, 0x0116, 0x0146, - 0x00B8, 0x01BE, 0x016D, 0x0093, 0x004A, 0x003F, - 0x000D, 0x0011, 0x004F, 0x00AE, 0x0166, 0x0266, - 0x0090, 0x0109, 0x012C, 0x00A6, 0x0282, 0x017A, - 0x00B5, 0x0034, 0x000E, +static const uint8_t on2avc_cb15_bits[ON2AVC_CB_15_CODES] = { + 2, 5, 8, 8, 12, 12, 12, 12, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 12, 12, 11, 11, 11, 11, 8, 11, 12, 13, 14, 14, 11, 12, 12, 11, + 11, 11, 11, 11, 11, 11, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 5, 5, 5, 6, 6, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 11, + 11, 11, 11, 11, 11, 11, 11, 10, 11, 12, 12, 10, 11, 12, 12, 11, 12, 13, 14, + 17, 17, 17, 17, 16, 16, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 11, 12, 12, 10, 11, 11, 9, 9, 9, 11, 11, 12, 12, 12, 12, 11, 12, 12, + 11, 11, 11, 11, 11, 11, 9, 10, 11, 11, 9, 10, 11, 11, 16, 16, 16, 16, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 9, 12, 13, 13, 12, 12, 11, 12, + 13, 14, 14, 11, 12, 12, 12, 12, 12, 12, 10, 11, 12, 12, 9, 10, 11, 11, 10, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 11, 12, 12, 11, 11, 10, + 11, 12, 12, 9, 11, 11, 11, 11, 10, 11, 11, 10, 10, 12, 12, 12, 12, 12, 12, + 12, 12, 10, 11, 12, 12, 9, 10, 11, 12, 14, 14, 14, 14, 9, 10, 11, 11, 9, + 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 9, 11, 12, 12, 12, + 12, 12, 12, 9, 9, 8, 12, 12, 12, 12, 11, 11, 10, 10, 5, 9, 10, 11, 13, + 13, 13, 13, 10, 10, 10, 10, 10, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 9, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 8, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, + 12, 11, 11, 10, 11, 11, 10, 10, 5, 5, 5, 5, 5, 7, 10, 10, 10, 10, 10, + 12, 13, 15, 15, 15, 15, 12, 12, 10, 10, 8, 10, 10, 12, 12, 12, 12, 12, 12, + 12, 12, 8, 12, 12, 12, 12, 12, 12, 12, 12, 10, 11, 12, 12, 10, 10, 10, 11, + 11, 10, 10, 10, 10, 9, 10, 10, 14, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 13, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 11, 12, 12, 10, 10, 10, 11, 12, 12, 9, 10, 10, 9, 11, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 10, 11, 12, 12, 10, 11, 11, 10, 11, 11, + 9, 10, 10, 7, 10, 11, 13, 14, 14, 13, 13, 10, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, + 12, 12, 10, 11, 11, 10, 10, 10, 11, 12, 12, 7, 10, 10, 10, 10, 10, 10, 10, + 10, 7, 9, 10, 10, 10, 10, 10, 10, 7, 7, 7, 10, 10, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 7, + 10, 10, 10, 11, 11, 10, 11, 11, 11, 11, 11, 11, 7, 10, 10, 10, 10, 9, 10, + 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, + 11, 10, 11, 11, 10, 10 }; -static const uint8_t on2avc_cb11_bits[ON2AVC_CB11_CODES] = { - 2, 4, 7, 9, 10, 11, - 9, 10, 10, 9, 11, 10, - 9, 7, 4, 4, 5, 7, - 9, 9, 10, 9, 10, 10, - 9, 10, 9, 8, 7, 5, - 7, 7, 8, 9, 9, 10, - 9, 10, 10, 9, 10, 9, - 9, 8, 7, 9, 8, 9, - 9, 10, 10, 9, 10, 10, - 9, 10, 10, 9, 9, 8, - 10, 9, 9, 10, 10, 10, - 9, 10, 10, 9, 11, 10, - 10, 10, 10, 11, 10, 10, - 10, 11, 10, 10, 10, 11, - 10, 11, 11, 10, 11, 10, - 9, 9, 9, 9, 9, 10, - 10, 11, 11, 10, 10, 10, - 9, 9, 8, 10, 10, 10, - 10, 10, 10, 10, 11, 12, - 11, 10, 10, 10, 10, 10, - 10, 9, 10, 10, 10, 11, - 11, 12, 11, 11, 10, 10, - 10, 10, 10, 9, 9, 9, - 9, 10, 10, 10, 11, 11, - 10, 10, 9, 9, 9, 9, - 11, 10, 10, 11, 11, 11, - 10, 11, 10, 10, 11, 10, - 10, 10, 10, 10, 9, 10, - 10, 10, 11, 9, 10, 10, - 9, 10, 10, 10, 9, 9, - 9, 8, 9, 9, 10, 11, - 9, 10, 10, 9, 10, 10, - 9, 9, 8, 7, 7, 8, - 9, 10, 10, 9, 10, 10, - 9, 10, 9, 9, 8, 7, - 4, 5, 7, 8, 9, 10, - 9, 10, 10, 9, 10, 9, - 8, 7, 5, +static const uint16_t on2avc_cb_1_syms[ON2AVC_CB_1_2_CODES] = { + 0x0000, 0x0F10, 0x01F0, 0x0011, 0xFF00, 0x00FF, 0x1111, 0xFFFF, 0x1FF1, + 0xF11F, 0x11FF, 0xFF11, 0x0FF0, 0x0110, 0xF010, 0x010F, 0x10F0, 0x0F01, + 0x1010, 0xF001, 0x0F0F, 0xF0F0, 0x0101, 0x100F, 0xF00F, 0x1001, 0x1F00, + 0x00F1, 0x001F, 0xF100, 0x1100, 0xF1F1, 0xF1FF, 0x1F11, 0xFF1F, 0x11F1, + 0x1F1F, 0x1FFF, 0xF111, 0xFFF1, 0x111F, }; -static const uint16_t on2avc_cb11_syms[ON2AVC_CB11_CODES] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x00F9, 0x00FA, 0x00FB, 0x00FC, - 0x00FD, 0x00FE, 0x00FF, 0x0100, 0x0101, 0x0102, - 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x01F9, - 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF, - 0x0200, 0x0201, 0x0202, 0x0203, 0x0204, 0x0205, - 0x0206, 0x0207, 0x02F9, 0x02FA, 0x02FB, 0x02FC, - 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302, - 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x03F9, - 0x03FA, 0x03FB, 0x03FC, 0x03FD, 0x03FE, 0x03FF, - 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, - 0x0406, 0x0407, 0x04F9, 0x04FA, 0x04FB, 0x04FC, - 0x04FD, 0x04FE, 0x04FF, 0x0500, 0x0501, 0x0502, - 0x0503, 0x0504, 0x0505, 0x0506, 0x0507, 0x05F9, - 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF, - 0x0600, 0x0601, 0x0602, 0x0603, 0x0604, 0x0605, - 0x0606, 0x0607, 0x06F9, 0x06FA, 0x06FB, 0x06FC, - 0x06FD, 0x06FE, 0x06FF, 0x0700, 0x0701, 0x0702, - 0x0703, 0x0704, 0x0705, 0x0706, 0x0707, 0x07F9, - 0x07FA, 0x07FB, 0x07FC, 0x07FD, 0x07FE, 0x07FF, - 0xF900, 0xF901, 0xF902, 0xF903, 0xF904, 0xF905, - 0xF906, 0xF907, 0xF9F9, 0xF9FA, 0xF9FB, 0xF9FC, - 0xF9FD, 0xF9FE, 0xF9FF, 0xFA00, 0xFA01, 0xFA02, - 0xFA03, 0xFA04, 0xFA05, 0xFA06, 0xFA07, 0xFAF9, - 0xFAFA, 0xFAFB, 0xFAFC, 0xFAFD, 0xFAFE, 0xFAFF, - 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0xFB05, - 0xFB06, 0xFB07, 0xFBF9, 0xFBFA, 0xFBFB, 0xFBFC, - 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, 0xFC01, 0xFC02, - 0xFC03, 0xFC04, 0xFC05, 0xFC06, 0xFC07, 0xFCF9, - 0xFCFA, 0xFCFB, 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF, - 0xFD00, 0xFD01, 0xFD02, 0xFD03, 0xFD04, 0xFD05, - 0xFD06, 0xFD07, 0xFDF9, 0xFDFA, 0xFDFB, 0xFDFC, - 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, 0xFE01, 0xFE02, - 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07, 0xFEF9, - 0xFEFA, 0xFEFB, 0xFEFC, 0xFEFD, 0xFEFE, 0xFEFF, - 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05, - 0xFF06, 0xFF07, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, - 0xFFFD, 0xFFFE, 0xFFFF, +static const uint16_t on2avc_cb_2_syms[ON2AVC_CB_1_2_CODES] = { + 0x00FF, 0xFFFF, 0x1111, 0x11FF, 0xFF11, 0xFF00, 0x0011, 0x100F, 0x1FF1, + 0xF11F, 0x1FFF, 0x11F1, 0xF001, 0x10F0, 0x0F10, 0x010F, 0xF010, 0x1F11, + 0xF111, 0xF1FF, 0x111F, 0x0F01, 0x01F0, 0x0110, 0x1001, 0x0FF0, 0xF00F, + 0x1010, 0xF0F0, 0x0101, 0x0F0F, 0x1100, 0xFFF1, 0xFF1F, 0x1F1F, 0xF1F1, + 0x0000, 0xF100, 0x1F00, 0x00F1, 0x001F, }; -#define ON2AVC_CB12_CODES 441 -static const uint16_t on2avc_cb12_codes[ON2AVC_CB12_CODES] = { - 0x0000, 0x000C, 0x004F, 0x0156, 0x02E6, 0x0462, - 0x044C, 0x086A, 0x0222, 0x0228, 0x047F, 0x037A, - 0x028F, 0x02B8, 0x0BB7, 0x04B7, 0x02DA, 0x0262, - 0x0124, 0x0052, 0x000F, 0x000D, 0x000E, 0x0058, - 0x00A2, 0x0129, 0x02C8, 0x0256, 0x044D, 0x016E, - 0x02AA, 0x02BE, 0x027F, 0x02A9, 0x016E, 0x0597, - 0x02EE, 0x02EE, 0x013A, 0x00A4, 0x004E, 0x000C, - 0x0056, 0x004B, 0x0058, 0x0125, 0x010E, 0x01A7, - 0x026A, 0x0415, 0x010C, 0x0228, 0x0446, 0x0232, - 0x017E, 0x0128, 0x0473, 0x035E, 0x026A, 0x015E, - 0x00DB, 0x005E, 0x0048, 0x017A, 0x00AE, 0x00BA, - 0x0172, 0x0229, 0x02FB, 0x0458, 0x05A4, 0x015A, - 0x0296, 0x05BE, 0x044E, 0x0216, 0x012A, 0x0423, - 0x053E, 0x02F0, 0x02F1, 0x011E, 0x0110, 0x009C, - 0x026B, 0x0112, 0x011B, 0x01B3, 0x01BF, 0x0263, - 0x057E, 0x04B8, 0x016B, 0x02DE, 0x04DE, 0x0416, - 0x02DB, 0x02AB, 0x06EE, 0x04CF, 0x025F, 0x02EB, - 0x022A, 0x011A, 0x010A, 0x05A5, 0x0238, 0x0217, - 0x02D6, 0x025A, 0x0282, 0x044F, 0x043D, 0x01AE, - 0x026B, 0x05C2, 0x043C, 0x044F, 0x02DB, 0x05A7, - 0x044E, 0x05BF, 0x0297, 0x022A, 0x026C, 0x02BD, - 0x0897, 0x0283, 0x02B6, 0x02B7, 0x0264, 0x0459, - 0x040B, 0x04DF, 0x0298, 0x0456, 0x0AFF, 0x06B7, - 0x0448, 0x0449, 0x08BE, 0x06EF, 0x04B9, 0x0597, - 0x049A, 0x02D2, 0x02F8, 0x08F7, 0x0476, 0x0452, - 0x0453, 0x045A, 0x05BE, 0x043E, 0x04D2, 0x02F2, - 0x02E4, 0x0477, 0x0AFE, 0x05A6, 0x02E3, 0x0BB6, - 0x0A7E, 0x05A6, 0x0A66, 0x08BF, 0x05FF, 0x0492, - 0x0170, 0x0106, 0x0140, 0x0142, 0x022E, 0x02CF, - 0x02B9, 0x02E2, 0x02F3, 0x05A0, 0x088E, 0x0DD7, - 0x04F6, 0x047E, 0x045B, 0x0347, 0x029E, 0x026D, - 0x01AC, 0x013B, 0x0104, 0x035F, 0x02EC, 0x026E, - 0x0233, 0x0207, 0x023E, 0x026E, 0x053F, 0x05A7, - 0x0456, 0x04AE, 0x0DD6, 0x0A67, 0x0493, 0x04BA, - 0x05D3, 0x05C3, 0x0246, 0x0247, 0x0202, 0x02E8, - 0x05AE, 0x0374, 0x0537, 0x05C6, 0x04BB, 0x0686, - 0x04D3, 0x04DE, 0x08C3, 0x05BF, 0x04F7, 0x14FB, - 0x0997, 0x0A7F, 0x08C2, 0x0417, 0x0434, 0x0477, - 0x037B, 0x0463, 0x02EF, 0x0592, 0x02E5, 0x049B, - 0x035A, 0x0436, 0x05AF, 0x0687, 0x0896, 0x095F, - 0x09BE, 0x0996, 0x0558, 0x088F, 0x0B8E, 0x057E, - 0x04CA, 0x05CE, 0x05F3, 0x047A, 0x05A1, 0x02E2, - 0x02FA, 0x0204, 0x022C, 0x020E, 0x0360, 0x02AE, - 0x05FC, 0x0457, 0x05DA, 0x086B, 0x14FA, 0x04B6, - 0x02FE, 0x040A, 0x02E6, 0x0576, 0x044A, 0x028C, - 0x0212, 0x0248, 0x02E0, 0x029A, 0x0126, 0x017E, - 0x0130, 0x024C, 0x0232, 0x0596, 0x0378, 0x053A, - 0x04CC, 0x0A7C, 0x0470, 0x0593, 0x02D8, 0x029C, - 0x02D9, 0x02BE, 0x01A0, 0x014E, 0x0120, 0x013C, - 0x06EC, 0x04CD, 0x0559, 0x06B6, 0x0420, 0x057F, - 0x0596, 0x09BF, 0x0532, 0x055A, 0x095E, 0x08BC, - 0x0472, 0x02CA, 0x05F2, 0x05FD, 0x047E, 0x05A2, - 0x06EA, 0x05CF, 0x04D2, 0x043F, 0x028E, 0x0422, - 0x0460, 0x05DE, 0x053B, 0x08F6, 0x0B8F, 0x02CE, - 0x0473, 0x06ED, 0x0421, 0x028D, 0x023C, 0x047F, - 0x05A3, 0x044C, 0x044D, 0x0457, 0x02CA, 0x02D8, - 0x027C, 0x029E, 0x023E, 0x027D, 0x0361, 0x0414, - 0x05BC, 0x08BD, 0x02DA, 0x024A, 0x0437, 0x055B, - 0x0379, 0x01BE, 0x05DF, 0x04D3, 0x0268, 0x0206, - 0x0213, 0x02BA, 0x0203, 0x0236, 0x0127, 0x0136, - 0x0268, 0x0242, 0x02CF, 0x05FE, 0x05D2, 0x0237, - 0x0243, 0x0472, 0x0362, 0x027A, 0x02AE, 0x0471, - 0x0474, 0x024B, 0x02AF, 0x01A6, 0x012C, 0x0166, - 0x0166, 0x00A6, 0x00AC, 0x0100, 0x01B2, 0x020F, - 0x0363, 0x0446, 0x016A, 0x022E, 0x0577, 0x02FF, - 0x022D, 0x0168, 0x0475, 0x027E, 0x0222, 0x01A2, - 0x017B, 0x00D2, 0x00BE, 0x0050, 0x0054, 0x006A, - 0x011A, 0x0143, 0x024F, 0x02E7, 0x0447, 0x0110, - 0x0233, 0x02D9, 0x02AF, 0x024E, 0x016A, 0x0536, - 0x0342, 0x02BC, 0x0176, 0x00DA, 0x0054, 0x004A, - 0x000E, 0x0010, 0x004C, 0x00DC, 0x0164, 0x023A, - 0x0476, 0x04CE, 0x0118, 0x02CE, 0x025E, 0x0346, - 0x02A8, 0x0122, 0x05BD, 0x022F, 0x02EA, 0x014A, - 0x00AA, 0x0051, 0x000F, +static const uint16_t on2avc_cb_3_syms[ON2AVC_CB_3_4_CODES] = { + 0x0000, 0xE000, 0x0F10, 0x000E, 0x01F2, 0x0F1E, 0xEE00, 0x1021, 0x22E0, + 0x02E2, 0xE1F2, 0xEEE0, 0xE2E2, 0xE20E, 0x0FEF, 0x2200, 0x0002, 0xF2F0, + 0xFFFF, 0x1E10, 0x00E2, 0xFE0F, 0x0EE2, 0x022E, 0xF001, 0xF111, 0x20F1, + 0x1F02, 0xFFEE, 0xE2F1, 0xF221, 0xE121, 0xEEEE, 0x20EE, 0x2FFE, 0x1201, + 0xE011, 0x1EF0, 0x0F2F, 0x0101, 0xFE10, 0x002E, 0xE01F, 0xE220, 0x1E21, + 0xE110, 0xF210, 0x100F, 0x1010, 0x0F0F, 0x0F01, 0x1001, 0xF010, 0x10F0, + 0xF00F, 0x010F, 0x2FF0, 0xF10E, 0x2EE0, 0x0E02, 0x2FEF, 0x110E, 0xF2EF, + 0xE020, 0x1EF2, 0x01EF, 0x12F0, 0xF0F0, 0x0FF0, 0x0110, 0x01E1, 0x0F21, + 0x012F, 0xFF20, 0xFF02, 0x0220, 0x011E, 0x0FF2, 0x0FE1, 0xF120, 0xE12F, + 0xE11E, 0xE0E2, 0x2E0E, 0x22EE, 0x202E, 0xFEF2, 0x21E1, 0x02EE, 0xFE12, + 0x2E22, 0x1FE0, 0x12E1, 0xFFE2, 0x1EEF, 0xE0E0, 0xE1EF, 0x0222, 0x21FE, + 0x0E11, 0x20FF, 0xFE2F, 0xF1EE, 0x01FE, 0xF1E0, 0x0E1F, 0x11E0, 0x1F0E, + 0x0EE0, 0x02FF, 0x0EF1, 0x0F12, 0x00EE, 0xF21E, 0xFE1E, 0x2020, 0xEE20, + 0x121E, 0x1F22, 0xEF2F, 0x0EEE, 0xE2E0, 0x2F10, 0x1F20, 0x021F, 0xE1F0, + 0x02F1, 0x0022, 0x001F, 0xF100, 0x1F00, 0x00F1, 0x0E00, 0xE0F1, 0x12EF, + 0x0202, 0xE022, 0x2E02, 0x2121, 0x212F, 0x201F, 0xFEE1, 0xEF21, 0x21EF, + 0xF102, 0xE1E1, 0x21F2, 0x220E, 0xE02E, 0x12FE, 0x2F2F, 0xFF0E, 0x2011, + 0x0200, 0x2110, 0xE10F, 0x10F2, 0x00E0, 0x0020, 0x2F0F, 0xF0F2, 0xF01E, + 0xF22F, 0xFE21, 0x1EE1, 0x2220, 0x2222, 0xEF1E, 0x2F12, 0xEFF0, 0x102F, + 0x1102, 0x112E, 0xEE1F, 0x0011, 0xF11F, 0x101E, 0xF02F, 0x1FF1, 0xF0E1, + 0x122F, 0x2FE1, 0x0E0E, 0x222E, 0xEE0E, 0x2022, 0xE0EE, 0xE211, 0xF2F2, + 0x2112, 0xEE2E, 0x20E2, 0x1F1F, 0x10E1, 0xE0FF, 0x22F1, 0x2E20, 0x1EFE, + 0x2002, 0x1E0F, 0xF20F, 0xF1F1, 0xE101, 0x1FE2, 0xF122, 0x11EE, 0x1FEE, + 0x1E01, 0x120F, 0x21F0, 0xF201, 0xEEFF, 0x2EFF, 0x1E1E, 0x2F1E, 0x2EE2, + 0xE2EE, 0x10EF, 0x1120, 0x210F, 0x2F01, 0x0112, 0xEF10, 0xF1FF, 0xF021, + 0x22FF, 0xEFEF, 0xEFF2, 0xEE02, 0xEEE2, 0x2EEE, 0xFF22, 0x221F, 0x1F11, + 0xFE01, 0xEF01, 0x0FFE, 0x0EFF, 0x02E0, 0xFF00, 0x1100, 0x2000, 0x00FF, + 0x01F0, 0xFF1F, 0x11F1, 0xFEEF, 0xF12E, 0x12F2, 0xE112, 0x200E, 0x1F2E, + 0xFF2E, 0xEE11, 0x10FE, 0xF012, 0x2E00, 0xFFE0, 0x0E20, 0x1FFF, 0x0211, + 0x2211, 0x2EF1, 0xF212, 0xEFFE, 0xE1FE, 0xE200, 0xF0FE, 0x11E2, 0x2E11, + 0x20E0, 0xEF12, 0x2E2E, 0x22E2, 0xE22E, 0x2202, 0x1210, 0xEF0F, 0x2101, + 0x111F, 0xF0EF, 0x2E1F, 0xE21F, 0xEEF1, 0x11FF, 0x1012, 0xF1E2, 0x1E12, + 0x0E2E, 0x2FF2, 0xFF11, 0xFFF1, 0x0121, 0xF2E1, 0x020E, 0xEFE1, 0x211E, + 0xE00E, 0x1E2F, 0x1122, 0x1111, 0xFEF0, 0x1221, 0xE2FF, 0x1212, 0x2F21, + 0x0E22, 0xF2FE, 0xFEFE, 0xE002, 0xEE22, 0xE202, 0xE222, }; -static const uint8_t on2avc_cb12_bits[ON2AVC_CB12_CODES] = { - 2, 4, 7, 9, 10, 11, - 12, 13, 10, 11, 11, 11, - 11, 10, 12, 12, 11, 11, - 9, 7, 4, 4, 5, 7, - 9, 10, 10, 11, 12, 10, - 10, 11, 11, 10, 9, 12, - 11, 10, 10, 9, 7, 5, - 7, 7, 8, 9, 10, 10, - 11, 12, 10, 10, 11, 11, - 10, 10, 12, 11, 10, 10, - 9, 8, 7, 9, 9, 9, - 9, 10, 10, 11, 11, 10, - 11, 11, 11, 11, 10, 12, - 11, 10, 10, 10, 9, 9, - 10, 10, 10, 10, 10, 11, - 11, 12, 10, 11, 11, 12, - 11, 10, 12, 12, 11, 10, - 10, 10, 10, 11, 10, 11, - 10, 11, 11, 12, 12, 10, - 11, 11, 12, 11, 10, 12, - 12, 11, 11, 11, 10, 10, - 12, 11, 11, 11, 11, 11, - 12, 12, 10, 11, 12, 12, - 11, 11, 12, 12, 12, 11, - 11, 11, 10, 12, 12, 12, - 12, 11, 12, 12, 12, 10, - 11, 12, 12, 11, 11, 12, - 13, 12, 12, 12, 11, 12, - 10, 10, 10, 10, 10, 10, - 10, 10, 10, 11, 12, 13, - 12, 12, 11, 11, 11, 10, - 10, 10, 10, 11, 10, 10, - 11, 11, 11, 11, 11, 11, - 12, 12, 13, 12, 12, 12, - 11, 11, 11, 11, 11, 10, - 11, 11, 11, 11, 12, 12, - 12, 12, 12, 12, 12, 14, - 13, 13, 12, 12, 12, 11, - 11, 11, 11, 11, 11, 11, - 11, 12, 11, 12, 12, 13, - 12, 13, 12, 12, 12, 12, - 12, 11, 11, 11, 11, 11, - 10, 11, 11, 11, 11, 11, - 11, 12, 11, 13, 14, 12, - 11, 12, 11, 11, 11, 11, - 11, 11, 10, 10, 10, 9, - 10, 10, 10, 11, 11, 11, - 12, 13, 12, 11, 10, 10, - 10, 10, 10, 10, 10, 10, - 12, 12, 12, 12, 12, 12, - 12, 12, 11, 12, 13, 12, - 11, 10, 11, 11, 11, 11, - 12, 11, 11, 12, 11, 12, - 11, 11, 11, 12, 12, 11, - 11, 12, 12, 11, 10, 12, - 11, 11, 11, 11, 11, 11, - 11, 10, 10, 11, 11, 12, - 11, 12, 10, 11, 12, 12, - 11, 10, 11, 11, 11, 11, - 11, 10, 11, 10, 10, 10, - 10, 11, 11, 11, 11, 10, - 11, 12, 11, 11, 10, 12, - 11, 11, 10, 10, 10, 10, - 9, 9, 9, 10, 10, 11, - 11, 12, 10, 11, 11, 11, - 11, 10, 11, 11, 11, 10, - 9, 9, 9, 7, 7, 8, - 9, 10, 10, 11, 12, 10, - 10, 11, 11, 10, 9, 11, - 11, 10, 10, 9, 8, 7, - 4, 5, 7, 9, 10, 11, - 11, 12, 10, 10, 11, 11, - 10, 10, 11, 11, 10, 10, - 9, 7, 5, +static const uint16_t on2avc_cb_4_syms[ON2AVC_CB_3_4_CODES] = { + 0x1FF1, 0xF111, 0x111F, 0xF01E, 0xE011, 0x20FF, 0xFFEE, 0xF2FE, 0x220E, + 0x20EE, 0x0110, 0x0F01, 0x0011, 0xF1F1, 0x20F1, 0x2F0F, 0x10F2, 0x110E, + 0xF010, 0xF001, 0x10F0, 0xFFF1, 0xFF02, 0xE01F, 0x021F, 0xFE01, 0x010F, + 0x0FF0, 0x1001, 0x1FFF, 0x1F1F, 0x100F, 0xF00F, 0x2101, 0x1F02, 0xE10F, + 0xFFE2, 0xEE02, 0x0E20, 0x2F12, 0x1EFE, 0x1FE0, 0xF10E, 0x120F, 0x21F2, + 0xEFF2, 0xEFEF, 0x2E20, 0xE022, 0xFF1F, 0x10EF, 0x0EF1, 0xF0FE, 0xF120, + 0x1F11, 0x02FF, 0xEF0F, 0xE101, 0xEF1E, 0xE112, 0xEFE1, 0xF212, 0xF1FF, + 0x101E, 0xF20F, 0xE000, 0x10E1, 0xF100, 0x001F, 0x1F00, 0x11F1, 0xFE0F, + 0xF021, 0x1E01, 0xE1EF, 0x2F21, 0x212F, 0x12F2, 0x0101, 0x0E00, 0x0E11, + 0xF0F2, 0x11E0, 0x201F, 0xF02F, 0x1E0F, 0x1201, 0x0F0F, 0x00F1, 0x1010, + 0xF0F0, 0x0F10, 0x0EFF, 0x2011, 0x0E1F, 0xFE1E, 0x2FFE, 0xE1FE, 0x211E, + 0x0200, 0xE0F1, 0xFF20, 0xF1E0, 0x01F0, 0xFFE0, 0xEEF1, 0x2E00, 0xE0E2, + 0x2EE0, 0x02E2, 0xE22E, 0x0211, 0xF201, 0x1F20, 0xF102, 0x02F1, 0x1021, + 0x1102, 0xE020, 0xE20E, 0xE200, 0x20E0, 0x22EE, 0xE2E0, 0xFF0E, 0xF0E1, + 0x1F0E, 0x102F, 0x1120, 0xE0FF, 0xF0EF, 0x0E02, 0x2EE2, 0x0E2E, 0x2E02, + 0x002E, 0x20E2, 0xEE22, 0x2000, 0xF122, 0x1FEE, 0x21FE, 0x020E, 0x2EEE, + 0x00E2, 0x221F, 0x2E1F, 0x0F1E, 0xEF12, 0xE2F1, 0x0F12, 0x01FE, 0xE110, + 0x2FF0, 0xF2F0, 0x0F2F, 0x1E10, 0x000E, 0x01F2, 0x22E2, 0xE2EE, 0xE02E, + 0x2E0E, 0x200E, 0x222E, 0xEE2E, 0x01E1, 0x011E, 0x0020, 0x01EF, 0xF210, + 0xF1E2, 0x1E2F, 0xFFFF, 0x0F21, 0xE21F, 0x22FF, 0x12F0, 0x0002, 0x012F, + 0xEE11, 0xE12F, 0x0FF2, 0xF2E1, 0x1F2E, 0x0000, 0x1111, 0x1EF0, 0x2E11, + 0x2002, 0x02E0, 0xE0EE, 0x00E0, 0x2FEF, 0xFE12, 0xFE10, 0x1EEF, 0x2020, + 0x0EE0, 0xF22F, 0xEEEE, 0x2EF1, 0x2220, 0xEE0E, 0xEEE2, 0x0FE1, 0x12FE, + 0xE2FF, 0x22F1, 0xE002, 0x202E, 0x2202, 0x21EF, 0x1EF2, 0x2110, 0x11EE, + 0x12E1, 0x2FE1, 0xF21E, 0xEFF0, 0x2EFF, 0xE211, 0xFEE1, 0x2FF2, 0xFE2F, + 0x1FE2, 0xFE21, 0x21E1, 0xEF21, 0xE0E0, 0x2022, 0xE220, 0x0E22, 0x2E22, + 0xF2EF, 0xFEF2, 0x0112, 0xE11E, 0xF221, 0x1EE1, 0xE00E, 0xE202, 0xE222, + 0xF012, 0x122F, 0x11E2, 0xF12E, 0x2F2F, 0x0FEF, 0x0FFE, 0xEF01, 0xFF22, + 0x2222, 0x121E, 0x2E2E, 0x0222, 0x1210, 0x210F, 0x2F10, 0x1212, 0x112E, + 0xEF2F, 0xEEE0, 0x0022, 0xFEF0, 0xFEFE, 0x0EEE, 0x0202, 0xEE1F, 0xF1EE, + 0x0121, 0x10FE, 0xEF10, 0x2F1E, 0x2121, 0xFF2E, 0x1E21, 0x21F0, 0xE121, + 0x0E0E, 0xE2E2, 0x1E1E, 0xF2F2, 0x2F01, 0x2211, 0x1E12, 0x0220, 0x22E0, + 0x0EE2, 0x02EE, 0x022E, 0x1221, 0xEFFE, 0xE1E1, 0x12EF, 0x00EE, 0x2200, + 0x2112, 0xE1F2, 0xFF11, 0x11FF, 0x1100, 0x00FF, 0xFF00, 0xF11F, 0xE1F0, + 0xFEEF, 0xEEFF, 0x1012, 0x1122, 0x1F22, 0xEE00, 0xEE20, }; -static const uint16_t on2avc_cb12_syms[ON2AVC_CB12_CODES] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x00F6, - 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, - 0x00FD, 0x00FE, 0x00FF, 0x0100, 0x0101, 0x0102, - 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, - 0x0109, 0x010A, 0x01F6, 0x01F7, 0x01F8, 0x01F9, - 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF, - 0x0200, 0x0201, 0x0202, 0x0203, 0x0204, 0x0205, - 0x0206, 0x0207, 0x0208, 0x0209, 0x020A, 0x02F6, - 0x02F7, 0x02F8, 0x02F9, 0x02FA, 0x02FB, 0x02FC, - 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302, - 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x0308, - 0x0309, 0x030A, 0x03F6, 0x03F7, 0x03F8, 0x03F9, - 0x03FA, 0x03FB, 0x03FC, 0x03FD, 0x03FE, 0x03FF, - 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, - 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x04F6, - 0x04F7, 0x04F8, 0x04F9, 0x04FA, 0x04FB, 0x04FC, - 0x04FD, 0x04FE, 0x04FF, 0x0500, 0x0501, 0x0502, - 0x0503, 0x0504, 0x0505, 0x0506, 0x0507, 0x0508, - 0x0509, 0x050A, 0x05F6, 0x05F7, 0x05F8, 0x05F9, - 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF, - 0x0600, 0x0601, 0x0602, 0x0603, 0x0604, 0x0605, - 0x0606, 0x0607, 0x0608, 0x0609, 0x060A, 0x06F6, - 0x06F7, 0x06F8, 0x06F9, 0x06FA, 0x06FB, 0x06FC, - 0x06FD, 0x06FE, 0x06FF, 0x0700, 0x0701, 0x0702, - 0x0703, 0x0704, 0x0705, 0x0706, 0x0707, 0x0708, - 0x0709, 0x070A, 0x07F6, 0x07F7, 0x07F8, 0x07F9, - 0x07FA, 0x07FB, 0x07FC, 0x07FD, 0x07FE, 0x07FF, - 0x0800, 0x0801, 0x0802, 0x0803, 0x0804, 0x0805, - 0x0806, 0x0807, 0x0808, 0x0809, 0x080A, 0x08F6, - 0x08F7, 0x08F8, 0x08F9, 0x08FA, 0x08FB, 0x08FC, - 0x08FD, 0x08FE, 0x08FF, 0x0900, 0x0901, 0x0902, - 0x0903, 0x0904, 0x0905, 0x0906, 0x0907, 0x0908, - 0x0909, 0x090A, 0x09F6, 0x09F7, 0x09F8, 0x09F9, - 0x09FA, 0x09FB, 0x09FC, 0x09FD, 0x09FE, 0x09FF, - 0x0A00, 0x0A01, 0x0A02, 0x0A03, 0x0A04, 0x0A05, - 0x0A06, 0x0A07, 0x0A08, 0x0A09, 0x0A0A, 0x0AF6, - 0x0AF7, 0x0AF8, 0x0AF9, 0x0AFA, 0x0AFB, 0x0AFC, - 0x0AFD, 0x0AFE, 0x0AFF, 0xF600, 0xF601, 0xF602, - 0xF603, 0xF604, 0xF605, 0xF606, 0xF607, 0xF608, - 0xF609, 0xF60A, 0xF6F6, 0xF6F7, 0xF6F8, 0xF6F9, - 0xF6FA, 0xF6FB, 0xF6FC, 0xF6FD, 0xF6FE, 0xF6FF, - 0xF700, 0xF701, 0xF702, 0xF703, 0xF704, 0xF705, - 0xF706, 0xF707, 0xF708, 0xF709, 0xF70A, 0xF7F6, - 0xF7F7, 0xF7F8, 0xF7F9, 0xF7FA, 0xF7FB, 0xF7FC, - 0xF7FD, 0xF7FE, 0xF7FF, 0xF800, 0xF801, 0xF802, - 0xF803, 0xF804, 0xF805, 0xF806, 0xF807, 0xF808, - 0xF809, 0xF80A, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9, - 0xF8FA, 0xF8FB, 0xF8FC, 0xF8FD, 0xF8FE, 0xF8FF, - 0xF900, 0xF901, 0xF902, 0xF903, 0xF904, 0xF905, - 0xF906, 0xF907, 0xF908, 0xF909, 0xF90A, 0xF9F6, - 0xF9F7, 0xF9F8, 0xF9F9, 0xF9FA, 0xF9FB, 0xF9FC, - 0xF9FD, 0xF9FE, 0xF9FF, 0xFA00, 0xFA01, 0xFA02, - 0xFA03, 0xFA04, 0xFA05, 0xFA06, 0xFA07, 0xFA08, - 0xFA09, 0xFA0A, 0xFAF6, 0xFAF7, 0xFAF8, 0xFAF9, - 0xFAFA, 0xFAFB, 0xFAFC, 0xFAFD, 0xFAFE, 0xFAFF, - 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0xFB05, - 0xFB06, 0xFB07, 0xFB08, 0xFB09, 0xFB0A, 0xFBF6, - 0xFBF7, 0xFBF8, 0xFBF9, 0xFBFA, 0xFBFB, 0xFBFC, - 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, 0xFC01, 0xFC02, - 0xFC03, 0xFC04, 0xFC05, 0xFC06, 0xFC07, 0xFC08, - 0xFC09, 0xFC0A, 0xFCF6, 0xFCF7, 0xFCF8, 0xFCF9, - 0xFCFA, 0xFCFB, 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF, - 0xFD00, 0xFD01, 0xFD02, 0xFD03, 0xFD04, 0xFD05, - 0xFD06, 0xFD07, 0xFD08, 0xFD09, 0xFD0A, 0xFDF6, - 0xFDF7, 0xFDF8, 0xFDF9, 0xFDFA, 0xFDFB, 0xFDFC, - 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, 0xFE01, 0xFE02, - 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07, 0xFE08, - 0xFE09, 0xFE0A, 0xFEF6, 0xFEF7, 0xFEF8, 0xFEF9, - 0xFEFA, 0xFEFB, 0xFEFC, 0xFEFD, 0xFEFE, 0xFEFF, - 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05, - 0xFF06, 0xFF07, 0xFF08, 0xFF09, 0xFF0A, 0xFFF6, - 0xFFF7, 0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, - 0xFFFD, 0xFFFE, 0xFFFF, +static const uint16_t on2avc_cb_5_syms[ON2AVC_CB_5_6_CODES] = { + 0x0000, 0x1100, 0x3F00, 0xF1FF, 0x010D, 0x0F30, 0xFE30, 0x10FE, 0xD021, + 0xE23F, 0xE3EF, 0xFF33, 0xFF00, 0x03F0, 0x0301, 0xF1EE, 0xF3D1, 0xF30E, + 0x023D, 0xFEDE, 0xFE0F, 0x1F11, 0xF11D, 0x10E3, 0xEDF2, 0xEEEE, 0xEE1F, + 0xEF1E, 0xF00D, 0xF131, 0xFF1F, 0x1FFF, 0xEF2F, 0xE1ED, 0xE1FE, 0xE2E0, + 0xE3F2, 0xF31D, 0x03ED, 0x1D3F, 0x131D, 0x2DFE, 0x2FFE, 0x202E, 0x22FD, + 0x220E, 0x3E12, 0x32F2, 0x0F2F, 0xED30, 0xF22D, 0x11EE, 0x33FF, 0x03EF, + 0x0121, 0x03D0, 0x0011, 0x0D10, 0x0112, 0xDE01, 0xF1E2, 0x1D31, 0x2D2F, + 0xE1F0, 0x2E00, 0x300F, 0xF1DF, 0x0FDE, 0x111F, 0x0132, 0x1DFF, 0x1F31, + 0xD221, 0xFEE1, 0x033E, 0x0330, 0x1E21, 0x12E1, 0x20D1, 0x213E, 0x012F, + 0x1FDF, 0x00FF, 0xFFD1, 0xFFF1, 0x01F2, 0xFFF3, 0xDF20, 0x22FF, 0x2332, + 0xF0FE, 0xF113, 0x0DE1, 0x31FF, 0xF311, 0xD1D1, 0xFFD3, 0x1E2F, 0x1122, + 0xFD11, 0x0FEF, 0x3111, 0x113D, 0xDDD3, 0x330E, 0xDD3D, 0xDED0, 0xDEF2, + 0xDE23, 0xDE3E, 0xD0E1, 0xD230, 0x00D3, 0x1FFD, 0x131F, 0xD30E, 0xE002, + 0xE3E3, 0xFD1D, 0xFE1E, 0xF33D, 0x1DFD, 0x1D1D, 0x13DD, 0x13F3, 0x2D2D, + 0x2E02, 0x2F03, 0x203D, 0x22F3, 0x2202, 0x23E3, 0x230D, 0x232D, 0x233E, + 0x3D2E, 0x3F3F, 0x31DF, 0x31E2, 0x33DF, 0x33FD, 0x332E, 0x3333, 0xDF3F, + 0xD3E0, 0xED1E, 0xEEDF, 0xEEF3, 0xE112, 0xE12D, 0xE21D, 0xFF3D, 0xF212, + 0xF223, 0x0E3D, 0x0202, 0x2ED3, 0x2002, 0x212F, 0x2130, 0x222E, 0x2233, + 0x2312, 0x3ED0, 0x3FEE, 0xEFEF, 0x30F2, 0x31EE, 0xE211, 0xFF2E, 0xF122, + 0x0312, 0x1DEE, 0x12ED, 0x2D21, 0x21D2, 0x00EE, 0x201F, 0x23D0, 0x3021, + 0x00E2, 0x2200, 0x0123, 0x00E0, 0x3001, 0x02D1, 0x11FF, 0x1210, 0x0EFF, + 0x31E0, 0xFF31, 0xF230, 0xF111, 0x030F, 0x1003, 0x3FFF, 0xD00F, 0x0FED, + 0x01ED, 0x3EF0, 0x0031, 0x003D, 0x0FFE, 0x0130, 0xDE10, 0x10D0, 0xDEE1, + 0x331F, 0xDE1E, 0xE11E, 0x1EEF, 0x2ED1, 0x223F, 0x231E, 0x3120, 0x32F0, + 0x0D01, 0x02E0, 0x10EF, 0x00F3, 0x0103, 0x113F, 0x0310, 0xFFFF, 0x013E, + 0x2D0F, 0x2F01, 0x111D, 0xE2F1, 0xFEED, 0x1111, 0x0DF0, 0x13F1, 0x2F0F, + 0x10D2, 0xD032, 0xD331, 0xEDD0, 0xEE13, 0xD0F0, 0xDF00, 0x001D, 0x1F3F, + 0xDF11, 0xD1FF, 0xF030, 0x13FF, 0x3F11, 0xEFDE, 0xE220, 0xF203, 0xF3FD, + 0x0EE2, 0x020E, 0x0332, 0x1302, 0x2E2E, 0x2F0D, 0x2F32, 0x20E2, 0x21E3, + 0x221D, 0x23F2, 0x3F0E, 0xDDE0, 0x31D1, 0x3122, 0xDFE0, 0xED12, 0xE121, + 0xE132, 0xFD31, 0x0DFE, 0x1D02, 0x1E12, 0x20DF, 0x302F, 0xF03E, 0xF032, + 0xEE00, 0xF2EF, 0x10DE, 0xF1F1, 0xFDF1, 0x12D0, 0x3FF1, 0x1221, 0xE130, + 0x0020, 0xF0F2, 0x101E, 0x0F0D, 0x0E31, 0x0033, 0xE30F, 0xF0EF, 0x1230, + 0xDD3F, 0x32FE, 0xDFFD, 0xD113, 0xD13D, 0xD133, 0x0013, 0x1F1F, 0xD210, + 0xDFF1, 0xE101, 0x11D1, 0xD02F, 0xEEDD, 0xE1E1, 0xFDEE, 0xF331, 0x0DE3, + 0x02D3, 0x0220, 0x12E3, 0x1212, 0x13E2, 0x2EF1, 0x3100, 0x0F23, 0x0D12, + 0x2E11, 0x2FF2, 0x230F, 0x3221, 0x311F, 0xFF13, 0x012D, 0xF2DE, 0xFEEF, + 0x2F1E, 0xD2DE, 0xD3DF, 0xD32E, 0xEE3D, 0xE0EE, 0xE0E2, 0x2022, 0x22DD, + 0x0F32, 0x00DD, 0x0FD0, 0x0E00, 0xFEE3, 0x1E3E, 0x11E2, 0x22E2, 0x23ED, + 0x3D0E, 0x3D3D, 0x3E0D, 0x3E03, 0x3E2D, 0x3E3E, 0x3E32, 0x3FDD, 0x3003, + 0x311D, 0xDD02, 0x32DE, 0x33D3, 0xFF20, 0x0022, 0x10F2, 0xDEDE, 0xED32, + 0xEE1D, 0xE0E0, 0xE033, 0xE2D3, 0xE2EE, 0xE202, 0xFDF3, 0xFD33, 0xF313, + 0x2DE3, 0x2D23, 0x2F12, 0x2033, 0x2220, 0x2330, 0x3DE2, 0x3E30, 0x3FDF, + 0x3FFD, 0x3F2E, 0x3F31, 0x30FE, 0xDD2E, 0x32ED, 0x33EE, 0xDEFE, 0xDE12, + 0xD1EE, 0xEFED, 0xEFE1, 0xE0FD, 0xE02E, 0xE020, 0xE022, 0xE123, 0xE32D, + 0xF302, 0x0E0E, 0x0323, 0x1D0E, 0x2D3E, 0x2FED, 0x2F3E, 0x20F3, 0x22E0, + 0x2213, 0x3E21, 0xDF2E, 0xEDDE, 0xEDE1, 0xEF12, 0xE330, 0xFE2D, 0xFFE2, + 0xF2FE, 0xF22F, 0x0D32, 0x02DD, 0x1E1E, 0x121E, 0x130E, 0x2EE0, 0x2E3F, + 0x2FE1, 0x20E0, 0x2031, 0x2222, 0x2231, 0x3F20, 0xD030, 0xEF30, 0xFE32, + 0xF2E1, 0x02F3, 0x1ED2, 0xF3E0, 0x2DE1, 0x3DFF, 0x0231, 0x2301, 0xD111, + 0xFDE0, 0x1012, 0x20F1, 0x1D00, 0x0200, 0x2101, 0xDD1F, 0x33D1, 0xDE21, + 0xE301, 0x0DDE, 0x0DD2, 0xF201, 0x0EF1, 0x01DE, 0x02DF, 0x21F0, 0x023F, + 0xED0F, 0xEF32, 0xE13E, 0xE2DF, 0xE2E2, 0xE312, 0xF21E, 0xF3DF, 0x0E02, + 0x11D3, 0x12EF, 0x2FDE, 0x2FEF, 0x00FD, 0x2F2F, 0x22F1, 0x3DDF, 0x3D11, + 0xD3F1, 0x30E1, 0x32D0, 0xF1DD, 0x03FE, 0x031E, 0x1133, 0x1032, 0x12D2, + 0x1223, 0x3D00, 0x3D1F, 0xD311, 0x0FD2, 0x0F12, 0xF0D2, 0x021F, 0x0F10, + 0x01F0, 0x10F0, 0x100F, 0x0F01, 0x23F0, 0xF1E0, 0xEE3F, 0x032D, 0xE310, + 0x11E0, 0x33F1, 0xD0F2, 0x33E2, 0xDFEE, 0xD01E, 0xD102, 0x0DD0, 0x0D2F, + 0x0E3F, 0x120F, 0x2FF0, 0xF3F1, 0xD2F2, 0xD3E2, 0xD322, 0xEDFE, 0xEE2E, + 0xEFE3, 0xEF0D, 0xEF2D, 0xE01D, 0xE1E3, 0xE10D, 0xE213, 0xFD13, 0x0D3E, + 0x02E2, 0x030D, 0x1D3D, 0x2D03, 0x2D1E, 0x2EE2, 0x2E1D, 0x20FD, 0x203F, + 0x21F2, 0xDD11, 0x2112, 0x321E, 0xD3FF, 0xEFD0, 0xEF21, 0xE1D0, 0xE3FE, + 0xE31E, 0xFE12, 0xF133, 0x0E2E, 0x12F2, 0x1203, 0x2E31, 0x21DE, 0x211E, + 0xED01, 0xFDE2, 0xF2E3, 0xF232, 0x1F3D, 0x13DF, 0xEF0F, 0xE0F1, 0xFED2, + 0xFF0E, 0x1E32, 0x11FD, 0x1010, 0xF010, 0xF001, 0xED10, 0x110E, 0x20FF, + 0xF1D1, 0x0FE3, 0x1D1F, 0x02FF, 0x3E2F, 0x3320, 0xDF22, 0xE110, 0x1102, + 0xFDD1, 0xFD3F, 0xF300, 0x01D2, 0xD201, 0xF3E2, 0xF33F, 0xF023, 0x1E30, + 0x0F0F, 0x1001, 0x010F, 0x0101, 0xF00F, 0x1300, 0xED2F, 0x1E23, 0xEF3E, + 0xE12F, 0xF0DE, 0x102D, 0x2DF0, 0x103E, 0x31F1, 0xFDD3, 0xFD2E, 0xFEFE, + 0x0E22, 0x03F2, 0x1EF2, 0x12DE, 0x1322, 0xDD20, 0x2E20, 0x21E1, 0xF20D, + 0x1DE2, 0xDE0F, 0x13D1, 0x132E, 0xFED0, 0xF120, 0x02F1, 0x03E1, 0x1320, + 0x2321, 0x01FE, 0x3201, 0x21D0, 0x3DE0, 0xDFE2, 0xDFF3, 0xDF13, 0xDF33, + 0xF0F0, 0x0D0F, 0x0ED1, 0xEF10, 0xF10E, 0x10ED, 0x1EF0, 0x2D10, 0xFD00, + 0xF1D3, 0x0EE0, 0x122D, 0x133F, 0xF0E1, 0x2EDF, 0x2FD0, 0x1F20, 0x102F, + 0x2DEF, 0x221F, 0xD0D0, 0xD03E, 0xD2ED, 0xD2E3, 0xD212, 0xD22D, 0xED0D, + 0xED03, 0x0110, 0x3010, 0xD010, 0x13E0, 0xEEFF, 0xF2D0, 0x1E10, 0x0DEF, + 0x1E0F, 0x0FF0, 0x01EF, 0x1F02, 0xED3E, 0xEEE2, 0xEFF2, 0xE0D3, 0xE00E, + 0xE03D, 0xE23D, 0xE323, 0xE33E, 0xFD3D, 0xF3D3, 0x0D2D, 0x1313, 0x1333, + 0x2DED, 0x2E0E, 0x011E, 0x2E3D, 0x212D, 0x223D, 0x3DD1, 0x3D22, 0x3EDE, + 0x3EE3, 0x3E23, 0x3F22, 0x30D0, 0x300D, 0x313F, 0xDFD1, 0x32D2, 0x331D, + 0xDF0E, 0xDF02, 0xD012, 0xEDD2, 0xEED3, 0xEFFE, 0xE1EF, 0xE103, 0xE3DE, + 0xE332, 0xFDDD, 0xFE0D, 0x03E3, 0x2D32, 0x2EF3, 0x2E22, 0x200E, 0x201D, + 0x3EFE, 0x3EF2, 0xDDEE, 0x312E, 0x3212, 0xDDFF, 0xD131, 0xEEE0, 0xE0DF, + 0xE0D1, 0xE1D2, 0xE1F2, 0xE3D2, 0xFD02, 0xFEF2, 0xFE21, 0x0D23, 0x02EE, + 0x0222, 0x120D, 0x2DF2, 0x2D12, 0x2F2D, 0x21ED, 0x2121, 0xDEEF, 0x22DF, + 0x301E, 0xEE11, 0xF3EE, 0x0213, 0x1D22, 0x1EDE, 0x1E03, 0x1F2E, 0x3EEF, + 0xE011, 0x0EDF, 0x0E11, 0x2011, 0xF1F3, 0x0FF2, 0x3FE0, 0x1ED0, 0x1021, + 0x123E, 0xE000, 0x30F0, 0x2310, 0xD2E1, 0x3322, 0xDDF1, 0xEEF1, 0xFFDD, + 0x0D30, 0x03DE, 0x1D33, 0x1FDD, 0xD300, 0x112E, 0x22D1, 0x0002, 0x2000, + 0xEDF0, 0xE0FF, 0xFFEE, 0x0E1F, 0x1023, 0x3210, 0x0F21, 0xE321, 0xF02F, + 0x1FF1, 0xF021, 0x1F0E, 0x1232, 0x3E01, 0x01E1, 0xEF01, 0xFD20, 0xF2F0, + 0xF210, 0x1FD1, 0x3E10, 0x3300, 0xD0EF, 0xD2EF, 0xE03F, 0xE031, 0x0EEE, + 0x022E, 0x0233, 0x03D2, 0x13EE, 0x133D, 0x2FE3, 0x21EF, 0xD1E0, 0x21FE, + 0x30EF, 0xE2D1, 0xE2FF, 0xE21F, 0xE231, 0xFE3E, 0xF12E, 0xF2ED, 0x1EE3, + 0x1E2D, 0x122F, 0x2DD0, 0x3EE1, 0x1E01, 0x10E1, 0xFE10, 0xF320, 0xD100, + 0x1113, 0xF012, 0x0F3E, 0x1DE0, 0x11DF, 0x12F0, 0xF003, 0xFF02, 0x0211, + 0xF31F, 0x0FE1, 0x1DF1, 0x320F, 0x1DD1, 0x1FE2, 0xD2F0, 0xDD00, 0x11F1, + 0xEDEF, 0x1F22, 0x11DD, 0x1D20, 0x1201, 0x1F13, 0x11F3, 0x0F2D, 0xF0D0, + 0xD1F1, 0xF20F, 0x32E1, 0xDDDF, 0xDD31, 0xDEE3, 0xDE32, 0x000E, 0x01D0, + 0x1D11, 0x3F1F, 0xFFDF, 0x2E1F, 0xDF31, 0xD0FE, 0xD13F, 0xD2D2, 0xD2FE, + 0xD23E, 0xD3EE, 0xD33F, 0x00D1, 0xDEF0, 0xFF3F, 0xEDE3, 0xEEFD, 0xEF03, + 0xE0F3, 0xE013, 0xE1DE, 0xE2F3, 0xE233, 0xE3D0, 0x1D13, 0x1EFE, 0x2DD2, + 0x2D30, 0x2E13, 0x210D, 0x2132, 0x0F03, 0x22D3, 0x22EE, 0x23D2, 0x3012, + 0xDE30, 0xD10E, 0xEFD2, 0xFE03, 0xF3DD, 0x1DF3, 0x1EED, 0x1E0D, 0x12FE, + 0x1331, 0xDE2F, 0x2013, 0x23FE, 0xFE23, 0xFF22, 0xF32E, 0x0DF2, 0xE3E1, + 0x1DDF, 0x1FD3, 0xFF11, 0xFDFF, 0x021D, 0x0321, 0x1FF3, 0xF1FD, 0x100D, + 0xF02D, 0x32EF, 0xD22F, 0xFEF0, 0x1FE0, 0x1F33, 0x0F1E, 0xF13F, 0x2211, + 0xD31F, 0xF23E, 0x001F, 0xF100, 0x1F00, 0x2110, 0xFFFD, 0x0D21, 0xFD1F, + 0x2F10, 0xDFFF, 0xF322, 0x0E1D, 0x23EF, 0x33E0, 0x210F, 0xF102, 0x3311, + 0xD12E, 0x3331, 0xDDFD, 0xDDF3, 0xDD0E, 0xDD22, 0xDD33, 0xDED2, 0xDEED, + 0xDE0D, 0xEFF0, 0xE01F, 0xF0ED, 0xF0E3, 0x02FD, 0x01E3, 0xF11F, 0x003F, + 0x00DF, 0x00F1, 0xF01E, 0xD122, 0xEED1, 0xEE20, 0xFD0E, 0x0EDD, 0x2EFF, + 0x20EE, 0x2020, 0xED21, 0x3D20, 0x3E1E, 0x0E33, 0x1D2E, 0xFE01, 0x2F30, + 0x232F, 0xFFE0, 0x0ED3, 0x0E13, 0x23E1, 0xE3F0, 0x1311, 0xFF1D, 0x3E0F, + 0xD120, 0x1131, 0xD001, 0x1030, 0x1F1D, 0x1120, 0xD320, 0x3F02, 0xDE03, + 0xDE2D, 0xDFDD, 0xDFD3, 0xDF1D, 0xD0DE, 0xD0E3, 0xD1DD, 0xD20D, 0xD3DD, + 0xD3FD, 0xD3F3, 0xD302, 0xD31D, 0xD313, 0xD33D, 0xEE31, 0xE32F, 0xFD22, + 0xF13D, 0x0EFD, 0x0E20, 0x1FEE, 0x2D01, 0xD11F, 0xD20F, 0xF2D2, 0xF3FF, + 0x0EF3, 0x3DF1, 0x0D0D, 0x1DD3, 0x2D0D, 0x2323, 0x3DDD, 0x3DD3, 0x3DF3, + 0x3D1D, 0x3D13, 0x3EED, 0x3FD3, 0x3F13, 0x3F3D, 0x3F33, 0x30E3, 0x302D, + 0x3023, 0x3032, 0x31D3, 0x31FD, 0x310E, 0x3113, 0x313D, 0x3133, 0x3203, + 0x323E, 0x33DD, 0x33F3, 0xDD1D, 0x3302, 0x333D, 0xE200, 0xDF1F, 0xE10F, + 0x032F, 0xDD13, 0xDFDF, 0xDF3D, 0xD0D2, 0xD0ED, 0xD003, 0xD023, 0xD1D3, + 0xD1FD, 0xD11D, 0xD2D0, 0xD203, 0xD223, 0xD3D3, 0xD333, 0xED2D, 0xED23, + 0xEE0E, 0xEE33, 0xE30D, 0x1DDD, 0x2E33, 0x20D3, 0x2303, 0x3DEE, 0x3DFD, + 0x3D02, 0x3D33, 0x3F1D, 0x30DE, 0x30ED, 0x303E, 0x3030, 0x31DD, 0x3131, + 0x32E3, 0x320D, 0x322D, 0x3223, 0x3232, 0xDDD1, 0x3313, 0x333F, 0xD00D, + 0xD02D, 0xD1DF, 0xD1F3, 0xD232, 0xD3D1, 0xEDED, 0xEE02, 0xE2DD, 0xE222, + 0xE303, 0xF333, 0x0D03, 0x0303, 0x20DD, 0x23DE, 0x3D3F, 0x3D31, 0x3ED2, + 0x3FF3, 0x30D2, 0x31F3, 0xDDDD, 0xDDE2, 0xD1E2, 0xEE22, 0xE0DD, 0xE20E, + 0xE22E, 0xE3ED, 0xFDFD, 0xF3F3, 0x0DED, 0x13D3, 0x13FD, 0x2DDE, 0x2EDD, + 0x2EEE, 0x2F21, 0x2F23, 0x2103, 0x2123, 0x3FD1, 0x3FE2, 0xD21E, 0x3102, + 0x3230, 0xEF23, 0xE2FD, 0x0D1E, 0x2EFD, 0xFDDF, 0x2FD2, 0x322F, 0x002E, + 0xFE2F, 0xF2F2, 0xF221, 0x1EE1, }; -#define ON2AVC_CB13_CODES 625 -static const uint16_t on2avc_cb13_codes[ON2AVC_CB13_CODES] = { - 0x0000, 0x0015, 0x008E, 0x0338, 0x09FB, 0x0BEC, - 0x0C61, 0x13E1, 0x18A7, 0x313B, 0x61BB, 0x05D9, - 0x0896, 0x066B, 0x05C6, 0x18A6, 0x40E4, 0x2081, - 0x104F, 0x13E0, 0x0C22, 0x07E4, 0x03F7, 0x0087, - 0x0014, 0x0016, 0x001D, 0x009C, 0x02E2, 0x037E, - 0x0897, 0x0898, 0x0C63, 0x117D, 0x2082, 0x27AA, - 0x033B, 0x06C5, 0x04F2, 0x0331, 0x19EB, 0x18A8, - 0x13E2, 0x0DE7, 0x0C62, 0x06DF, 0x05C7, 0x02F4, - 0x0098, 0x001A, 0x007C, 0x0080, 0x0106, 0x02F5, - 0x03EC, 0x0617, 0x0621, 0x08F9, 0x1050, 0x117F, - 0x11E0, 0x036A, 0x045A, 0x06C6, 0x037F, 0x117E, - 0x2083, 0x0BED, 0x0C9E, 0x0658, 0x04F3, 0x0368, - 0x02EE, 0x00FA, 0x008D, 0x031C, 0x01FF, 0x0206, - 0x031E, 0x06C8, 0x0659, 0x09B5, 0x0C23, 0x0BEF, - 0x0C9F, 0x19EC, 0x04CC, 0x0623, 0x06C7, 0x0622, - 0x313C, 0x17BB, 0x11E1, 0x0C64, 0x0BEE, 0x07DC, - 0x04CB, 0x0375, 0x0205, 0x026E, 0x0C24, 0x06C9, - 0x0324, 0x04DF, 0x0642, 0x09B6, 0x0643, 0x0BF2, - 0x083B, 0x1051, 0x27AB, 0x036C, 0x0607, 0x06E2, - 0x045B, 0x313D, 0x2084, 0x18A9, 0x13E3, 0x0CA0, - 0x0899, 0x066E, 0x06E3, 0x0369, 0x0606, 0x0DE8, - 0x061A, 0x0453, 0x065A, 0x065B, 0x089B, 0x089C, - 0x09FD, 0x0BA5, 0x18AA, 0x11E2, 0x05C8, 0x09B7, - 0x066F, 0x06CA, 0x19ED, 0x2085, 0x2086, 0x0D83, - 0x1052, 0x1053, 0x09FC, 0x089A, 0x0644, 0x083E, - 0x13E4, 0x08FC, 0x0624, 0x1055, 0x0C65, 0x089D, - 0x0645, 0x08FD, 0x0C66, 0x0CA1, 0x1056, 0x05E1, - 0x089E, 0x08FA, 0x07E5, 0x313E, 0x2087, 0x11E3, - 0x19EE, 0x18AB, 0x1054, 0x19EF, 0x17BC, 0x08FB, - 0x07E6, 0x18AD, 0x0BF3, 0x07E7, 0x0C67, 0x1057, - 0x07EA, 0x08FF, 0x1058, 0x0DE9, 0x18AE, 0x19F0, - 0x0608, 0x089F, 0x08FE, 0x06CB, 0x313F, 0x2088, - 0x13E5, 0x3142, 0x11E4, 0x18AC, 0x11E5, 0x0CA2, - 0x065E, 0x13E6, 0x27AD, 0x19F1, 0x0D86, 0x0DEA, - 0x0CA3, 0x0DEB, 0x17BE, 0x0C2A, 0x13E8, 0x0CA6, - 0x0DEE, 0x05FD, 0x0992, 0x0C25, 0x063E, 0x40E5, - 0x11E6, 0x3143, 0x18AF, 0x27AC, 0x0C26, 0x17BD, - 0x13E7, 0x0C27, 0x11E7, 0x27B2, 0x40E8, 0x18B3, - 0x17C0, 0x18FE, 0x19F2, 0x19F3, 0x31FE, 0x17C1, - 0x19F6, 0x0BA6, 0x09FE, 0x0DEF, 0x17BF, 0x0C2B, - 0x40E6, 0x18B0, 0x40E7, 0x13E9, 0x2089, 0x27AE, - 0x27AF, 0x208A, 0x18B1, 0x18B2, 0x27B3, 0xBCEF, - 0x2F3A, 0x40EA, 0x17C5, 0x17C6, 0x17C7, 0x19F7, - 0x133E, 0x105A, 0x17CA, 0x065F, 0x0CA7, 0x0C7E, - 0x1059, 0xBCED, 0x40E9, 0xBCEE, 0x17C2, 0x63FE, - 0x208B, 0x208E, 0x208F, 0x17C3, 0x17C4, 0x0625, - 0x03ED, 0x045C, 0x04CD, 0x05DA, 0x05CE, 0x05FF, - 0x0626, 0x060A, 0x05E3, 0x083F, 0x0BA8, 0x0BA9, - 0x40EB, 0x13EA, 0x0CCA, 0x0BA7, 0x08A2, 0x0646, - 0x0609, 0x05E2, 0x041E, 0x05FE, 0x0373, 0x0376, - 0x099E, 0x05DE, 0x0647, 0x05E6, 0x06D6, 0x07EB, - 0x09FF, 0x1B5E, 0x0BAB, 0x08AE, 0x0C36, 0x0FBA, - 0x17CB, 0x4CFE, 0x105B, 0x0D87, 0x0DAE, 0x13EB, - 0x0BAA, 0x0993, 0x08A3, 0x085E, 0x0600, 0x0601, - 0x05DB, 0x0664, 0x04F0, 0x05F8, 0x0634, 0x085F, - 0x06F6, 0x08F4, 0x0C5A, 0x0CFC, 0x0DDC, 0x09F6, - 0x0C16, 0x115E, 0x13D8, 0x13DA, 0x0C94, 0x0CFA, - 0x082E, 0x0B9E, 0x06C2, 0x0BE4, 0x06DA, 0x05C0, - 0x0614, 0x05C9, 0x05DF, 0x033A, 0x0336, 0x05FA, - 0x04CE, 0x05C1, 0x0890, 0x0891, 0x0838, 0x0839, - 0x0CFD, 0x0BA0, 0x61B8, 0x07DE, 0x0635, 0x0B9F, - 0x0640, 0x06DB, 0x082F, 0x09AC, 0x04C8, 0x0666, - 0x04DE, 0x03F4, 0x0339, 0x2079, 0x267E, 0x179E, - 0x30DE, 0x63FF, 0x27A0, 0x1997, 0x36BF, 0x3EEC, - 0x99FE, 0x99FF, 0x0C95, 0x1048, 0x0C5B, 0x0636, - 0x0C5C, 0x2076, 0x13DB, 0x115F, 0x179C, 0x2077, - 0x1046, 0x36BE, 0x1996, 0x2078, 0x61B9, 0x1175, - 0x17B0, 0x3EED, 0x19E1, 0x19E2, 0x207A, 0x3EEE, - 0xBCEC, 0x3138, 0x3139, 0x07DF, 0x1176, 0x0892, - 0x0667, 0x18A0, 0x18A2, 0x13DC, 0x1174, 0x13DD, - 0x179F, 0x30DF, 0x19E0, 0x18A3, 0x1049, 0x17B2, - 0x207B, 0x17B3, 0x0C17, 0x19E3, 0x17B4, 0x207C, - 0x3EEF, 0x207D, 0x19E4, 0x27A1, 0x0C5F, 0x08F5, - 0x0DDD, 0x0652, 0x18A4, 0x0C96, 0x0C5D, 0x104A, - 0x1177, 0x0CFE, 0x0C5E, 0x0DDE, 0x09F7, 0x17B1, - 0x19E6, 0x0C1E, 0x09AE, 0x1179, 0x0DE0, 0x17B5, - 0x0BA2, 0x17B6, 0x27A3, 0x40E0, 0x40E1, 0x06DC, - 0x09AF, 0x09AD, 0x05C2, 0x19E5, 0x27A2, 0x0DDF, - 0x0C1C, 0x0C1D, 0x0BE6, 0x0BA1, 0x1178, 0x0654, - 0x13DE, 0x40E2, 0x0893, 0x0668, 0x07E1, 0x0BE7, - 0x08F6, 0x0DE1, 0x27A4, 0x104B, 0x19E7, 0x40E3, - 0x05D6, 0x09F9, 0x06DD, 0x04CA, 0x17B7, 0x17B8, - 0x0C97, 0x0C98, 0x07E0, 0x0C99, 0x0655, 0x09F8, - 0x0656, 0x0C9A, 0x0DE2, 0x0669, 0x04D3, 0x061C, - 0x0894, 0x13DF, 0x0C1F, 0x104C, 0x27A6, 0x61BA, - 0x27A7, 0x066A, 0x061D, 0x0637, 0x04D2, 0x27A5, - 0x117A, 0x0C9B, 0x09B0, 0x09B1, 0x05E0, 0x0602, - 0x05FB, 0x04F1, 0x08F7, 0x06FA, 0x0603, 0x037C, - 0x05C3, 0x0BE8, 0x0895, 0x0C60, 0x117B, 0x19E8, - 0x27A8, 0x19E9, 0x0657, 0x083A, 0x06C4, 0x05D7, - 0x17B9, 0x0CFF, 0x0DE3, 0x104D, 0x07E2, 0x0641, - 0x061E, 0x05D8, 0x0366, 0x0616, 0x032E, 0x0268, - 0x02E6, 0x0456, 0x0BA3, 0x06FB, 0x0D80, 0x0DE5, - 0x104E, 0x17BA, 0x27A9, 0x0330, 0x07E3, 0x061F, - 0x0367, 0x207E, 0x0C9C, 0x117C, 0x0DE4, 0x06DE, - 0x0620, 0x0450, 0x042E, 0x02F2, 0x0204, 0x0086, - 0x008C, 0x00FE, 0x022A, 0x0372, 0x05CA, 0x0452, - 0x08F8, 0x0BA4, 0x19EA, 0x18A5, 0x0306, 0x05FC, - 0x03F6, 0x0458, 0x0D81, 0x0BE9, 0x09B2, 0x0C20, - 0x09FA, 0x0604, 0x0370, 0x01FE, 0x010A, 0x0084, - 0x0012, 0x001C, 0x0088, 0x026A, 0x05CB, 0x063B, - 0x09B4, 0x0D82, 0x0DE6, 0x207F, 0x2080, 0x030C, - 0x0605, 0x0459, 0x0374, 0x313A, 0x0C9D, 0x0BEA, - 0x0BEB, 0x0C21, 0x09B3, 0x063A, 0x0216, 0x009D, - 0x001E, +static const uint16_t on2avc_cb_6_syms[ON2AVC_CB_5_6_CODES] = { + 0xFF1F, 0x1EF0, 0x0D32, 0x3E30, 0x0D0F, 0x2E02, 0x0D10, 0xD0E3, 0xD33D, + 0xDDD3, 0xD030, 0x0DD0, 0x3DD3, 0x1E10, 0x2DE1, 0x20EE, 0x11F1, 0xF0F2, + 0xFE1E, 0x1D22, 0xEEFF, 0xE0F1, 0xFEEF, 0xE101, 0xDEF2, 0x2EE2, 0x00FD, + 0x0D0D, 0x3D13, 0xEFF2, 0xF212, 0x0F2F, 0x1120, 0x2F0F, 0x1E2D, 0x2F30, + 0xD3E0, 0x1F11, 0x1122, 0xEFE1, 0xE02E, 0x2F03, 0xF20F, 0xF02D, 0x22FD, + 0xF1FF, 0xFE10, 0xFF20, 0x21FE, 0xFE2F, 0xED2D, 0xF3D3, 0x023F, 0x20DD, + 0xF2F0, 0xD1E0, 0x203F, 0x3010, 0x330E, 0x02FF, 0xE0FF, 0xFFE0, 0xF1EE, + 0x0EE2, 0x0103, 0xF0EF, 0x0EFF, 0x0FE1, 0x1E01, 0x10E1, 0xFF0E, 0x0F21, + 0x2EFF, 0x21ED, 0xEDDE, 0x0130, 0xDEE3, 0xD003, 0xD02D, 0xE303, 0xF333, + 0x0DDE, 0x23E3, 0x3DD1, 0xDE32, 0xDF1D, 0xE332, 0x0D3E, 0x0F0D, 0x1D1D, + 0xDF11, 0xE0E0, 0x2DD0, 0x22E0, 0x23DE, 0x3030, 0xDFD3, 0x00DD, 0x201F, + 0x1D11, 0x1221, 0x211E, 0xF311, 0x133F, 0xFFEE, 0x31EE, 0x2031, 0x2213, + 0xD00F, 0xF02F, 0x2E3F, 0x321E, 0xEEF1, 0xEDD2, 0x03EF, 0x2ED3, 0x32D0, + 0xE0DF, 0xFFDD, 0xEF12, 0xDEE1, 0x223F, 0xF102, 0xDDF1, 0x3F1D, 0x010D, + 0x02F1, 0x12F0, 0xF201, 0xD10E, 0xF2D0, 0x0D2F, 0x1E21, 0x22F1, 0x231E, + 0xF1E0, 0x0211, 0x3F2E, 0xED01, 0xFDE0, 0xD032, 0x0033, 0x3D33, 0xFD33, + 0x3DF3, 0xD322, 0xF300, 0xE000, 0x3D02, 0x3D3F, 0x3EDE, 0x30E3, 0xEDED, + 0xF13D, 0xEF23, 0x1E30, 0x212F, 0x22DF, 0xF0E1, 0x1DF1, 0xE132, 0x0312, + 0x3100, 0x3133, 0xDDFD, 0xF2EF, 0x03FE, 0xFE0F, 0xF1FD, 0x11F3, 0x2211, + 0xD021, 0xE2D1, 0x0DF2, 0x1023, 0xD210, 0x102F, 0x2011, 0x21D0, 0x2E20, + 0xDE2D, 0xD3EE, 0x0E1F, 0x1F20, 0x1113, 0x00EE, 0x30F2, 0x1201, 0xD32E, + 0xE23D, 0x0ED1, 0x3DEE, 0xE1DE, 0x31F3, 0x3302, 0xF3E2, 0x0EDD, 0x2103, + 0x2FDE, 0x2F1E, 0xF113, 0xD001, 0xF11D, 0x1FFD, 0xF0ED, 0x112E, 0x12F2, + 0x2E31, 0xD1F1, 0x1E0F, 0x2233, 0xE20E, 0x0E22, 0x2200, 0x0202, 0xDD22, + 0xDFDD, 0x3FD3, 0x0D12, 0x02D1, 0x1DE2, 0x1EFE, 0x3F0E, 0x30E1, 0xF3FF, + 0x1021, 0xD230, 0x00D1, 0x01D2, 0x013E, 0x1DFD, 0x1D13, 0x32DE, 0x32E3, + 0xEE2E, 0xF302, 0x0E2E, 0x02E2, 0xF31F, 0x331F, 0xEE31, 0x000E, 0x3EF2, + 0x3E21, 0x2000, 0xEE0E, 0x33EE, 0xDD13, 0xE0E2, 0x03DE, 0xDDFF, 0xD1E2, + 0xD3F1, 0xD311, 0x0002, 0xFEE3, 0xFE3E, 0x01EF, 0x12DE, 0xD02F, 0xEEE0, + 0xE1EF, 0x0EE0, 0x031E, 0x11DF, 0x1D20, 0xDFFD, 0xD3D1, 0xE3DE, 0xFE30, + 0x3F1F, 0x131F, 0x0DE3, 0x0F2D, 0x2DDE, 0x3131, 0xF203, 0x1FD3, 0xF2ED, + 0x0231, 0x1ED2, 0x1EE3, 0xF3F1, 0x2F12, 0x3212, 0x13FF, 0xFE23, 0x3D20, + 0xDDDF, 0x0E13, 0x030F, 0x1E03, 0x1230, 0xDD1F, 0xDF3F, 0xEFD0, 0xEEDD, + 0xEEDF, 0xD20F, 0xF23E, 0x1E23, 0x3001, 0x1FEE, 0xF122, 0xEDF2, 0x0233, + 0xD3FD, 0xDD33, 0xDD1D, 0x33D3, 0xDD3D, 0xE0DD, 0x331D, 0x1322, 0x2DF2, + 0xE0D1, 0xDE3E, 0xFDD3, 0xE0EE, 0xFF33, 0xDDEE, 0x0E33, 0x2D3E, 0xDF0E, + 0xD2FE, 0xD3FF, 0xD300, 0xF20D, 0xF3E0, 0x12ED, 0x13E2, 0x3F11, 0x221F, + 0x2EF3, 0x3FFD, 0x13F3, 0xDD0E, 0xFDF1, 0xFFFD, 0x11D1, 0x23E1, 0xED12, + 0xFD22, 0x0EDF, 0x02FD, 0x1032, 0x12D2, 0x3DFF, 0x310E, 0x2321, 0x33F1, + 0x3322, 0xD13F, 0xEE20, 0x11DD, 0x2E0E, 0xDFE0, 0x10DE, 0x1320, 0x2332, + 0xDFEE, 0xF0D2, 0x0EF3, 0x3F22, 0x3122, 0x322F, 0x0000, 0x1F3F, 0xED2F, + 0xD302, 0xEED3, 0xFD00, 0xFD1D, 0x0DF0, 0x0D03, 0x2DD2, 0x22D3, 0x223D, + 0x23D2, 0x23ED, 0x3EE3, 0xED30, 0x30D0, 0x32D2, 0xE2E0, 0x0DD2, 0x0D30, + 0x2022, 0x1D02, 0x30EF, 0xFFF3, 0xFD11, 0x32F0, 0xFDEE, 0x2330, 0xF31D, + 0xEDEF, 0x0D01, 0x103E, 0x111D, 0x2E1D, 0x0E3D, 0x033E, 0xDEEF, 0xDF02, + 0x222E, 0xDDF3, 0xD133, 0x032D, 0x13DD, 0xE1E3, 0xE21D, 0xFE32, 0x021D, + 0x0220, 0x13D1, 0x2231, 0x3F02, 0x2DEF, 0x2310, 0x30D2, 0x302D, 0x3032, + 0x31DD, 0xD03E, 0xD232, 0xD331, 0x1313, 0x2DED, 0x232D, 0x02EE, 0x3ED0, + 0x3ED2, 0x2EEE, 0x202E, 0x320F, 0xD0FE, 0xE13E, 0xE2DF, 0x00E2, 0x2F2D, + 0x30FE, 0xD201, 0x301E, 0x32F2, 0xFF3F, 0x1FDF, 0xDDE2, 0xDD20, 0xD131, + 0x2202, 0xEEFD, 0x3DE0, 0x3331, 0xE312, 0xFD2E, 0x122D, 0x3D1F, 0x2DF0, + 0x3FEE, 0xDF2E, 0xE3FE, 0xF22D, 0x0022, 0x10D2, 0xFEDE, 0x13EE, 0x2123, + 0x3E0F, 0x3FE2, 0xDDD1, 0xD023, 0xD2ED, 0xFDFD, 0x0D2D, 0x03ED, 0x0323, + 0x3D0E, 0x3EED, 0x3023, 0x3230, 0x33E2, 0xD320, 0xEEE2, 0xE2D3, 0x0F03, + 0x0132, 0x03F0, 0x1302, 0x131D, 0xD0EF, 0xED1E, 0xE022, 0x302F, 0x31E2, + 0x3102, 0xE310, 0xF00D, 0xE31E, 0x2E3D, 0x33FD, 0x1D33, 0xD3DD, 0xD333, + 0x003D, 0x3DDD, 0x333D, 0x2D1E, 0x3EFE, 0xF21E, 0x121E, 0x00FF, 0x1311, + 0xE3D2, 0xFDDD, 0x22E2, 0x3FD1, 0xD0E1, 0xD0F2, 0xE031, 0x1DEE, 0xD1FF, + 0x1EED, 0x3FF3, 0xD1DD, 0xD31D, 0x0303, 0x3DFD, 0x0E02, 0x002E, 0x1100, + 0x2DFE, 0x2FD2, 0x2FE3, 0x3F20, 0xFDFF, 0x3E01, 0xDE01, 0xF1D1, 0xF131, + 0x2D2F, 0x0011, 0xD30E, 0xED32, 0x1D3D, 0x2D23, 0xD1DF, 0xFDF3, 0xDEFE, + 0xEF3E, 0xFD3F, 0x201D, 0x21E3, 0x2220, 0xF012, 0xFF31, 0xEFE3, 0x3120, + 0x3EF0, 0xDE0F, 0xF1DF, 0xDEDE, 0x230D, 0x3D3D, 0xD0D2, 0x30F0, 0x31FD, + 0xEED1, 0xEF2D, 0xE020, 0xE3F2, 0xFE2D, 0x020E, 0x0222, 0x213E, 0xF13F, + 0x2D10, 0xD2E1, 0x23F2, 0xD1EE, 0x1EF2, 0xEF32, 0xE2F3, 0x2F3E, 0x20D1, + 0x23FE, 0x3021, 0x0E00, 0x21EF, 0xDE03, 0xE033, 0xE2DD, 0xE30D, 0x0E31, + 0x13D3, 0x133D, 0x2EDD, 0xEDD0, 0xEE3D, 0xF030, 0x0FDE, 0xD01E, 0x31DF, + 0x3232, 0xEDFE, 0xEE00, 0xEE22, 0xE1D2, 0xE200, 0xF322, 0x1232, 0x130E, + 0x20E0, 0x22FF, 0x1FD1, 0x3221, 0xF30E, 0x332E, 0x33DF, 0xD20D, 0xD223, + 0x1DE0, 0x20DF, 0xDFD1, 0x3F13, 0xFF00, 0x1111, 0xFD20, 0xDE1E, 0xEF0D, + 0xE03F, 0x1FDD, 0x2FED, 0x21DE, 0x0200, 0xD122, 0x33E0, 0xF33D, 0x3F3D, + 0x3F33, 0x33DD, 0xFE03, 0xF0DE, 0xF223, 0x02E0, 0xE12F, 0x0FE3, 0x00E0, + 0x220E, 0xEE33, 0xFD3D, 0x2E33, 0x20D3, 0xD2D2, 0x3DDF, 0x3E2D, 0xE33E, + 0xE330, 0x0013, 0x02D3, 0x31D1, 0x3113, 0xE12D, 0xFFD3, 0x0EEE, 0x2E13, + 0x1001, 0x0FFE, 0xFFDF, 0x2F32, 0x212D, 0x0E0E, 0x120D, 0x13DF, 0x20F3, + 0xE3F0, 0x2013, 0x2132, 0x10F0, 0x210F, 0xE321, 0xFEED, 0x300F, 0x11EE, + 0x12FE, 0xF3F3, 0x3FDF, 0x32ED, 0x3223, 0xEFDE, 0xEF03, 0x1223, 0xF32E, + 0xF331, 0x3201, 0x3320, 0xDFE2, 0xED10, 0x0020, 0x0112, 0xF003, 0xEFED, + 0x1D31, 0xD0ED, 0x33F3, 0xD00D, 0xD113, 0xD3DF, 0x00F3, 0x03E3, 0x2D03, + 0x3E32, 0xD102, 0xEE02, 0xE22E, 0xF1DD, 0x12E3, 0x20FD, 0xF001, 0xF320, + 0x1131, 0x23F0, 0x21D2, 0xD010, 0x322D, 0x323E, 0xEFF0, 0x012D, 0xF03E, + 0x3311, 0x100F, 0x232F, 0xD012, 0xFD02, 0xF133, 0xF3D1, 0x0EFD, 0x03F2, + 0x2110, 0xFEF2, 0x1DDF, 0x210D, 0xF00F, 0x0F01, 0x010F, 0xFFFF, 0xEF01, + 0xD2EF, 0x100D, 0x13E0, 0xD212, 0xD23E, 0xDD3F, 0xED03, 0xE1D0, 0xFFD1, + 0xF032, 0xF1D3, 0xDE2F, 0xEE11, 0xF221, 0x2FE1, 0x0FEF, 0xE3E1, 0x2EDF, + 0x3FF1, 0x2FEF, 0x0D23, 0x2DE3, 0x203D, 0x300D, 0xDF13, 0xDF31, 0xFF02, + 0xE002, 0x0332, 0x13FD, 0x1331, 0x200E, 0xE11E, 0x221D, 0x2D32, 0xF3FD, + 0xE301, 0x02DF, 0xD11F, 0x2222, 0xE213, 0x0E1D, 0xF010, 0x0110, 0x0FF0, + 0x1DD1, 0x2D2D, 0x2323, 0xE01D, 0x00D3, 0xF023, 0x1133, 0x312E, 0x2D21, + 0xD3E2, 0xE013, 0x1E3E, 0xFED0, 0xF33F, 0x001F, 0xFEF0, 0x123E, 0xD3D3, + 0xE0D3, 0x2D0D, 0x2033, 0x3E0D, 0x3E03, 0x3E23, 0x30DE, 0xFE12, 0xE10D, + 0x2D30, 0x30ED, 0x3313, 0x32E1, 0xFE0D, 0x3F31, 0x0FD0, 0x311F, 0x22D1, + 0xE123, 0x22F3, 0x1E32, 0x2FD0, 0xEDE1, 0x3D11, 0x0F30, 0x001D, 0x3FFF, + 0x1003, 0xDDDD, 0x0E20, 0x10FE, 0xF1E2, 0x3E2F, 0xF100, 0x0121, 0xEF21, + 0x2F23, 0x2E22, 0xDF3D, 0x313D, 0x03D0, 0x3300, 0xDD00, 0xD1D1, 0x1DD3, + 0xE3EF, 0xF2E1, 0xEE1D, 0xE00E, 0xE103, 0x0213, 0xD120, 0x2E00, 0x33FF, + 0xEEEE, 0x1ED0, 0x110E, 0x122F, 0xEFEF, 0x21F0, 0xE2F1, 0x0DE1, 0x1012, + 0x23EF, 0xDD31, 0xD0D0, 0xD100, 0xD203, 0x01DE, 0x22DD, 0x2303, 0x3203, + 0x1010, 0xDE10, 0xD11D, 0xE222, 0xE3D0, 0xE0FD, 0x02DD, 0x0301, 0xDF20, + 0xE32F, 0x01ED, 0xE0F3, 0xE2FD, 0xE121, 0xF3DF, 0x2312, 0x1F00, 0xF0F0, + 0x0F10, 0xF2D2, 0xF2FE, 0xF2F2, 0xED0F, 0xFF13, 0xE21F, 0x032F, 0x0101, + 0x1FE0, 0x1EE1, 0xDED0, 0x33D1, 0xDF33, 0xD0F0, 0xD1FD, 0x3111, 0xE202, + 0x1333, 0x3E3E, 0x3F3F, 0xFDDF, 0x113D, 0x01F0, 0x11FF, 0x0F0F, 0x31F1, + 0xEE1F, 0xE30F, 0x3012, 0xD2F2, 0x11E2, 0xD31F, 0x3003, 0xD2DE, 0xD33F, + 0xEF2F, 0xE231, 0x3EE1, 0x1F31, 0xED0D, 0xE3ED, 0xE323, 0x0DED, 0xDEF0, + 0x2FF2, 0x01D0, 0x030D, 0x1DDD, 0x333F, 0xD2D0, 0xE2EE, 0xF0FE, 0xD221, + 0xF22F, 0xD2F0, 0xFEE1, 0xDD11, 0x0F23, 0x3F00, 0x0D21, 0x21E1, 0x2112, + 0x2301, 0x3EEF, 0xFD31, 0x1D3F, 0xDE21, 0x113F, 0x2130, 0xEF10, 0x1EEF, + 0x2D01, 0x1210, 0x2FF0, 0xDFFF, 0xDD02, 0xDE23, 0xEDF0, 0x003F, 0x1E0D, + 0x1F33, 0x3FE0, 0xE2FF, 0x1E2F, 0x2D0F, 0xD111, 0x11E0, 0x3E10, 0x2EF1, + 0xFD0E, 0x3D22, 0xDE0D, 0xD13D, 0x3D1D, 0x1FFF, 0x0F12, 0x1F02, 0x10F2, + 0x1E12, 0x1D0E, 0x1F3D, 0xFF11, 0xF021, 0x13F1, 0xD22F, 0x2020, 0xDFDF, + 0x0FD2, 0x3D31, 0xE130, 0xFDE2, 0x00F1, 0xF232, 0xF3EE, 0x31E0, 0xDDE0, + 0xEEF3, 0xEE3F, 0x2002, 0x3DF1, 0xE23F, 0xF2E3, 0xDFF1, 0x10ED, 0x2F2F, + 0xE01F, 0xF0E3, 0x3D00, 0xF10E, 0x01FE, 0x20F1, 0xE011, 0x0FF2, 0xE1ED, + 0x0310, 0xDFF3, 0x22EE, 0x23D0, 0xEF0F, 0xFED2, 0x3D2E, 0xD1F3, 0xD2E3, + 0xFE21, 0xF2DE, 0x1F2E, 0x1F22, 0x2101, 0x2E1F, 0x02F3, 0x2EE0, 0xFD1F, + 0x101E, 0x3210, 0x1EDE, 0x2ED1, 0xF120, 0x3E1E, 0x2EFD, 0x313F, 0xEDE3, + 0x01F2, 0xFF2E, 0xF12E, 0x1FF1, 0x10EF, 0xF230, 0xE1F2, 0x1FE2, 0x0DFE, + 0xED3E, 0x0031, 0xD12E, 0xE1FE, 0xF11F, 0x0E11, 0x03E1, 0x2FFE, 0x011E, + 0x32EF, 0x01E3, 0x023D, 0x1D00, 0x3DE2, 0x111F, 0x32FE, 0x0D1E, 0x2E2E, + 0xFF22, 0x0F32, 0xE1F0, 0xE10F, 0xFFF1, 0x012F, 0x12E1, 0xDF22, 0xF210, + 0xE1E1, 0x0E3F, 0x31FF, 0x102D, 0x3E12, 0xED21, 0x11D3, 0xDD2E, 0xDEED, + 0xEF30, 0xE211, 0x0F1E, 0x2F01, 0x12D0, 0xED23, 0xE32D, 0xFD13, 0x10D0, + 0x0DEF, 0xEFD2, 0x2F0D, 0xF111, 0x120F, 0x1D2E, 0x1212, 0x11FD, 0x2E11, + 0x3333, 0xE2E2, 0xF1F1, 0xFF1D, 0x0EF1, 0xD21E, 0x2F21, 0x21F2, 0x230F, + 0x021F, 0xEE13, 0xEFFE, 0x01E1, 0x2F10, 0x1D1F, 0x2121, 0xD0DE, 0xD313, + 0x0ED3, 0xD3F3, 0xF3DD, 0x00DF, 0x1300, 0x303E, 0x31D3, 0xDE30, 0x03D2, + 0x1DF3, 0x1030, 0xFDD1, 0xFF3D, 0xE112, 0x12EF, 0x1F1F, 0xF1F3, 0x2D12, + 0x20E2, 0xDED2, 0xDF00, 0xFE01, 0xE110, 0xF01E, 0xFFE2, 0xEF1E, 0x1DFF, + 0x1FF3, 0xE233, 0xF0D0, 0xF313, 0x311D, 0xE220, 0x0123, 0xDE12, 0x0F3E, + 0xDF1F, 0x0321, 0x022E, 0xD1D3, 0xE03D, 0x3FDD, 0x320D, 0x1F0E, 0x1F1D, + 0x1F13, 0x1102, 0xD22D, 0xE3E3, 0x0330, 0x233E, 0x0FED, 0x1203, 0xFEFE, + 0x1E1E, 0x20FF, 0x10E3, 0x132E, }; -static const uint8_t on2avc_cb13_bits[ON2AVC_CB13_CODES] = { - 1, 5, 8, 10, 12, 12, - 12, 13, 13, 14, 15, 11, - 12, 11, 11, 13, 15, 14, - 13, 13, 12, 11, 10, 8, - 5, 5, 5, 8, 10, 10, - 12, 12, 12, 13, 14, 14, - 10, 11, 11, 10, 13, 13, - 13, 12, 12, 11, 11, 10, - 8, 5, 7, 8, 9, 10, - 10, 11, 11, 12, 13, 13, - 13, 10, 11, 11, 10, 13, - 14, 12, 12, 11, 11, 10, - 10, 8, 8, 10, 9, 10, - 10, 11, 11, 12, 12, 12, - 12, 13, 11, 11, 11, 11, - 14, 13, 13, 12, 12, 11, - 11, 10, 10, 10, 12, 11, - 10, 11, 11, 12, 11, 12, - 12, 13, 14, 10, 11, 11, - 11, 14, 14, 13, 13, 12, - 12, 11, 11, 10, 11, 12, - 11, 11, 11, 11, 12, 12, - 12, 12, 13, 13, 11, 12, - 11, 11, 13, 14, 14, 12, - 13, 13, 12, 12, 11, 12, - 13, 12, 11, 13, 12, 12, - 11, 12, 12, 12, 13, 11, - 12, 12, 11, 14, 14, 13, - 13, 13, 13, 13, 13, 12, - 11, 13, 12, 11, 12, 13, - 11, 12, 13, 12, 13, 13, - 11, 12, 12, 11, 14, 14, - 13, 14, 13, 13, 13, 12, - 11, 13, 14, 13, 12, 12, - 12, 12, 13, 12, 13, 12, - 12, 11, 12, 12, 11, 15, - 13, 14, 13, 14, 12, 13, - 13, 12, 13, 14, 15, 13, - 13, 13, 13, 13, 14, 13, - 13, 12, 12, 12, 13, 12, - 15, 13, 15, 13, 14, 14, - 14, 14, 13, 13, 14, 16, - 14, 15, 13, 13, 13, 13, - 13, 13, 13, 11, 12, 12, - 13, 16, 15, 16, 13, 15, - 14, 14, 14, 13, 13, 11, - 10, 11, 11, 11, 11, 11, - 11, 11, 11, 12, 12, 12, - 15, 13, 12, 12, 12, 11, - 11, 11, 11, 11, 10, 10, - 12, 11, 11, 11, 11, 11, - 12, 13, 12, 12, 12, 12, - 13, 15, 13, 12, 12, 13, - 12, 12, 12, 12, 11, 11, - 11, 11, 11, 11, 11, 12, - 11, 12, 12, 12, 12, 12, - 12, 13, 13, 13, 12, 12, - 12, 12, 11, 12, 11, 11, - 11, 11, 11, 10, 10, 11, - 11, 11, 12, 12, 12, 12, - 12, 12, 15, 11, 11, 12, - 11, 11, 12, 12, 11, 11, - 11, 10, 10, 14, 14, 13, - 14, 15, 14, 13, 14, 14, - 16, 16, 12, 13, 12, 11, - 12, 14, 13, 13, 13, 14, - 13, 14, 13, 14, 15, 13, - 13, 14, 13, 13, 14, 14, - 16, 14, 14, 11, 13, 12, - 11, 13, 13, 13, 13, 13, - 13, 14, 13, 13, 13, 13, - 14, 13, 12, 13, 13, 14, - 14, 14, 13, 14, 12, 12, - 12, 11, 13, 12, 12, 13, - 13, 12, 12, 12, 12, 13, - 13, 12, 12, 13, 12, 13, - 12, 13, 14, 15, 15, 11, - 12, 12, 11, 13, 14, 12, - 12, 12, 12, 12, 13, 11, - 13, 15, 12, 11, 11, 12, - 12, 12, 14, 13, 13, 15, - 11, 12, 11, 11, 13, 13, - 12, 12, 11, 12, 11, 12, - 11, 12, 12, 11, 11, 11, - 12, 13, 12, 13, 14, 15, - 14, 11, 11, 11, 11, 14, - 13, 12, 12, 12, 11, 11, - 11, 11, 12, 11, 11, 10, - 11, 12, 12, 12, 13, 13, - 14, 13, 11, 12, 11, 11, - 13, 12, 12, 13, 11, 11, - 11, 11, 10, 11, 10, 10, - 10, 11, 12, 11, 12, 12, - 13, 13, 14, 10, 11, 11, - 10, 14, 12, 13, 12, 11, - 11, 11, 11, 10, 10, 8, - 8, 8, 10, 10, 11, 11, - 12, 12, 13, 13, 10, 11, - 10, 11, 12, 12, 12, 12, - 12, 11, 10, 9, 9, 8, - 5, 5, 8, 10, 11, 11, - 12, 12, 12, 14, 14, 10, - 11, 11, 10, 14, 12, 12, - 12, 12, 12, 11, 10, 8, - 5, +static const uint16_t on2avc_cb_7_syms[ON2AVC_CB_7_8_CODES] = { + 0x0000, 0x00FF, 0x3F00, 0xCC00, 0x1C10, 0x1140, 0xFCEF, 0x4220, 0x43C1, + 0xCCCE, 0xFF40, 0xF2DC, 0xF21C, 0x1E4F, 0x114C, 0x2E1F, 0x30F0, 0xC020, + 0xC2E0, 0x0022, 0x01C1, 0x014F, 0x1012, 0x104D, 0xEF21, 0xFEDC, 0xFFE2, + 0xFF42, 0xF003, 0xF2FE, 0xF212, 0xF4CD, 0x0C40, 0x0DF4, 0x0224, 0x033C, + 0x1EF2, 0x1E21, 0x1FEE, 0x1F22, 0x103C, 0x1212, 0x142D, 0x1421, 0x2DC1, + 0x2FFE, 0x21FE, 0x2141, 0x22FF, 0x2420, 0x4CDF, 0x4C1F, 0x4D01, 0x4E20, + 0x4121, 0x441F, 0xCF01, 0xC301, 0x002C, 0xF3CE, 0xFCD2, 0x0143, 0x012F, + 0x20F1, 0x1F00, 0x00F1, 0x001F, 0x2F10, 0xC400, 0x112C, 0xF40F, 0xF1C2, + 0x002E, 0x1E10, 0x140F, 0x2101, 0x0F4D, 0x004C, 0x0044, 0x02E0, 0x1E43, + 0x10CF, 0xE200, 0x2C11, 0x4F0F, 0x0F4F, 0x1F2C, 0x0200, 0x14E1, 0x401F, + 0xC00E, 0xC3D2, 0xC330, 0xC4F1, 0xCF10, 0x1041, 0xF0F2, 0x0DC1, 0x1F0E, + 0x2F0F, 0x0134, 0x0FDC, 0xFF00, 0x0011, 0x1100, 0x0114, 0xFFFF, 0xC41F, + 0xC431, 0xDC01, 0xDE4F, 0xDE43, 0xDF40, 0xD001, 0xD14E, 0xD2E1, 0xD24F, + 0xD432, 0xECC4, 0xECF3, 0xEDCD, 0xEE42, 0xEFFC, 0xEF1E, 0xEF30, 0xEF41, + 0xE1C1, 0xE2E0, 0xE33C, 0xE42E, 0xE43D, 0xFCC3, 0xFCDE, 0xFCF2, 0xFDCC, + 0xFD4E, 0xFEED, 0xFF1D, 0xFF3D, 0xFF3F, 0xFF31, 0xF030, 0xF1D3, 0xF1FD, + 0xF3FF, 0xF311, 0x0CE4, 0x0C24, 0x0C33, 0x0C42, 0x0D10, 0x0ED1, 0x0E0E, + 0x0E4C, 0x0FD0, 0x003D, 0x01DE, 0x01D0, 0x0132, 0x0310, 0x1CE3, 0x1DFF, + 0x1E2D, 0x1FDF, 0x10C3, 0x1133, 0x12CD, 0x131F, 0x2CE2, 0x2C02, 0x2C22, + 0x2EC2, 0x2EE2, 0x2E20, 0x20C2, 0x20EE, 0x200E, 0x2334, 0x24C2, 0x243D, + 0x3DC0, 0x3E2F, 0x3FF1, 0x3111, 0x3221, 0x34EF, 0x3443, 0x4DD0, 0x4DE1, + 0x4DF2, 0x4D21, 0x4FC1, 0x4FD0, 0x4F12, 0x4F21, 0x42DF, 0x42EE, 0x43D0, + 0x44EE, 0xCD0F, 0xCFEF, 0xDCDE, 0xED10, 0xEEE0, 0xEE1F, 0xEF12, 0xE1F2, + 0xFEFE, 0xF2F4, 0xF22F, 0xF3EC, 0xF41E, 0x0D4F, 0x0222, 0x03F0, 0x1CCF, + 0x1DCE, 0x1DE0, 0x1E4D, 0x1FE2, 0x1F1D, 0x10D4, 0x11C4, 0x11E2, 0x111D, + 0x2343, 0x241F, 0x3CD0, 0x3E10, 0xD401, 0x3F1F, 0x320F, 0xEC40, 0xE2F1, + 0xFED4, 0xF2E1, 0xF340, 0x0CE2, 0x00C4, 0x042E, 0x020C, 0x1104, 0x24FF, + 0x022C, 0x2200, 0x00F3, 0x001D, 0x1111, 0x00C2, 0x41F0, 0xCE11, 0x4EE0, + 0x44D1, 0xCCFF, 0xFDC2, 0x004E, 0x00EC, 0x2110, 0x01E1, 0x134E, 0xC01F, + 0xF1EC, 0x0FED, 0x1FEC, 0xE4F1, 0x10C1, 0x2CE0, 0x011C, 0x0CD1, 0x44F1, + 0xE1F0, 0xEF0F, 0x23C1, 0xCF2F, 0xC121, 0x0E40, 0x02EC, 0x1210, 0x3100, + 0x0F14, 0xD1F1, 0xEC31, 0xE34F, 0xE422, 0xFC32, 0xFDE4, 0xFE4D, 0xFF22, + 0xFF4E, 0xF03C, 0xF23C, 0xF3CC, 0xF3C0, 0xF324, 0xF4D0, 0x0D34, 0x0EE0, + 0x0E02, 0x0FDE, 0x0031, 0x02EE, 0x024C, 0x03FC, 0x04CE, 0x04C0, 0x04EE, + 0x1EEF, 0x1FCC, 0x10CD, 0x10E3, 0x12F2, 0x1223, 0x123C, 0x1243, 0x1342, + 0x1344, 0x2ECE, 0x2EFF, 0x2FE1, 0x2F2F, 0x20C0, 0x21F2, 0x2121, 0x3D00, + 0x340F, 0x3421, 0x4DCF, 0x4D0F, 0xD4F0, 0x4FEF, 0x44FF, 0xEC11, 0xEEEE, + 0xFE4F, 0xF041, 0xF043, 0x0E4E, 0xE01F, 0x1221, 0x14EF, 0xFEC3, 0xF2CD, + 0xF2F0, 0x0FC3, 0x00CE, 0x1EF0, 0xE110, 0x0F41, 0x1C0F, 0x10F4, 0x40FF, + 0xCE20, 0xC321, 0xF4F0, 0x0D41, 0x0EC0, 0x02C0, 0x2C00, 0x0F12, 0x0020, + 0xDF00, 0x2E00, 0xC21F, 0xC220, 0x0FF4, 0x00FD, 0x1F1F, 0x0024, 0x4DF0, + 0xFCF0, 0xF14E, 0x0EE4, 0x0F23, 0x10F0, 0x1DC0, 0x1F44, 0x110C, 0x112E, + 0xFF02, 0x143E, 0x32C1, 0xF0E1, 0x0E1F, 0x0411, 0xF102, 0x0C20, 0x0C31, + 0x0F0D, 0x01DC, 0x014D, 0x0240, 0x101C, 0x120F, 0x0FFC, 0x01CF, 0x124D, + 0x1410, 0x0E00, 0xCC2E, 0x4442, 0xCCC0, 0xCEDF, 0xCE02, 0xCF4F, 0xCF41, + 0xC002, 0xC031, 0xC040, 0xC132, 0xC2EE, 0xC34F, 0xC341, 0xDCC1, 0xDC03, + 0xDC34, 0xDC41, 0xDDEE, 0xDD42, 0xDEC1, 0xDEDC, 0xDEF2, 0xDE12, 0xDE2F, + 0xDE23, 0xDE32, 0xDE4D, 0xDE41, 0xDF0C, 0xDF20, 0xDF3F, 0xD012, 0xD030, + 0xD032, 0xD04F, 0xD041, 0xD1EE, 0xD1E2, 0xD1E4, 0xD120, 0xD14C, 0xD142, + 0xD2D2, 0xD2FE, 0xD2F2, 0xD232, 0xD243, 0xD3D3, 0xD30E, 0xD31D, 0xD320, + 0xD33D, 0xD331, 0xD42D, 0xD44F, 0xECCC, 0xECC2, 0xECD1, 0xECD3, 0xECE4, + 0xEC02, 0xEDD4, 0xEDF2, 0xED14, 0xEECC, 0xEEC2, 0xEEC4, 0xEEFD, 0xEE1D, + 0xEE2E, 0xEE33, 0xEFCF, 0xEFDE, 0xEF3C, 0xEF32, 0xE0F3, 0xE1CD, 0xE123, + 0xE2C2, 0xE2C4, 0xE2EC, 0xE2E4, 0xE233, 0xE3C1, 0xE3DC, 0xE3D0, 0xE3F2, + 0xE3F4, 0xE31E, 0xE4CE, 0xE4C2, 0xE4E4, 0xE402, 0xFCD4, 0xFDDF, 0xFDE0, + 0xFD04, 0xFED0, 0xFE03, 0xFE43, 0xFFD3, 0xF03E, 0xF032, 0xF133, 0xF20D, + 0xF223, 0xF3EE, 0xF3E0, 0xF3F1, 0xF33F, 0xF4D4, 0xF414, 0x0CCE, 0x0CC0, + 0x0CC2, 0x0CC4, 0x0C0E, 0x0C04, 0x0C44, 0x0DDC, 0x0DD2, 0x0DE1, 0x0D1E, + 0x0EDF, 0x0EF3, 0x02C4, 0x02F3, 0x0213, 0x023D, 0x03E1, 0x03FE, 0x0301, + 0x032F, 0x033E, 0x0332, 0x04C2, 0x04DD, 0x04D3, 0x0402, 0x042C, 0x1CD4, + 0x1C43, 0x1DDF, 0x1D2C, 0x1EED, 0x1EE3, 0x1FD3, 0x10D2, 0x11DD, 0x122D, + 0x123E, 0x13CC, 0x13D1, 0x13FD, 0x1320, 0x1324, 0x1432, 0x1434, 0x1443, + 0x2C13, 0x2C4E, 0x2D0F, 0x2D1E, 0x2D3C, 0x2D30, 0x2D4D, 0x2E0C, 0x2E1D, + 0x2E2C, 0x2E44, 0x2FD0, 0x2FED, 0x2F4D, 0x20CC, 0x20DF, 0x201D, 0x2013, + 0x202E, 0x21D2, 0x21ED, 0x213C, 0x213E, 0x22CC, 0x22EE, 0x22E2, 0x22FD, + 0x2202, 0x23C3, 0x23E1, 0x23F4, 0x2310, 0x232F, 0x24CC, 0x240C, 0x240E, + 0x241D, 0x2422, 0x244C, 0x2442, 0x3C2D, 0x3C32, 0x3C4F, 0x3C43, 0x3DC2, + 0x3D3F, 0x3EE1, 0x3E1E, 0x3E14, 0x3E2D, 0x3E21, 0x3E43, 0x3FE2, 0x3F4E, + 0x30E1, 0x3012, 0x302F, 0x31CC, 0x3120, 0x3122, 0x3142, 0x32CF, 0x32C3, + 0x32FC, 0x32F4, 0x324F, 0x33E0, 0x33FF, 0x3311, 0x3331, 0x3342, 0x34DE, + 0x34E3, 0x3412, 0x3432, 0x4DCD, 0x4DC1, 0x4DD2, 0x4D32, 0x4D4F, 0x4EC2, + 0x4E0E, 0x4E31, 0x4FCD, 0x4FD2, 0x4F1E, 0x4F30, 0x40DF, 0x402E, 0x403F, + 0x4040, 0x41DE, 0x41F2, 0x414F, 0x42E4, 0x4202, 0x4222, 0x423F, 0x43CD, + 0x43CF, 0x43F2, 0x432D, 0x4323, 0x44DF, 0x44D3, 0xCCD1, 0x44FD, 0x4402, + 0xCD30, 0xCE22, 0xCE31, 0xCFD0, 0xCFE1, 0xC0EE, 0xC0E0, 0xC2D1, 0xC202, + 0xC22E, 0xC3F2, 0xDCD2, 0xDCF2, 0xDC3E, 0xDDFF, 0xDD40, 0xDEEF, 0xD20F, + 0xD201, 0xD311, 0xD32C, 0xD4ED, 0xD430, 0xEC33, 0xEDDC, 0xEE22, 0xEFC3, + 0xEFE1, 0xEF34, 0xE0E0, 0xE042, 0xE11C, 0xE22E, 0xE3F0, 0xE301, 0xE321, + 0xE4DF, 0xE4FD, 0xFCC1, 0xFCE3, 0xFC23, 0xFDF1, 0xFE30, 0xF0ED, 0xF14C, + 0xF2E3, 0xF2FC, 0xF21E, 0xF3E2, 0xF3E4, 0xF4ED, 0xF4F2, 0xF432, 0x0C13, + 0x0DD4, 0x0E1D, 0x0E3F, 0x0FE3, 0x0F30, 0x01D2, 0x02DF, 0x021D, 0x0233, + 0x03CD, 0x031C, 0x0321, 0x04F3, 0x0422, 0x044C, 0x1C2D, 0x1C34, 0x1DEC, + 0x1D04, 0x1D24, 0x1FC4, 0x1F3F, 0x10DE, 0x11D1, 0x12F4, 0x120D, 0x134C, + 0x141C, 0x143C, 0x2CEE, 0x2D2F, 0x2EEE, 0x2FCD, 0x2FD4, 0x2F1E, 0x2F41, + 0x2F43, 0x202C, 0x2044, 0x21DC, 0x21F4, 0x2112, 0x214D, 0x214F, 0x22E0, + 0x2231, 0x224E, 0x2242, 0x24CE, 0x24E2, 0x2440, 0x3CDE, 0x3C30, 0x3EEF, + 0x321E, 0x33C0, 0x3344, 0x4D1E, 0x4D3E, 0x4EC0, 0x4E3F, 0x4FF2, 0x40EE, + 0x4020, 0x4022, 0x411E, 0x4112, 0x412F, 0xC1EF, 0xC231, 0xDCE1, 0xDC21, + 0xDE01, 0xDE10, 0xDF1F, 0xECE2, 0xECF1, 0xE2E2, 0xE220, 0xFC41, 0xFD20, + 0xFECD, 0xFE21, 0xFF2E, 0xF00D, 0xF02D, 0xF023, 0xF1EE, 0xF11D, 0xF2C3, + 0xF31F, 0xF43E, 0x0C2E, 0x0EC4, 0x0EEE, 0x0F3E, 0x003F, 0x0033, 0x013E, + 0x034D, 0x1CF2, 0x1C23, 0x1D44, 0x1ED4, 0x1EFE, 0x10DC, 0x10ED, 0x100D, + 0x1113, 0x1311, 0x1340, 0x14CF, 0x14DE, 0x1430, 0x2E40, 0x21CF, 0x2321, + 0x4CF1, 0x432F, 0x4420, 0xCE1F, 0xDC10, 0xF04F, 0xF10C, 0x0FCD, 0x02C2, + 0x11C2, 0x12C1, 0x20E0, 0x41EF, 0xC2FF, 0xFFC0, 0xF01C, 0xF02F, 0xF021, + 0xF1E0, 0x0E24, 0x11E0, 0xFFC2, 0x1102, 0x201F, 0xF410, 0x24F1, 0x4FF0, + 0x42F1, 0x43F0, 0x0E11, 0x2C1F, 0x4310, 0x0FF2, 0xD010, 0xE341, 0xFC21, + 0xF124, 0xF241, 0x0C22, 0x012D, 0x0123, 0x0420, 0x1CE1, 0x1E2F, 0x1241, + 0xE0FF, 0x2EF1, 0x3410, 0xFE0F, 0xFFEC, 0x0E04, 0x00EE, 0x02F1, 0x1F24, + 0x2CFF, 0x01FC, 0x4000, 0xD421, 0x4321, 0xCC3F, 0xCD01, 0xFC2F, 0x0E42, + 0x0FD4, 0x1FE0, 0x1F20, 0x10EF, 0xF401, 0x110E, 0x2DCF, 0x2FF0, 0x21F0, + 0xC11E, 0xC12F, 0xC130, 0xC4E0, 0xDF11, 0xD00F, 0xD340, 0xECCE, 0xECDF, + 0xEC2E, 0xED41, 0xEE11, 0xE00E, 0xE1EF, 0xE112, 0xE24E, 0xE4E0, 0xFC12, + 0xFE12, 0xFE14, 0xFE3C, 0xFFCC, 0xFFDF, 0xFFF3, 0xFF4C, 0xF1C4, 0xF12E, + 0xF2EF, 0xF24D, 0xF320, 0x0CDF, 0x0D14, 0x01F0, 0x0E13, 0x0E22, 0x0E31, + 0x0FD2, 0x00D1, 0x0242, 0x1DE4, 0x1EFC, 0x1E1C, 0x1FCE, 0x1F13, 0x102D, + 0x1034, 0x11EE, 0x11F3, 0x2C3F, 0x2E42, 0x2FC1, 0x22C2, 0x22EC, 0x23F0, + 0x3CCF, 0x3CE1, 0x3F11, 0x300F, 0x342F, 0x4F2F, 0x41E1, 0xCEE0, 0xED4F, + 0xE21F, 0xE420, 0xFECF, 0xFE41, 0xFFC4, 0xF430, 0x0E2C, 0x04DF, 0x1E1E, + 0x1F4C, 0x13C0, 0x14FE, 0xC0F1, 0x2411, 0x3C2F, 0xC411, 0xEEFF, 0xFFE0, + 0xF0DC, 0xF0F4, 0xF10E, 0xF20F, 0x0C11, 0x0EC2, 0x0FCF, 0x0141, 0x024E, + 0xEF01, 0x11E4, 0x1122, 0xF001, 0xF1F1, 0x1FF1, 0xF421, 0x01FE, 0x3401, + 0x4D2F, 0xCD2F, 0xC2F1, 0xFE01, 0xF104, 0x00E2, 0xE411, 0x10E1, 0x3CF0, + 0x0F01, 0x100F, 0xF010, 0x010F, 0xF00F, 0x111F, 0x00E0, 0x14F0, 0xF01E, + 0xECE0, 0xFCD0, 0xFEFC, 0xFE2F, 0xCDF0, 0xF0D4, 0xF4DE, 0x1CD0, 0x1ECF, + 0xE0F1, 0x1EE1, 0x1EF4, 0xE431, 0xFF0E, 0xFF24, 0xF0FC, 0xF201, 0x021F, + 0x1E0F, 0x2CC0, 0x1001, 0xFF1F, 0x12F0, 0x2011, 0x4E1F, 0xC310, 0x410F, + 0x121E, 0xCCDD, 0x4433, 0xCCC2, 0xCCC4, 0xCCDF, 0xCCE2, 0xC200, 0xEF10, + 0xCC1F, 0xFDCE, 0xCE00, 0xFFCE, 0xF120, 0x0EF1, 0x02CE, 0x0F10, 0x0FF0, + 0xFF11, 0x1EC1, 0x1E01, 0x2211, 0x3CEF, 0x011E, 0x3010, 0x4EF1, 0xC000, + 0x0F3C, 0x10FE, 0x4E11, 0xCC20, 0xCC31, 0xCD1E, 0xCD4F, 0xCED1, 0xCE2E, + 0xCFFE, 0xCF32, 0xC1F0, 0xE400, 0x104F, 0xC03F, 0xC1F2, 0xC2DF, 0xC20E, + 0xC3FE, 0xC32F, 0xC4E2, 0xC42E, 0xDC12, 0xDF2E, 0xD1E0, 0xD4D2, 0xD42F, + 0xEC22, 0xEC4E, 0xEDC1, 0x1FFF, 0xCFF0, 0xF0F0, 0xEDC3, 0xEDEF, 0xED2F, + 0xEEDD, 0xEFCD, 0xEFFE, 0xEF4D, 0xEF43, 0xE0C2, 0xE0EE, 0xE0E4, 0xE002, + 0xE004, 0xE022, 0xE13E, 0xE132, 0xE143, 0xE2D3, 0xE20E, 0xE22C, 0xE231, + 0xE3CD, 0xE3C3, 0xE3E1, 0xE3FE, 0xE310, 0xE4C0, 0xE4EC, 0xE4E2, 0xE442, + 0xFCED, 0xFC43, 0xFDD1, 0xFDEE, 0xFDFF, 0xFD22, 0xFEDE, 0xFED2, 0xFEF2, + 0xFF13, 0xFF33, 0xF0D2, 0xF2D2, 0xF230, 0xF243, 0xF3C4, 0xF331, 0xF4C1, + 0xF4DC, 0xF4FE, 0x0D43, 0x03D4, 0x03F4, 0x0334, 0x04E2, 0x04FD, 0x041D, + 0x1C4D, 0x1DC2, 0x1D11, 0x1ECD, 0x1ED2, 0x1FD1, 0x1F33, 0x10D0, 0x11D3, + 0x12DE, 0x12D0, 0x12D4, 0x12E3, 0x13EC, 0x13F1, 0x14C3, 0x14F2, 0x141E, + 0x2C0E, 0x2C1D, 0x2DDE, 0x2DEF, 0x2D14, 0x2D4F, 0x2EEC, 0x2E3F, 0x2E31, + 0x2FCF, 0x2FC3, 0x2FDC, 0x2F3C, 0x20E2, 0x20E4, 0x2022, 0x2024, 0x204E, + 0x2042, 0x21E3, 0x2132, 0x22CE, 0x22D1, 0x224C, 0x2341, 0x242E, 0x243F, + 0x244E, 0x3CC1, 0x3CD2, 0x3CED, 0x3DF1, 0x3D1F, 0x3D11, 0x3D40, 0x3ECF, + 0x3ED4, 0x3FFF, 0x32ED, 0x3201, 0x341E, 0x343E, 0x4C20, 0x4DDE, 0x4ED1, + 0x4E22, 0x4FFE, 0x42E2, 0x43DE, 0xCF30, 0x43FE, 0x4332, 0xDD00, 0xDFE0, + 0xD300, 0xD4E1, 0xD4F2, 0xEDDE, 0xEEC0, 0xEE04, 0xEE24, 0xEE4E, 0xE242, + 0xFC1E, 0xFD11, 0xFE1C, 0xFE1E, 0xFFD1, 0xF44F, 0x0C3F, 0x0EE2, 0x0E2E, + 0x0130, 0x02E4, 0x020E, 0x0341, 0x1CD2, 0x1C32, 0x1C41, 0x1DF1, 0x1EC3, + 0x1FF3, 0x1030, 0x11CC, 0x11DF, 0x1131, 0x1144, 0x1300, 0x132C, 0x2CD1, + 0x2D41, 0x21E1, 0x211E, 0x2220, 0x23CF, 0x3E0F, 0x34C1, 0x4EDF, 0x4EEE, + 0x430F, 0xD210, 0xD241, 0xEFEF, 0xE11E, 0xF1E2, 0x0F2D, 0x0220, 0x1E34, + 0x0110, 0x11CE, 0x12CF, 0x12EF, 0x121C, 0xFEEF, 0x221F, 0x31FF, 0xF014, + 0xF2C1, 0x0C1F, 0x0EFF, 0x1F02, 0x24E0, 0x3C10, 0x42E0, 0xF0C1, 0x114E, + 0xF11F, 0xFC10, 0x42FF, 0x40E0, 0xC1E1, 0x0FC1, 0x1F42, 0x0F0F, 0x11FF, + 0x0112, 0xC211, 0xD410, 0xFFEE, 0xFF20, 0xF1FF, 0x01C3, 0x010D, 0x1CEF, + 0x1F4E, 0x0042, 0x102F, 0x1021, 0x1010, 0xFFF1, 0xFC0F, 0x34E1, 0xC30F, + 0xC4FF, 0x2400, 0xD1FF, 0xD140, 0xD2F0, 0xEEF1, 0x4110, 0xF111, 0x0101, + 0x11F1, 0xFCE1, 0xF0CD, 0xF142, 0xF144, 0xF300, 0xF34E, 0x0E20, 0x1C12, + 0x1C21, 0x1C30, 0x1D00, 0x1E14, 0x1E3C, 0x1FC2, 0x12E1, 0x12FC, 0x1214, + 0x21C1, 0x34D0, 0x4EFF, 0xCEFF, 0x43E1, 0x4301, 0xC101, 0xECFF, 0xE011, + 0xFF0C, 0xFF2C, 0x02FF, 0x041F, 0x1C2F, 0xFE10, 0x14D0, 0x3210, 0xF1CE, + 0x0FE1, 0x0F21, 0x101E, 0x2CDF, 0x4211, 0xC011, 0xEE40, 0xE240, 0xF1C0, + 0xF2CF, 0x0CFF, 0x0F2F, 0x4E00, 0x0F43, 0x10F2, 0x4D10, 0xEC20, 0xF0EF, + 0xF42F, 0x04FF, 0x1C01, 0x1FC0, 0x1043, 0x1120, 0x1201, 0x2CF1, 0x24D1, + 0x4CFF, 0x4F01, 0x4011, 0x00E4, 0xFEC1, 0xF0CF, 0x1401, 0x4C00, 0x2000, + 0xE101, 0xCCE0, 0x44E0, 0xCCD3, 0xCCEC, 0xCCE4, 0xCCFD, 0xCDE1, 0xCD21, + 0xC1D0, 0xC23F, 0xC420, 0xD11F, 0xD3FF, 0xD40F, 0xD441, 0xEDF0, 0xEE02, + 0xE0C0, 0xE1D4, 0xE1E1, 0xE1FE, 0xE4D1, 0xE43F, 0xFDEC, 0xFD00, 0xFD1F, + 0xFE23, 0xFFDD, 0xFFFD, 0xF1DF, 0xF113, 0xF13F, 0xF214, 0xF234, 0xF412, + 0x0CF3, 0x0D0F, 0x0ECC, 0x00D3, 0x022E, 0x04D1, 0x040E, 0x1CC1, 0x1C1E, + 0x1C4F, 0x1E12, 0x1E3E, 0x1F31, 0x103E, 0x113D, 0x113F, 0x13CE, 0x13E0, + 0x14C1, 0x14ED, 0x144D, 0x2C2E, 0x2D10, 0x2D21, 0x2EE0, 0x2E02, 0x2E4E, + 0x2F21, 0x2F4F, 0x220E, 0x2240, 0x234D, 0x3CF2, 0x3C01, 0x3C21, 0x34D2, + 0x4CE0, 0xCE3F, 0x42D1, 0x43EF, 0xCF21, 0xC3E1, 0xE121, 0xE2FF, 0xE211, + 0xFDC4, 0xFEE1, 0xFE34, 0xFF04, 0xF122, 0xF2D4, 0x0EEC, 0x00DF, 0x0204, + 0x043F, 0x044E, 0x1D40, 0x1FFD, 0x1F04, 0x12FE, 0x122F, 0x144F, 0x2C20, + 0x2222, 0xCDEF, 0xD0F0, 0xE440, 0xF1CC, 0xFEF0, 0x0CF1, 0x0F34, 0x00C0, + 0xF012, 0x0121, 0x1F11, 0x0C00, 0x1E41, 0x4101, 0x40F1, 0xDFF1, 0x01F2, + 0xEC3F, 0x01CD, 0x2F01, 0xDCF0, 0xFC30, 0xFFE4, 0xF24F, 0x00CC, 0x1FE4, + 0x0004, 0x4F10, 0x11EC, 0x1234, 0x22C0, 0x24C0, 0xEC00, 0x0FEF, 0x01F4, + 0x0F1E, 0x2EC0, 0x3C0F, 0xD111, 0xEF2F, 0x4200, 0xEC1F, 0xEE00, 0x0002, + 0xC110, 0xF210, 0x1CF0, 0x0FFE, 0xE141, 0xE4FF, 0xF034, 0xF221, 0xF4E1, + 0x0DC3, 0x1003, 0x11FD, 0xE000, 0xCF0F, 0x21EF, 0x31F1, 0xDEF0, 0xE040, + 0xF4EF, 0x013C, 0x0211, 0x04E0, 0x1D42, 0x1F2E, 0x10FC, 0x11C0, 0x03CF, + 0x1124, 0x34F0, 0x0F1C, 0xD100, 0x034F, 0x1142, 0xCD10, 0xC3F0, 0x421F, + 0x4431, 0xCCF3, 0xCC0C, 0xCC02, 0xCC04, 0xCC1D, 0xCC13, 0xCC2C, 0xCC24, + 0xCC3D, 0xCC33, 0xCC4C, 0xCC4E, 0xCC42, 0xCC44, 0xCDCD, 0xCDCF, 0xF100, + 0x000C, 0xE10F, 0x1F40, 0x20FF, 0x210F, 0xEFF0, 0xCEF1, 0xC0FF, 0xE41F, + 0xFC01, 0x000E, 0xFD40, 0xF0C3, 0xF1E4, 0xF12C, 0xF140, 0x01E3, 0x1F0C, + 0x1014, 0x01EF, 0x4411, 0xCDC1, 0xCDDC, 0xCDD4, 0xCDE3, 0xCDFC, 0xCDF4, + 0xCD0D, 0xCD03, 0xCD1C, 0xCD14, 0xCD2D, 0xCD23, 0xCD3C, 0xCD34, 0xCD4D, + 0xCD41, 0xCECC, 0xCECE, 0xCEC0, 0xCEC2, 0xCEC4, 0xCED3, 0xCEEC, 0xCEEE, + 0xCEE2, 0xCEFD, 0xCEF3, 0xCE0C, 0xCE04, 0xCE1D, 0xCE13, 0xCE2C, 0x0040, + 0x04F1, 0x0400, 0x124F, 0x4400, 0xCE24, 0xCE3D, 0xCE33, 0xCE4C, 0xCE42, + 0xCE44, 0xCFCD, 0xCFCF, 0xCFC1, 0xCFC3, 0xCFDC, 0xCFD2, 0xCFD4, 0xCFED, + 0xCFE3, 0xCFFC, 0xCFF2, 0xCFF4, 0xCF0D, 0xCF03, 0xCF1C, 0xCF1E, 0xCF3C, + 0xCF34, 0xCF4D, 0xCF43, 0xC0CC, 0xC0CE, 0xC0C0, 0xC0C2, 0xC0C4, 0xC0D1, + 0xC0D3, 0xC0EC, 0xC0E2, 0xC0E4, 0xC0F3, 0xC00C, 0xC004, 0xC013, 0xC02C, + 0xC022, 0xC024, 0xC03D, 0xC033, 0xC04E, 0xC042, 0xC044, 0xC1CF, 0xC1C3, + 0xC1DC, 0xC1D2, 0xC1D4, 0xC1ED, 0xC1E3, 0xC1FC, 0xC1F4, 0xC10D, 0xC11C, + 0xC112, 0xC114, 0xC12D, 0xC123, 0xC13C, 0x0013, 0xC134, 0xC14D, 0xC14F, + 0xC143, 0xC2CC, 0xC2CE, 0xC2C0, 0xC2C2, 0xC2C4, 0xC2D3, 0xC2EC, 0xC2E4, + 0xC2FD, 0xC20C, 0xC204, 0xC21D, 0xC213, 0xC22C, 0xC224, 0xC23D, 0xC233, + 0xC24C, 0xC24E, 0xC240, 0xC3CD, 0xC3C3, 0xC3DC, 0xC3D4, 0xC3ED, 0xC3F4, + 0xC30D, 0xC303, 0xC31C, 0xC312, 0xC314, 0xC32D, 0xC33C, 0xC33E, 0xC334, + 0xC34D, 0xC4CC, 0xC4CE, 0xC4C0, 0xC4C2, 0xC4C4, 0xC4DF, 0xC4EC, 0xC4EE, + 0xC4FD, 0xC4F3, 0xC40E, 0xC402, 0xC404, 0xC41D, 0xC413, 0xC42C, 0xC424, + 0xC43D, 0xC433, 0xC44C, 0xC442, 0xC444, 0xDCCF, 0xDCDC, 0xDCED, 0xDCE3, + 0xDCFC, 0xDCF4, 0xDC0D, 0xDC1C, 0xDC14, 0xDC3C, 0xDC43, 0xDDCE, 0xDDC4, + 0xDDD1, 0xDDD3, 0xDDE2, 0xDDE4, 0xDDFD, 0xDDF3, 0xDD0C, 0xDD0E, 0xDD1D, + 0xDD1F, 0xDD13, 0xDD24, 0xDD3D, 0xDD3F, 0xDD31, 0xDD33, 0xDD4C, 0xDD44, + 0xDECD, 0xDEC3, 0xDED0, 0xDED2, 0xDEED, 0xDEE3, 0xDEFC, 0xDEF4, 0xDE0D, + 0xDE03, 0xDE1C, 0xDE1E, 0xDE14, 0xDE2D, 0xDE3C, 0xDE3E, 0xDE30, 0xDFCC, + 0xDFC0, 0xDFC2, 0xDFC4, 0xDFDD, 0xDFD1, 0xDFD3, 0xDFEC, 0xDFE2, 0xDFFD, + 0xDFF3, 0xDF02, 0xDF04, 0xDF1D, 0xDF24, 0xDF3D, 0xDF31, 0xDF33, 0xDF4C, + 0xDF4E, 0xDF44, 0xD0CD, 0xD0CF, 0xD0C3, 0xD0DC, 0xD0D0, 0xD0D2, 0xD0D4, + 0xD0ED, 0xD0EF, 0xD0E1, 0xD0FC, 0xD0FE, 0xD0F4, 0xD00D, 0xD003, 0xD014, + 0xD02D, 0xD023, 0xD03C, 0xD034, 0xD04D, 0xD1C4, 0xD1DD, 0xD1DF, 0xD1D1, + 0xD1D3, 0xD1FD, 0xD1F3, 0xD10C, 0xD10E, 0xD102, 0xD11D, 0xD113, 0xD12E, + 0xD122, 0xD124, 0xD13D, 0xD13F, 0xD131, 0xD133, 0xD144, 0xD2CD, 0xD2CF, + 0xD2C1, 0xD2C3, 0xD2DE, 0xD2D0, 0xD2D4, 0xD2ED, 0xD20D, 0xD203, 0xD21C, + 0xD21E, 0xD212, 0xD223, 0xD23C, 0xD230, 0xD234, 0xD24D, 0xD3CC, 0xD3CE, + 0xD3DD, 0xD3DF, 0xD3D1, 0xD3EE, 0xD3E2, 0xD3E4, 0xD3FD, 0xD3F3, 0xD30C, + 0xD302, 0xD304, 0xD31F, 0xD313, 0xD32E, 0xD324, 0xD33F, 0xD333, 0xD34C, + 0xD34E, 0xD344, 0xD4CD, 0xD4CF, 0xD4DC, 0xD4DE, 0xD4D0, 0xD4D4, 0xD4FC, + 0xD4FE, 0xD4F4, 0xD40D, 0xD403, 0xD41C, 0xD412, 0xD414, 0xD423, 0xD43C, + 0xD43E, 0xD434, 0xD44D, 0xECC0, 0xECDD, 0xECEC, 0xEC0C, 0xEC04, 0xEC1D, + 0xEC2C, 0xEC3D, 0xEC4C, 0xEC42, 0xEC44, 0xEDD0, 0xEDD2, 0xEDED, 0xEDE1, + 0xEDE3, 0xEDFC, 0xEDFE, 0xEDF4, 0xED0D, 0xED03, 0xED1C, 0xED1E, 0xED12, + 0xED2D, 0xED23, 0xED3E, 0xED32, 0xEED1, 0xEED3, 0xEEE4, 0xEE0E, 0xEE2C, + 0xEE3D, 0xEE3F, 0xEE4C, 0xEE44, 0xEFD0, 0xEFD2, 0xEF0D, 0xEF03, 0xEF1C, + 0xEF2D, 0xE0CC, 0xE0DD, 0xE0DF, 0xE0D1, 0xE0D3, 0xE0FD, 0xE01D, 0xE03D, + 0xE033, 0xE044, 0xE1DC, 0xE1DE, 0xE1D0, 0xE1D2, 0xE1ED, 0xE10D, 0xE103, + 0xE13C, 0xE2DD, 0xE2FD, 0xE2F3, 0xE23D, 0xE23F, 0xE244, 0xE3D2, 0xE3ED, + 0xE3E3, 0xE30D, 0xE303, 0xE312, 0xE314, 0xE32D, 0xE323, 0xE33E, 0xE332, + 0xE334, 0xE4CC, 0xE4C4, 0xE4F3, 0xE40C, 0xE404, 0xE41D, 0xE424, 0xE433, + 0xE44C, 0xE444, 0xFCFC, 0xFC1C, 0xFC14, 0xFC2D, 0xFC3C, 0xFC3E, 0xFDD3, + 0xFDE2, 0xFDFD, 0xFDF3, 0xFD0C, 0xFD0E, 0xFD1D, 0xFD13, 0xFD2C, 0xFD3D, + 0xFD3F, 0xFD33, 0xFD4C, 0xF1DD, 0xF13D, 0xF203, 0xF22D, 0xF232, 0xF3DD, + 0xF3DF, 0xF3D1, 0xF3FD, 0xF3F3, 0xF302, 0xF31D, 0xF313, 0xF32E, 0xF33D, + 0xF333, 0xF4C3, 0xF4E3, 0xF4FC, 0xF4F4, 0xF41C, 0xF423, 0xF434, 0xF443, + 0x0CDD, 0x0CEC, 0x0C2C, 0x0C3D, 0x0DED, 0x0DE3, 0x0DFC, 0x0DFE, 0x0D0D, + 0x0D03, 0x0D1C, 0x0D12, 0x0D23, 0x0D3C, 0x0D3E, 0x0D30, 0x0ED3, 0x0EFD, + 0x0E3D, 0x02D1, 0x0231, 0x03DE, 0x03D0, 0x03D2, 0x03ED, 0x03E3, 0x03F2, + 0x030F, 0x0303, 0x031E, 0x032D, 0x0323, 0x0330, 0x04CC, 0x04C4, 0x04E4, + 0x0404, 0x0413, 0x0424, 0x0433, 0x0444, 0x1CCD, 0x1CC3, 0x1CDC, 0x1CF4, + 0x1C0D, 0x1C1C, 0x1C3C, 0x1DCC, 0x1DEE, 0x1DFD, 0x1DF3, 0x1D0C, 0x1D13, + 0x1D2E, 0x1D22, 0x1D3D, 0x1D3F, 0x1D33, 0x1D4C, 0x1ED0, 0x1E0D, 0x1E03, + 0x1E32, 0x1023, 0x12C3, 0x12D2, 0x12ED, 0x1203, 0x13C4, 0x13DD, 0x13DF, + 0x13D3, 0x13EE, 0x13E2, 0x13E4, 0x13F3, 0x130C, 0x1302, 0x1304, 0x1313, + 0x1322, 0x133D, 0x1331, 0x14CD, 0x14D4, 0x14F4, 0x1403, 0x1412, 0x1414, + 0x1423, 0x2CCC, 0x2CC2, 0x2CC4, 0x2CDD, 0x2CE4, 0x2CFD, 0x2CF3, 0x2C0C, + 0x2C04, 0x2C2C, 0x2C24, 0x2C33, 0x2C4C, 0x2C40, 0x2C44, 0x2DCD, 0x2DC3, + 0x2DD0, 0x2DD2, 0x2DD4, 0x2DED, 0x2DE1, 0x2DFE, 0x2DF2, 0x2D0D, 0x2D03, + 0x2D1C, 0x2D12, 0x2D2D, 0x2D23, 0x2D3E, 0x2D32, 0x2D43, 0x2EDD, 0x2ED3, + 0x2EFD, 0x2E0E, 0x2E04, 0x2E13, 0x2E3D, 0x2E33, 0x2E4C, 0x2FD2, 0x2FFC, + 0x2F0D, 0x2F03, 0x2F1C, 0x2F14, 0x2F23, 0x2F30, 0x2F32, 0x20C4, 0x20DD, + 0x20D3, 0x203D, 0x203F, 0x2031, 0x2033, 0x204C, 0x21D4, 0x2103, 0x212D, + 0x2130, 0x2143, 0x22C4, 0x22DD, 0x22DF, 0x22D3, 0x22F3, 0x221D, 0x222C, + 0x223D, 0x223F, 0x23CD, 0x23D2, 0x23ED, 0x23E3, 0x23F2, 0x230D, 0x2314, + 0x232D, 0x2323, 0x233C, 0x233E, 0x24C4, 0x24EC, 0x24F3, 0x2402, 0x2404, + 0x2413, 0x2424, 0x3CCD, 0x3CC3, 0x3CDC, 0x3CD4, 0x3CE3, 0x3CFC, 0x3CF4, + 0x3C0D, 0x3C1E, 0x3C3C, 0x3C34, 0x3DCC, 0x3DCE, 0x3DC4, 0x3DDD, 0x3DDF, + 0x3DD1, 0x3DD3, 0x3DEC, 0x3DEE, 0x3DE0, 0x3DE2, 0x3DE4, 0x3DFD, 0x3DF3, + 0x3D0C, 0x3D0E, 0x3D02, 0x3D04, 0x3D1D, 0x3D2E, 0x3D20, 0x3D24, 0x3D31, + 0x3D4C, 0x3D44, 0x3ECD, 0x3EC3, 0x3ED0, 0x3ED2, 0x3EED, 0x3EFC, 0x3EFE, + 0x3EF2, 0x3EF4, 0x3E0D, 0x3E03, 0x3E1C, 0x3E23, 0x3E3E, 0x3E30, 0x3E32, + 0x3E4D, 0x3FC4, 0x3FDD, 0x3FD1, 0x3FEC, 0x3FEE, 0x3FE0, 0x3FE4, 0x3FFD, + 0x3F0C, 0x3F04, 0x3F1D, 0x3F13, 0x3F2E, 0x3F22, 0x3F24, 0x3F3D, 0x3F3F, + 0x3F31, 0x3F33, 0x3F4C, 0x3F40, 0x3F42, 0x3F44, 0x30CD, 0x30CF, 0x30C1, + 0x30C3, 0x30DC, 0x30DE, 0x30D0, 0x30D2, 0x30ED, 0x30E3, 0x30F4, 0x300D, + 0x3003, 0x301C, 0x302D, 0x3021, 0x3023, 0x303C, 0x303E, 0x3030, 0x3032, + 0x3034, 0x304F, 0x3041, 0x3043, 0x31C2, 0x31C4, 0x31D3, 0x31E4, 0x31FD, + 0x31F3, 0x310C, 0x3102, 0x3104, 0x311D, 0x3113, 0x312E, 0x3124, 0x313D, + 0x313F, 0x3131, 0x3133, 0x314C, 0x3140, 0x32CD, 0x32DC, 0x32DE, 0x32D0, + 0x32D2, 0x32D4, 0x32E3, 0x320D, 0x3203, 0x3212, 0x3214, 0x322D, 0x3223, + 0x323E, 0x3230, 0x3234, 0x324D, 0x3241, 0x3243, 0x33CC, 0x33DD, 0x33DF, + 0x33D1, 0x33D3, 0x33EE, 0x33E2, 0x33E4, 0x33F3, 0x330C, 0x330E, 0x3302, + 0x3304, 0x331D, 0x3313, 0x3320, 0x333D, 0x333F, 0x3340, 0x34CD, 0x34C3, + 0x34D4, 0x34FC, 0x34F4, 0x3403, 0x341C, 0x3414, 0x342D, 0x3423, 0x3434, + 0x344D, 0x344F, 0x3441, 0x4CCC, 0x4CCE, 0x4CC0, 0x4CC2, 0x4CC4, 0x4CDD, + 0x4CD1, 0x4CD3, 0x4CEC, 0x4CEE, 0x4CE2, 0x4CE4, 0x4CFD, 0x4CF3, 0x4C0C, + 0x4C02, 0x4C04, 0x4C1D, 0x4C13, 0x4C2C, 0x4C2E, 0x4C22, 0x4C3F, 0x4C31, + 0x4C4C, 0x4C4E, 0x4C40, 0x4C42, 0x4C44, 0x4DC3, 0x4DDC, 0x4DD4, 0x4DED, + 0x4DE3, 0x4DFC, 0x4DF4, 0x4D0D, 0x4D03, 0x4D1C, 0x4D14, 0x4D2D, 0x4D3C, + 0x4D30, 0x4D34, 0x4D4D, 0x4D41, 0x4D43, 0x4ECC, 0x4EC4, 0x4EDD, 0x4ED3, + 0x4EEC, 0x4EF3, 0x4E0C, 0x4E1D, 0x4E13, 0x4E2C, 0x4E24, 0x4E33, 0x4E40, + 0x4E44, 0x4FC3, 0x4FDC, 0x4FD4, 0x4FED, 0x4FE3, 0x4FFC, 0x4FF4, 0x4F0D, + 0x4F1C, 0x4F14, 0x4F2D, 0x4F23, 0x4F3C, 0x4F34, 0x4F4D, 0x4F4F, 0x4F43, + 0x40CC, 0x40C2, 0x40C4, 0x40DD, 0x40D3, 0x40EC, 0x40E2, 0x40E4, 0x40FD, + 0x40F3, 0x400C, 0x4002, 0x4004, 0x401D, 0x4013, 0x402C, 0x4024, 0x403D, + 0x4033, 0x404C, 0x404E, 0x4042, 0x4044, 0x41CD, 0x41CF, 0x41C1, 0x41C3, + 0x41DC, 0x41D2, 0x41D4, 0x41ED, 0x41E3, 0x41FC, 0x41F4, 0x410D, 0x4103, + 0x411C, 0x4114, 0x412D, 0x4123, 0x4132, 0x4134, 0x414D, 0x4141, 0x4143, + 0x42CC, 0x42CE, 0x42C2, 0x42C4, 0x42DD, 0x42EC, 0x42FD, 0x42F3, 0x420C, + 0x4204, 0x421D, 0x422C, 0x4224, 0x423D, 0x4233, 0x424C, 0x424E, 0x4240, + 0x4242, 0x4244, 0x43C3, 0x43DC, 0x43D2, 0x43D4, 0x43E3, 0x43FC, 0x43F4, + 0x430D, 0x4303, 0x431C, 0x4314, 0x433C, 0x433E, 0x4330, 0x4334, 0x434D, + 0x434F, 0x4341, 0x4343, 0x44CC, 0x44CE, 0x44C0, 0x44C4, 0x44DD, 0x44EC, + 0x44E4, 0x44F3, 0x440C, 0x4404, 0x4413, 0x442C, 0x4422, 0x4424, 0x443D, + 0x444C, 0x444E, 0xCCCC, 0x4440, 0x4444, 0xCC0E, 0xCC40, 0xCDC3, 0xCDD2, + 0xCDED, 0xCDF2, 0xCD12, 0xCD32, 0xCD43, 0xCEDD, 0xCEE4, 0xCE4E, 0xCFDE, + 0xCF14, 0xCF2D, 0xCF23, 0xCF3E, 0xC0DD, 0xC0DF, 0xC0FD, 0xC01D, 0xC02E, + 0xC04C, 0xC1CD, 0xC1C1, 0xC1DE, 0xC103, 0xC141, 0xC2DD, 0xC2F3, 0xC222, + 0xC242, 0xC244, 0xC3CF, 0xC3C1, 0xC3DE, 0xC3D0, 0xC3FC, 0xC31E, 0xC323, + 0xC343, 0xC4DD, 0xC4D1, 0xC4E4, 0xC40C, 0xC422, 0xC44E, 0xDCCD, 0xDCC3, + 0xDCD4, 0xDC1E, 0xDC2D, 0xDC23, 0xDC32, 0xDC4D, 0xDDC0, 0xDDC2, 0xDDDF, + 0xDDEC, 0xDDE0, 0xDD02, 0xDD04, 0xDD2C, 0xDD2E, 0xDD20, 0xDD22, 0xDD4E, + 0xDEDE, 0xDED4, 0xDEFE, 0xDE34, 0xDFCE, 0xDFDF, 0xDFEE, 0xDFE4, 0xDF0E, + 0xDF13, 0xDF2C, 0xDF22, 0xD0C1, 0xD0DE, 0xD0E3, 0xD0F2, 0xD01C, 0xD01E, + 0xD02F, 0xD021, 0xD03E, 0xD043, 0xD1CC, 0xD1C0, 0xD104, 0xD2DC, 0xD2E3, + 0xD2FC, 0xD2F4, 0xD22D, 0xD23E, 0xD3C0, 0xD3C2, 0xD3C4, 0xD3EC, 0xD3E0, + 0xD3F1, 0xD322, 0xD4C1, 0xD4C3, 0xD4E3, 0xD443, 0xECFD, 0xEC0E, 0xEC13, + 0xEC24, 0xEDCF, 0xED0F, 0xED21, 0xED30, 0xEEDF, 0xEEEC, 0xEEF3, 0xEE0C, + 0xEFED, 0xEFE3, 0xEFF2, 0xEF14, 0xEF23, 0xEF3E, 0xE0CE, 0xE0C4, 0xE0E2, + 0xE013, 0xE02C, 0xE02E, 0xE03F, 0xE031, 0xE04E, 0xE1E3, 0xE1FC, 0xE130, + 0xE134, 0xE2CC, 0xE2DF, 0xE2D1, 0xE2EE, 0xE20C, 0xE202, 0xE21D, 0xE24C, + 0xE3DE, 0xE3EF, 0xE3FC, 0xE31C, 0xE330, 0xE34D, 0xE413, 0xFCCD, 0xFCF4, + 0xFC0D, 0xFC03, 0xFC34, 0xFC4D, 0xFDDD, 0xFD2E, 0xFD31, 0xFD44, 0xFE0D, + 0xFE3E, 0xFE32, 0xFF44, 0xF2DE, 0xF2D0, 0xF3D3, 0xF30C, 0xF30E, 0xF304, + 0xF322, 0xF34C, 0xF344, 0xF40D, 0xF403, 0xF42D, 0xF43C, 0xF44D, 0x0CCC, + 0x0CD3, 0x0CFD, 0x0C0C, 0x0C1D, 0x0C4C, 0x0C4E, 0x0DCD, 0x0DDE, 0x0DD0, + 0x0DEF, 0x0DF2, 0x0D4D, 0x0EDD, 0x0E33, 0x02DD, 0x02D3, 0x02FD, 0x0202, + 0x023F, 0x0244, 0x03C3, 0x030D, 0x0312, 0x0314, 0x0343, 0x04EC, 0x040C, + 0x043D, 0x0442, 0x1CFC, 0x1C14, 0x1DD3, 0x1D0E, 0x1D02, 0x1D1D, 0x1D31, + 0x1EDE, 0x1E23, 0x1032, 0x1230, 0x13FF, 0x130E, 0x131D, 0x133F, 0x14DC, + 0x14E3, 0x14FC, 0x140D, 0x2CCE, 0x2CEC, 0x2DE3, 0x2DFC, 0x2ECC, 0x2EC4, + 0x2ED1, 0x2E22, 0x2FDE, 0x2FF4, 0x2F2D, 0x2F3E, 0x20FD, 0x2040, 0x21C3, + 0x21DE, 0x21FC, 0x210D, 0x2134, 0x22E4, 0x220C, 0x2204, 0x2213, 0x222E, + 0x2224, 0x23DC, 0x23DE, 0x23D0, 0x23D4, 0x23EF, 0x23FE, 0x2303, 0x231E, + 0x2312, 0x2330, 0x24DD, 0x24E4, 0x24FD, 0x2433, 0x3C03, 0x3C1C, 0x3C12, + 0x3C14, 0x3C23, 0x3C4D, 0x3D13, 0x3D22, 0x3D3D, 0x3D33, 0x3D42, 0x3EDE, + 0x3EE3, 0x3E12, 0x3E3C, 0x3E34, 0x3E41, 0x3FCC, 0x3FCE, 0x3FC2, 0x3FDF, + 0x3FD3, 0x3FF3, 0x3F0E, 0x3F02, 0x3F20, 0x30D4, 0x30EF, 0x30FC, 0x30FE, + 0x30F2, 0x301E, 0x3014, 0x304D, 0x31DD, 0x31DF, 0x31D1, 0x31EC, 0x31E2, + 0x310E, 0x312C, 0x3144, 0x32EF, 0x32E1, 0x32F2, 0x321C, 0x323C, 0x3232, + 0x33CE, 0x33C4, 0x33EC, 0x33FD, 0x33F1, 0x3300, 0x331F, 0x332C, 0x3322, + 0x3324, 0x334C, 0x334E, 0x34ED, 0x34F2, 0x340D, 0x343C, 0x3430, 0x4C24, + 0x4C3D, 0x4C33, 0x4DFE, 0x4D12, 0x4D23, 0x4ECE, 0x4EE4, 0x4EFD, 0x4E02, + 0x4E04, 0x4E4C, 0x4E4E, 0x4E42, 0x4FCF, 0x4F03, 0x4F3E, 0x4F32, 0x4F41, + 0x40CE, 0x40C0, 0x400E, 0x4031, 0x413C, 0x413E, 0x4130, 0x42D3, 0x420E, + 0x4213, 0x4231, 0x43ED, 0x431E, 0x4312, 0x44C2, 0x44E2, 0x440E, 0x441D, + 0x442E, 0xCCEE, 0xCC22, 0xCDD0, 0xCDFE, 0xCD3E, 0xCE0E, 0xCF12, 0xC1FE, + 0xC13E, 0xC2E2, 0xC3E3, 0xC332, 0xC4D3, 0xC43F, 0xC440, 0xDCD0, 0xDCFE, + 0xDDCC, 0xDDDD, 0xDDF1, 0xDD11, 0xDECF, 0xDEE1, 0xDE21, 0xDF42, 0xD1CE, + 0xD1C2, 0xD1EC, 0xD12C, 0xD2EF, 0xD214, 0xD22F, 0xD221, 0xD342, 0xD41E, + 0xED01, 0xED3C, 0xED34, 0xED4D, 0xED43, 0xEEE2, 0xEE13, 0xEE31, 0xEFDC, + 0xEFD4, 0xEFF4, 0xE0EC, 0xE00C, 0xE024, 0xE04C, 0xE1C3, 0xE114, 0xE12D, + 0xE14D, 0xE14F, 0xE2CE, 0xE2C0, 0xE204, 0xE213, 0xE222, 0xE224, 0xE3D4, + 0xE30F, 0xE32F, 0xE4DD, 0xE4D3, 0xE4EE, 0xE40E, 0xE42C, 0xE44E, 0xFCCF, + 0xFCDC, 0xFCFE, 0xFD02, 0xFD42, 0xFEE3, 0xFE2D, 0xF0DE, 0xF0D0, 0xF04D, + 0xF131, 0xF2ED, 0xF23E, 0xF32C, 0x0CEE, 0x0D2D, 0x0D21, 0x0D32, 0x03EF, + 0x0431, 0x0440, 0x1CDE, 0x1CED, 0x1C03, 0x1DDD, 0x1DE2, 0x1D1F, 0x1D20, + 0x1EDC, 0x1E30, 0x1FDD, 0x1F3D, 0x1232, 0x132E, 0x1333, 0x2CD3, 0x2C3D, + 0x2C31, 0x2C42, 0x2DDC, 0x2D01, 0x2EDF, 0x2EE4, 0x2EF3, 0x2E24, 0x2FE3, + 0x2F12, 0x2F34, 0x20CE, 0x20D1, 0x20EC, 0x20F3, 0x200C, 0x2002, 0x2004, + 0x21CD, 0x21D0, 0x211C, 0x2114, 0x2123, 0x2233, 0x2244, 0x23FC, 0x230F, + 0x2301, 0x231C, 0x234F, 0x24D3, 0x242C, 0x2444, 0x3CFE, 0x3C3E, 0x3C41, + 0x3DFF, 0x3D2C, 0x3D4E, 0x3EC1, 0x3EDC, 0x3E4F, 0x3F2C, 0x31CE, 0x31C0, + 0x31E0, 0x314E, 0x32FE, 0x322F, 0x33C2, 0x332E, 0x3333, 0x34CF, 0x34DC, + 0x34FE, 0x4C0E, 0x4E2E, 0x4E3D, 0x4FDE, 0x40D1, 0x42C0, 0xCC11, 0x422E, + 0x443F, 0xCDDE, 0xCE40, 0xC3EF, 0xDC30, 0xDE0F, 0xD4EF, 0xECEE, 0xEECE, + 0xEFC1, 0xE1CF, 0xE1F4, 0xE3CF, 0xE343, 0xFC4F, 0xFDC0, 0xFD24, 0xF0E3, + 0xF1D1, 0xF3C2, 0xF342, 0xF4D2, 0x0C02, 0x0DF0, 0x0D01, 0x0D2F, 0x0E44, + 0x0F32, 0x00DD, 0x01ED, 0x02CC, 0x03C1, 0x1CFE, 0x1C3E, 0x1DC4, 0x1DD1, + 0x1D4E, 0x13C2, 0x14D2, 0x1441, 0x2DF0, 0x2DF4, 0x2D34, 0x2E2E, 0x2FF2, + 0x2020, 0x212F, 0x2332, 0x24EE, 0x3E01, 0x3FC0, 0x31EE, 0x311F, 0x4C11, + 0x4EE2, 0x41D0, 0x41FE, 0xCCF1, 0xDCEF, 0xDC4F, 0xDFFF, 0xEE20, 0xEF4F, + 0xE020, 0xE12F, 0xFEF4, 0xF1F3, 0xF2F2, 0xF4CF, 0xF441, 0x0DCF, 0x0ECE, + 0x0E0C, 0x02E2, 0x03DC, 0x12DC, 0x142F, 0x2E11, 0x2FEF, 0x22F1, 0x24DF, + 0x2431, 0x3EF0, 0x3001, 0x32F0, 0x4DEF, 0x4FE1, 0xC10F, 0xDC0F, 0xF0FE, + 0xDC2F, 0x0F03, 0x01D4, 0x0CE0, 0x0103, }; -static const uint16_t on2avc_cb13_syms[ON2AVC_CB13_CODES] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, - 0x000C, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, - 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, - 0x00FF, 0x0100, 0x0101, 0x0102, 0x0103, 0x0104, - 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x010A, - 0x010B, 0x010C, 0x01F4, 0x01F5, 0x01F6, 0x01F7, - 0x01F8, 0x01F9, 0x01FA, 0x01FB, 0x01FC, 0x01FD, - 0x01FE, 0x01FF, 0x0200, 0x0201, 0x0202, 0x0203, - 0x0204, 0x0205, 0x0206, 0x0207, 0x0208, 0x0209, - 0x020A, 0x020B, 0x020C, 0x02F4, 0x02F5, 0x02F6, - 0x02F7, 0x02F8, 0x02F9, 0x02FA, 0x02FB, 0x02FC, - 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302, - 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x0308, - 0x0309, 0x030A, 0x030B, 0x030C, 0x03F4, 0x03F5, - 0x03F6, 0x03F7, 0x03F8, 0x03F9, 0x03FA, 0x03FB, - 0x03FC, 0x03FD, 0x03FE, 0x03FF, 0x0400, 0x0401, - 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, - 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x04F4, - 0x04F5, 0x04F6, 0x04F7, 0x04F8, 0x04F9, 0x04FA, - 0x04FB, 0x04FC, 0x04FD, 0x04FE, 0x04FF, 0x0500, - 0x0501, 0x0502, 0x0503, 0x0504, 0x0505, 0x0506, - 0x0507, 0x0508, 0x0509, 0x050A, 0x050B, 0x050C, - 0x05F4, 0x05F5, 0x05F6, 0x05F7, 0x05F8, 0x05F9, - 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF, - 0x0600, 0x0601, 0x0602, 0x0603, 0x0604, 0x0605, - 0x0606, 0x0607, 0x0608, 0x0609, 0x060A, 0x060B, - 0x060C, 0x06F4, 0x06F5, 0x06F6, 0x06F7, 0x06F8, - 0x06F9, 0x06FA, 0x06FB, 0x06FC, 0x06FD, 0x06FE, - 0x06FF, 0x0700, 0x0701, 0x0702, 0x0703, 0x0704, - 0x0705, 0x0706, 0x0707, 0x0708, 0x0709, 0x070A, - 0x070B, 0x070C, 0x07F4, 0x07F5, 0x07F6, 0x07F7, - 0x07F8, 0x07F9, 0x07FA, 0x07FB, 0x07FC, 0x07FD, - 0x07FE, 0x07FF, 0x0800, 0x0801, 0x0802, 0x0803, - 0x0804, 0x0805, 0x0806, 0x0807, 0x0808, 0x0809, - 0x080A, 0x080B, 0x080C, 0x08F4, 0x08F5, 0x08F6, - 0x08F7, 0x08F8, 0x08F9, 0x08FA, 0x08FB, 0x08FC, - 0x08FD, 0x08FE, 0x08FF, 0x0900, 0x0901, 0x0902, - 0x0903, 0x0904, 0x0905, 0x0906, 0x0907, 0x0908, - 0x0909, 0x090A, 0x090B, 0x090C, 0x09F4, 0x09F5, - 0x09F6, 0x09F7, 0x09F8, 0x09F9, 0x09FA, 0x09FB, - 0x09FC, 0x09FD, 0x09FE, 0x09FF, 0x0A00, 0x0A01, - 0x0A02, 0x0A03, 0x0A04, 0x0A05, 0x0A06, 0x0A07, - 0x0A08, 0x0A09, 0x0A0A, 0x0A0B, 0x0A0C, 0x0AF4, - 0x0AF5, 0x0AF6, 0x0AF7, 0x0AF8, 0x0AF9, 0x0AFA, - 0x0AFB, 0x0AFC, 0x0AFD, 0x0AFE, 0x0AFF, 0x0B00, - 0x0B01, 0x0B02, 0x0B03, 0x0B04, 0x0B05, 0x0B06, - 0x0B07, 0x0B08, 0x0B09, 0x0B0A, 0x0B0B, 0x0B0C, - 0x0BF4, 0x0BF5, 0x0BF6, 0x0BF7, 0x0BF8, 0x0BF9, - 0x0BFA, 0x0BFB, 0x0BFC, 0x0BFD, 0x0BFE, 0x0BFF, - 0x0C00, 0x0C01, 0x0C02, 0x0C03, 0x0C04, 0x0C05, - 0x0C06, 0x0C07, 0x0C08, 0x0C09, 0x0C0A, 0x0C0B, - 0x0C0C, 0x0CF4, 0x0CF5, 0x0CF6, 0x0CF7, 0x0CF8, - 0x0CF9, 0x0CFA, 0x0CFB, 0x0CFC, 0x0CFD, 0x0CFE, - 0x0CFF, 0xF400, 0xF401, 0xF402, 0xF403, 0xF404, - 0xF405, 0xF406, 0xF407, 0xF408, 0xF409, 0xF40A, - 0xF40B, 0xF40C, 0xF4F4, 0xF4F5, 0xF4F6, 0xF4F7, - 0xF4F8, 0xF4F9, 0xF4FA, 0xF4FB, 0xF4FC, 0xF4FD, - 0xF4FE, 0xF4FF, 0xF500, 0xF501, 0xF502, 0xF503, - 0xF504, 0xF505, 0xF506, 0xF507, 0xF508, 0xF509, - 0xF50A, 0xF50B, 0xF50C, 0xF5F4, 0xF5F5, 0xF5F6, - 0xF5F7, 0xF5F8, 0xF5F9, 0xF5FA, 0xF5FB, 0xF5FC, - 0xF5FD, 0xF5FE, 0xF5FF, 0xF600, 0xF601, 0xF602, - 0xF603, 0xF604, 0xF605, 0xF606, 0xF607, 0xF608, - 0xF609, 0xF60A, 0xF60B, 0xF60C, 0xF6F4, 0xF6F5, - 0xF6F6, 0xF6F7, 0xF6F8, 0xF6F9, 0xF6FA, 0xF6FB, - 0xF6FC, 0xF6FD, 0xF6FE, 0xF6FF, 0xF700, 0xF701, - 0xF702, 0xF703, 0xF704, 0xF705, 0xF706, 0xF707, - 0xF708, 0xF709, 0xF70A, 0xF70B, 0xF70C, 0xF7F4, - 0xF7F5, 0xF7F6, 0xF7F7, 0xF7F8, 0xF7F9, 0xF7FA, - 0xF7FB, 0xF7FC, 0xF7FD, 0xF7FE, 0xF7FF, 0xF800, - 0xF801, 0xF802, 0xF803, 0xF804, 0xF805, 0xF806, - 0xF807, 0xF808, 0xF809, 0xF80A, 0xF80B, 0xF80C, - 0xF8F4, 0xF8F5, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9, - 0xF8FA, 0xF8FB, 0xF8FC, 0xF8FD, 0xF8FE, 0xF8FF, - 0xF900, 0xF901, 0xF902, 0xF903, 0xF904, 0xF905, - 0xF906, 0xF907, 0xF908, 0xF909, 0xF90A, 0xF90B, - 0xF90C, 0xF9F4, 0xF9F5, 0xF9F6, 0xF9F7, 0xF9F8, - 0xF9F9, 0xF9FA, 0xF9FB, 0xF9FC, 0xF9FD, 0xF9FE, - 0xF9FF, 0xFA00, 0xFA01, 0xFA02, 0xFA03, 0xFA04, - 0xFA05, 0xFA06, 0xFA07, 0xFA08, 0xFA09, 0xFA0A, - 0xFA0B, 0xFA0C, 0xFAF4, 0xFAF5, 0xFAF6, 0xFAF7, - 0xFAF8, 0xFAF9, 0xFAFA, 0xFAFB, 0xFAFC, 0xFAFD, - 0xFAFE, 0xFAFF, 0xFB00, 0xFB01, 0xFB02, 0xFB03, - 0xFB04, 0xFB05, 0xFB06, 0xFB07, 0xFB08, 0xFB09, - 0xFB0A, 0xFB0B, 0xFB0C, 0xFBF4, 0xFBF5, 0xFBF6, - 0xFBF7, 0xFBF8, 0xFBF9, 0xFBFA, 0xFBFB, 0xFBFC, - 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, 0xFC01, 0xFC02, - 0xFC03, 0xFC04, 0xFC05, 0xFC06, 0xFC07, 0xFC08, - 0xFC09, 0xFC0A, 0xFC0B, 0xFC0C, 0xFCF4, 0xFCF5, - 0xFCF6, 0xFCF7, 0xFCF8, 0xFCF9, 0xFCFA, 0xFCFB, - 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF, 0xFD00, 0xFD01, - 0xFD02, 0xFD03, 0xFD04, 0xFD05, 0xFD06, 0xFD07, - 0xFD08, 0xFD09, 0xFD0A, 0xFD0B, 0xFD0C, 0xFDF4, - 0xFDF5, 0xFDF6, 0xFDF7, 0xFDF8, 0xFDF9, 0xFDFA, - 0xFDFB, 0xFDFC, 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, - 0xFE01, 0xFE02, 0xFE03, 0xFE04, 0xFE05, 0xFE06, - 0xFE07, 0xFE08, 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, - 0xFEF4, 0xFEF5, 0xFEF6, 0xFEF7, 0xFEF8, 0xFEF9, - 0xFEFA, 0xFEFB, 0xFEFC, 0xFEFD, 0xFEFE, 0xFEFF, - 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05, - 0xFF06, 0xFF07, 0xFF08, 0xFF09, 0xFF0A, 0xFF0B, - 0xFF0C, 0xFFF4, 0xFFF5, 0xFFF6, 0xFFF7, 0xFFF8, - 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE, - 0xFFFF, +static const uint16_t on2avc_cb_8_syms[ON2AVC_CB_7_8_CODES] = { + 0x0E24, 0x0E3D, 0x0FDC, 0x0FFC, 0x0F3E, 0x0134, 0x02CC, 0x024C, 0x03D0, + 0x030F, 0x04CE, 0x04F3, 0x1C41, 0x1D1D, 0x1D20, 0x1D33, 0x1E03, 0x10D0, + 0x10D2, 0x102D, 0x103E, 0x1030, 0x11D3, 0x12D0, 0x13F3, 0x134E, 0x144D, + 0x2DDC, 0x2DE3, 0x2DFC, 0x2D2D, 0x2D23, 0x2D32, 0x2EC0, 0x2E31, 0x21E3, + 0x223D, 0x23D0, 0x2323, 0x2330, 0x24FD, 0x3DC0, 0x3EC3, 0x3EE3, 0x3FDD, + 0x30C1, 0x30DE, 0x31CC, 0x3102, 0x324D, 0x331D, 0x333F, 0x334E, 0x34CF, + 0x4CE0, 0x4C11, 0x4C20, 0x4C3F, 0x4F23, 0x422C, 0xCCE2, 0x423F, 0x4233, + 0xCE1D, 0xCF30, 0xC1E3, 0xC3EF, 0xDCE3, 0xDC23, 0xDEF4, 0xDE10, 0xDF0E, + 0xDF02, 0xD2F2, 0xD212, 0xD4EF, 0xECCC, 0xED12, 0xED41, 0xEF34, 0xE0CE, + 0xE0E0, 0xE1CD, 0xE3F0, 0xE33C, 0xFFD3, 0xF1F3, 0xF2ED, 0xF23C, 0xF243, + 0xF30E, 0x0DEF, 0x0FDE, 0x00EC, 0x1D22, 0x1E3E, 0x1F31, 0x10CD, 0x100D, + 0x122D, 0x13EC, 0x13E4, 0x2CD3, 0x2DFE, 0x2F03, 0x20DF, 0x20F3, 0x2004, + 0x21D2, 0x214D, 0x23DC, 0x23FE, 0x23F0, 0x23F2, 0x2312, 0x2444, 0x32ED, + 0x331F, 0x332E, 0x3412, 0x3423, 0x4D1E, 0x4FED, 0xC222, 0x442E, 0x443F, + 0xEF14, 0xF11D, 0x0C3F, 0x020E, 0x0200, 0x2FC1, 0x20E0, 0x20E2, 0x232F, + 0x32FE, 0x4E22, 0x422E, 0x0F21, 0x1C21, 0x1EC1, 0x2EF1, 0x2F41, 0x2011, + 0x4002, 0x4121, 0xFF0E, 0x0E1F, 0x0042, 0x1E0F, 0x1F20, 0xFC0F, 0x1120, + 0x2C2E, 0xFF11, 0x41F2, 0xECCE, 0xECE2, 0xEDF2, 0xEE20, 0xEF41, 0xFD42, + 0x0C2E, 0x0E2E, 0x1F1D, 0x1113, 0x2E0E, 0x2E02, 0x2E20, 0x2422, 0xC1F2, + 0xE1F2, 0xF0EF, 0xF2F0, 0xF201, 0x0FE1, 0x2F0F, 0x2F1E, 0xFFE4, 0x0CF1, + 0x0C20, 0x0F2F, 0xF11F, 0x1EF2, 0x11E2, 0x21EF, 0x212F, 0x11FF, 0xCCCE, + 0x4422, 0xCCFF, 0xC022, 0xC10D, 0xC213, 0xDDE0, 0xDDE2, 0xDE21, 0xDFCE, + 0xDF13, 0xDF24, 0xD012, 0xD1EC, 0xD12E, 0xD2EF, 0xD210, 0xD221, 0xD243, + 0xED0F, 0xEECC, 0xEEDF, 0xEF03, 0xE1DE, 0xE12D, 0xE2DF, 0xE23D, 0xE3F2, + 0xE34F, 0xE41D, 0xFCC1, 0xFC41, 0xFFD1, 0xF0E3, 0xF03E, 0xF23E, 0xF33F, + 0x0D1C, 0x0ECC, 0x0E13, 0x0FE3, 0x0013, 0x003F, 0x1DE0, 0x1E32, 0x10C3, + 0x1144, 0x1223, 0x1423, 0x2C1D, 0x2D1E, 0x2D12, 0x2D3E, 0x2FCD, 0x201D, + 0x3CF2, 0x3E01, 0x3F20, 0x3122, 0x3243, 0x330E, 0x3430, 0x4F30, 0x401D, + 0x42DD, 0xCF32, 0xC202, 0xDDCC, 0xDF11, 0xEEC0, 0xE0E2, 0xE2EE, 0xE20E, + 0x0143, 0x30FC, 0x4E02, 0x43FE, 0xCF21, 0xC12F, 0xC2E0, 0xEE1F, 0xEFEF, + 0xEFF2, 0xE0F1, 0xE2FF, 0xE41F, 0xFEE1, 0x0C11, 0x012F, 0x11EE, 0x110C, + 0x1FF1, 0x0110, 0x2121, 0x24E0, 0xFE0F, 0x00CE, 0x02FF, 0x0211, 0x210F, + 0x112E, 0x2E1F, 0xF2CF, 0x2E11, 0xC0EE, 0xDC0F, 0x01F0, 0xDE23, 0xD1FF, + 0xEFF4, 0xE020, 0xE024, 0xE1CF, 0xE141, 0xE2E0, 0xF032, 0xF4DE, 0x02E0, + 0x1131, 0x131F, 0x1342, 0x2EEE, 0x2E22, 0x2E24, 0x2002, 0x202C, 0x2022, + 0x2042, 0x2242, 0x2332, 0x3221, 0xF0E1, 0x4EE0, 0x42EE, 0xF1E0, 0xF2F2, + 0x1E1C, 0x1201, 0xF012, 0x00FF, 0xF02F, 0x0F1E, 0x12FE, 0x1212, 0x4E00, + 0x0F01, 0x2EE2, 0x2F14, 0x011C, 0xCC02, 0xCC13, 0xCC22, 0xCC31, 0xCDCD, + 0xCDDC, 0xCDD2, 0xCE3D, 0xCE42, 0xCF03, 0xC0F3, 0xC2C2, 0xC2D3, 0xC2FD, + 0xC303, 0xDC03, 0xDC41, 0xDD22, 0xDD4E, 0xDECF, 0xDED4, 0xDE0D, 0xDE3C, + 0xDFD1, 0xDF04, 0xDF3F, 0xDF33, 0xDF40, 0xD0CF, 0xD0D2, 0xD0F4, 0xD032, + 0xD1DF, 0xD214, 0xD223, 0xD3C4, 0xD3D3, 0xD3E0, 0xD3F1, 0xD3F3, 0xD324, + 0xD403, 0xED3E, 0xEFD0, 0xE03D, 0xE332, 0xE4CE, 0xE4C0, 0xFC0D, 0xFDC2, + 0xFF3D, 0xF1DD, 0xF14C, 0xF3D1, 0xF3FD, 0xF3F3, 0x0CC0, 0x0CE0, 0x0C42, + 0x0DED, 0x0D3E, 0x0E3F, 0x003D, 0x014D, 0x02EC, 0x03FC, 0x030D, 0x0334, + 0x04E4, 0x04FD, 0x041D, 0x0440, 0x1CCD, 0x1CD4, 0x1CF4, 0x1C1C, 0x1DD3, + 0x1D00, 0x1003, 0x113D, 0x1142, 0x13D1, 0x13D3, 0x1300, 0x14FC, 0x1414, + 0x143C, 0x143E, 0x2C2C, 0x2DDE, 0x2DEF, 0x2E1D, 0x2E44, 0x2F43, 0x203F, + 0x22CC, 0x3DDF, 0x3DF3, 0x3D04, 0x3D3D, 0x3D3F, 0x3D33, 0x3EF4, 0x3E03, + 0x3FC4, 0x3FF3, 0x3F2C, 0x301E, 0x31D1, 0x32D2, 0x32F4, 0x33CC, 0x33DF, + 0x33EC, 0x33E2, 0x34E3, 0x4CEE, 0x4CE2, 0x4C2E, 0x4D23, 0x4D4F, 0x4ECE, + 0x4E2C, 0x4E24, 0x4FFC, 0x4F41, 0x42C2, 0x4224, 0x43DC, 0x43FC, 0x4330, + 0x4343, 0xCD12, 0xCED1, 0xCEF3, 0xCFD0, 0xCFED, 0xCFE3, 0xC1D0, 0xC2F3, + 0xC312, 0xDCCF, 0xDD13, 0xDE3E, 0xDFEC, 0xDFEE, 0xD0F0, 0xD1E4, 0xD201, + 0xD31F, 0xD4D0, 0xD40F, 0xED43, 0xEEF3, 0xEE31, 0xEFC3, 0xEFD4, 0xE0C0, + 0xE0C2, 0xE0F3, 0xE031, 0xE033, 0xE04E, 0xE130, 0xE2EC, 0xE3FE, 0xE312, + 0xE321, 0xE4C2, 0xFCF4, 0xFC32, 0xFDCC, 0xFD20, 0xFE43, 0xFFDD, 0xF0D2, + 0xF13F, 0xF2D0, 0xF3E2, 0xF423, 0x0D2D, 0x0E1D, 0x00D1, 0x02D1, 0x02F3, + 0x03FE, 0x1DEE, 0x1D02, 0x1D11, 0x1D2C, 0x1EC3, 0x1E0D, 0x120D, 0x13E0, + 0x131D, 0x1344, 0x1443, 0x2CCE, 0x2DCD, 0x2DF0, 0x2ED3, 0x2F3C, 0x21DC, + 0x23F4, 0x3EC1, 0x3E3C, 0x31CE, 0x31DF, 0x31EC, 0x31E0, 0x31E4, 0x312E, + 0x32CF, 0x32F2, 0x3223, 0x3232, 0x3234, 0x4EDF, 0xDDCE, 0x4E33, 0x4F0D, + 0xDE12, 0xD42F, 0xECDF, 0xECD1, 0xEC31, 0xEDDC, 0xEE24, 0xEE42, 0xEFCD, + 0xEF23, 0xE0EE, 0xE132, 0xF113, 0xF432, 0x0CE2, 0x0ECE, 0x0FCD, 0x0224, + 0x03C1, 0x1FF3, 0x1F13, 0x10D4, 0x12E3, 0x13F1, 0x2CD1, 0x2C4E, 0x2EE4, + 0x2FDE, 0x20CE, 0x20C2, 0x200E, 0x224E, 0x31EE, 0x3210, 0xC121, 0x341E, + 0x402E, 0xE4E2, 0x01E1, 0x1E2F, 0x142F, 0xCE1F, 0x2F12, 0x4222, 0xC01F, + 0x4112, 0x4F12, 0xEEE0, 0xEF1E, 0xE112, 0xFEDC, 0xFE2F, 0xF2F4, 0xF412, + 0x112C, 0x1C10, 0x121E, 0x4FE1, 0xFFF1, 0x1124, 0x2222, 0xCCCC, 0x41E3, + 0x443D, 0xCCC0, 0xCCC2, 0xCDFE, 0xC020, 0xDEDC, 0xD2E1, 0xD4D2, 0xECEE, + 0xEE13, 0xEE2E, 0xE00E, 0xE13C, 0xE3C1, 0xE42E, 0xFFF3, 0xFF3F, 0xF2D4, + 0xF3C0, 0x0E02, 0x002E, 0x0204, 0x04D1, 0x1CDE, 0x1DC0, 0x1DF1, 0x1ECD, + 0x1ED2, 0x12C3, 0x2C0E, 0x2EEC, 0x2134, 0x22E0, 0x22FD, 0x3F1F, 0x4D0F, + 0x430F, 0xD401, 0xEFC1, 0xE022, 0xE4E0, 0xF140, 0xF22F, 0xF24F, 0x1FC0, + 0x241F, 0x41EF, 0x1C2F, 0x4D10, 0x0011, 0xC1E1, 0x42E0, 0xDC10, 0xFF00, + 0xE4FF, 0xFC01, 0xFFCE, 0x0141, 0x0240, 0x1EFC, 0x1FCE, 0x211E, 0xF0C1, + 0xF100, 0xF111, 0x1FFF, 0x0F12, 0x24FF, 0xCCF1, 0xCEFD, 0xC01D, 0xC123, + 0x10FE, 0x1012, 0x11F1, 0xC132, 0xC2DF, 0xC3D2, 0xC33E, 0xDCDC, 0xDD11, + 0xDEC1, 0xDE2F, 0xDF2C, 0xDF42, 0xD0EF, 0xD1EE, 0xD122, 0xD131, 0xD24D, + 0xEC1D, 0xEDC1, 0xED23, 0xED3C, 0xEEFD, 0xE00C, 0xE1DC, 0xE1ED, 0xE204, + 0xE3D2, 0xE31E, 0xE32F, 0xE334, 0xFC23, 0xFC4F, 0xFDE0, 0xFDF3, 0xFD2E, + 0xFD24, 0xFEC3, 0xFED0, 0xFE03, 0xF00D, 0xF02D, 0xF24D, 0xF311, 0xF4C1, + 0xF42D, 0x0DCD, 0x0DE1, 0x0D10, 0x0D4D, 0x0FD0, 0x0F23, 0x00DF, 0x00FD, + 0x00F3, 0x01DE, 0x01E3, 0x022C, 0x031C, 0x031E, 0x0310, 0x1CED, 0x1DC2, + 0x1DEC, 0x1DE4, 0x1D04, 0x1D3F, 0x13C2, 0x130E, 0x132C, 0x1331, 0x1340, + 0x14C1, 0x14ED, 0x2C13, 0x2C3D, 0x2C33, 0x2D1C, 0x2D2F, 0x2EFD, 0x20DD, + 0x2040, 0x213C, 0x22DD, 0x2231, 0x2244, 0x23ED, 0x23EF, 0x2314, 0x234D, + 0x240E, 0x2413, 0x3C4D, 0x3DF1, 0x3ECD, 0x3E4F, 0x3E43, 0x30F2, 0x3021, + 0x31E2, 0x3140, 0x33E0, 0x4C22, 0x4D30, 0x4E1D, 0x4F32, 0x40DF, 0x40FD, + 0x4130, 0x42DF, 0x42FD, 0xCE22, 0xDC21, 0xDEF0, 0xEDDE, 0xEDE1, 0xE402, + 0xFEDE, 0xFE14, 0xF133, 0x0D4F, 0x0233, 0x0431, 0x1034, 0x14D2, 0x2EE0, + 0x20EC, 0x22EC, 0x234F, 0x3CFE, 0x3C1E, 0x31FF, 0x321E, 0xCF2F, 0x34F2, + 0x4312, 0xFE1C, 0xF2E1, 0x0E42, 0x0FCF, 0x02CE, 0x1E21, 0x1FE4, 0x2C11, + 0xEEEE, 0x214F, 0x2343, 0xEF10, 0xE4F1, 0x0FF4, 0x1E41, 0x4E1F, 0x1F1F, + 0xEF2F, 0x4444, 0x4323, 0xCC1D, 0xCC4C, 0xCC42, 0xCDD4, 0xE21F, 0xE211, + 0xFE41, 0xFF2E, 0xF21C, 0x1E12, 0xEF01, 0x1FE2, 0x12EF, 0x01FC, 0x1F42, + 0xF1F1, 0x14E1, 0x21FE, 0x2C20, 0xC0E2, 0xC22E, 0xC21F, 0xFFEE, 0x4011, + 0xCE00, 0x1FEC, 0xDE4F, 0xEE0E, 0xEFDC, 0xE0E4, 0xF1FF, 0xE200, 0xE224, + 0xE23F, 0xE4DF, 0xFD02, 0xFE3C, 0xF3FF, 0x0CDF, 0x0123, 0x02E2, 0x043F, + 0x1C30, 0x1DCE, 0x1EDE, 0x1E2D, 0x1FFD, 0x2ED1, 0x2E13, 0x2E42, 0x2FE3, + 0x2143, 0x2233, 0x2321, 0x3ECF, 0x3F11, 0x322F, 0x3322, 0x3344, 0xEC11, + 0x4013, 0x43E1, 0xEF1C, 0xE11C, 0xE4D1, 0xFF04, 0xFF42, 0x00E0, 0x1E14, + 0x11CE, 0xC211, 0x2EFF, 0x21CF, 0x0411, 0x2C1F, 0xFEC1, 0xF2C1, 0x1FE0, + 0x4FF2, 0xE1E1, 0xFC1E, 0xFEFE, 0xFFE2, 0x02C0, 0x1C12, 0x1E1E, 0x1234, + 0x14FE, 0x2114, 0x2334, 0x3CEF, 0x4200, 0x0F10, 0x3C10, 0x432F, 0x2FF0, + 0xC3F0, 0x0FEF, 0x0F41, 0xC0FF, 0xC0F1, 0x11E4, 0x4F21, 0xFF1F, 0xCD4D, + 0xCD43, 0xCECE, 0xCEC2, 0xCEEC, 0xCEE4, 0xCF4D, 0xC0C2, 0xC0D3, 0xC1C3, + 0xC143, 0xC2CE, 0xC2DD, 0xC2E4, 0xC24C, 0xC3CF, 0xC3DC, 0xC3D4, 0xC310, + 0xC334, 0xC4C2, 0xC4DD, 0xC41D, 0xC41F, 0xC431, 0xC44C, 0xDCC1, 0xDCC3, + 0xDC14, 0xDDD1, 0xDFC4, 0xD0CD, 0xD0DE, 0xD0FC, 0xD234, 0xD302, 0xD31D, + 0xD313, 0xD344, 0xD443, 0xEE4C, 0xE0C4, 0xE3DE, 0xE3F4, 0xE30D, 0xE4DD, + 0xE44C, 0xFCD4, 0xFC1C, 0xFC14, 0xFC34, 0xFD33, 0xF144, 0xF2CD, 0xF4FC, + 0x0CC4, 0x0CDD, 0x0CFD, 0x0C24, 0x0C4C, 0x00E4, 0x0044, 0x020C, 0x03F4, + 0x0303, 0x0323, 0x044E, 0x1CDC, 0x1D0E, 0x1D44, 0x134C, 0x14D4, 0x2CC4, + 0x2D34, 0x20CC, 0x2033, 0x24C2, 0x24C4, 0x240C, 0x3CC3, 0x3C1C, 0x3C34, + 0x3DC2, 0x3DDD, 0x3DD3, 0x3D0E, 0x3E32, 0x3E34, 0x3F33, 0x3F40, 0x30D0, + 0x303E, 0x31D3, 0x313D, 0x3203, 0x321C, 0x34DC, 0x34FC, 0x340D, 0x341C, + 0x4CCE, 0x4CC4, 0x4CF3, 0x4C2C, 0x4D3C, 0x4D4D, 0x4D43, 0x4E0C, 0x4E04, + 0x4E4E, 0x40CC, 0x40C0, 0x41CD, 0x414D, 0x4204, 0x43CF, 0x43C3, 0x4303, + 0x4334, 0x44CE, 0xCC2E, 0x44DD, 0x44D3, 0xCDCF, 0xCDD0, 0xCE44, 0xCFDC, + 0xC134, 0xC22C, 0xC23D, 0xC23F, 0xC24E, 0xC3DE, 0xC30D, 0xC323, 0xC332, + 0xC341, 0xC4C4, 0xC4D3, 0xDD33, 0xDD40, 0xDEE3, 0xDEFC, 0xDE03, 0xDFDF, + 0xDFFD, 0xDFF3, 0xDF1D, 0xDF44, 0xD0F2, 0xD02D, 0xD03C, 0xD03E, 0xD034, + 0xD04F, 0xD043, 0xD1CE, 0xD1DD, 0xD1D1, 0xD1FD, 0xD102, 0xD104, 0xD133, + 0xD144, 0xD2DC, 0xD2D0, 0xD20D, 0xD320, 0xD33F, 0xD4DE, 0xD4ED, 0xD4FC, + 0xD41C, 0xD423, 0xECE4, 0xEC42, 0xEEC4, 0xEED3, 0xE0DF, 0xE0D3, 0xE044, + 0xE240, 0xE330, 0xE4C4, 0xFC43, 0xFDFD, 0xF3CE, 0xF3DD, 0xF3D3, 0xF304, + 0xF33D, 0xF333, 0xF4ED, 0xF40D, 0xF403, 0x0CC2, 0x0C33, 0x0DC1, 0x0DDC, + 0x0DFC, 0x0D32, 0x01D2, 0x012D, 0x02D3, 0x02FD, 0x03CF, 0x03DE, 0x03E3, + 0x0314, 0x032D, 0x0332, 0x1DDF, 0x133F, 0x140D, 0x1434, 0x2CDD, 0x2CEC, + 0x2CE4, 0x2C24, 0x2DD0, 0x2D03, 0x2D3C, 0x2F30, 0x22C4, 0x23D2, 0x24D3, + 0x3CDE, 0x3CED, 0x3C14, 0x3C41, 0x3DD1, 0x3DEC, 0x3DE2, 0x3DE4, 0x3D0C, + 0x3D4C, 0x3E0D, 0x3E23, 0x3FE4, 0x3F13, 0x3F3F, 0x3F31, 0x30C3, 0x301C, + 0x3043, 0x3113, 0x313F, 0x3133, 0x322D, 0x33CE, 0x33D3, 0x333D, 0x343E, + 0x3434, 0x3441, 0x4C02, 0x4C13, 0x4C3D, 0x4C31, 0x4DD0, 0x4DD4, 0x4EEC, + 0x4FCD, 0x4033, 0x41C1, 0x41DC, 0x41FC, 0x4242, 0x43CD, 0x43D0, 0x44DF, + 0x44EC, 0x44FD, 0xCF23, 0xC1ED, 0xC130, 0xC14F, 0xC21D, 0xC32D, 0xC420, + 0xDCD0, 0xDC2D, 0xDEDE, 0xDE2D, 0xDF4E, 0xD0E1, 0xD021, 0xD11D, 0xD3FF, + 0xD342, 0xD4C3, 0xD412, 0xD44F, 0xEC24, 0xED10, 0xED21, 0xEED1, 0xEF0D, + 0xEF2D, 0xEF4D, 0xE042, 0xE1D2, 0xE2D3, 0xE3CF, 0xE3EF, 0xE343, 0xE4FD, + 0xE413, 0xFCED, 0xFC03, 0xFD00, 0xFD31, 0xFED2, 0xFE0D, 0xFE23, 0xF0D0, + 0xF203, 0xF230, 0xF3EC, 0xF3E4, 0xF300, 0xF320, 0xF344, 0x0DCF, 0x0DE3, + 0x0EFD, 0x0E31, 0x0F03, 0x0F30, 0x01D0, 0x03E1, 0x03F2, 0x0321, 0x1CC1, + 0x1C4F, 0x1DE2, 0x1DFF, 0x1DF3, 0x1D24, 0x1FCC, 0x1FD1, 0x1F3D, 0x1230, + 0x13DF, 0x130C, 0x1313, 0x1403, 0x144F, 0x2CC2, 0x2ECC, 0x2EDD, 0x2E3D, + 0x2FC3, 0x2FD0, 0x2FD4, 0x20D1, 0x20FD, 0x2031, 0x21DE, 0x21D4, 0x2204, + 0x223F, 0x23E3, 0x232D, 0x24DD, 0x24F3, 0x3CD2, 0x3C12, 0x3C21, 0x3D11, + 0x3EDC, 0x3EFE, 0x3E1E, 0x3E4D, 0x3FCE, 0x3FC2, 0x3F0E, 0x3F2E, 0x3F4E, + 0x30CF, 0x30E1, 0x30F4, 0x310E, 0x3100, 0x3124, 0x314E, 0x32D4, 0x324F, + 0x3241, 0x33FF, 0x3311, 0x3320, 0x4DF0, 0x4D2D, 0x4D32, 0x4FD0, 0x4FE3, + 0x403F, 0x41DE, 0xCCDD, 0xCD23, 0xC002, 0xC31E, 0xDCFE, 0xDCF2, 0xDC01, + 0xDF22, 0xD2CF, 0xD21E, 0xD4F2, 0xEDCF, 0xED14, 0xE1C3, 0xE2C0, 0xE20C, + 0xE244, 0xE4D3, 0xE422, 0xFCDE, 0xFED4, 0xFEED, 0xF023, 0xF03C, 0xF1C4, + 0xF3EE, 0x0C02, 0x02EE, 0x0244, 0x1C2D, 0x1E34, 0x10DC, 0x10E3, 0x12CD, + 0x13C0, 0x1311, 0x2DF2, 0x2D41, 0x2024, 0x22E4, 0x2202, 0x221D, 0x231E, + 0x3EF2, 0x31F1, 0x3214, 0x3333, 0x34EF, 0x4E3F, 0x40E0, 0x42D1, 0x43EF, + 0xEFCF, 0xE1FC, 0xFE1E, 0xF4F2, 0x0000, 0x1EDC, 0x1F04, 0x1412, 0x2F1C, + 0x21F4, 0x3C0F, 0x431E, 0xECFF, 0xFFC2, 0xF01C, 0x1FEE, 0x120F, 0x124F, + 0xC200, 0x1401, 0x20FF, 0x010F, 0xEC20, 0xF120, 0xC101, 0x114E, 0x221F, + 0x001F, 0x111F, 0x4FF0, 0xCDDE, 0x4431, 0x4213, 0x44F3, 0x4400, 0xCCC4, + 0xCCEC, 0xCEEE, 0xCF1E, 0xC0E0, 0xDCDE, 0xE2C2, 0xFF4E, 0xF20F, 0xF4FE, + 0x0F34, 0x1CFE, 0x1E4D, 0x12FC, 0x201F, 0x342F, 0xE420, 0xF0FE, 0x4E11, + 0x0E11, 0x1104, 0x4000, 0x21F0, 0x4E0E, 0xCCDF, 0xCD21, 0xEEF1, 0xFFEC, + 0x01FE, 0x2CE0, 0x20F1, 0x2110, 0xCFF0, 0xC02E, 0xC3FE, 0xC4F1, 0xDC12, + 0xDF20, 0xEC0E, 0xEDEF, 0xE21D, 0xE43F, 0xFDE2, 0xFD11, 0xFF31, 0xF0D4, + 0xF342, 0x0E0C, 0x0E22, 0x1C32, 0x1F3F, 0x12DC, 0x13CE, 0x132E, 0x2C31, + 0x2EDF, 0x2FED, 0x20E4, 0x21C3, 0x2123, 0x22CE, 0x23E1, 0x23FC, 0x241D, + 0x243F, 0x3EE1, 0x3E0F, 0x3FFF, 0x32E1, 0xCE02, 0x32F0, 0x4D3E, 0xC301, + 0xEDCD, 0xE2E2, 0xFECD, 0xFEFC, 0xF2EF, 0xF41E, 0x00EE, 0x022E, 0x041F, + 0x0420, 0x1CF2, 0x2E40, 0x2FFE, 0x2F2F, 0x2F4F, 0x21C1, 0x2200, 0x24E2, + 0x2420, 0xC10F, 0xF0CF, 0x3401, 0x4D2F, 0xF42F, 0x0FC1, 0x01CF, 0x4020, + 0x4442, 0xCCE0, 0xCC0E, 0xFF2C, 0xF0F2, 0xF01E, 0xF1C2, 0x0112, 0x1F0C, + 0x1F11, 0x10E1, 0x110E, 0x1100, 0x4F1E, 0x4F01, 0xC11E, 0xC220, 0xDCCD, + 0xEFFC, 0xF241, 0x0EE2, 0x0E2C, 0x024E, 0x121C, 0x2CEE, 0x2E2C, 0x2FCF, + 0xFCEF, 0x0FFE, 0x014F, 0x1F4E, 0x10F4, 0x1221, 0x1F00, 0x40F1, 0xFC21, + 0x24D1, 0xCDED, 0xCDE3, 0xCE33, 0xC0DF, 0x0F14, 0xC03D, 0xC3D0, 0xC330, + 0xC34F, 0xDDC2, 0xDD02, 0xDD24, 0xDE0F, 0xFC2F, 0x4101, 0xDFDD, 0xDFE4, + 0xDF00, 0xD00F, 0xD041, 0xD10C, 0xD10E, 0xD113, 0xD22F, 0xD3E4, 0xD32C, + 0xD322, 0xD43E, 0xECC0, 0xEDD4, 0xEDED, 0xEDFC, 0xED01, 0xE0FD, 0xE01D, + 0xE2DD, 0xE2F3, 0xE30F, 0xE43D, 0xE442, 0xFCE3, 0xFD0C, 0xFD0E, 0xFD1D, + 0xFE34, 0xFF33, 0xFF4C, 0xF3C4, 0xF322, 0xF44F, 0x0DDE, 0x0DFE, 0x0D1E, + 0x0D12, 0x0D14, 0x0EDF, 0x0E44, 0x002C, 0x010D, 0x021D, 0x03C3, 0x0413, + 0x1D0C, 0x1032, 0x1041, 0x1333, 0x142D, 0x2DCF, 0x2E3F, 0x2F0D, 0x2F32, + 0x21D0, 0x213E, 0x2130, 0x22DF, 0x230D, 0x2301, 0x233E, 0x242C, 0x3CD0, + 0x3C32, 0x3C4F, 0x3DCE, 0x3D1F, 0x3D20, 0x3D24, 0x3EDE, 0x3EFC, 0x3FDF, + 0x3FEC, 0x3FE0, 0x3F42, 0x30D2, 0x30FE, 0x3012, 0x302F, 0x304F, 0x3041, + 0x310C, 0x3131, 0x32DC, 0x32DE, 0x3201, 0x3230, 0x33EE, 0x3331, 0x342D, + 0x4CD1, 0x4C1F, 0x4DED, 0x4EDD, 0x4ED3, 0x4F03, 0x40EC, 0x40E2, 0x412D, + 0x4123, 0x42D3, 0x42F3, 0xCE13, 0xC1D2, 0xC231, 0xDEFE, 0xD2FE, 0xD24F, + 0xECF3, 0xEEE4, 0xEE2C, 0xEF3E, 0xE123, 0xE202, 0xE3E1, 0xFDFF, 0xFDF1, + 0xFE4D, 0xF0ED, 0xF1FD, 0xF22D, 0xF34E, 0x032F, 0x0341, 0x0402, 0x1EED, + 0x11DF, 0x111D, 0x13FF, 0x14DE, 0x1430, 0x1432, 0x2D14, 0x2E0C, 0x2E00, + 0x2E04, 0x2FDC, 0x2F4D, 0x212D, 0x24DF, 0x3FEE, 0x34FE, 0xCF12, 0x4DE1, + 0x4E31, 0xECE0, 0xEC2E, 0xE2CE, 0xFEF4, 0xF10C, 0x0022, 0x1C1E, 0x12E1, + 0x12F4, 0x1241, 0x2224, 0x242E, 0xEEFF, 0x4D01, 0x41FE, 0xF0FC, 0x011E, + 0x1410, 0x2211, 0xCF0F, 0x2400, 0x2411, 0xFFFF, 0xC2F1, 0xEC00, 0x01F2, + 0xF00F, 0x021F, 0x12F0, 0x0FF0, 0xCDEF, 0x4231, 0x44E2, 0xCCFD, 0xCC33, + 0xCEE0, 0xCEE2, 0xCE20, 0xEE02, 0xE2E4, 0xF041, 0xF212, 0x0F4D, 0x1EF4, + 0x1FC2, 0x141E, 0x2ECE, 0x22EE, 0x3CF0, 0xC1EF, 0x3C2F, 0x4321, 0xFE01, + 0xFF0C, 0x0F4F, 0x1F02, 0xC2FF, 0x2101, 0xE01F, 0x00F1, 0xF122, 0x0CFF, + 0x1F0E, 0x10EF, 0x10FC, 0x1102, 0x1122, 0x2F01, 0x412F, 0xCD1E, 0xCFDE, + 0xC00E, 0xC3F2, 0xF010, 0xDCD2, 0xDC1E, 0xDEEF, 0xDE01, 0xDE14, 0xDE34, + 0xD1E2, 0xD4FE, 0xECDD, 0xEC22, 0xEE0C, 0xEFED, 0xEF3C, 0xEF32, 0xE002, + 0xE1D4, 0xE1E3, 0xE143, 0xE231, 0xE4F3, 0xFDC0, 0xFD1F, 0xFF1D, 0xF003, + 0xF034, 0xF1DF, 0xF31F, 0x0EEC, 0x0E0E, 0x0202, 0x1CD2, 0x1D1F, 0x1EE3, + 0x1E43, 0x1FDD, 0x1023, 0x12D2, 0x1320, 0x22F3, 0x2402, 0x3CE1, 0x3EEF, + 0x3E41, 0x32EF, 0x320F, 0x4D12, 0x4ED1, 0x4EF3, 0xCDF2, 0x4FD2, 0x40F3, + 0xCD0F, 0xDCEF, 0xDC2F, 0xD410, 0xFECF, 0xFE21, 0xF04F, 0xF14E, 0x0020, + 0x01C3, 0x0242, 0x042E, 0x1E3C, 0x1F22, 0xEF12, 0x1043, 0x2C3F, 0xFF02, + 0xF0F4, 0xF1CE, 0xF102, 0x1001, 0xF124, 0x04FF, 0xE12F, 0x20EE, 0x43ED, + 0xCC4E, 0xCDFC, 0xCDF0, 0xCD0D, 0x1EF0, 0x1021, 0xE411, 0x2CF1, 0x4EF1, + 0x4F2F, 0xC112, 0xC3E1, 0xEE00, 0xEFE1, 0xE1EF, 0xE431, 0xF12E, 0x02C2, + 0x1EFE, 0x1232, 0x21F2, 0x2240, 0xCE11, 0x2431, 0x3421, 0xCFE1, 0xCFFE, + 0xF021, 0xF210, 0x2C00, 0x2FE1, 0xCF10, 0xF0F0, 0xCEF1, 0x400E, 0x3432, + 0xCD3E, 0xCD4F, 0xCED3, 0xCE0C, 0xCE4E, 0xCFFC, 0xCF1C, 0xCF4F, 0xCF01, + 0xFEF0, 0x0400, 0x4110, 0x2112, 0x411E, 0xC13C, 0xC141, 0xC2C0, 0xC204, + 0xC3FC, 0xC4EE, 0xC4FD, 0xC40E, 0xC43F, 0xDCD4, 0xDCF4, 0xDC4D, 0xDDEC, + 0xDD04, 0xDD2C, 0xDD2E, 0xDD42, 0xDED0, 0xDED2, 0xDE1C, 0xDFC2, 0xD0C1, + 0xD0D0, 0xD01C, 0xD014, 0xD030, 0xD1C4, 0xD100, 0xD140, 0xD142, 0xD2E3, + 0xD241, 0xD3FD, 0xD300, 0xD333, 0xD4C1, 0xD40D, 0xED0D, 0xED30, 0xEE44, + 0xE103, 0xE323, 0xE33E, 0xE400, 0xE42C, 0xE424, 0xE433, 0xFCCD, 0xFDD3, + 0xFD3D, 0xFD4C, 0xF043, 0xF30C, 0xF313, 0xF4F4, 0xF44D, 0xF441, 0x0CCC, + 0x0C13, 0x0D0D, 0x0D01, 0x0EC4, 0x0F43, 0x0033, 0x0330, 0x0442, 0x1CCF, + 0x1CC3, 0x1C0F, 0x1C43, 0x1DDD, 0x1F4C, 0x1F44, 0x133D, 0x14C3, 0x140F, + 0x2E33, 0x203D, 0x204C, 0x224C, 0x23DE, 0x233C, 0x244E, 0x3CC1, 0x3D02, + 0x3D13, 0x3D40, 0x3E14, 0x3FFD, 0x3F0C, 0x30CD, 0x30D4, 0x30ED, 0x31C0, + 0x31C4, 0x31FD, 0x311D, 0x32C3, 0x32E3, 0x323C, 0x323E, 0x33E4, 0x3313, + 0x332C, 0x3340, 0x344F, 0x4C4C, 0x4C4E, 0x4DC1, 0x4DDE, 0x4DE3, 0x4EC0, + 0x4E3D, 0x4FCF, 0x4FC3, 0x4F14, 0x40DD, 0x40D3, 0x403D, 0x42C0, 0x43D2, + 0x43E3, 0x431C, 0x4341, 0xCCF3, 0xCC11, 0xCD2D, 0xCD34, 0xCE24, 0xC033, + 0xC1DE, 0xC4D1, 0xC4E0, 0xC4E2, 0xC422, 0xDC3E, 0xDC34, 0xDE32, 0xDFC0, + 0xDFE0, 0xD001, 0xD010, 0xD02F, 0xD1E0, 0xD13F, 0xD2C3, 0xD22D, 0xD23E, + 0xD3CE, 0xD3C2, 0xD3E2, 0xD311, 0xD32E, 0xD34E, 0xD42D, 0xECD3, 0xEDFE, + 0xED4D, 0xEE04, 0xEE1D, 0xEE40, 0xEFD2, 0xEF30, 0xE013, 0xE1D0, 0xE10D, + 0xE2CC, 0xE213, 0xE3CD, 0xE3DC, 0xE301, 0xE310, 0xFCCF, 0xFDD1, 0xFD13, + 0xF030, 0xF20D, 0xF4C3, 0xF4E3, 0x0CD3, 0x0C4E, 0x0D03, 0x0E04, 0x0E4C, + 0x02C4, 0x023F, 0x0231, 0x03D2, 0x03EF, 0x1DD1, 0x1D13, 0x1D4C, 0x1FC4, + 0x13FD, 0x1324, 0x14F4, 0x2CF3, 0x2C40, 0x2DC3, 0x2DD4, 0x2DF4, 0x2D10, + 0x2F23, 0x22D3, 0x231C, 0x243D, 0x3C23, 0x3C30, 0x3D2C, 0x3D22, 0x3D42, + 0x3ED2, 0x3ED4, 0x3E2D, 0x3FC0, 0x3FD3, 0x300F, 0x33C2, 0x33FD, 0x330C, + 0x34C1, 0x4DD2, 0x4EFD, 0x41D0, 0x4103, 0x42EC, 0xCE31, 0x423D, 0x441D, + 0xCFD2, 0xC2D1, 0xC32F, 0xDC32, 0xD11F, 0xED1E, 0xE0EC, 0xE14D, 0xFDE4, + 0xFD22, 0xFE32, 0xF1D1, 0xF32E, 0x0CEE, 0x0D21, 0x0FD2, 0x0F32, 0x001D, + 0x02DF, 0x1CE3, 0x1E30, 0x10ED, 0x12ED, 0x1203, 0x123E, 0x2C02, 0x2EF3, + 0x2F2D, 0x202E, 0x220C, 0x2213, 0x230F, 0x3C3E, 0x3E21, 0x3FE2, 0x3F02, + 0x3324, 0x340F, 0x4EEE, 0x41ED, 0xCDE1, 0x413E, 0x441F, 0xCD01, 0xC20E, + 0xDCE1, 0xEECE, 0xEEC2, 0xE134, 0xE222, 0xE242, 0xFCF2, 0xFC12, 0xF2C3, + 0x0FD4, 0x1214, 0x14D0, 0x2F21, 0x21ED, 0xE10F, 0x4022, 0x420E, 0xFCE1, + 0xF1E4, 0x0F0F, 0x0121, 0x14F0, 0x1E4F, 0x1014, 0xC1F0, 0x1111, 0x410F, + 0x0C1F, 0xCFF2, 0xF014, 0xF4F0, 0x1F40, 0x10F2, 0x11E0, 0x12C1, 0x1210, + 0xF410, 0x41E1, 0xCEDF, 0xC30F, 0xE1F4, 0xFCFE, 0xFD40, 0x013C, 0x1CD0, + 0x1D4E, 0x11F3, 0x14F2, 0xEF0F, 0x2141, 0x220E, 0xE011, 0xE1F0, 0xFCF0, + 0xF1E2, 0xF40F, 0x0FF2, 0x1ECF, 0x2FF2, 0x2F10, 0xEE11, 0x2CFF, 0xEFF0, + 0xE101, 0xE11E, 0xFF22, 0x2FEF, 0x42FF, 0xEC1F, 0xFC10, 0xCCEE, 0xCEDD, + 0xDDDF, 0xDDF1, 0xDECD, 0xDE1E, 0xDFE2, 0xDF2E, 0xD0FE, 0xD01E, 0xD4E3, + 0xEC02, 0xEFDE, 0xE004, 0xE02C, 0xE03F, 0xE31C, 0xFC2D, 0xFE2D, 0xFE3E, + 0xFFC4, 0xF2D2, 0xF3F1, 0x0EDD, 0x0132, 0x0213, 0x040E, 0x0422, 0x1C23, + 0x1ED0, 0x1ED4, 0x11D1, 0x1133, 0x13E2, 0x204E, 0x21CD, 0x2132, 0x222C, + 0x23CF, 0x2310, 0x2433, 0x3CE3, 0x3C01, 0x3EF0, 0x3E1C, 0x3E2F, 0x3F24, + 0x30EF, 0x30F0, 0x3212, 0x4E13, 0x4FDE, 0x4F2D, 0x40EE, 0x41D2, 0x43DE, + 0xEF4F, 0xE14F, 0xE341, 0xE4EE, 0xF0CD, 0xF131, 0xF142, 0x0EEE, 0x0EE4, + 0x0E20, 0x0002, 0x02E4, 0x103C, 0x123C, 0x2C22, 0x20C0, 0x2000, 0x21FC, + 0x24EE, 0x4301, 0xCFEF, 0xEF21, 0xFF24, 0x0040, 0x1421, 0x4332, 0x43F2, + 0xCC20, 0x4413, 0xCCE4, 0xCC0C, 0xCC2C, 0xCC40, 0xECF1, 0xFEF2, 0x4F10, + 0xFFE0, 0xF1C0, 0xF2FE, 0x12CF, 0x24F1, 0x22FF, 0x4E2E, 0x1010, 0x4211, + 0xD421, 0xFC30, 0xFF13, 0xF234, 0xF430, 0x00E2, 0x1FDF, 0x10CF, 0xC000, + 0x124D, 0x1243, 0x2CE2, 0x2D4F, 0x2EC2, 0x2FFC, 0x2220, 0x3111, 0xF221, + 0x34F0, 0x4DEF, 0xF4EF, 0x1EEF, 0x1CEF, 0x0101, 0xC1FE, 0xFEEF, 0xFE4F, + 0xF21E, 0x0EC2, 0x0EF1, 0x1C01, 0x21E1, 0x421F, 0xCD03, 0xCD30, 0xCD41, + 0xCF34, 0xCF43, 0xC03F, 0xC031, 0xC103, 0xC13E, 0xC402, 0xDDFF, 0xDDF3, + 0xDE4D, 0xDF0C, 0xD1F3, 0xD124, 0xD13D, 0xD14E, 0xD2CD, 0xD2DE, 0xD2D2, + 0xD3C0, 0xD3EC, 0xD3EE, 0xD41E, 0xD432, 0xD441, 0xECFD, 0xEC4E, 0xEDD0, + 0xEDD2, 0xED34, 0xE13E, 0xE233, 0xE314, 0xE34D, 0xE44E, 0xFCC3, 0xFCDC, + 0xFDDD, 0xFDEC, 0xFD04, 0xFD3F, 0xFE30, 0xFF44, 0xF13D, 0xF302, 0xF331, + 0x0CF3, 0x0C1D, 0x0C31, 0x0DD0, 0x0DD2, 0x0DD4, 0x0DF0, 0x0D0F, 0x0F0D, + 0x00D3, 0x0031, 0x02DD, 0x03D4, 0x03ED, 0x03F0, 0x0301, 0x0312, 0x04DD, + 0x043D, 0x1C03, 0x1C14, 0x1D31, 0x1FD3, 0x10DE, 0x104D, 0x1302, 0x1304, + 0x14CD, 0x1441, 0x2CFD, 0x2DD2, 0x2D43, 0x2EC4, 0x2FD2, 0x210D, 0x23C3, + 0x24CE, 0x24EC, 0x2424, 0x3C2D, 0x3DFF, 0x3D2E, 0x3ED0, 0x3E3E, 0x30DC, + 0x31DD, 0x3104, 0x33DD, 0x33F1, 0x34DE, 0x34ED, 0x4EE4, 0x4FD4, 0x40D1, + 0x410D, 0x433E, 0xDEE1, 0xDEF2, 0xDFF1, 0xD111, 0xD12C, 0xD2C1, 0xD2FC, + 0xD2F0, 0xD21C, 0xEDF0, 0xEE3F, 0xEE4E, 0xEF43, 0xE2C4, 0xE2FD, 0xE3D4, + 0xFDEE, 0xFD2C, 0xFFDF, 0xF1D3, 0xF2DE, 0xF2E3, 0xF43E, 0x0DF2, 0x0D3C, + 0x0ED1, 0x0F2D, 0x01ED, 0x013E, 0x0343, 0x1D2E, 0x1E23, 0x12DE, 0x1322, + 0x14E3, 0x2C42, 0x2D21, 0x200C, 0x2013, 0x2103, 0x22E2, 0x3D4E, 0x3E10, + 0x3FD1, 0x3001, 0x311F, 0x3142, 0x32FC, 0x3342, 0x4DF2, 0x4F3E, 0x4031, + 0xCE2E, 0x4132, 0x44E0, 0xC2EE, 0xE000, 0xE02E, 0xE220, 0xF214, 0xF232, + 0xF4D0, 0xF4D2, 0x0C22, 0x0D41, 0x0EE0, 0x0E4E, 0x000E, 0x1D40, 0x1D42, + 0x10C1, 0x11FD, 0x2DC1, 0xF1EC, 0x2D4D, 0x2E4E, 0x04E0, 0x1CE1, 0x1F2E, + 0x1F24, 0xF401, 0x40FF, 0xC011, 0x2FF4, 0xCE0E, 0xF1EE, 0xF10E, 0xF4E1, + 0x11EC, 0x22F1, 0xCEFF, 0x04F1, 0x1CF0, 0x41F0, 0xDDEE, 0xDF1F, 0xD1F1, + 0xEEE2, 0xE1C1, 0xE114, 0xE22C, 0xE3C3, 0xFFFD, 0xF3C2, 0x0E00, 0x0FED, + 0x0220, 0x0222, 0x04DF, 0x04EE, 0x2E2E, 0x2020, 0x2442, 0x3FF1, 0xE0FF, + 0x3443, 0x42E2, 0x4F0F, 0xE121, 0xFE10, 0xE110, 0x4220, 0xCF2D, 0xCF3E, + 0xE2F1, 0xFF40, 0xF12C, 0x14EF, 0x100F, 0x4E20, 0xDC30, 0xDE41, 0xD1C2, + 0xD2F4, 0xD20F, 0xEC13, 0xEDC3, 0xEDF4, 0xEEDD, 0xE2D1, 0xE24E, 0xFDDF, + 0xFEE3, 0xFFCC, 0xF0DE, 0xF04D, 0xF223, 0xF3E0, 0x0C0E, 0x0D2F, 0x0EF3, + 0x03CD, 0x1C3E, 0x1DCC, 0x11DD, 0x113F, 0x13EE, 0x14CF, 0x2DE1, 0x2D0F, + 0x2D01, 0x2E4C, 0x2F3E, 0x2F34, 0x22D1, 0x3E12, 0x3F00, 0x3F04, 0x3F22, + 0x3010, 0x31C2, 0x312C, 0x3410, 0x4202, 0xC2E2, 0x43F0, 0x430D, 0xDDDD, + 0xDFFF, 0xED4F, 0xEEEC, 0xE22E, 0xFC3E, 0xFD4E, 0xF0C3, 0x01DC, 0x04E2, + 0x11C2, 0x12D4, 0x12F2, 0x22C0, 0x22C2, 0x222E, 0x4EE2, 0x4433, 0xFFC0, + 0xF2FC, 0x004E, 0x01C1, 0xC110, 0x1EE1, 0xEFFE, 0x1F2C, 0xE1FE, 0xFE12, + 0xF104, 0x101E, 0x11C0, 0x122F, 0xCD2F, 0xDCF0, 0xEE22, 0xF340, 0x211C, + 0x23C1, 0x2341, 0x34E1, 0xD4F0, 0x4DFE, 0x4D21, 0xFF20, 0x0EFF, 0x01EF, + 0x1E10, 0x102F, 0x1140, 0xF001, 0x4FEF, 0x4FFE, 0x4EFF, 0xD4E1, 0x02F1, + 0x10F0, 0x1E01, 0x101C, 0x401F, 0x104F, 0xCDC3, 0xCDF4, 0xCD1C, 0xCEC4, + 0xCE2C, 0xCE3F, 0xCE4C, 0xCE40, 0xCFCD, 0xCFD4, 0xCFF4, 0xCF14, 0xC0CC, + 0xC0C0, 0xC0C4, 0xC0EC, 0xC0E4, 0xC004, 0xC1DC, 0xC1D4, 0xC1FC, 0xC1F4, + 0xC114, 0xC2CC, 0xC2C4, 0xC20C, 0xC224, 0xC244, 0xC3C1, 0xC3C3, 0xC31C, + 0xC34D, 0xC4CC, 0xC4EC, 0xC4FF, 0xC40C, 0xC400, 0xC404, 0xC411, 0xC424, + 0xC433, 0xC440, 0xC442, 0xC444, 0xDCFC, 0xDC0D, 0xDD0C, 0xDD3D, 0xDD4C, + 0xDE43, 0xD0C3, 0xD0ED, 0xD00D, 0xD04D, 0xD1CC, 0xD3CC, 0xD30E, 0xD34C, + 0xD414, 0xD434, 0xECC4, 0xEC04, 0xEC3F, 0xEC4C, 0xE0DD, 0xE040, 0xE4CC, + 0xE4EC, 0xE404, 0xE440, 0xFCD0, 0xFDC4, 0xF1CC, 0xF3CC, 0xF4CD, 0xF4CF, + 0xF4D4, 0xF414, 0xF421, 0x0C0C, 0x0C00, 0x0C40, 0x0D34, 0x0E40, 0x0F3C, + 0x00CC, 0x00C0, 0x00C2, 0x00DD, 0x0004, 0x01CD, 0x0103, 0x03DC, 0x033C, + 0x034D, 0x034F, 0x04C0, 0x04C4, 0x040C, 0x0404, 0x0433, 0x044C, 0x11C4, + 0x114C, 0x13C4, 0x2CC0, 0x2C4C, 0x2DED, 0x2D0D, 0x20C4, 0x2044, 0x24CC, + 0x24C0, 0x244C, 0x2440, 0x3CCD, 0x3CCF, 0x3CDC, 0x3DCC, 0x3DC4, 0x3DE0, + 0x3DFD, 0x3D00, 0x3F3D, 0x3F4C, 0x3F44, 0x30E3, 0x3023, 0x303C, 0x33C0, + 0x33C4, 0x33D1, 0x33F3, 0x3300, 0x4CCC, 0x4CC0, 0x4CC2, 0x4CDD, 0x4CD3, + 0x4C0C, 0x4C00, 0x4C04, 0x4C24, 0x4C40, 0x4C44, 0x4DCD, 0x4DC3, 0x4D14, + 0x4D34, 0x4E4C, 0x4F3C, 0x4F4D, 0x4F43, 0x40C2, 0x40C4, 0x40E4, 0x400C, + 0x402C, 0x404C, 0x404E, 0x4040, 0x4044, 0x41CF, 0x41F4, 0x4114, 0x4141, + 0x4143, 0x42CC, 0x42C4, 0x42E4, 0x43C1, 0x43D4, 0x43F4, 0x4310, 0x4314, + 0x434D, 0x44CC, 0x44C4, 0x44FF, 0x440C, 0x4404, 0x4411, 0x442C, 0x444C, + 0xCCD3, 0x444E, 0x4440, 0xCC00, 0xCC04, 0xCC3D, 0xCD10, 0xCD3C, 0xCFCF, + 0xCFC3, 0xCF3C, 0xC0CE, 0xC0DD, 0xC00C, 0xC013, 0xC02C, 0xC04C, 0xC04E, + 0xC040, 0xC044, 0xC1CD, 0xC1CF, 0xC14D, 0xC233, 0xC240, 0xC3CD, 0xC3F4, + 0xC314, 0xC343, 0xC4CE, 0xC4C0, 0xC4DF, 0xC4E4, 0xC42C, 0xC44E, 0xDC3C, + 0xDC4F, 0xDC43, 0xDDC0, 0xDDC4, 0xDDFD, 0xDD1D, 0xDD31, 0xDD44, 0xDEC3, + 0xDE30, 0xDF3D, 0xD0DC, 0xD0D4, 0xD0E3, 0xD003, 0xD1D3, 0xD203, 0xD340, + 0xD4CD, 0xD4DC, 0xD4F4, 0xEC0C, 0xEC2C, 0xEC40, 0xEC44, 0xE0CC, 0xE04C, + 0xE303, 0xE4E4, 0xE40C, 0xFCFC, 0xF2DC, 0xF324, 0xF34C, 0xF4DC, 0xF434, + 0x0CEC, 0x0CE4, 0x0C04, 0x0C2C, 0x0C3D, 0x0C44, 0x0DC3, 0x0EC0, 0x0E33, + 0x0FC3, 0x0F1C, 0x00C4, 0x000C, 0x004C, 0x01F4, 0x0114, 0x023D, 0x04CC, + 0x04C2, 0x1CFC, 0x1C0D, 0x1C3C, 0x1C34, 0x1DC4, 0x2CCC, 0x2C04, 0x20D3, + 0x24E4, 0x3CFC, 0x3CF4, 0x3C0D, 0x3D44, 0x3F1D, 0x300D, 0x3003, 0x3030, + 0x304D, 0x31F3, 0x314C, 0x3144, 0x3302, 0x3304, 0x34D4, 0x34F4, 0x3403, + 0x344D, 0x4CDF, 0x4CEC, 0x4CFD, 0x4C42, 0x4DCF, 0x4DDC, 0x4DFC, 0x4D0D, + 0x4D03, 0x4D1C, 0x4D41, 0x4ECC, 0x4E42, 0x4E44, 0x4FC1, 0x4FF4, 0x4F1C, + 0x4F34, 0x4F4F, 0x40CE, 0x4004, 0x4024, 0x41C3, 0x4134, 0x414F, 0x420C, + 0x421D, 0x424C, 0x424E, 0x4244, 0x433C, 0x434F, 0x44EE, 0x44E4, 0x44F1, + 0xCC24, 0x4402, 0x4424, 0xCC3F, 0xCC44, 0xCDC1, 0xCD14, 0xCECC, 0xCE04, + 0xCFC1, 0xCF0D, 0xC0D1, 0xC0FD, 0xC024, 0xC042, 0xC11C, 0xC12D, 0xC2EC, + 0xC242, 0xC3ED, 0xC3E3, 0xC4F3, 0xC413, 0xC43D, 0xDC1C, 0xDDD3, 0xDDE4, + 0xDD00, 0xDD3F, 0xDFCC, 0xDFD3, 0xDF4C, 0xD023, 0xD14C, 0xD23C, 0xD3DD, + 0xD3D1, 0xD304, 0xD331, 0xD4CF, 0xD43C, 0xD430, 0xD44D, 0xECC2, 0xECEC, + 0xEDE3, 0xED32, 0xEE3D, 0xE24C, 0xE3D0, 0xE3E3, 0xE444, 0xFC3C, 0xFD44, + 0xF0DC, 0xF3DF, 0xF41C, 0xF43C, 0xF443, 0x0CCE, 0x0CD1, 0x0DF4, 0x0D30, + 0x0024, 0x01D4, 0x0130, 0x033E, 0x04D3, 0x04EC, 0x042C, 0x0424, 0x0444, + 0x1C4D, 0x1DFD, 0x1D3D, 0x1F33, 0x11CC, 0x13CC, 0x13DD, 0x14DC, 0x141C, + 0x2CDF, 0x2C0C, 0x2C44, 0x2D30, 0x23CD, 0x23D4, 0x2303, 0x2404, 0x3CD4, + 0x3C03, 0x3C3C, 0x3C43, 0x3DEE, 0x3D1D, 0x3D31, 0x3EED, 0x3E30, 0x3FCC, + 0x3014, 0x302D, 0x3032, 0x3034, 0x3120, 0x32CD, 0x32C1, 0x32D0, 0x320D, + 0x334C, 0x34CD, 0x34C3, 0x34D0, 0x34D2, 0x3414, 0x343C, 0x4CE4, 0x4CFF, + 0x4CF1, 0x4C0E, 0x4C1D, 0x4C33, 0x4DF4, 0x4EC2, 0x4EC4, 0x4E40, 0x4FDC, + 0x4042, 0x41D4, 0x411C, 0x413C, 0x42CE, 0x42F1, 0x4240, 0x432D, 0x44C0, + 0x44C2, 0x44D1, 0x440E, 0x4420, 0xCCD1, 0xCC1F, 0xCD32, 0xCEC0, 0xCF41, + 0xC1C1, 0xC321, 0xC33C, 0xC42E, 0xDCED, 0xDD0E, 0xDD1F, 0xDD20, 0xDEED, + 0xDF31, 0xD1C0, 0xD120, 0xD2D4, 0xD2ED, 0xD230, 0xD232, 0xD3DF, 0xD30C, + 0xD33D, 0xD4D4, 0xEC3D, 0xEC33, 0xED03, 0xED1C, 0xED2D, 0xED2F, 0xEE33, + 0xEFE3, 0xE0D1, 0xE3ED, 0xE3FC, 0xE32D, 0xE40E, 0xFCD2, 0xFC4D, 0xFDCE, + 0xF31D, 0xF32C, 0x0D23, 0x0D43, 0x0ED3, }; -#define ON2AVC_CB14_CODES 729 -static const uint16_t on2avc_cb14_codes[ON2AVC_CB14_CODES] = { - 0x0000, 0x0018, 0x009C, 0x033F, 0x06CF, 0x0860, - 0x3ED2, 0x15F8, 0x0CA3, 0x15F9, 0x3ED3, 0x3ED4, - 0x3ED5, 0x03B3, 0x0336, 0x3ECF, 0x3ED0, 0x15F5, - 0x15F6, 0x3ED1, 0x1FB6, 0x15F7, 0x0D6D, 0x074E, - 0x02A4, 0x008C, 0x0017, 0x0016, 0x0024, 0x00A8, - 0x02AB, 0x043C, 0x038D, 0x15FA, 0x0CA4, 0x1FB8, - 0x15FB, 0x3ED9, 0x1FB9, 0x15FC, 0x01D8, 0x01F1, - 0x3ED6, 0x1090, 0x1FB7, 0x0D6E, 0x3ED7, 0x3ED8, - 0x074F, 0x0D6F, 0x0750, 0x01F2, 0x0098, 0x0020, - 0x0070, 0x009D, 0x00E4, 0x026F, 0x03AE, 0x055D, - 0x06D0, 0x0862, 0x0667, 0x09ED, 0x1900, 0x3EDA, - 0x1901, 0x01DE, 0x026B, 0x15FD, 0x15FE, 0x1091, - 0x15FF, 0x0D70, 0x0666, 0x0689, 0x0861, 0x034E, - 0x026E, 0x00E8, 0x008E, 0x019E, 0x01BF, 0x01F3, - 0x02B5, 0x054E, 0x0669, 0x09EE, 0x09EF, 0x0D71, - 0x0CA5, 0x1FBB, 0x1FBC, 0x3EDF, 0x02A6, 0x01CA, - 0x3EDB, 0x3EDC, 0x3EDD, 0x3EDE, 0x1FBA, 0x1092, - 0x0863, 0x0751, 0x0668, 0x038E, 0x02B4, 0x01C4, - 0x068A, 0x0CA7, 0x06D1, 0x055F, 0x043E, 0x09F0, - 0x0865, 0x0866, 0x0867, 0x0752, 0x1902, 0x3EE2, - 0x1096, 0x0278, 0x02B6, 0x3EE0, 0x1FBD, 0x3EE1, - 0x0864, 0x1FBE, 0x0CA6, 0x1093, 0x1094, 0x1095, - 0x0478, 0x043D, 0x055E, 0x3EE5, 0x0CA9, 0x066A, - 0x0D75, 0x0560, 0x0561, 0x0868, 0x0D76, 0x0CAA, - 0x0CAB, 0x3EE6, 0x3EE7, 0x3EE8, 0x02AC, 0x038F, - 0x3EE3, 0x1FBF, 0x3EE4, 0x0D72, 0x0D73, 0x0D74, - 0x09F1, 0x068B, 0x0CA8, 0x0479, 0x06D2, 0x1097, - 0x1099, 0x09F3, 0x066B, 0x06D3, 0x0CAD, 0x109A, - 0x06D4, 0x068C, 0x06D5, 0x0D79, 0x0D7A, 0x109B, - 0x1FC1, 0x02B2, 0x0396, 0x3EE9, 0x1903, 0x3EEA, - 0x1904, 0x1905, 0x1FC0, 0x09F2, 0x0D77, 0x0D78, - 0x1098, 0x0562, 0x0CAC, 0x190C, 0x109C, 0x06D6, - 0x0D7C, 0x1FC4, 0x0D7D, 0x09F4, 0x06D7, 0x09F5, - 0x3EEE, 0x0CAE, 0x0D7E, 0x3EEF, 0x03AF, 0x043F, - 0x3EEB, 0x1906, 0x1FC2, 0x1907, 0x3EEC, 0x1908, - 0x1909, 0x190A, 0x1FC3, 0x3EED, 0x0D7B, 0x190B, - 0x1FC6, 0x10A1, 0x10A2, 0x0D7F, 0x0CB0, 0x190E, - 0x0D80, 0x10A3, 0x0869, 0x190F, 0x1910, 0x10A4, - 0x10A5, 0x0753, 0x068D, 0x3EF0, 0x3EF1, 0x190D, - 0x1FC5, 0x3EF2, 0x3EF3, 0x109D, 0x109E, 0x0CAF, - 0x109F, 0x3EF4, 0x10A0, 0x10A7, 0x3EFC, 0x0CB1, - 0x09F7, 0x1911, 0x10A8, 0x09F8, 0x10A9, 0x1912, - 0x06D9, 0x09F9, 0x3EFD, 0x1913, 0x068E, 0x06D8, - 0x3EF5, 0x3EF6, 0x3EF7, 0x3EF8, 0x3EF9, 0x0D81, - 0x3EFA, 0x1FC7, 0x1FC8, 0x10A6, 0x09F6, 0x3EFB, - 0x1FCE, 0x0CB2, 0x3F02, 0x10AA, 0x3F03, 0x1FCF, - 0x10AB, 0x10AC, 0x1916, 0x3F04, 0x09FA, 0x0D83, - 0x3F05, 0x068F, 0x086A, 0x1914, 0x3EFE, 0x1FC9, - 0x1FCA, 0x3EFF, 0x0D82, 0x1FCB, 0x1FCC, 0x3F00, - 0x1FCD, 0x3F01, 0x1915, 0x3F0F, 0x1918, 0x10AD, - 0x0CB3, 0x3F10, 0x1919, 0x3F11, 0x191A, 0x1FD2, - 0x0CB4, 0x0CB5, 0x10AE, 0x191B, 0x047A, 0x06DA, - 0x3F06, 0x3F07, 0x1917, 0x3F08, 0x3F09, 0x3F0A, - 0x3F0B, 0x3F0C, 0x3F0D, 0x3F0E, 0x1FD0, 0x1FD1, - 0x3F18, 0x191F, 0x1FDA, 0x3F19, 0x3F1A, 0x10AF, - 0x3F1B, 0x10B2, 0x1FDB, 0x0D86, 0x0D87, 0x10B3, - 0x0CB6, 0x086B, 0x09FB, 0x3F12, 0x1FD3, 0x1FD4, - 0x3F13, 0x1FD5, 0x191E, 0x1FD6, 0x3F14, 0x3F15, - 0x3F16, 0x1FD7, 0x3F17, 0x033A, 0x01AA, 0x02B8, - 0x01DF, 0x02B9, 0x02BA, 0x086F, 0x03BB, 0x03B2, - 0x046A, 0x066F, 0x08DE, 0x0563, 0x046B, 0x0CB7, - 0x11BE, 0x086E, 0x066E, 0x06DB, 0x047B, 0x03BA, - 0x0A9E, 0x02B7, 0x0340, 0x0264, 0x01CE, 0x01A9, - 0x0265, 0x01A8, 0x0266, 0x02A8, 0x036F, 0x03AB, - 0x037A, 0x04FE, 0x0683, 0x06C4, 0x0C90, 0x065D, - 0x0D3C, 0x0FEC, 0x0436, 0x06C2, 0x0682, 0x0C8E, - 0x055A, 0x033B, 0x065C, 0x0348, 0x03AA, 0x0234, - 0x036E, 0x01F0, 0x01A6, 0x3E86, 0x3E87, 0x153E, - 0x3E88, 0x3E89, 0x0FEF, 0x3E8A, 0x3E8B, 0x3E8C, - 0x3E8D, 0x3E8E, 0x3E8F, 0x3E90, 0x09E4, 0x03AC, - 0x11BF, 0x1F8E, 0x1F8F, 0x0FEE, 0x3E80, 0x3E81, - 0x3E82, 0x3E83, 0x3E84, 0x3E85, 0x1F90, 0x1F91, - 0x3E95, 0x3E96, 0x0C91, 0x3E97, 0x3E98, 0x3E99, - 0x3E9A, 0x3E9B, 0x3E9C, 0x3E9D, 0x3E9E, 0x3E9F, - 0x3EA0, 0x0858, 0x04FF, 0x0FF0, 0x0FF1, 0x153F, - 0x0FF2, 0x3E91, 0x1F92, 0x3E92, 0x1F93, 0x3E93, - 0x1F94, 0x3E94, 0x0D3D, 0x3EA3, 0x1F99, 0x0FF7, - 0x0D3E, 0x3EA4, 0x1F9A, 0x15D9, 0x0D3F, 0x3EA5, - 0x3EA6, 0x3EA7, 0x0D58, 0x3EA8, 0x06C5, 0x072E, - 0x3EA1, 0x1F95, 0x1F96, 0x0C92, 0x0FF3, 0x0FF4, - 0x0FF5, 0x15D8, 0x1F97, 0x0FF6, 0x1F98, 0x3EA2, - 0x3EAC, 0x0FF9, 0x1F9C, 0x15DB, 0x1F9D, 0x15DC, - 0x0FFA, 0x1F9E, 0x3EAD, 0x3EAE, 0x3EAF, 0x3EB0, - 0x3EB1, 0x065E, 0x055B, 0x3EA9, 0x0D59, 0x15DA, - 0x0FF8, 0x3EAA, 0x0D5A, 0x3EAB, 0x0D5B, 0x0D5C, - 0x0D5D, 0x072F, 0x1F9B, 0x3EB4, 0x1FA0, 0x073C, - 0x0D5F, 0x1FA1, 0x1FA2, 0x0FFE, 0x1FA3, 0x1FA4, - 0x3EB5, 0x3EB6, 0x3EB7, 0x3EB8, 0x065F, 0x06C6, - 0x3EB2, 0x15DD, 0x0FFB, 0x3EB3, 0x1F9F, 0x0D5E, - 0x0C93, 0x0C94, 0x0FFC, 0x0FFD, 0x15DE, 0x15DF, - 0x1FA7, 0x15E1, 0x06C7, 0x0D62, 0x15E2, 0x0C96, - 0x15E3, 0x1082, 0x15E4, 0x1FA8, 0x3EBA, 0x3EBB, - 0x3EBC, 0x0660, 0x046E, 0x3EB9, 0x1FA5, 0x0FFF, - 0x1FA6, 0x1080, 0x1081, 0x0D60, 0x0C95, 0x15E0, - 0x0D61, 0x073D, 0x085A, 0x15E6, 0x09E9, 0x085B, - 0x0C97, 0x1083, 0x0C98, 0x0D63, 0x0D64, 0x0C99, - 0x15E7, 0x15E8, 0x1FAC, 0x3EBE, 0x0684, 0x037B, - 0x1FA9, 0x1FAA, 0x3EBD, 0x073E, 0x1FAB, 0x15E5, - 0x06C8, 0x09E5, 0x09E6, 0x09E7, 0x0661, 0x09E8, - 0x1FAE, 0x0C9A, 0x06CA, 0x055C, 0x0C9B, 0x3EC0, - 0x15EB, 0x1085, 0x1086, 0x15EC, 0x1087, 0x3EC1, - 0x3EC2, 0x02A9, 0x02B3, 0x1FAD, 0x15E9, 0x3EBF, - 0x15EA, 0x1084, 0x0D65, 0x0662, 0x0D66, 0x06C9, - 0x0438, 0x054A, 0x073F, 0x085D, 0x0663, 0x0439, - 0x0686, 0x06CB, 0x0C9E, 0x0C9F, 0x1088, 0x15EF, - 0x3EC6, 0x1089, 0x1FAF, 0x3EC7, 0x0349, 0x0267, - 0x3EC3, 0x3EC4, 0x15ED, 0x15EE, 0x3EC5, 0x09EA, - 0x0C9C, 0x0C9D, 0x054B, 0x0685, 0x085C, 0x09EB, - 0x01BC, 0x01DC, 0x01BE, 0x03AD, 0x038A, 0x0749, - 0x0688, 0x0665, 0x074A, 0x0CA1, 0x0D68, 0x3EC8, - 0x1FB1, 0x0236, 0x034A, 0x1FB0, 0x108A, 0x108B, - 0x0CA0, 0x0D67, 0x0687, 0x0748, 0x0664, 0x038B, - 0x023E, 0x01DA, 0x01DB, 0x006E, 0x0094, 0x00E6, - 0x033E, 0x043A, 0x06CD, 0x085E, 0x085F, 0x0D69, - 0x0D6A, 0x1FB3, 0x1FB4, 0x3ECA, 0x034B, 0x023F, - 0x3EC9, 0x108C, 0x1FB2, 0x15F0, 0x15F1, 0x074B, - 0x06CC, 0x074C, 0x038C, 0x0268, 0x0136, 0x0095, - 0x0014, 0x001E, 0x0097, 0x019C, 0x074D, 0x0D6C, - 0x06CE, 0x0CA2, 0x108E, 0x09EC, 0x3ECD, 0x108F, - 0x3ECE, 0x026A, 0x02AA, 0x3ECB, 0x1FB5, 0x15F2, - 0x3ECC, 0x15F3, 0x15F4, 0x0D6B, 0x108D, 0x043B, - 0x0269, 0x0096, 0x0022, +static const uint16_t on2avc_cb_9_syms[ON2AVC_CB_9_10_CODES] = { + 0x0000, 0xFF00, 0x05FF, 0x02FB, 0xFE02, 0xFDFE, 0x03FE, 0x05FE, 0x0301, + 0x0400, 0x02FD, 0x0103, 0xFCFE, 0x02FC, 0x0303, 0x04FD, 0x0004, 0x00FC, + 0x0302, 0x04FF, 0x0502, 0xFC05, 0xFC01, 0xFDFC, 0xFC04, 0x03FC, 0x0504, + 0xFFFC, 0xFCFF, 0xFBFC, 0xFCFB, 0xFE00, 0xFEFB, 0xFEFD, 0x0304, 0xFD04, + 0xFE03, 0x0401, 0x00FF, 0x0002, 0x0205, 0x04FB, 0x0405, 0x00FE, 0xFD05, + 0x0003, 0xFB04, 0xFFFB, 0xFF05, 0x01FB, 0x03FB, 0x00FD, 0xFC02, 0xFC03, + 0xFCFD, 0xFB00, 0x0503, 0xFBFE, 0x0105, 0xFDFB, 0x0305, 0x0501, 0xFB01, + 0x0005, 0x01FC, 0x0403, 0xFCFC, 0xFC00, 0xFF04, 0x05FC, 0x0104, 0xFD03, + 0x0500, 0xFBFF, 0x05FD, 0x0300, 0xFD00, 0x00FB, 0x0200, 0xFE05, 0xFBFD, + 0xFB03, 0xFF01, 0x03FF, 0xFB05, 0x0204, 0x03FD, 0xFEFE, 0xFBFB, 0xFDFD, + 0x04FE, 0x01FE, 0xFF03, 0xFFFD, 0x02FF, 0xFF02, 0xFEFF, 0x0201, 0x01FF, + 0xFFFF, 0x0101, 0xFD01, 0xFEFC, 0x04FC, 0x0404, 0xFE04, 0x0402, 0x01FD, + 0xFDFF, 0xFB02, 0x02FE, 0x05FB, 0x0505, 0xFFFE, 0xFE01, 0x0102, 0x0202, + 0x0203, 0xFD02, 0x0100, 0x0001, }; -static const uint8_t on2avc_cb14_bits[ON2AVC_CB14_CODES] = { - 1, 5, 8, 10, 11, 12, - 14, 13, 12, 13, 14, 14, - 14, 10, 10, 14, 14, 13, - 13, 14, 13, 13, 12, 11, - 10, 8, 5, 5, 6, 8, - 10, 11, 10, 13, 12, 13, - 13, 14, 13, 13, 9, 9, - 14, 13, 13, 12, 14, 14, - 11, 12, 11, 9, 8, 6, - 7, 8, 8, 10, 10, 11, - 11, 12, 11, 12, 13, 14, - 13, 9, 10, 13, 13, 13, - 13, 12, 11, 11, 12, 10, - 10, 8, 8, 9, 9, 9, - 10, 11, 11, 12, 12, 12, - 12, 13, 13, 14, 10, 9, - 14, 14, 14, 14, 13, 13, - 12, 11, 11, 10, 10, 9, - 11, 12, 11, 11, 11, 12, - 12, 12, 12, 11, 13, 14, - 13, 10, 10, 14, 13, 14, - 12, 13, 12, 13, 13, 13, - 11, 11, 11, 14, 12, 11, - 12, 11, 11, 12, 12, 12, - 12, 14, 14, 14, 10, 10, - 14, 13, 14, 12, 12, 12, - 12, 11, 12, 11, 11, 13, - 13, 12, 11, 11, 12, 13, - 11, 11, 11, 12, 12, 13, - 13, 10, 10, 14, 13, 14, - 13, 13, 13, 12, 12, 12, - 13, 11, 12, 13, 13, 11, - 12, 13, 12, 12, 11, 12, - 14, 12, 12, 14, 10, 11, - 14, 13, 13, 13, 14, 13, - 13, 13, 13, 14, 12, 13, - 13, 13, 13, 12, 12, 13, - 12, 13, 12, 13, 13, 13, - 13, 11, 11, 14, 14, 13, - 13, 14, 14, 13, 13, 12, - 13, 14, 13, 13, 14, 12, - 12, 13, 13, 12, 13, 13, - 11, 12, 14, 13, 11, 11, - 14, 14, 14, 14, 14, 12, - 14, 13, 13, 13, 12, 14, - 13, 12, 14, 13, 14, 13, - 13, 13, 13, 14, 12, 12, - 14, 11, 12, 13, 14, 13, - 13, 14, 12, 13, 13, 14, - 13, 14, 13, 14, 13, 13, - 12, 14, 13, 14, 13, 13, - 12, 12, 13, 13, 11, 11, - 14, 14, 13, 14, 14, 14, - 14, 14, 14, 14, 13, 13, - 14, 13, 13, 14, 14, 13, - 14, 13, 13, 12, 12, 13, - 12, 12, 12, 14, 13, 13, - 14, 13, 13, 13, 14, 14, - 14, 13, 14, 10, 9, 10, - 9, 10, 10, 12, 10, 10, - 11, 11, 12, 11, 11, 12, - 13, 12, 11, 11, 11, 10, - 12, 10, 10, 10, 9, 9, - 10, 9, 10, 10, 10, 10, - 10, 11, 11, 11, 12, 11, - 12, 12, 11, 11, 11, 12, - 11, 10, 11, 10, 10, 10, - 10, 9, 9, 14, 14, 13, - 14, 14, 12, 14, 14, 14, - 14, 14, 14, 14, 12, 10, - 13, 13, 13, 12, 14, 14, - 14, 14, 14, 14, 13, 13, - 14, 14, 12, 14, 14, 14, - 14, 14, 14, 14, 14, 14, - 14, 12, 11, 12, 12, 13, - 12, 14, 13, 14, 13, 14, - 13, 14, 12, 14, 13, 12, - 12, 14, 13, 13, 12, 14, - 14, 14, 12, 14, 11, 11, - 14, 13, 13, 12, 12, 12, - 12, 13, 13, 12, 13, 14, - 14, 12, 13, 13, 13, 13, - 12, 13, 14, 14, 14, 14, - 14, 11, 11, 14, 12, 13, - 12, 14, 12, 14, 12, 12, - 12, 11, 13, 14, 13, 11, - 12, 13, 13, 12, 13, 13, - 14, 14, 14, 14, 11, 11, - 14, 13, 12, 14, 13, 12, - 12, 12, 12, 12, 13, 13, - 13, 13, 11, 12, 13, 12, - 13, 13, 13, 13, 14, 14, - 14, 11, 11, 14, 13, 12, - 13, 13, 13, 12, 12, 13, - 12, 11, 12, 13, 12, 12, - 12, 13, 12, 12, 12, 12, - 13, 13, 13, 14, 11, 10, - 13, 13, 14, 11, 13, 13, - 11, 12, 12, 12, 11, 12, - 13, 12, 11, 11, 12, 14, - 13, 13, 13, 13, 13, 14, - 14, 10, 10, 13, 13, 14, - 13, 13, 12, 11, 12, 11, - 11, 11, 11, 12, 11, 11, - 11, 11, 12, 12, 13, 13, - 14, 13, 13, 14, 10, 10, - 14, 14, 13, 13, 14, 12, - 12, 12, 11, 11, 12, 12, - 9, 9, 9, 10, 10, 11, - 11, 11, 11, 12, 12, 14, - 13, 10, 10, 13, 13, 13, - 12, 12, 11, 11, 11, 10, - 10, 9, 9, 7, 8, 8, - 10, 11, 11, 12, 12, 12, - 12, 13, 13, 14, 10, 10, - 14, 13, 13, 13, 13, 11, - 11, 11, 10, 10, 9, 8, - 5, 5, 8, 9, 11, 12, - 11, 12, 13, 12, 14, 13, - 14, 10, 10, 14, 13, 13, - 14, 13, 13, 12, 13, 11, - 10, 8, 6, +static const uint16_t on2avc_cb_10_syms[ON2AVC_CB_9_10_CODES] = { + 0x04FE, 0x0401, 0x04FB, 0x04FD, 0xFDFD, 0xFFFC, 0xFCFC, 0xFE00, 0x03FB, + 0xFC03, 0x04FF, 0xFD00, 0x03FC, 0x0404, 0x0405, 0xFCFB, 0xFD05, 0xFB03, + 0x05FD, 0x03FD, 0x0101, 0x05FF, 0x0504, 0xFBFC, 0xFD03, 0x0003, 0x05FE, + 0x0500, 0x0300, 0x0203, 0xFBFE, 0xFFFB, 0x00FD, 0xFB05, 0xFC00, 0x0501, + 0x0005, 0xFEFC, 0x0205, 0xFF05, 0xFDFE, 0x0505, 0x0004, 0x00FC, 0x0102, + 0xFB01, 0xFEFD, 0x01FF, 0xFFFE, 0xFEFB, 0x01FB, 0x01FE, 0x0502, 0x0204, + 0x0400, 0x05FB, 0x0201, 0xFF02, 0xFFFF, 0x02FF, 0xFEFF, 0xFF01, 0xFDFF, + 0x0301, 0x03FF, 0x0302, 0xFE01, 0x0105, 0x03FE, 0xFEFE, 0x01FD, 0x0304, + 0xFB00, 0xFF00, 0xFFFD, 0xFE03, 0x0103, 0xFBFF, 0x00FF, 0xFB02, 0xFB04, + 0x0402, 0xFBFB, 0xFCFE, 0x00FB, 0xFC05, 0x0100, 0x0000, 0xFD01, 0x02FB, + 0x0202, 0xFF03, 0x05FC, 0x0403, 0x0200, 0xFE05, 0xFDFC, 0xFE04, 0x0001, + 0x02FE, 0x02FD, 0x02FC, 0xFD04, 0xFD02, 0x0305, 0xFCFF, 0x04FC, 0xFC04, + 0xFC01, 0xFF04, 0xFE02, 0xFBFD, 0xFC02, 0xFCFD, 0x0002, 0x0303, 0x01FC, + 0x0104, 0x00FE, 0xFDFB, 0x0503, }; -static const uint16_t on2avc_cb14_syms[ON2AVC_CB14_CODES] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, - 0x000C, 0x000D, 0x00F3, 0x00F4, 0x00F5, 0x00F6, - 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, - 0x00FD, 0x00FE, 0x00FF, 0x0100, 0x0101, 0x0102, - 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, - 0x0109, 0x010A, 0x010B, 0x010C, 0x010D, 0x01F3, - 0x01F4, 0x01F5, 0x01F6, 0x01F7, 0x01F8, 0x01F9, - 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF, - 0x0200, 0x0201, 0x0202, 0x0203, 0x0204, 0x0205, - 0x0206, 0x0207, 0x0208, 0x0209, 0x020A, 0x020B, - 0x020C, 0x020D, 0x02F3, 0x02F4, 0x02F5, 0x02F6, - 0x02F7, 0x02F8, 0x02F9, 0x02FA, 0x02FB, 0x02FC, - 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302, - 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x0308, - 0x0309, 0x030A, 0x030B, 0x030C, 0x030D, 0x03F3, - 0x03F4, 0x03F5, 0x03F6, 0x03F7, 0x03F8, 0x03F9, - 0x03FA, 0x03FB, 0x03FC, 0x03FD, 0x03FE, 0x03FF, - 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, - 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, - 0x040C, 0x040D, 0x04F3, 0x04F4, 0x04F5, 0x04F6, - 0x04F7, 0x04F8, 0x04F9, 0x04FA, 0x04FB, 0x04FC, - 0x04FD, 0x04FE, 0x04FF, 0x0500, 0x0501, 0x0502, - 0x0503, 0x0504, 0x0505, 0x0506, 0x0507, 0x0508, - 0x0509, 0x050A, 0x050B, 0x050C, 0x050D, 0x05F3, - 0x05F4, 0x05F5, 0x05F6, 0x05F7, 0x05F8, 0x05F9, - 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF, - 0x0600, 0x0601, 0x0602, 0x0603, 0x0604, 0x0605, - 0x0606, 0x0607, 0x0608, 0x0609, 0x060A, 0x060B, - 0x060C, 0x060D, 0x06F3, 0x06F4, 0x06F5, 0x06F6, - 0x06F7, 0x06F8, 0x06F9, 0x06FA, 0x06FB, 0x06FC, - 0x06FD, 0x06FE, 0x06FF, 0x0700, 0x0701, 0x0702, - 0x0703, 0x0704, 0x0705, 0x0706, 0x0707, 0x0708, - 0x0709, 0x070A, 0x070B, 0x070C, 0x070D, 0x07F3, - 0x07F4, 0x07F5, 0x07F6, 0x07F7, 0x07F8, 0x07F9, - 0x07FA, 0x07FB, 0x07FC, 0x07FD, 0x07FE, 0x07FF, - 0x0800, 0x0801, 0x0802, 0x0803, 0x0804, 0x0805, - 0x0806, 0x0807, 0x0808, 0x0809, 0x080A, 0x080B, - 0x080C, 0x080D, 0x08F3, 0x08F4, 0x08F5, 0x08F6, - 0x08F7, 0x08F8, 0x08F9, 0x08FA, 0x08FB, 0x08FC, - 0x08FD, 0x08FE, 0x08FF, 0x0900, 0x0901, 0x0902, - 0x0903, 0x0904, 0x0905, 0x0906, 0x0907, 0x0908, - 0x0909, 0x090A, 0x090B, 0x090C, 0x090D, 0x09F3, - 0x09F4, 0x09F5, 0x09F6, 0x09F7, 0x09F8, 0x09F9, - 0x09FA, 0x09FB, 0x09FC, 0x09FD, 0x09FE, 0x09FF, - 0x0A00, 0x0A01, 0x0A02, 0x0A03, 0x0A04, 0x0A05, - 0x0A06, 0x0A07, 0x0A08, 0x0A09, 0x0A0A, 0x0A0B, - 0x0A0C, 0x0A0D, 0x0AF3, 0x0AF4, 0x0AF5, 0x0AF6, - 0x0AF7, 0x0AF8, 0x0AF9, 0x0AFA, 0x0AFB, 0x0AFC, - 0x0AFD, 0x0AFE, 0x0AFF, 0x0B00, 0x0B01, 0x0B02, - 0x0B03, 0x0B04, 0x0B05, 0x0B06, 0x0B07, 0x0B08, - 0x0B09, 0x0B0A, 0x0B0B, 0x0B0C, 0x0B0D, 0x0BF3, - 0x0BF4, 0x0BF5, 0x0BF6, 0x0BF7, 0x0BF8, 0x0BF9, - 0x0BFA, 0x0BFB, 0x0BFC, 0x0BFD, 0x0BFE, 0x0BFF, - 0x0C00, 0x0C01, 0x0C02, 0x0C03, 0x0C04, 0x0C05, - 0x0C06, 0x0C07, 0x0C08, 0x0C09, 0x0C0A, 0x0C0B, - 0x0C0C, 0x0C0D, 0x0CF3, 0x0CF4, 0x0CF5, 0x0CF6, - 0x0CF7, 0x0CF8, 0x0CF9, 0x0CFA, 0x0CFB, 0x0CFC, - 0x0CFD, 0x0CFE, 0x0CFF, 0x0D00, 0x0D01, 0x0D02, - 0x0D03, 0x0D04, 0x0D05, 0x0D06, 0x0D07, 0x0D08, - 0x0D09, 0x0D0A, 0x0D0B, 0x0D0C, 0x0D0D, 0x0DF3, - 0x0DF4, 0x0DF5, 0x0DF6, 0x0DF7, 0x0DF8, 0x0DF9, - 0x0DFA, 0x0DFB, 0x0DFC, 0x0DFD, 0x0DFE, 0x0DFF, - 0xF300, 0xF301, 0xF302, 0xF303, 0xF304, 0xF305, - 0xF306, 0xF307, 0xF308, 0xF309, 0xF30A, 0xF30B, - 0xF30C, 0xF30D, 0xF3F3, 0xF3F4, 0xF3F5, 0xF3F6, - 0xF3F7, 0xF3F8, 0xF3F9, 0xF3FA, 0xF3FB, 0xF3FC, - 0xF3FD, 0xF3FE, 0xF3FF, 0xF400, 0xF401, 0xF402, - 0xF403, 0xF404, 0xF405, 0xF406, 0xF407, 0xF408, - 0xF409, 0xF40A, 0xF40B, 0xF40C, 0xF40D, 0xF4F3, - 0xF4F4, 0xF4F5, 0xF4F6, 0xF4F7, 0xF4F8, 0xF4F9, - 0xF4FA, 0xF4FB, 0xF4FC, 0xF4FD, 0xF4FE, 0xF4FF, - 0xF500, 0xF501, 0xF502, 0xF503, 0xF504, 0xF505, - 0xF506, 0xF507, 0xF508, 0xF509, 0xF50A, 0xF50B, - 0xF50C, 0xF50D, 0xF5F3, 0xF5F4, 0xF5F5, 0xF5F6, - 0xF5F7, 0xF5F8, 0xF5F9, 0xF5FA, 0xF5FB, 0xF5FC, - 0xF5FD, 0xF5FE, 0xF5FF, 0xF600, 0xF601, 0xF602, - 0xF603, 0xF604, 0xF605, 0xF606, 0xF607, 0xF608, - 0xF609, 0xF60A, 0xF60B, 0xF60C, 0xF60D, 0xF6F3, - 0xF6F4, 0xF6F5, 0xF6F6, 0xF6F7, 0xF6F8, 0xF6F9, - 0xF6FA, 0xF6FB, 0xF6FC, 0xF6FD, 0xF6FE, 0xF6FF, - 0xF700, 0xF701, 0xF702, 0xF703, 0xF704, 0xF705, - 0xF706, 0xF707, 0xF708, 0xF709, 0xF70A, 0xF70B, - 0xF70C, 0xF70D, 0xF7F3, 0xF7F4, 0xF7F5, 0xF7F6, - 0xF7F7, 0xF7F8, 0xF7F9, 0xF7FA, 0xF7FB, 0xF7FC, - 0xF7FD, 0xF7FE, 0xF7FF, 0xF800, 0xF801, 0xF802, - 0xF803, 0xF804, 0xF805, 0xF806, 0xF807, 0xF808, - 0xF809, 0xF80A, 0xF80B, 0xF80C, 0xF80D, 0xF8F3, - 0xF8F4, 0xF8F5, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9, - 0xF8FA, 0xF8FB, 0xF8FC, 0xF8FD, 0xF8FE, 0xF8FF, - 0xF900, 0xF901, 0xF902, 0xF903, 0xF904, 0xF905, - 0xF906, 0xF907, 0xF908, 0xF909, 0xF90A, 0xF90B, - 0xF90C, 0xF90D, 0xF9F3, 0xF9F4, 0xF9F5, 0xF9F6, - 0xF9F7, 0xF9F8, 0xF9F9, 0xF9FA, 0xF9FB, 0xF9FC, - 0xF9FD, 0xF9FE, 0xF9FF, 0xFA00, 0xFA01, 0xFA02, - 0xFA03, 0xFA04, 0xFA05, 0xFA06, 0xFA07, 0xFA08, - 0xFA09, 0xFA0A, 0xFA0B, 0xFA0C, 0xFA0D, 0xFAF3, - 0xFAF4, 0xFAF5, 0xFAF6, 0xFAF7, 0xFAF8, 0xFAF9, - 0xFAFA, 0xFAFB, 0xFAFC, 0xFAFD, 0xFAFE, 0xFAFF, - 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0xFB05, - 0xFB06, 0xFB07, 0xFB08, 0xFB09, 0xFB0A, 0xFB0B, - 0xFB0C, 0xFB0D, 0xFBF3, 0xFBF4, 0xFBF5, 0xFBF6, - 0xFBF7, 0xFBF8, 0xFBF9, 0xFBFA, 0xFBFB, 0xFBFC, - 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, 0xFC01, 0xFC02, - 0xFC03, 0xFC04, 0xFC05, 0xFC06, 0xFC07, 0xFC08, - 0xFC09, 0xFC0A, 0xFC0B, 0xFC0C, 0xFC0D, 0xFCF3, - 0xFCF4, 0xFCF5, 0xFCF6, 0xFCF7, 0xFCF8, 0xFCF9, - 0xFCFA, 0xFCFB, 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF, - 0xFD00, 0xFD01, 0xFD02, 0xFD03, 0xFD04, 0xFD05, - 0xFD06, 0xFD07, 0xFD08, 0xFD09, 0xFD0A, 0xFD0B, - 0xFD0C, 0xFD0D, 0xFDF3, 0xFDF4, 0xFDF5, 0xFDF6, - 0xFDF7, 0xFDF8, 0xFDF9, 0xFDFA, 0xFDFB, 0xFDFC, - 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, 0xFE01, 0xFE02, - 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07, 0xFE08, - 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, 0xFE0D, 0xFEF3, - 0xFEF4, 0xFEF5, 0xFEF6, 0xFEF7, 0xFEF8, 0xFEF9, - 0xFEFA, 0xFEFB, 0xFEFC, 0xFEFD, 0xFEFE, 0xFEFF, - 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05, - 0xFF06, 0xFF07, 0xFF08, 0xFF09, 0xFF0A, 0xFF0B, - 0xFF0C, 0xFF0D, 0xFFF3, 0xFFF4, 0xFFF5, 0xFFF6, - 0xFFF7, 0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, - 0xFFFD, 0xFFFE, 0xFFFF, +static const uint16_t on2avc_cb11_syms[ON2AVC_CB_11_CODES] = { + 0x0000, 0xFA04, 0xFBFA, 0xFAFB, 0xFE04, 0x0103, 0xFDFC, 0xFB03, 0x0504, + 0x04FF, 0xFF07, 0x04FE, 0x0506, 0x01FA, 0xFDFE, 0xFAFF, 0x07FF, 0xFD05, + 0x05F9, 0x0302, 0xFE07, 0xF902, 0x0701, 0x0005, 0xF907, 0x07F9, 0xFC02, + 0x05FE, 0xF9FA, 0xFA01, 0x0203, 0xFF06, 0x0304, 0x0702, 0x03FE, 0xFEFD, + 0xFEFE, 0xFFF9, 0x0607, 0xF905, 0xF9FE, 0x0307, 0x0106, 0x06FC, 0xF900, + 0x0404, 0x0605, 0x01F9, 0x0500, 0x00FB, 0x0601, 0x04FD, 0x07FE, 0xFD02, + 0x02F9, 0x0403, 0x0202, 0x02FD, 0xFEF9, 0xFC03, 0xFE06, 0x03F9, 0xFB07, + 0xFAF9, 0xFFFA, 0xFCFD, 0x0007, 0xFE03, 0xFD04, 0x04FB, 0x05FC, 0x0206, + 0x0606, 0x0703, 0x06FE, 0xF9FF, 0xFAFA, 0x0207, 0xF9FD, 0x0107, 0x06FB, + 0x02FE, 0x0303, 0x0400, 0xFB04, 0xFBFB, 0xFE02, 0xFA02, 0x02FA, 0xFEFA, + 0xFB06, 0x0004, 0xFAFE, 0x0700, 0xFB00, 0xF906, 0x00FD, 0x03FC, 0xFA05, + 0x00FA, 0xFD07, 0xFC05, 0x06F9, 0xFDFD, 0x07FD, 0xFCFC, 0x0300, 0xF903, + 0xFDF9, 0x0602, 0x05FA, 0xF9F9, 0xFB05, 0x0600, 0x0006, 0xFD00, 0x00FC, + 0x07FC, 0x0306, 0xFDFA, 0xFD06, 0x0003, 0x0603, 0x0407, 0xFA07, 0x07FA, + 0xFFFE, 0xFAFD, 0x00F9, 0xFCF9, 0x0604, 0x06FD, 0x0201, 0x03FA, 0xF9FC, + 0x01FB, 0x0704, 0xFBFD, 0xFEFB, 0x0105, 0xFFFF, 0x02FF, 0xFE01, 0x01FE, + 0xFEFF, 0x0101, 0xFF01, 0x01FF, 0xFCFA, 0x0205, 0xFC00, 0xFD03, 0xFF05, + 0x04F9, 0x03FD, 0xFA03, 0x05FF, 0x0707, 0x05FB, 0xF904, 0xFBF9, 0x0102, + 0xFF02, 0xFAFC, 0xFFFB, 0xFB01, 0x0104, 0x06FA, 0x07FB, 0x06FF, 0xFA06, + 0xFE05, 0x0502, 0xFBFF, 0x0401, 0xFC04, 0xFDFB, 0xFA00, 0x0204, 0x0301, + 0x01FC, 0x0406, 0x0200, 0xFD01, 0x0305, 0x0507, 0x0705, 0xFC07, 0x0002, + 0xFF03, 0xFC06, 0x02FB, 0xFB02, 0x00FE, 0xFC01, 0xFCFB, 0x0501, 0xFF04, + 0x04FC, 0x0503, 0x03FF, 0xFFFD, 0x04FA, 0xFEFC, 0x0402, 0x03FB, 0x0505, + 0xFE00, 0x01FD, 0x02FC, 0x0706, 0xFBFE, 0xFDFF, 0xFFFC, 0xF9FB, 0xFBFC, + 0xFCFE, 0xF901, 0xFCFF, 0x05FD, 0x0405, 0x0100, 0xFF00, 0x0001, 0x00FF, }; -#define ON2AVC_CB15_CODES 1089 -static const uint16_t on2avc_cb15_codes[ON2AVC_CB15_CODES] = { - 0x00000, 0x0000A, 0x00064, 0x00104, 0x0034B, 0x0047B, - 0x007D7, 0x00E14, 0x00957, 0x021FD, 0x013B0, 0x03F08, - 0x07A01, 0x0E579, 0x00E15, 0x013A1, 0x003A2, 0x00397, - 0x0137F, 0x01F96, 0x021FC, 0x034CD, 0x01E97, 0x01A82, - 0x013A0, 0x01A83, 0x0089D, 0x00F6B, 0x0076C, 0x0026A, - 0x00118, 0x0006E, 0x00008, 0x0000B, 0x00015, 0x00076, - 0x000EC, 0x001D2, 0x003A6, 0x00716, 0x00726, 0x01F98, - 0x00E77, 0x01BF0, 0x01A84, 0x021FE, 0x021FF, 0x00D93, - 0x01A85, 0x0036E, 0x003B4, 0x00FFE, 0x00FDF, 0x07A02, - 0x065AF, 0x01E98, 0x01F97, 0x00E16, 0x00F30, 0x00CF0, - 0x00846, 0x00398, 0x0020F, 0x000EB, 0x00074, 0x00012, - 0x0007C, 0x00049, 0x0009C, 0x00136, 0x00344, 0x0026D, - 0x0076E, 0x00847, 0x00F6C, 0x00958, 0x01A86, 0x00F6D, - 0x013A3, 0x013B1, 0x009F8, 0x00F31, 0x0032F, 0x00268, - 0x00FE0, 0x0076D, 0x01F99, 0x013A2, 0x03D05, 0x0111A, - 0x00FFF, 0x00CF1, 0x0080D, 0x004FA, 0x0040B, 0x0023E, - 0x0011B, 0x0008E, 0x00077, 0x0010A, 0x000F8, 0x001B0, - 0x001D4, 0x003D9, 0x004C6, 0x006AE, 0x007DE, 0x0080E, - 0x00F33, 0x00E78, 0x01BF1, 0x0111B, 0x034CE, 0x00959, - 0x0111C, 0x00262, 0x001FA, 0x00F32, 0x00FE1, 0x02200, - 0x01F9A, 0x013A4, 0x00E17, 0x00FE2, 0x004B7, 0x00FE3, - 0x00717, 0x00453, 0x00366, 0x001C6, 0x0011A, 0x0010E, - 0x0032B, 0x0023F, 0x00345, 0x0035A, 0x0036F, 0x007B6, - 0x00E19, 0x00705, 0x0076F, 0x0111D, 0x00E79, 0x00D57, - 0x01BF4, 0x01A87, 0x0095B, 0x0095C, 0x00216, 0x0039A, - 0x00F34, 0x0095A, 0x01BF2, 0x01BF3, 0x01000, 0x00F6E, - 0x00F6F, 0x00E18, 0x007DF, 0x008F1, 0x007BE, 0x003BD, - 0x003EB, 0x00342, 0x0022D, 0x00772, 0x007BF, 0x00454, - 0x00455, 0x0071E, 0x004FB, 0x00727, 0x0080F, 0x009E7, - 0x00E7C, 0x01BF6, 0x01A89, 0x01001, 0x01BF7, 0x0089E, - 0x00E1A, 0x0027F, 0x00334, 0x00F35, 0x00F36, 0x01BF5, - 0x01F9B, 0x013A5, 0x00E7A, 0x0095D, 0x00D58, 0x00E7B, - 0x01A88, 0x00FE4, 0x006CE, 0x0040E, 0x00687, 0x006D2, - 0x00E1C, 0x00706, 0x00747, 0x006B6, 0x0084E, 0x00CF2, - 0x006F2, 0x00D59, 0x00CF3, 0x01004, 0x013A6, 0x00F71, - 0x01A8B, 0x01E99, 0x00D5A, 0x00D94, 0x00335, 0x0022E, - 0x0095E, 0x00E1B, 0x01A8A, 0x01BF8, 0x01BF9, 0x01002, - 0x009F9, 0x00F70, 0x01003, 0x00773, 0x00F37, 0x00812, - 0x004D2, 0x004A3, 0x0089F, 0x013A9, 0x013AA, 0x00813, - 0x0081E, 0x00707, 0x008A0, 0x00E1E, 0x00D95, 0x008F2, - 0x009FB, 0x00E7D, 0x00E7E, 0x00F39, 0x01F9C, 0x00CF4, - 0x00F75, 0x00346, 0x0026E, 0x01005, 0x00F72, 0x013A7, - 0x0111E, 0x01BFA, 0x00F73, 0x013A8, 0x00F38, 0x00F74, - 0x009FA, 0x00FE5, 0x0084F, 0x0095F, 0x00E1D, 0x009EA, - 0x01A8D, 0x00E20, 0x00E21, 0x007CE, 0x00D96, 0x01008, - 0x00E22, 0x00960, 0x01121, 0x00E7F, 0x01122, 0x01A8E, - 0x01BFB, 0x01A8F, 0x008A1, 0x01009, 0x0035F, 0x00368, - 0x013B2, 0x01A8C, 0x01F9D, 0x02201, 0x01006, 0x0111F, - 0x013AB, 0x013AC, 0x01120, 0x00F76, 0x01007, 0x009FC, - 0x008F3, 0x00E1F, 0x01E9A, 0x01F9F, 0x013B3, 0x00F3B, - 0x00F77, 0x00F78, 0x00FE7, 0x009FD, 0x00FE8, 0x01123, - 0x00D97, 0x01BFF, 0x00E80, 0x01A93, 0x01124, 0x00D9E, - 0x00D5B, 0x003DA, 0x003A7, 0x00961, 0x01BFC, 0x01F9E, - 0x01BFD, 0x01BFE, 0x01A90, 0x01A91, 0x013AD, 0x00F3A, - 0x01A92, 0x00FE6, 0x00962, 0x0085E, 0x00963, 0x013AE, - 0x03D06, 0x01C01, 0x013B5, 0x00965, 0x01FA2, 0x02202, - 0x009FE, 0x00F79, 0x00F7A, 0x00E23, 0x00E26, 0x00966, - 0x013B1, 0x01E9C, 0x00F7B, 0x008A2, 0x003FE, 0x003AB, - 0x00964, 0x013B4, 0x01C00, 0x01E9B, 0x01FA0, 0x01FA1, - 0x0100A, 0x013AF, 0x03F09, 0x00E81, 0x01A94, 0x01125, - 0x01126, 0x01A95, 0x013B0, 0x03D08, 0x01E9E, 0x01FA3, - 0x013B4, 0x01A99, 0x0100B, 0x013B9, 0x00F3E, 0x00967, - 0x00E27, 0x0100C, 0x01E9F, 0x00968, 0x01C05, 0x00F3F, - 0x00E82, 0x0039B, 0x00386, 0x01A96, 0x01C02, 0x03D07, - 0x013B6, 0x01C03, 0x01E9D, 0x01127, 0x01A97, 0x01C04, - 0x013B2, 0x013B3, 0x013B7, 0x01A98, 0x013B8, 0x03F0A, - 0x0E57A, 0x07A03, 0x013BB, 0x01FA4, 0x01A9C, 0x01FA5, - 0x01FA6, 0x013BC, 0x0100D, 0x01FA7, 0x013B5, 0x0100E, - 0x01A9D, 0x0100F, 0x0096A, 0x01128, 0x00328, 0x003FF, - 0x00969, 0x01EA0, 0x01C06, 0x013BA, 0x01A9A, 0x034CF, - 0x00F7C, 0x02203, 0x034D2, 0x01EA1, 0x01C07, 0x02204, - 0x01A9B, 0x01EA2, 0x06982, 0x03D09, 0x0E57B, 0x01FA8, - 0x013C2, 0x013C3, 0x01129, 0x01FA9, 0x0112A, 0x01010, - 0x01FAA, 0x01EA6, 0x03F0F, 0x013B6, 0x00CF5, 0x0072A, - 0x00F7D, 0x00340, 0x0025F, 0x02205, 0x02206, 0x06983, - 0x01C08, 0x013BD, 0x013BE, 0x01EA3, 0x013BF, 0x034D3, - 0x01EA4, 0x02207, 0x01A9E, 0x01EA5, 0x03F0B, 0x03F0E, - 0x01AA2, 0x00E00, 0x00E3E, 0x00D9F, 0x00D5F, 0x00CF7, - 0x00CFE, 0x01011, 0x00E85, 0x00E01, 0x00E02, 0x0096B, - 0x00CFF, 0x00F92, 0x00D6E, 0x008CA, 0x00359, 0x00456, - 0x01CAE, 0x03D0A, 0x01A9F, 0x0112B, 0x00E83, 0x013B7, - 0x00F7E, 0x009FF, 0x00E84, 0x00FE9, 0x009EB, 0x00F7F, - 0x008A3, 0x00D5E, 0x00CF6, 0x0112E, 0x0112F, 0x01016, - 0x00F93, 0x01FAE, 0x00FEA, 0x00FEB, 0x009A6, 0x00E03, - 0x01C0A, 0x01017, 0x01C0B, 0x01FAF, 0x00F9E, 0x013BB, - 0x0196A, 0x0039C, 0x003F6, 0x0379A, 0x03D0B, 0x01FAB, - 0x01EA7, 0x013B8, 0x01012, 0x01AA3, 0x01C09, 0x013B9, - 0x01013, 0x00CB4, 0x00E86, 0x01F3E, 0x013BA, 0x00E87, - 0x007FB, 0x003CF, 0x0037A, 0x003AD, 0x00387, 0x0038A, - 0x003B5, 0x0039E, 0x0026F, 0x0038B, 0x00272, 0x0039F, - 0x00399, 0x0038E, 0x00252, 0x0039A, 0x00018, 0x0001B, - 0x003CE, 0x00457, 0x003E8, 0x0067E, 0x0041A, 0x003BE, - 0x003BF, 0x003EE, 0x00437, 0x0039D, 0x003AC, 0x00464, - 0x003C6, 0x003C7, 0x0041B, 0x007F6, 0x0042E, 0x0025C, - 0x0038C, 0x003BA, 0x003E9, 0x003EA, 0x00271, 0x003BB, - 0x0026A, 0x0025D, 0x0025E, 0x00389, 0x003EE, 0x004F4, - 0x00415, 0x0001A, 0x00017, 0x00388, 0x0038E, 0x003FC, - 0x00270, 0x00378, 0x0038A, 0x003AE, 0x003AA, 0x00398, - 0x003E8, 0x00358, 0x00414, 0x00384, 0x003B8, 0x006D3, - 0x01A6B, 0x00FEA, 0x01BCE, 0x009E4, 0x00E56, 0x01BCF, - 0x0131D, 0x009E5, 0x01BD8, 0x01BD9, 0x034C0, 0x01F86, - 0x01A6C, 0x01F3F, 0x065AC, 0x072BE, 0x00436, 0x0022C, - 0x009E0, 0x00F54, 0x009E2, 0x01104, 0x01105, 0x00FE8, - 0x009E3, 0x00FE9, 0x00F55, 0x0131C, 0x01A68, 0x01A6A, - 0x00E06, 0x01106, 0x01BCC, 0x00E6E, 0x00E3F, 0x00CB7, - 0x00F28, 0x00702, 0x0094E, 0x00F29, 0x00FEC, 0x00F2A, - 0x0131E, 0x00F56, 0x0131F, 0x00F57, 0x0110A, 0x0134E, - 0x01E86, 0x00712, 0x001F6, 0x0081F, 0x00D6F, 0x00FEB, - 0x01107, 0x00CB6, 0x0094C, 0x01BDA, 0x01108, 0x01109, - 0x009E6, 0x00E6C, 0x01F88, 0x00E6D, 0x00896, 0x0094D, - 0x03F00, 0x01E88, 0x0217C, 0x03F01, 0x03F02, 0x01399, - 0x01E89, 0x0E578, 0x0139A, 0x01E8A, 0x01F8A, 0x01F8B, - 0x01E8B, 0x03D02, 0x01F8C, 0x0139B, 0x00392, 0x0035E, - 0x00F58, 0x009DE, 0x0094F, 0x01358, 0x01359, 0x0135A, - 0x0134F, 0x01BDB, 0x0135B, 0x0379B, 0x01F89, 0x01398, - 0x034C2, 0x065AD, 0x01E87, 0x03F04, 0x07A00, 0x0217D, - 0x01A6D, 0x065AE, 0x01E8C, 0x0217E, 0x01BDD, 0x0135C, - 0x01A6E, 0x034C4, 0x01E8D, 0x03F05, 0x01E8E, 0x0217F, - 0x0139D, 0x003F7, 0x0032C, 0x034C3, 0x00E07, 0x0110B, - 0x009E7, 0x00F59, 0x03D03, 0x00D8A, 0x01F8D, 0x00E6F, - 0x00FED, 0x03F03, 0x00FEE, 0x01BDC, 0x0139C, 0x072BF, - 0x03F06, 0x021F2, 0x01A70, 0x021F3, 0x0135E, 0x0139E, - 0x01F8E, 0x01F8F, 0x0139F, 0x01E91, 0x013A0, 0x0135F, - 0x034C6, 0x0110E, 0x01A71, 0x021F4, 0x0026C, 0x00206, - 0x0110C, 0x009E8, 0x01BDE, 0x00F5A, 0x00FEF, 0x0135D, - 0x00FF0, 0x01E8F, 0x021F0, 0x009E9, 0x01E90, 0x021F1, - 0x01A6F, 0x0110D, 0x034C5, 0x021F5, 0x01A73, 0x01BE2, - 0x01BE3, 0x01F91, 0x01A74, 0x00E70, 0x021F6, 0x034C8, - 0x00FF3, 0x01F92, 0x013A1, 0x013A2, 0x013A3, 0x01A75, - 0x01372, 0x003BC, 0x00341, 0x034C7, 0x00950, 0x00FF1, - 0x00FF2, 0x009EA, 0x00F5B, 0x01370, 0x01BDF, 0x01371, - 0x01A72, 0x01BE0, 0x009EB, 0x01F90, 0x0110F, 0x01BE1, - 0x01E92, 0x013A6, 0x00D8B, 0x00FD8, 0x01BE5, 0x00FF4, - 0x00FF5, 0x01BE6, 0x013A7, 0x00F5F, 0x01BE7, 0x021F7, - 0x021F8, 0x034C9, 0x009EC, 0x013A8, 0x003EF, 0x00269, - 0x00CD8, 0x00FD6, 0x00F5C, 0x013A4, 0x00F5D, 0x00F2B, - 0x00E08, 0x01110, 0x01BE4, 0x00E09, 0x013A5, 0x00F2C, - 0x00898, 0x00F5E, 0x01A76, 0x013A9, 0x00D8C, 0x009DF, - 0x009E0, 0x00FF8, 0x00D8D, 0x01374, 0x01A78, 0x01112, - 0x01BE8, 0x01A79, 0x01F93, 0x01113, 0x01375, 0x00F61, - 0x01376, 0x00399, 0x0027C, 0x009ED, 0x00F60, 0x01373, - 0x01A77, 0x00951, 0x009EE, 0x00D50, 0x00CD9, 0x00FF6, - 0x00FD9, 0x00FF7, 0x00899, 0x007C8, 0x00D52, 0x01111, - 0x009EF, 0x007D3, 0x007D4, 0x0071E, 0x00CDB, 0x00746, - 0x00E0A, 0x00E0B, 0x021F9, 0x00FF9, 0x01A7A, 0x00952, - 0x013AB, 0x01377, 0x009F0, 0x01E93, 0x003AF, 0x0032E, - 0x009E1, 0x007CA, 0x013AA, 0x01114, 0x00F62, 0x00E71, - 0x008CB, 0x008CC, 0x0089A, 0x008CD, 0x00840, 0x00CDA, - 0x007D2, 0x009E2, 0x00E72, 0x00F63, 0x006D6, 0x00841, - 0x0079E, 0x00D53, 0x008CE, 0x00955, 0x00E0C, 0x0137A, - 0x00E74, 0x01115, 0x01F94, 0x01116, 0x01BEA, 0x00E0D, - 0x01A7B, 0x0038D, 0x0033E, 0x00CDC, 0x00D8E, 0x01BE9, - 0x01378, 0x01379, 0x00FDA, 0x00E73, 0x00953, 0x00954, - 0x009E3, 0x004D6, 0x007B7, 0x007BA, 0x007BB, 0x004A0, - 0x0089B, 0x006D7, 0x0047A, 0x00408, 0x007F7, 0x00E0E, - 0x009E4, 0x007D5, 0x00842, 0x00D90, 0x009F1, 0x034CA, - 0x01A7C, 0x01A7D, 0x00E0F, 0x01A7E, 0x00329, 0x0021E, - 0x00F64, 0x01117, 0x021FA, 0x01118, 0x013AC, 0x013AD, - 0x00D8F, 0x008CF, 0x008F0, 0x0071F, 0x004A1, 0x00686, - 0x00426, 0x00416, 0x007CB, 0x003D8, 0x00264, 0x00347, - 0x003DC, 0x004F6, 0x004D7, 0x00F2D, 0x00F65, 0x009F3, - 0x00FDB, 0x00E75, 0x009F4, 0x0137B, 0x013AE, 0x009E5, - 0x00E10, 0x0027E, 0x0020C, 0x00FFA, 0x00956, 0x01BEB, - 0x01E94, 0x01E95, 0x00D91, 0x009F2, 0x00D54, 0x007BC, - 0x007BD, 0x0040A, 0x00385, 0x0036A, 0x0022F, 0x0020E, - 0x000FC, 0x000F2, 0x001AE, 0x001C8, 0x0034A, 0x004F7, - 0x00452, 0x00CDE, 0x00843, 0x00E76, 0x00F2E, 0x00F67, - 0x0137C, 0x01A7F, 0x0080C, 0x00FDC, 0x0021A, 0x001FC, - 0x00E11, 0x009F5, 0x01BEC, 0x00F66, 0x013AF, 0x00CDD, - 0x00E12, 0x00D55, 0x00703, 0x0080A, 0x00394, 0x00265, - 0x001F6, 0x001B6, 0x0010C, 0x00078, 0x0004C, 0x000CC, - 0x001A4, 0x00212, 0x00396, 0x006C4, 0x0089C, 0x00CDF, - 0x01A80, 0x00F68, 0x00FFD, 0x0137D, 0x01F95, 0x00845, - 0x00E13, 0x00267, 0x00266, 0x00FFB, 0x009F6, 0x03D04, - 0x01BED, 0x01BEE, 0x034CB, 0x00FFC, 0x00844, 0x007D6, - 0x00704, 0x003C8, 0x0032A, 0x00130, 0x000CE, 0x00048, - 0x0000C, 0x00014, 0x0007A, 0x000F0, 0x001E6, 0x00417, - 0x004A2, 0x004B6, 0x00D92, 0x01A81, 0x009F7, 0x0137E, - 0x01E96, 0x03F07, 0x009E6, 0x00FDE, 0x003C9, 0x00268, - 0x00F2F, 0x00D56, 0x021FB, 0x034CC, 0x01BEF, 0x00F69, - 0x01119, 0x00F6A, 0x00FDD, 0x007FA, 0x003E6, 0x001E2, - 0x000EA, 0x00072, 0x00016, +static const uint16_t on2avc_cb12_syms[ON2AVC_CB_12_CODES] = { + 0x0000, 0xFD03, 0x09FE, 0xFBFF, 0xF701, 0xF7F8, 0x0606, 0xFBFC, 0x0904, + 0x08FF, 0xFB05, 0x0207, 0x04F6, 0x0AFA, 0x0801, 0xF703, 0xFD05, 0xF904, + 0xFAF6, 0xFA02, 0x03F9, 0xF7FD, 0xFBFD, 0x04FF, 0x03F7, 0x0502, 0x0208, + 0x0AFB, 0x0007, 0xF709, 0xF604, 0xFB0A, 0x0204, 0x05F6, 0x0507, 0x0706, + 0xFA00, 0xFE08, 0xFDFB, 0xFD07, 0xFE07, 0x0401, 0x0006, 0x0107, 0x05FA, + 0x0506, 0x0009, 0x0702, 0x0703, 0x05FD, 0x0909, 0xF707, 0xF702, 0xFDF7, + 0xFD09, 0xFFFA, 0xFF08, 0x02F6, 0x0903, 0x04FE, 0x0402, 0xF8F6, 0xFCF9, + 0xFC0A, 0x02F9, 0xFF05, 0x0701, 0x070A, 0x03FD, 0x0905, 0x08F8, 0xFAF9, + 0xF8FE, 0xFC04, 0xFC09, 0xFFF8, 0x09FC, 0x09FD, 0xF7FE, 0x07FF, 0x09F8, + 0xFB09, 0xFCFB, 0xF801, 0xFC01, 0x02F8, 0x0104, 0x03F8, 0x0106, 0x090A, + 0xF90A, 0xF608, 0xFCFE, 0x0504, 0xF7F6, 0x00FA, 0x0407, 0x06FB, 0x09F9, + 0x0A04, 0xFF0A, 0x04FB, 0xF803, 0x00FC, 0x0405, 0x0604, 0xF6FA, 0xF60A, + 0x0AF7, 0xF809, 0xF901, 0xFF07, 0x04FA, 0xFBFB, 0x0707, 0x0A06, 0x0206, + 0x0509, 0xFC02, 0x0906, 0x0A07, 0x0607, 0x03FF, 0x01FC, 0x08FE, 0xF8FF, + 0xFCF7, 0x08F7, 0x0A0A, 0xFB00, 0xFB03, 0xFDFA, 0x01F6, 0x0802, 0x0505, + 0x0601, 0x0803, 0xFE04, 0x0103, 0xF7FC, 0xFAF7, 0xFA01, 0x00F7, 0x01FD, + 0xFFFC, 0x0309, 0x05FC, 0xFD01, 0xF8FD, 0x08FB, 0xF80A, 0xF70A, 0x0AF6, + 0x07FA, 0x0AF8, 0xFEFE, 0xFFFD, 0xF6F6, 0xF902, 0xF909, 0xFBF6, 0xF705, + 0xFEF6, 0xFD02, 0x0308, 0x0602, 0x0603, 0x0301, 0x02FC, 0x010A, 0xF6F9, + 0xF905, 0x0202, 0xFF04, 0xFAFE, 0xF906, 0x01F9, 0xFCFF, 0xFA08, 0xFC05, + 0xFDF8, 0x06FE, 0x07FB, 0x05F9, 0xFD08, 0x0408, 0xFAFF, 0xFE0A, 0x00FB, + 0x04F7, 0x0108, 0x0409, 0x0705, 0x0A09, 0x0800, 0xF6FF, 0x07F8, 0x0709, + 0xF601, 0xF7F9, 0xFE06, 0x0302, 0xFEFC, 0x01FA, 0x0AFF, 0x02FE, 0xFDFF, + 0x02F7, 0xF7F7, 0xFDF6, 0x01FF, 0xF8FC, 0xFEFA, 0x0A05, 0xF606, 0xFDFC, + 0xFFF6, 0x08FA, 0xFDFE, 0xFCFD, 0x0205, 0xFE02, 0x08FD, 0xF603, 0xF903, + 0x06F6, 0x0508, 0x02FA, 0x0900, 0xF704, 0xFB04, 0xFCF6, 0xFD06, 0xFD04, + 0x0403, 0xFEFD, 0x02FD, 0xFF03, 0x0A01, 0xF9FD, 0x09F6, 0x08F6, 0xF900, + 0xFA0A, 0x04F9, 0x06FA, 0xF807, 0xFBF7, 0x00F6, 0x0AFD, 0xFBF8, 0x0404, + 0x0101, 0xFFFF, 0xFF01, 0x03FE, 0x0008, 0x020A, 0x080A, 0xF6F7, 0x06F7, + 0x06F8, 0xF7FB, 0xF607, 0x0600, 0xFAFB, 0xFAFC, 0x03F6, 0x05F7, 0x0209, + 0x0304, 0x04FD, 0x0609, 0xFAFD, 0x0306, 0x0605, 0x0704, 0x08F9, 0x0804, + 0xF9F6, 0xFB07, 0x06F9, 0x07FD, 0xFA03, 0x0AF9, 0x0A08, 0x0005, 0x0AFE, + 0xF805, 0xFE09, 0xFE03, 0xFC00, 0xFC08, 0x0501, 0xF9F7, 0xFA09, 0xFCFA, + 0xFDF9, 0xFF06, 0x0AFC, 0xFAF8, 0xF6FD, 0xFA06, 0x0700, 0xFB02, 0xF9FB, + 0x000A, 0x02FF, 0x00FD, 0x0203, 0xF804, 0x06FD, 0xF602, 0xFEF7, 0xFE05, + 0xFEFF, 0x0201, 0xFF02, 0xFC03, 0xF9FF, 0xFBFA, 0x02FB, 0x0400, 0x05FE, + 0x08FC, 0x0902, 0x040A, 0xF609, 0xF907, 0x01FE, 0x0002, 0xFE00, 0xFFFE, + 0x00FE, 0x0608, 0xF908, 0x07FC, 0x09F7, 0xF800, 0xFEF9, 0x0A02, 0xF8F9, + 0xF808, 0xFA05, 0xFB01, 0x03FA, 0x0907, 0xFE01, 0xFFF7, 0x01F7, 0x0109, + 0x04F8, 0x0003, 0xFCF8, 0xFCFC, 0x0200, 0x00F8, 0x0806, 0xFBFE, 0xF7FA, + 0xFD0A, 0xFEFB, 0x05FF, 0xF8FB, 0x0406, 0x07F6, 0x060A, 0x0102, 0x0105, + 0xF600, 0xF8F7, 0xF9F8, 0xF806, 0x06FC, 0xFD00, 0xFF09, 0x0805, 0x0809, + 0xF6FE, 0xF9FC, 0xFAFA, 0x0307, 0x0500, 0x07F7, 0x0908, 0xFEF8, 0x0503, + 0x0A00, 0xF605, 0xF8F8, 0xF8FA, 0xFB08, 0x05F8, 0x01F8, 0xFB06, 0xFFF9, + 0x030A, 0x05FB, 0xF7FF, 0x050A, 0x09FB, 0x0807, 0x0A03, 0xF6F8, 0xFA07, + 0x0303, 0x0004, 0xF6FB, 0xF9FE, 0x09FF, 0xFC07, 0x09FA, 0xFFFB, 0x04FC, + 0x0901, 0xF708, 0x07F9, 0x00F9, 0x01FB, 0xFA04, 0xFBF9, 0x03FB, 0x03FC, + 0x0708, 0x0808, 0x0300, 0xFDFD, 0x06FF, 0xF9F9, 0xF6FC, 0xF700, 0x0305, + 0xF802, 0xF706, 0xF9FA, 0xFC06, 0x07FE, 0x0001, 0x0100, 0xFF00, 0x00FF, }; -static const uint8_t on2avc_cb15_bits[ON2AVC_CB15_CODES] = { - 2, 5, 7, 9, 10, 11, - 12, 12, 13, 14, 14, 14, - 16, 17, 12, 13, 11, 11, - 13, 13, 14, 14, 14, 13, - 13, 13, 12, 13, 12, 10, - 9, 7, 5, 5, 5, 7, - 9, 10, 11, 11, 12, 13, - 13, 13, 13, 14, 14, 12, - 13, 10, 11, 13, 12, 16, - 15, 14, 13, 12, 12, 12, - 12, 11, 10, 9, 7, 5, - 7, 8, 8, 9, 10, 11, - 12, 12, 13, 13, 13, 13, - 13, 14, 13, 12, 10, 10, - 12, 12, 13, 13, 15, 13, - 13, 12, 12, 11, 11, 10, - 9, 8, 7, 9, 9, 9, - 9, 10, 11, 11, 12, 12, - 12, 13, 13, 13, 14, 13, - 13, 10, 10, 12, 12, 14, - 13, 13, 12, 12, 12, 12, - 11, 11, 10, 10, 9, 9, - 10, 10, 10, 10, 10, 11, - 12, 12, 12, 13, 13, 12, - 13, 13, 13, 13, 10, 10, - 12, 13, 13, 13, 13, 13, - 13, 12, 12, 12, 11, 11, - 10, 10, 10, 12, 11, 11, - 11, 11, 11, 12, 12, 12, - 13, 13, 13, 13, 13, 12, - 12, 10, 10, 12, 12, 13, - 13, 13, 13, 13, 12, 13, - 13, 12, 11, 11, 11, 11, - 12, 12, 12, 11, 12, 12, - 11, 12, 12, 13, 13, 13, - 13, 14, 12, 12, 10, 10, - 13, 12, 13, 13, 13, 13, - 13, 13, 13, 12, 12, 12, - 12, 12, 12, 13, 13, 12, - 12, 12, 12, 12, 12, 12, - 13, 13, 13, 12, 13, 12, - 13, 10, 11, 13, 13, 13, - 13, 13, 13, 13, 12, 13, - 13, 12, 12, 13, 12, 12, - 13, 12, 12, 12, 12, 13, - 12, 13, 13, 13, 13, 13, - 13, 13, 12, 13, 10, 10, - 14, 13, 13, 14, 13, 13, - 13, 13, 13, 13, 13, 13, - 12, 12, 14, 13, 14, 12, - 13, 13, 12, 13, 12, 13, - 12, 13, 13, 13, 13, 12, - 12, 10, 11, 13, 13, 13, - 13, 13, 13, 13, 13, 12, - 13, 12, 13, 12, 13, 13, - 15, 13, 14, 13, 13, 14, - 13, 13, 13, 12, 12, 13, - 13, 14, 13, 12, 10, 10, - 13, 14, 13, 14, 13, 13, - 13, 13, 14, 13, 13, 13, - 13, 13, 13, 15, 14, 13, - 13, 13, 13, 14, 12, 13, - 12, 13, 14, 13, 13, 12, - 13, 10, 11, 13, 13, 15, - 14, 13, 14, 13, 13, 13, - 13, 13, 14, 13, 14, 14, - 17, 16, 14, 13, 13, 13, - 13, 14, 13, 13, 13, 13, - 13, 13, 13, 13, 10, 10, - 13, 14, 13, 14, 13, 14, - 13, 14, 14, 14, 13, 14, - 13, 14, 15, 15, 17, 13, - 14, 14, 13, 13, 13, 13, - 13, 14, 14, 13, 12, 12, - 13, 10, 11, 14, 14, 15, - 13, 14, 14, 14, 14, 14, - 14, 14, 13, 14, 14, 14, - 13, 13, 12, 12, 12, 12, - 12, 13, 13, 13, 13, 13, - 12, 13, 12, 12, 10, 11, - 14, 15, 13, 13, 13, 13, - 13, 13, 13, 12, 12, 13, - 12, 12, 12, 13, 13, 13, - 13, 13, 12, 12, 13, 13, - 13, 13, 13, 13, 13, 13, - 13, 10, 11, 14, 15, 13, - 14, 13, 13, 13, 13, 13, - 13, 12, 13, 14, 13, 13, - 11, 11, 10, 10, 11, 11, - 11, 10, 11, 11, 11, 10, - 11, 11, 11, 11, 5, 6, - 11, 11, 11, 11, 11, 11, - 11, 10, 11, 10, 10, 11, - 11, 11, 11, 11, 11, 11, - 10, 11, 10, 10, 11, 11, - 11, 11, 11, 11, 11, 11, - 11, 6, 5, 11, 10, 10, - 11, 10, 10, 10, 10, 10, - 10, 10, 11, 11, 11, 11, - 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 14, 13, - 13, 14, 15, 16, 11, 10, - 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, - 12, 13, 13, 13, 12, 12, - 12, 12, 13, 12, 13, 12, - 13, 13, 13, 13, 13, 14, - 14, 11, 10, 12, 12, 13, - 13, 12, 13, 13, 13, 13, - 13, 13, 13, 13, 12, 13, - 14, 14, 14, 14, 14, 14, - 14, 17, 14, 14, 13, 13, - 14, 15, 13, 14, 11, 10, - 13, 12, 13, 13, 13, 13, - 14, 13, 13, 14, 13, 14, - 14, 15, 14, 14, 16, 14, - 13, 15, 14, 14, 13, 13, - 13, 14, 14, 14, 14, 14, - 14, 11, 10, 14, 12, 13, - 13, 13, 15, 12, 13, 13, - 13, 14, 13, 13, 14, 16, - 14, 14, 13, 14, 13, 14, - 13, 13, 14, 14, 14, 13, - 14, 13, 13, 14, 11, 10, - 13, 13, 13, 13, 13, 13, - 13, 14, 14, 13, 14, 14, - 13, 13, 14, 14, 13, 13, - 13, 13, 13, 13, 14, 14, - 13, 13, 14, 14, 14, 13, - 13, 11, 10, 14, 13, 13, - 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, - 14, 14, 12, 12, 13, 13, - 13, 13, 14, 13, 13, 14, - 14, 14, 13, 14, 10, 10, - 12, 12, 13, 14, 13, 12, - 12, 13, 13, 12, 14, 12, - 12, 13, 13, 14, 12, 12, - 12, 13, 12, 13, 13, 13, - 13, 13, 13, 13, 13, 13, - 13, 10, 10, 13, 13, 13, - 13, 13, 13, 12, 12, 13, - 12, 13, 12, 12, 12, 13, - 13, 12, 12, 12, 12, 12, - 12, 12, 14, 13, 13, 13, - 14, 13, 13, 14, 10, 10, - 12, 12, 14, 13, 13, 13, - 12, 12, 12, 12, 12, 12, - 12, 12, 13, 13, 11, 12, - 11, 12, 12, 13, 12, 13, - 13, 13, 13, 13, 13, 12, - 13, 10, 10, 12, 12, 13, - 13, 13, 12, 13, 13, 13, - 12, 12, 11, 11, 11, 12, - 12, 11, 11, 11, 11, 12, - 12, 12, 12, 12, 13, 14, - 13, 13, 12, 13, 10, 10, - 13, 13, 14, 13, 14, 14, - 12, 12, 12, 12, 12, 11, - 11, 11, 12, 10, 10, 10, - 10, 11, 12, 12, 13, 13, - 12, 13, 13, 13, 14, 12, - 12, 10, 10, 13, 13, 13, - 14, 14, 12, 13, 12, 11, - 11, 11, 11, 10, 10, 10, - 9, 9, 9, 10, 10, 11, - 11, 12, 12, 13, 12, 13, - 13, 13, 12, 12, 10, 10, - 12, 13, 13, 13, 14, 12, - 12, 12, 12, 12, 11, 10, - 9, 9, 9, 7, 8, 8, - 9, 10, 11, 11, 12, 12, - 13, 13, 13, 13, 13, 12, - 12, 10, 10, 13, 13, 15, - 13, 13, 14, 13, 12, 12, - 12, 10, 10, 9, 8, 8, - 5, 5, 7, 9, 10, 11, - 12, 12, 12, 13, 13, 13, - 14, 14, 12, 12, 10, 11, - 12, 12, 14, 14, 13, 13, - 13, 13, 12, 11, 11, 10, - 9, 7, 5, +static const uint16_t on2avc_cb13_syms[ON2AVC_CB_13_CODES] = { + 0x0000, 0x0201, 0xFDFF, 0x03FE, 0x0302, 0xF909, 0xF90A, 0xFA00, 0xFA0A, + 0x00F7, 0x08F6, 0x09F6, 0x09F8, 0x0901, 0x0AF7, 0x0A03, 0x0BF4, 0xF6F7, + 0xF6FB, 0xF6FF, 0xF600, 0xF706, 0xF801, 0xF806, 0xF808, 0xFDF6, 0xFF09, + 0xFF0A, 0x00F8, 0x0109, 0x02F7, 0x04F7, 0x05F7, 0x05F8, 0x06F7, 0x07F7, + 0x09FA, 0x09FD, 0x0AFB, 0xF6FC, 0x0AFC, 0x0AFD, 0xF60C, 0xF7FF, 0xF8F9, + 0xFA08, 0xFB07, 0xFCF9, 0xFD08, 0x00F9, 0x0208, 0x0409, 0x05FA, 0x05FB, + 0x06FB, 0x0603, 0x060A, 0x0704, 0x0707, 0x0AF5, 0x0A09, 0x0CF5, 0xF4F8, + 0xF5F9, 0x0202, 0xF508, 0xF509, 0xFC0C, 0x0408, 0x0BFC, 0x05FF, 0x0B0A, + 0xFEFF, 0xFEFE, 0xFFFD, 0xFDFD, 0x0CFC, 0xF404, 0xFE00, 0x00FE, 0xFF02, + 0xF506, 0xF507, 0xF7F4, 0xFA01, 0xFB04, 0xFC05, 0x000C, 0x0105, 0x0106, + 0x04FB, 0x05FD, 0x0505, 0x0506, 0x0605, 0x060C, 0x070C, 0xFDFC, 0x0BF8, + 0x0CFB, 0xFE06, 0x0502, 0xFE03, 0xFD03, 0x0C09, 0xF40C, 0xF6F9, 0xFEF5, + 0xFFF4, 0x020C, 0x04F5, 0x0B02, 0xF7F9, 0xF701, 0xF70C, 0xF8FA, 0xF9FD, + 0xF903, 0xFBF7, 0xFC07, 0xFDF8, 0x0108, 0x02F6, 0x0209, 0xFE01, 0x02FF, + 0x0002, 0x020A, 0x03F8, 0x050A, 0x06F8, 0x07FA, 0x07FC, 0x08F7, 0x08FF, + 0xF406, 0xF80C, 0xFA05, 0xFBFF, 0xFE07, 0x0207, 0x06F4, 0x06FE, 0x0601, + 0x0607, 0x07F4, 0x0706, 0xFF00, 0x01FE, 0xF5FB, 0x080C, 0x0CFA, 0xFAF5, + 0x03FC, 0x030B, 0x0B03, 0xF504, 0x0C00, 0x0A08, 0xF601, 0x0CF4, 0xF609, + 0xF60A, 0xFD01, 0xFBF5, 0xFB02, 0xFF03, 0xF5FA, 0xF9F4, 0xF902, 0xF90C, + 0xFBF9, 0xFBFA, 0xFEF8, 0xFFFB, 0xFF06, 0x0306, 0x0405, 0x050C, 0x03FF, + 0xF5FD, 0x0403, 0x0102, 0xFFFE, 0xF401, 0xFBFE, 0x01F4, 0x02FB, 0xF605, + 0xF80A, 0xF9F7, 0xF908, 0xFA07, 0xFBF6, 0xFB08, 0xFB0A, 0xFC09, 0xFD0A, + 0x010A, 0x040A, 0x08FA, 0x0800, 0x09FB, 0x09FC, 0xF4F4, 0x0900, 0x0A00, + 0xF4F5, 0xF6F8, 0xF7F8, 0xF7FA, 0xF9FF, 0xFB05, 0x00FA, 0x0007, 0x01F8, + 0x04F9, 0x0600, 0x07F8, 0x07FF, 0x08FD, 0x0808, 0x09F9, 0x0BF5, 0x0CF8, + 0xF40A, 0xF8FE, 0xFAFD, 0xFA0C, 0xFEFA, 0x0004, 0x05FC, 0x0507, 0x090B, + 0x0C06, 0x00FF, 0x0001, 0x0100, 0xF4FD, 0xF505, 0xF9F5, 0xFC03, 0x0103, + 0x00F5, 0x01FC, 0x050B, 0xF4FF, 0xFE05, 0xFF04, 0xFD02, 0x0B05, 0xF4F9, + 0xF5F6, 0xF50B, 0xF9FC, 0xF906, 0xFD04, 0xFE08, 0x0508, 0x090A, 0x0BF7, + 0x0B0B, 0x0B0C, 0x0CF9, 0x0C08, 0xFA0B, 0xFCF5, 0xFCFD, 0x000B, 0x0B04, + 0x0CFF, 0x02FD, 0x0C01, 0xF500, 0xFBFB, 0x060B, 0x0BFB, 0x0B09, 0xFDFE, + 0x0C03, 0xF6FA, 0x0A02, 0xF708, 0x0AF6, 0x0AF8, 0x0A01, 0xF602, 0xF7FB, + 0x01FD, 0x0203, 0xF702, 0xF8FF, 0xF800, 0xF802, 0xF805, 0xF905, 0xF907, + 0xFAF6, 0xFAF7, 0xFCF6, 0xFD09, 0x03F7, 0x06FD, 0x08FC, 0x0806, 0x09F4, + 0x0903, 0x0908, 0x0AF9, 0x0AFE, 0x0AFF, 0x0A04, 0x0A05, 0x0A06, 0xF4FB, + 0x0A0A, 0x0C0C, 0xF9FB, 0xFA04, 0xFC04, 0xFEF7, 0xFFF8, 0xFFF9, 0x0005, + 0x02F8, 0x03FA, 0x0308, 0xF402, 0x0407, 0x0701, 0xF503, 0xFBFD, 0xFE0C, + 0x080B, 0x0BFD, 0x0B06, 0x0CFD, 0x0CFE, 0xFBFC, 0xFC01, 0xFEFB, 0xFF0C, + 0x04FF, 0x040C, 0x070B, 0x0BFA, 0x0B08, 0xF40B, 0xF803, 0xFE0B, 0xF9F9, + 0xF9FA, 0xF901, 0xFB06, 0xFEF9, 0xFFFA, 0x00FB, 0x0307, 0x0400, 0x08F4, + 0x08FB, 0x08FE, 0xF4FE, 0x0807, 0x09F5, 0xFCFF, 0x0205, 0xFF0B, 0x0501, + 0x0C0A, 0xF50C, 0xF700, 0xFB09, 0x000A, 0xF603, 0xF7FC, 0xFB03, 0xFB0C, + 0xFCFC, 0xFDF4, 0xFDFB, 0x0206, 0x03F5, 0x030C, 0x0602, 0x0B00, 0x0B07, + 0xF709, 0xF70A, 0xFFF6, 0x0009, 0x03F6, 0x04F6, 0x06F6, 0x07F6, 0xF7F6, + 0x07F9, 0x08F8, 0xF7F7, 0xF7FE, 0xF8F6, 0xFE0A, 0x00F6, 0x0008, 0x01F7, + 0x04F8, 0x0509, 0x06FA, 0x07FB, 0x0700, 0x0709, 0x08F9, 0x09F7, 0x09FE, + 0x09FF, 0x0902, 0xF407, 0xF6F4, 0xF6F6, 0xF8F8, 0xF8FC, 0xF80B, 0xFC06, + 0x0006, 0x01FA, 0x0107, 0x03F9, 0x0604, 0x0608, 0x0703, 0xF403, 0xF5F5, + 0xF6F5, 0xFBF4, 0x0300, 0xFFFC, 0xFF05, 0x0303, 0x08F5, 0x0AF4, 0x0904, + 0x0907, 0x0AFA, 0xF604, 0xF5F7, 0xFCFB, 0x0404, 0x0406, 0x05FE, 0x0606, + 0x0BF9, 0x0C02, 0x0402, 0xF4F6, 0xF60B, 0xF8F7, 0xFAF8, 0xFAF9, 0xFAFB, + 0xFAFF, 0xFBF8, 0xFDF7, 0xFFF7, 0x02F9, 0x0309, 0x04FA, 0x0609, 0x07FD, + 0x0804, 0xF8F5, 0x0809, 0x0A0C, 0xF9FE, 0xFAFC, 0xFAFE, 0xFC0B, 0x02FA, + 0x0305, 0x0503, 0x0504, 0xFD00, 0x07FE, 0x0A0B, 0xFD0B, 0x01F5, 0xF400, + 0x0BF6, 0xF6FE, 0xF606, 0xF5FC, 0xF7F5, 0xFA02, 0xFB01, 0xFB0B, 0x00F4, + 0xF502, 0x04FC, 0x05F4, 0x0003, 0xF5FF, 0xF501, 0x010B, 0xF7FD, 0xF704, + 0xF705, 0xF804, 0xF809, 0xF9F6, 0xF900, 0xFA09, 0xFC08, 0xFC0A, 0xFE09, + 0x01F6, 0x030A, 0x05F6, 0x06F9, 0x06FC, 0x070A, 0x0801, 0x0905, 0x0906, + 0xF4F7, 0x0909, 0x0A07, 0xF408, 0xF50A, 0xF8FB, 0xFCF7, 0x01FF, 0xFD06, + 0xFEF6, 0xFF07, 0x05F9, 0xF4FA, 0x0802, 0x0CF6, 0xFCF4, 0x010C, 0x02F4, + 0x03F4, 0x0304, 0x0401, 0x05F5, 0x07F5, 0xFCFE, 0xFDF5, 0x02FC, 0x04FE, + 0x020B, 0x0C04, 0x0CF7, 0x0C07, 0xF6FD, 0xF607, 0x040B, 0xF4FC, 0xF5F8, + 0xF90B, 0xFAF4, 0xFDFA, 0x01FB, 0xFEFC, 0x04F4, 0x04FD, 0xFE04, 0x0BFE, + 0xFFF5, 0x03FD, 0x0BFF, 0xF409, 0xF8F4, 0xF8FD, 0xF9F8, 0xF904, 0xFA06, + 0xFB00, 0xFCF8, 0xFDF9, 0xFD07, 0xFF08, 0x01F9, 0x0500, 0x0708, 0x0803, + 0x0805, 0xF405, 0x080A, 0x090C, 0xFC02, 0xFC00, 0xFD05, 0x0104, 0x02F5, + 0xFF01, 0x0101, 0xFFFF, 0x0200, 0x02FE, 0x0204, 0x0B01, 0x03FB, 0x0C0B, + 0xF608, 0xF703, 0xF707, 0xF807, 0xF5F4, 0xF70B, 0xFAFA, 0xFA03, 0xFCFA, + 0xFD0C, 0x00FC, 0x06F5, 0x06FF, 0x0702, 0xF5FE, 0x0705, 0x0C05, 0xFEF4, + 0x00FD, 0xFE02, 0xFEFD, 0x0301, }; -static const uint16_t on2avc_cb15_syms[ON2AVC_CB15_CODES] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, - 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x00F0, - 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, - 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, - 0x00FD, 0x00FE, 0x00FF, 0x0100, 0x0101, 0x0102, - 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, - 0x0109, 0x010A, 0x010B, 0x010C, 0x010D, 0x010E, - 0x010F, 0x0110, 0x01F0, 0x01F1, 0x01F2, 0x01F3, - 0x01F4, 0x01F5, 0x01F6, 0x01F7, 0x01F8, 0x01F9, - 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF, - 0x0200, 0x0201, 0x0202, 0x0203, 0x0204, 0x0205, - 0x0206, 0x0207, 0x0208, 0x0209, 0x020A, 0x020B, - 0x020C, 0x020D, 0x020E, 0x020F, 0x0210, 0x02F0, - 0x02F1, 0x02F2, 0x02F3, 0x02F4, 0x02F5, 0x02F6, - 0x02F7, 0x02F8, 0x02F9, 0x02FA, 0x02FB, 0x02FC, - 0x02FD, 0x02FE, 0x02FF, 0x0300, 0x0301, 0x0302, - 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x0308, - 0x0309, 0x030A, 0x030B, 0x030C, 0x030D, 0x030E, - 0x030F, 0x0310, 0x03F0, 0x03F1, 0x03F2, 0x03F3, - 0x03F4, 0x03F5, 0x03F6, 0x03F7, 0x03F8, 0x03F9, - 0x03FA, 0x03FB, 0x03FC, 0x03FD, 0x03FE, 0x03FF, - 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, - 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, - 0x040C, 0x040D, 0x040E, 0x040F, 0x0410, 0x04F0, - 0x04F1, 0x04F2, 0x04F3, 0x04F4, 0x04F5, 0x04F6, - 0x04F7, 0x04F8, 0x04F9, 0x04FA, 0x04FB, 0x04FC, - 0x04FD, 0x04FE, 0x04FF, 0x0500, 0x0501, 0x0502, - 0x0503, 0x0504, 0x0505, 0x0506, 0x0507, 0x0508, - 0x0509, 0x050A, 0x050B, 0x050C, 0x050D, 0x050E, - 0x050F, 0x0510, 0x05F0, 0x05F1, 0x05F2, 0x05F3, - 0x05F4, 0x05F5, 0x05F6, 0x05F7, 0x05F8, 0x05F9, - 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF, - 0x0600, 0x0601, 0x0602, 0x0603, 0x0604, 0x0605, - 0x0606, 0x0607, 0x0608, 0x0609, 0x060A, 0x060B, - 0x060C, 0x060D, 0x060E, 0x060F, 0x0610, 0x06F0, - 0x06F1, 0x06F2, 0x06F3, 0x06F4, 0x06F5, 0x06F6, - 0x06F7, 0x06F8, 0x06F9, 0x06FA, 0x06FB, 0x06FC, - 0x06FD, 0x06FE, 0x06FF, 0x0700, 0x0701, 0x0702, - 0x0703, 0x0704, 0x0705, 0x0706, 0x0707, 0x0708, - 0x0709, 0x070A, 0x070B, 0x070C, 0x070D, 0x070E, - 0x070F, 0x0710, 0x07F0, 0x07F1, 0x07F2, 0x07F3, - 0x07F4, 0x07F5, 0x07F6, 0x07F7, 0x07F8, 0x07F9, - 0x07FA, 0x07FB, 0x07FC, 0x07FD, 0x07FE, 0x07FF, - 0x0800, 0x0801, 0x0802, 0x0803, 0x0804, 0x0805, - 0x0806, 0x0807, 0x0808, 0x0809, 0x080A, 0x080B, - 0x080C, 0x080D, 0x080E, 0x080F, 0x0810, 0x08F0, - 0x08F1, 0x08F2, 0x08F3, 0x08F4, 0x08F5, 0x08F6, - 0x08F7, 0x08F8, 0x08F9, 0x08FA, 0x08FB, 0x08FC, - 0x08FD, 0x08FE, 0x08FF, 0x0900, 0x0901, 0x0902, - 0x0903, 0x0904, 0x0905, 0x0906, 0x0907, 0x0908, - 0x0909, 0x090A, 0x090B, 0x090C, 0x090D, 0x090E, - 0x090F, 0x0910, 0x09F0, 0x09F1, 0x09F2, 0x09F3, - 0x09F4, 0x09F5, 0x09F6, 0x09F7, 0x09F8, 0x09F9, - 0x09FA, 0x09FB, 0x09FC, 0x09FD, 0x09FE, 0x09FF, - 0x0A00, 0x0A01, 0x0A02, 0x0A03, 0x0A04, 0x0A05, - 0x0A06, 0x0A07, 0x0A08, 0x0A09, 0x0A0A, 0x0A0B, - 0x0A0C, 0x0A0D, 0x0A0E, 0x0A0F, 0x0A10, 0x0AF0, - 0x0AF1, 0x0AF2, 0x0AF3, 0x0AF4, 0x0AF5, 0x0AF6, - 0x0AF7, 0x0AF8, 0x0AF9, 0x0AFA, 0x0AFB, 0x0AFC, - 0x0AFD, 0x0AFE, 0x0AFF, 0x0B00, 0x0B01, 0x0B02, - 0x0B03, 0x0B04, 0x0B05, 0x0B06, 0x0B07, 0x0B08, - 0x0B09, 0x0B0A, 0x0B0B, 0x0B0C, 0x0B0D, 0x0B0E, - 0x0B0F, 0x0B10, 0x0BF0, 0x0BF1, 0x0BF2, 0x0BF3, - 0x0BF4, 0x0BF5, 0x0BF6, 0x0BF7, 0x0BF8, 0x0BF9, - 0x0BFA, 0x0BFB, 0x0BFC, 0x0BFD, 0x0BFE, 0x0BFF, - 0x0C00, 0x0C01, 0x0C02, 0x0C03, 0x0C04, 0x0C05, - 0x0C06, 0x0C07, 0x0C08, 0x0C09, 0x0C0A, 0x0C0B, - 0x0C0C, 0x0C0D, 0x0C0E, 0x0C0F, 0x0C10, 0x0CF0, - 0x0CF1, 0x0CF2, 0x0CF3, 0x0CF4, 0x0CF5, 0x0CF6, - 0x0CF7, 0x0CF8, 0x0CF9, 0x0CFA, 0x0CFB, 0x0CFC, - 0x0CFD, 0x0CFE, 0x0CFF, 0x0D00, 0x0D01, 0x0D02, - 0x0D03, 0x0D04, 0x0D05, 0x0D06, 0x0D07, 0x0D08, - 0x0D09, 0x0D0A, 0x0D0B, 0x0D0C, 0x0D0D, 0x0D0E, - 0x0D0F, 0x0D10, 0x0DF0, 0x0DF1, 0x0DF2, 0x0DF3, - 0x0DF4, 0x0DF5, 0x0DF6, 0x0DF7, 0x0DF8, 0x0DF9, - 0x0DFA, 0x0DFB, 0x0DFC, 0x0DFD, 0x0DFE, 0x0DFF, - 0x0E00, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, - 0x0E06, 0x0E07, 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, - 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F, 0x0E10, 0x0EF0, - 0x0EF1, 0x0EF2, 0x0EF3, 0x0EF4, 0x0EF5, 0x0EF6, - 0x0EF7, 0x0EF8, 0x0EF9, 0x0EFA, 0x0EFB, 0x0EFC, - 0x0EFD, 0x0EFE, 0x0EFF, 0x0F00, 0x0F01, 0x0F02, - 0x0F03, 0x0F04, 0x0F05, 0x0F06, 0x0F07, 0x0F08, - 0x0F09, 0x0F0A, 0x0F0B, 0x0F0C, 0x0F0D, 0x0F0E, - 0x0F0F, 0x0F10, 0x0FF0, 0x0FF1, 0x0FF2, 0x0FF3, - 0x0FF4, 0x0FF5, 0x0FF6, 0x0FF7, 0x0FF8, 0x0FF9, - 0x0FFA, 0x0FFB, 0x0FFC, 0x0FFD, 0x0FFE, 0x0FFF, - 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005, - 0x1006, 0x1007, 0x1008, 0x1009, 0x100A, 0x100B, - 0x100C, 0x100D, 0x100E, 0x100F, 0x1010, 0x10F0, - 0x10F1, 0x10F2, 0x10F3, 0x10F4, 0x10F5, 0x10F6, - 0x10F7, 0x10F8, 0x10F9, 0x10FA, 0x10FB, 0x10FC, - 0x10FD, 0x10FE, 0x10FF, 0xF000, 0xF001, 0xF002, - 0xF003, 0xF004, 0xF005, 0xF006, 0xF007, 0xF008, - 0xF009, 0xF00A, 0xF00B, 0xF00C, 0xF00D, 0xF00E, - 0xF00F, 0xF010, 0xF0F0, 0xF0F1, 0xF0F2, 0xF0F3, - 0xF0F4, 0xF0F5, 0xF0F6, 0xF0F7, 0xF0F8, 0xF0F9, - 0xF0FA, 0xF0FB, 0xF0FC, 0xF0FD, 0xF0FE, 0xF0FF, - 0xF100, 0xF101, 0xF102, 0xF103, 0xF104, 0xF105, - 0xF106, 0xF107, 0xF108, 0xF109, 0xF10A, 0xF10B, - 0xF10C, 0xF10D, 0xF10E, 0xF10F, 0xF110, 0xF1F0, - 0xF1F1, 0xF1F2, 0xF1F3, 0xF1F4, 0xF1F5, 0xF1F6, - 0xF1F7, 0xF1F8, 0xF1F9, 0xF1FA, 0xF1FB, 0xF1FC, - 0xF1FD, 0xF1FE, 0xF1FF, 0xF200, 0xF201, 0xF202, - 0xF203, 0xF204, 0xF205, 0xF206, 0xF207, 0xF208, - 0xF209, 0xF20A, 0xF20B, 0xF20C, 0xF20D, 0xF20E, - 0xF20F, 0xF210, 0xF2F0, 0xF2F1, 0xF2F2, 0xF2F3, - 0xF2F4, 0xF2F5, 0xF2F6, 0xF2F7, 0xF2F8, 0xF2F9, - 0xF2FA, 0xF2FB, 0xF2FC, 0xF2FD, 0xF2FE, 0xF2FF, - 0xF300, 0xF301, 0xF302, 0xF303, 0xF304, 0xF305, - 0xF306, 0xF307, 0xF308, 0xF309, 0xF30A, 0xF30B, - 0xF30C, 0xF30D, 0xF30E, 0xF30F, 0xF310, 0xF3F0, - 0xF3F1, 0xF3F2, 0xF3F3, 0xF3F4, 0xF3F5, 0xF3F6, - 0xF3F7, 0xF3F8, 0xF3F9, 0xF3FA, 0xF3FB, 0xF3FC, - 0xF3FD, 0xF3FE, 0xF3FF, 0xF400, 0xF401, 0xF402, - 0xF403, 0xF404, 0xF405, 0xF406, 0xF407, 0xF408, - 0xF409, 0xF40A, 0xF40B, 0xF40C, 0xF40D, 0xF40E, - 0xF40F, 0xF410, 0xF4F0, 0xF4F1, 0xF4F2, 0xF4F3, - 0xF4F4, 0xF4F5, 0xF4F6, 0xF4F7, 0xF4F8, 0xF4F9, - 0xF4FA, 0xF4FB, 0xF4FC, 0xF4FD, 0xF4FE, 0xF4FF, - 0xF500, 0xF501, 0xF502, 0xF503, 0xF504, 0xF505, - 0xF506, 0xF507, 0xF508, 0xF509, 0xF50A, 0xF50B, - 0xF50C, 0xF50D, 0xF50E, 0xF50F, 0xF510, 0xF5F0, - 0xF5F1, 0xF5F2, 0xF5F3, 0xF5F4, 0xF5F5, 0xF5F6, - 0xF5F7, 0xF5F8, 0xF5F9, 0xF5FA, 0xF5FB, 0xF5FC, - 0xF5FD, 0xF5FE, 0xF5FF, 0xF600, 0xF601, 0xF602, - 0xF603, 0xF604, 0xF605, 0xF606, 0xF607, 0xF608, - 0xF609, 0xF60A, 0xF60B, 0xF60C, 0xF60D, 0xF60E, - 0xF60F, 0xF610, 0xF6F0, 0xF6F1, 0xF6F2, 0xF6F3, - 0xF6F4, 0xF6F5, 0xF6F6, 0xF6F7, 0xF6F8, 0xF6F9, - 0xF6FA, 0xF6FB, 0xF6FC, 0xF6FD, 0xF6FE, 0xF6FF, - 0xF700, 0xF701, 0xF702, 0xF703, 0xF704, 0xF705, - 0xF706, 0xF707, 0xF708, 0xF709, 0xF70A, 0xF70B, - 0xF70C, 0xF70D, 0xF70E, 0xF70F, 0xF710, 0xF7F0, - 0xF7F1, 0xF7F2, 0xF7F3, 0xF7F4, 0xF7F5, 0xF7F6, - 0xF7F7, 0xF7F8, 0xF7F9, 0xF7FA, 0xF7FB, 0xF7FC, - 0xF7FD, 0xF7FE, 0xF7FF, 0xF800, 0xF801, 0xF802, - 0xF803, 0xF804, 0xF805, 0xF806, 0xF807, 0xF808, - 0xF809, 0xF80A, 0xF80B, 0xF80C, 0xF80D, 0xF80E, - 0xF80F, 0xF810, 0xF8F0, 0xF8F1, 0xF8F2, 0xF8F3, - 0xF8F4, 0xF8F5, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9, - 0xF8FA, 0xF8FB, 0xF8FC, 0xF8FD, 0xF8FE, 0xF8FF, - 0xF900, 0xF901, 0xF902, 0xF903, 0xF904, 0xF905, - 0xF906, 0xF907, 0xF908, 0xF909, 0xF90A, 0xF90B, - 0xF90C, 0xF90D, 0xF90E, 0xF90F, 0xF910, 0xF9F0, - 0xF9F1, 0xF9F2, 0xF9F3, 0xF9F4, 0xF9F5, 0xF9F6, - 0xF9F7, 0xF9F8, 0xF9F9, 0xF9FA, 0xF9FB, 0xF9FC, - 0xF9FD, 0xF9FE, 0xF9FF, 0xFA00, 0xFA01, 0xFA02, - 0xFA03, 0xFA04, 0xFA05, 0xFA06, 0xFA07, 0xFA08, - 0xFA09, 0xFA0A, 0xFA0B, 0xFA0C, 0xFA0D, 0xFA0E, - 0xFA0F, 0xFA10, 0xFAF0, 0xFAF1, 0xFAF2, 0xFAF3, - 0xFAF4, 0xFAF5, 0xFAF6, 0xFAF7, 0xFAF8, 0xFAF9, - 0xFAFA, 0xFAFB, 0xFAFC, 0xFAFD, 0xFAFE, 0xFAFF, - 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0xFB05, - 0xFB06, 0xFB07, 0xFB08, 0xFB09, 0xFB0A, 0xFB0B, - 0xFB0C, 0xFB0D, 0xFB0E, 0xFB0F, 0xFB10, 0xFBF0, - 0xFBF1, 0xFBF2, 0xFBF3, 0xFBF4, 0xFBF5, 0xFBF6, - 0xFBF7, 0xFBF8, 0xFBF9, 0xFBFA, 0xFBFB, 0xFBFC, - 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, 0xFC01, 0xFC02, - 0xFC03, 0xFC04, 0xFC05, 0xFC06, 0xFC07, 0xFC08, - 0xFC09, 0xFC0A, 0xFC0B, 0xFC0C, 0xFC0D, 0xFC0E, - 0xFC0F, 0xFC10, 0xFCF0, 0xFCF1, 0xFCF2, 0xFCF3, - 0xFCF4, 0xFCF5, 0xFCF6, 0xFCF7, 0xFCF8, 0xFCF9, - 0xFCFA, 0xFCFB, 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF, - 0xFD00, 0xFD01, 0xFD02, 0xFD03, 0xFD04, 0xFD05, - 0xFD06, 0xFD07, 0xFD08, 0xFD09, 0xFD0A, 0xFD0B, - 0xFD0C, 0xFD0D, 0xFD0E, 0xFD0F, 0xFD10, 0xFDF0, - 0xFDF1, 0xFDF2, 0xFDF3, 0xFDF4, 0xFDF5, 0xFDF6, - 0xFDF7, 0xFDF8, 0xFDF9, 0xFDFA, 0xFDFB, 0xFDFC, - 0xFDFD, 0xFDFE, 0xFDFF, 0xFE00, 0xFE01, 0xFE02, - 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07, 0xFE08, - 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, 0xFE0D, 0xFE0E, - 0xFE0F, 0xFE10, 0xFEF0, 0xFEF1, 0xFEF2, 0xFEF3, - 0xFEF4, 0xFEF5, 0xFEF6, 0xFEF7, 0xFEF8, 0xFEF9, - 0xFEFA, 0xFEFB, 0xFEFC, 0xFEFD, 0xFEFE, 0xFEFF, - 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05, - 0xFF06, 0xFF07, 0xFF08, 0xFF09, 0xFF0A, 0xFF0B, - 0xFF0C, 0xFF0D, 0xFF0E, 0xFF0F, 0xFF10, 0xFFF0, - 0xFFF1, 0xFFF2, 0xFFF3, 0xFFF4, 0xFFF5, 0xFFF6, - 0xFFF7, 0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, - 0xFFFD, 0xFFFE, 0xFFFF, +static const uint16_t on2avc_cb14_syms[ON2AVC_CB_14_CODES] = { + 0x0000, 0x01FF, 0xF9F8, 0xF9F9, 0xF907, 0xFA04, 0xFBF8, 0xFB07, 0xFB08, + 0xFB0A, 0xFC07, 0xFC0A, 0xFDF5, 0xFDF6, 0xFEF5, 0xFFFB, 0xFF08, 0xFF0B, + 0x01F5, 0x02F6, 0x03F9, 0x04FA, 0x04FB, 0x04FC, 0x040C, 0x05FF, 0x06FD, + 0x0600, 0x0605, 0x060B, 0x0701, 0x08FA, 0x08FB, 0x08FD, 0x08FF, 0x0801, + 0x0802, 0x0807, 0x080B, 0x080C, 0x09FD, 0x0900, 0x0905, 0x0907, 0x0A03, + 0x0A06, 0x0A07, 0x0B02, 0x0B0B, 0x0C05, 0xF50D, 0x0C07, 0x0C0B, 0xF9FF, + 0xFA02, 0xFCFE, 0xFC00, 0xFE06, 0xFE07, 0x0005, 0x02FB, 0x0207, 0x03FA, + 0x04F7, 0x0406, 0x0407, 0x0408, 0x0506, 0x0808, 0x0AF3, 0x0C0D, 0xF3F3, + 0x0DF5, 0x0D06, 0xFBFD, 0xFC02, 0xFE04, 0xFFFC, 0x0104, 0x04FE, 0x0404, + 0x07F3, 0xFFFF, 0x00FE, 0xF3FC, 0x0D09, 0x0D0D, 0xFD0D, 0xF9F3, 0x0D0B, + 0x0DF4, 0xF4F4, 0x02FF, 0x04FD, 0x05FD, 0x0B0D, 0x0DF8, 0xFDFD, 0xFEF3, + 0x0101, 0xFE01, 0xFEFF, 0xFFFE, 0xFF02, 0x01FE, 0x0DFD, 0xF300, 0xF302, + 0xFCF3, 0xFEFD, 0xFFFD, 0xFF0D, 0x02F3, 0xFEFE, 0x02FD, 0x0203, 0x0002, + 0x0201, 0x040D, 0xF40D, 0xFAFB, 0xFAFC, 0xFAFD, 0xFAFF, 0xFA01, 0xFCF9, + 0xFCFF, 0xFF09, 0x0209, 0x0306, 0x0307, 0x0405, 0x05FA, 0x06FA, 0x0601, + 0x0706, 0x0708, 0x09FE, 0x0903, 0x0906, 0x090A, 0x0A0A, 0x0CF3, 0xF307, + 0xF5F3, 0xFF00, 0x0102, 0x00FD, 0xFBFE, 0xFCFC, 0x030D, 0x0304, 0x0DFA, + 0xF402, 0xF5F6, 0xF303, 0xFB0D, 0xFFF3, 0x0103, 0x050D, 0xF3F7, 0xF7F3, + 0xFB03, 0x0205, 0x04FF, 0x0403, 0x0504, 0x0505, 0x06FE, 0x0D0C, 0x060D, + 0xFBF3, 0x03FE, 0x0303, 0x04F3, 0x0DFB, 0x0D02, 0x0D04, 0x0D05, 0xF6FB, + 0xF606, 0xF7F6, 0xF703, 0xF705, 0xF8F5, 0xF8FE, 0xF8FF, 0xF9FC, 0xF901, + 0xF904, 0xF906, 0xF908, 0xFAF9, 0xFA00, 0xFA09, 0xFA0A, 0xFBF5, 0xFBF7, + 0xFB06, 0xFB09, 0xFCF6, 0xFCF7, 0xFC08, 0xFEF7, 0xFEF8, 0xFFF6, 0xFFF8, + 0xFFF9, 0x00F6, 0x00F7, 0x00FA, 0x0007, 0x0009, 0x0106, 0x0109, 0x010C, + 0x02F4, 0x02F5, 0x02F7, 0x0100, 0x00FF, 0x0001, 0x020A, 0x020C, 0x040A, + 0x06F5, 0x06F7, 0x06F8, 0x07F5, 0x07F7, 0x07F9, 0x07FA, 0x07FB, 0x07FF, + 0x0700, 0x08F6, 0x0805, 0x0809, 0x080A, 0x0904, 0x0908, 0x090C, 0x0AF4, + 0x0AFF, 0x0A08, 0x0BF6, 0x0B01, 0x0B05, 0x0B07, 0x0B0C, 0xF3F6, 0x0CF9, + 0x0C01, 0xF30A, 0xF502, 0xF6F7, 0xF8FA, 0xF8FB, 0xF9FB, 0xF905, 0xFA03, + 0xFA05, 0xFA08, 0xFB01, 0xFB04, 0xFCFA, 0xFCFB, 0xFC05, 0xFC06, 0xFDF7, + 0xFD09, 0xFF07, 0x0008, 0x0107, 0x0309, 0x04F9, 0x0401, 0x05FC, 0x0501, + 0x0508, 0x0509, 0x06FF, 0x0604, 0x070A, 0x08FC, 0x0804, 0x0902, 0x0A01, + 0x0B03, 0x0B09, 0x0B0A, 0x0C0C, 0x0DF3, 0xF3F9, 0xF30B, 0xF70D, 0xF80D, + 0xF90D, 0xFAFE, 0xFBFA, 0xFC01, 0xFDFB, 0xFD07, 0x02F9, 0x0208, 0x03FC, + 0x0305, 0x0502, 0x0602, 0x00F3, 0x0DF6, 0x0D0A, 0xFF03, 0x0D00, 0xF3F8, + 0x0300, 0xFE03, 0x0003, 0x0DFC, 0xF3F5, 0xF308, 0xFA0D, 0xFCFD, 0xFC03, + 0xFDF9, 0xFD06, 0x02FA, 0x0400, 0x05FB, 0x0607, 0x08F3, 0x090D, 0x0A0D, + 0xF3FA, 0xFC0D, 0xFDF3, 0xFE0D, 0xF3FF, 0x02FC, 0xF30C, 0xF5FF, 0xF603, + 0xF607, 0xF301, 0x0DFF, 0x0D01, 0xF60B, 0xF7F5, 0xF7F9, 0xF7FB, 0xF7FC, + 0xF7FD, 0xF8F9, 0xF803, 0xF9FA, 0xF9FD, 0xF903, 0xFA06, 0xFA07, 0xFBF9, + 0xFBFB, 0xFDF8, 0xFD0A, 0xFE08, 0xFE09, 0xFFFA, 0xFF05, 0x00FB, 0x01F7, + 0x01FB, 0x02F8, 0x0308, 0x05F7, 0x05F8, 0x05F9, 0x0503, 0x0507, 0x06FB, + 0x06FC, 0x0609, 0x060A, 0x07FE, 0x0703, 0x0705, 0x070B, 0x0803, 0x0806, + 0x09F9, 0x0AF9, 0x0A0B, 0xF3F4, 0x0C09, 0x0C0A, 0xF309, 0xF60D, 0xF8F3, + 0xF902, 0xFAFA, 0xFBFC, 0xFB02, 0xFC04, 0xFEFA, 0xFE05, 0xFF06, 0x0004, + 0x0206, 0x0402, 0x05FE, 0x0603, 0x0606, 0x0608, 0x0702, 0x0707, 0x09F3, + 0x0909, 0x0BF3, 0x0DF7, 0xF3FD, 0xF304, 0xFE00, 0xFD00, 0xF306, 0xFAF3, + 0xFD02, 0x0301, 0x0200, 0x03FF, 0xFD04, 0xFDFC, 0xFEFC, 0x0105, 0x03FD, + 0x05F3, 0x0202, 0x03F3, 0x06F3, 0xF6F3, 0xF7FE, 0xFE02, 0x0DFE, 0xF802, + 0xF9FE, 0xFAF7, 0xFBFF, 0x02FE, 0xFDFA, 0xFD05, 0xFD08, 0xFEF9, 0xFEFB, + 0xFF04, 0x00FC, 0x01FA, 0x01FC, 0x03FB, 0x0409, 0x080D, 0xF3FB, 0xF305, + 0xF4F3, 0xFD03, 0x0204, 0x070D, 0x010D, 0x0D08, 0x000D, 0xFDFE, 0xFDFF, + 0xFD01, 0x0DF9, 0x0D07, 0x020D, 0x0D03, 0xFF01, 0xF3FE, 0x01F3, 0x01FD, + 0x0302, 0xF4F8, 0xF4F9, 0xF4FA, 0xF4FB, 0xF4FC, 0xF4FD, 0xF400, 0xF401, + 0xF403, 0xF404, 0xF406, 0xF407, 0xF408, 0xF409, 0xF40A, 0xF40B, 0xF40C, + 0xF5F8, 0xF5FA, 0xF5FC, 0xF5FE, 0xF500, 0xF501, 0xF503, 0xF504, 0xF505, + 0xF506, 0xF507, 0xF508, 0xF509, 0xF50A, 0xF50B, 0xF50C, 0xF6F4, 0xF6FF, + 0xF600, 0xF604, 0xF608, 0xF609, 0xF60A, 0xF60C, 0xF7F4, 0xF7F8, 0xF7FA, + 0xF700, 0xF708, 0xF709, 0xF70A, 0xF70B, 0xF70C, 0xF8F4, 0xF8F7, 0xF800, + 0xF809, 0xF80A, 0xF80B, 0xF80C, 0xF9F4, 0xF90A, 0xF90B, 0xF90C, 0xFAF6, + 0xFA0C, 0xFBF6, 0xFB05, 0xFB0B, 0xFB0C, 0xFCF4, 0xFCF5, 0xFCF8, 0xFC09, + 0xFC0C, 0xFD0B, 0xFEF4, 0xFE0C, 0xFFF4, 0xFFF7, 0xFF0A, 0xFF0C, 0x00F4, + 0x00F5, 0x00F8, 0x0006, 0x000A, 0x000B, 0x000C, 0x01F4, 0x01F8, 0x01F9, + 0x010A, 0x020B, 0x03F4, 0x03F5, 0x03F6, 0x03F7, 0x030C, 0x04F4, 0x04F6, + 0x040B, 0x05F4, 0x05F6, 0x0500, 0x050A, 0x050B, 0x050C, 0x06F4, 0x06F6, + 0x07F4, 0x07F8, 0x07FD, 0x0709, 0x070C, 0x08F4, 0x08F5, 0x08F8, 0x08F9, + 0x08FE, 0x09F4, 0x09F5, 0x09F6, 0x09F7, 0x09F8, 0x09FA, 0x09FF, 0x0901, + 0x090B, 0x0AF5, 0x0AF8, 0x0AFC, 0x0AFE, 0x0A02, 0x0A04, 0x0A09, 0x0A0C, + 0x0BF4, 0x0BF5, 0x0BF7, 0x0BF8, 0x0BF9, 0x0BFA, 0x0BFB, 0x0BFC, 0x0BFD, + 0x0B00, 0x0B04, 0x0B06, 0x0CF4, 0x0CF7, 0x0CFB, 0x0CFC, 0x0CFD, 0x0CFF, + 0x0C00, 0x0C03, 0x0C04, 0x0C06, 0xF4F5, 0xF4F6, 0xF4FE, 0xF4FF, 0xF5F9, + 0xF5FB, 0xF5FD, 0xF6F5, 0xF6F6, 0xF6FC, 0xF6FE, 0xF601, 0xF605, 0xF7FF, + 0xF702, 0xF704, 0xF707, 0xF8F8, 0xF801, 0xF804, 0xF805, 0xF807, 0xF808, + 0xF9F5, 0xF9F7, 0xF900, 0xF909, 0xFAF4, 0xFAF5, 0xFAF8, 0xFA0B, 0xFBF4, + 0xFB00, 0xFC0B, 0xFDF4, 0xFD0C, 0xFEF6, 0xFE0A, 0xFE0B, 0xFFF5, 0x00F9, + 0x01F6, 0x0108, 0x010B, 0x03F8, 0x030A, 0x030B, 0x04F5, 0x04F8, 0x05F5, + 0x06F9, 0x060C, 0x07F6, 0x07FC, 0x0704, 0x08F7, 0x0800, 0x09FB, 0x09FC, + 0x0AF6, 0x0AF7, 0x0AFA, 0x0AFB, 0x0AFD, 0x0A00, 0x0A05, 0x0BFE, 0x0BFF, + 0x0B08, 0x0CF5, 0x0CF6, 0x0CF8, 0x0CFA, 0x0CFE, 0xF30D, 0x0C02, 0x0C08, + 0xF4F7, 0xF405, 0xF5F4, 0xF5F5, 0xF5F7, 0xF6F8, 0xF6F9, 0xF6FA, 0xF6FD, + 0xF602, 0xF7F7, 0xF701, 0xF706, 0xF8F6, 0xF8FC, 0xF8FD, 0xF806, 0xF9F6, }; -const void * const ff_on2avc_cb_codes[] = { - on2avc_cb1_codes, on2avc_cb2_codes, on2avc_cb3_codes, on2avc_cb4_codes, - on2avc_cb5_codes, on2avc_cb6_codes, on2avc_cb7_codes, on2avc_cb8_codes, - on2avc_cb9_codes, on2avc_cb10_codes, on2avc_cb11_codes, on2avc_cb12_codes, - on2avc_cb13_codes, on2avc_cb14_codes, on2avc_cb15_codes +static const uint16_t on2avc_cb15_syms[ON2AVC_CB_15_CODES] = { + 0x0000, 0x00FF, 0xFEFF, 0x0201, 0xFAFF, 0xFBFB, 0xFF06, 0x06FE, 0x100E, + 0xF2F6, 0xF2FF, 0xF205, 0xF3F3, 0xF6F2, 0xF8F5, 0xF90B, 0xFAF8, 0xFAF9, + 0xFA06, 0xFCF2, 0x0008, 0x0209, 0x030E, 0x04F2, 0x040E, 0x040F, 0x05F7, + 0x06F1, 0x07FD, 0x0807, 0x09F1, 0x09FC, 0x09FE, 0x0AF1, 0x0A03, 0x0A0B, + 0x0B08, 0x0B0C, 0x0CF1, 0x0C0E, 0x0E0B, 0xFF07, 0x03F8, 0xF002, 0xF00A, + 0xF00B, 0x0DF0, 0xFE01, 0xFFF0, 0x06FD, 0x0F07, 0xF20E, 0xF3F7, 0xF009, + 0xFAFB, 0xFC05, 0xF510, 0x0205, 0x07F0, 0x1008, 0xF0F4, 0xF007, 0x100A, + 0xF3FC, 0xF305, 0xF308, 0xF30F, 0xF4FE, 0xF40F, 0xF505, 0xF508, 0xF50A, + 0xF60B, 0xF60C, 0xF60D, 0xF7F4, 0xF7FB, 0xF701, 0xF708, 0xF70F, 0xF800, + 0xF9F3, 0xF90C, 0xFBF5, 0xFBF6, 0xFC0D, 0xFDF5, 0x000A, 0x020D, 0x08F1, + 0x0901, 0x0AF2, 0x0A02, 0x0BF4, 0x0BFC, 0x0BFE, 0x0B06, 0x0CF4, 0x0C02, + 0x0C07, 0x0DF5, 0x0DF6, 0x0DF8, 0xF1F1, 0x0D03, 0x0D04, 0xF1F3, 0xF1F7, + 0xF103, 0xF107, 0xF2FA, 0xF4F4, 0xF5F2, 0xF5FA, 0xF6F5, 0xF6FC, 0xF70E, + 0xF8F1, 0xF8F6, 0xF900, 0xF90E, 0xFB0A, 0xFCF7, 0xFC08, 0xFC0B, 0xFDF2, + 0xFEF2, 0xFF0A, 0x020E, 0x06F7, 0x07FA, 0x0709, 0x08FC, 0x0906, 0x0A06, + 0x0EF8, 0x0001, 0x0100, 0xFF00, 0xF010, 0x10F0, 0x0E01, 0x0E09, 0x0E0A, + 0x0F08, 0xF204, 0xFDF9, 0xFEFA, 0x0407, 0x0601, 0x0704, 0xF0FD, 0xFCFC, + 0x0BF0, 0x1004, 0xF0F1, 0xF00C, 0x1005, 0x1009, 0x03FD, 0x100D, 0xF903, + 0xFBFA, 0xFD03, 0xF310, 0x0107, 0x0506, 0xFDFB, 0x0D0E, 0xF104, 0x0EF1, + 0xF307, 0x000D, 0x0C00, 0x0D01, 0xF10F, 0xF4FF, 0xFE05, 0x00F0, 0x01FB, + 0x100C, 0x100F, 0xF2FB, 0xF2FD, 0xF200, 0xF4F9, 0xF606, 0xF9F6, 0xF9FF, + 0xFAF7, 0xFA09, 0xFC0A, 0xFD09, 0x0109, 0x030A, 0x040A, 0x05F6, 0x05F9, + 0x0509, 0x070A, 0x070B, 0x0809, 0x090B, 0x0AFA, 0x0B0F, 0x0EF5, 0x0EF9, + 0x0E08, 0x0FFC, 0x0FFF, 0x0010, 0xF905, 0x0602, 0x0104, 0x0105, 0x09F0, + 0xFFFD, 0x01FD, 0x0103, 0x01F0, 0x1006, 0x00FB, 0x02F2, 0x0206, 0x0408, + 0xF0FE, 0x0500, 0x06FA, 0xF004, 0xF008, 0xF610, 0x04FC, 0x10F6, 0x10F7, + 0xFF03, 0xFFFC, 0x10FD, 0x10FE, 0xFD01, 0xFF04, 0x10F1, 0x1001, 0xF401, + 0x000C, 0x01F3, 0x0C01, 0xF30D, 0xF4F6, 0xFEF3, 0x02F5, 0x0A00, 0x0BF3, + 0x0B00, 0x0D00, 0x0EF2, 0x0FF2, 0xF20F, 0xF3FF, 0xF301, 0xF306, 0xF309, + 0xF30C, 0xF405, 0xF40B, 0xF40D, 0xF5F8, 0xF5FB, 0xF509, 0xF700, 0xF90F, + 0xFCF4, 0xFCF5, 0xFF0C, 0x00F5, 0x01F5, 0x060D, 0x08FF, 0x0AF4, 0x0A0D, + 0x0BF6, 0x0B01, 0x0B0B, 0x0CF2, 0x0CFA, 0x0CFE, 0x0DF7, 0x0DFA, 0x0DFD, + 0x0D0A, 0x0FF4, 0xF1F2, 0xF1F9, 0xF20A, 0xF20C, 0xF3F1, 0xF4F5, 0xF5F4, + 0xF6F6, 0xF7F3, 0xF7F5, 0xF7FE, 0xF709, 0xF8F2, 0xF80E, 0xF9F5, 0xFA00, + 0xFBF1, 0xFC07, 0xFDF4, 0xFD0B, 0xFE0A, 0xFFF6, 0xFFF8, 0x00FA, 0x0208, + 0x020B, 0x04F6, 0x04F7, 0x06F8, 0x060B, 0x07F2, 0x07F6, 0x07F9, 0x070F, + 0x08FA, 0x0903, 0x0904, 0x0A07, 0x0A08, 0x0A0E, 0x0CF7, 0x0D0F, 0x0EF7, + 0x0EFC, 0x0301, 0xF8FD, 0x0E0D, 0x0F03, 0xF9F2, 0xFBFF, 0xFFFB, 0x0803, + 0x0F0D, 0x0FFD, 0xF10D, 0x10F3, 0xF9FD, 0xF901, 0xF902, 0xFB07, 0xFEF9, + 0x0006, 0xF2F0, 0xF00D, 0x0307, 0x04F9, 0xFD00, 0x03F0, 0x0FF0, 0xF410, + 0xFDF0, 0xF1F6, 0xF1F8, 0xF101, 0xF2F3, 0xF207, 0xF4FA, 0xF4FC, 0xF5F5, + 0xF5F7, 0xF6F3, 0xF6F4, 0xF609, 0xF705, 0xF706, 0xF8F9, 0xF8FB, 0xF804, + 0xF909, 0xFCF1, 0xFEF1, 0xFEF7, 0xFE0B, 0x01F1, 0x02F7, 0x04F5, 0x050C, + 0x06F6, 0x06F9, 0x0609, 0x07F1, 0x08F5, 0x08FB, 0x0805, 0x080F, 0x0AF7, + 0x0B05, 0x0B0A, 0x0C08, 0x0C0B, 0x0C0D, 0x0D08, 0x0E07, 0x0FF6, 0x0FFA, + 0xFDFA, 0x0F02, 0x0F0A, 0xFD0E, 0x02F9, 0x0308, 0x0507, 0xFB03, 0x06FC, + 0x0702, 0xFCFB, 0x02FB, 0xF5F0, 0x05FD, 0x0703, 0xF2F1, 0x0003, 0xF0FC, + 0xF00F, 0xFBFE, 0xFF05, 0xFCF0, 0x10F5, 0x10FF, 0xFCFF, 0x01FC, 0xF9FB, + 0xFA02, 0xFB08, 0xFD08, 0xFEF8, 0xFE0E, 0x01FA, 0x0207, 0xFE04, 0xFBFD, + 0x0604, 0x07FC, 0x0300, 0x0410, 0xF001, 0x09FD, 0xF302, 0xF402, 0xF406, + 0xF40E, 0xFDFF, 0xFD10, 0xF110, 0x10F9, 0x03FF, 0xFBF0, 0xF5F9, 0xF5FC, + 0xF501, 0xF503, 0xF50F, 0xF600, 0xF607, 0xF70B, 0xF70C, 0xF908, 0xFBF3, + 0xFFF3, 0x00F3, 0x0009, 0x010C, 0x010D, 0x03F3, 0x08F4, 0x0A05, 0x0CF8, + 0x0CFC, 0x0DF1, 0x0DF2, 0x0DFB, 0xF1F4, 0xF1F5, 0xF1FE, 0xF2F4, 0xF2F8, + 0xF2F9, 0xF20D, 0xF4F3, 0xF5F1, 0xF5FE, 0xF50D, 0xF6FE, 0xF7F8, 0xF8FF, + 0xF808, 0xF80C, 0xF9F4, 0xFA0A, 0xFA0C, 0xFBF2, 0xFBF4, 0xFFF7, 0x02F6, + 0x030C, 0x030F, 0x0409, 0x07F4, 0x08F6, 0x08F9, 0x0808, 0x080A, 0x0908, + 0x090D, 0x0AFC, 0x0AFD, 0x0BF7, 0x0C0F, 0x0D05, 0x0D07, 0x0EF4, 0xF2FE, + 0x0F00, 0x0F01, 0xF7FD, 0xF8FC, 0xF9F9, 0xFB00, 0xFE07, 0x00F9, 0x050E, + 0x06FF, 0x0705, 0x080E, 0x0A0F, 0x0EFD, 0xFD06, 0x03FB, 0x0502, 0x0503, + 0x0EF0, 0x10F2, 0xF1F0, 0x04FF, 0x06F0, 0xFCFE, 0x00FD, 0x10FC, 0x0E0F, + 0xF9F7, 0xF9F8, 0xF9FA, 0xFA05, 0xFBF8, 0x03FE, 0x02FD, 0x02FE, 0xFBF9, + 0x04FA, 0x0708, 0x08FD, 0xFB02, 0x0005, 0x02FC, 0x0401, 0x01FF, 0xFEFD, + 0x0310, 0x0305, 0xF1FA, 0xF106, 0xF209, 0xF20B, 0xFC01, 0xFDFC, 0xFEF0, + 0xFE10, 0x02F0, 0xF7F0, 0x00FC, 0xF3F4, 0xF3F5, 0xF3F6, 0xF3F9, 0xF408, + 0xF5F6, 0xF504, 0xF50B, 0x0203, 0xF6F7, 0xF6F9, 0xF60F, 0xF8F3, 0xF806, + 0xF80D, 0xF80F, 0xF90D, 0xFAF4, 0xFAF5, 0xFA08, 0xFC0C, 0xFD0C, 0xFE0C, + 0xFF0B, 0x00F1, 0x0202, 0x00F7, 0x000F, 0x02F4, 0x020C, 0x03F5, 0x05F5, + 0x060A, 0x07F3, 0x07F7, 0x0700, 0x0701, 0x08F7, 0x08F8, 0x09F8, 0x09FF, + 0x0AF8, 0x0AFF, 0x0A0C, 0x0BFA, 0x0BFB, 0x0B03, 0x0C0A, 0x0D0C, 0x0EF6, + 0x0FF5, 0x0FF9, 0x0FFE, 0x0F0E, 0xF3F2, 0xF802, 0xF803, 0xF9F1, 0xF9FE, + 0xFAFA, 0xFB06, 0xFC0E, 0xFF0E, 0x0508, 0xF00E, 0x07FF, 0x0EFB, 0xFC04, + 0xFD05, 0xF8F0, 0x02FA, 0x0505, 0xFC10, 0x0510, 0xFF01, 0x0101, 0xFFFF, + 0xF0F0, 0x1010, 0x0002, 0x0C10, 0xFB10, 0xFEFC, 0x0400, 0xF4F0, 0x0FFB, + 0x0F0F, 0xF10E, 0xF3FE, 0xF404, 0x01F4, 0xF2F5, 0xF202, 0xF9F0, 0x0210, + 0xFE02, 0x05F0, 0x0610, 0xF7F1, 0xF8F8, 0xF9FC, 0xF904, 0xFAF1, 0xFDF6, + 0xFD07, 0xFE08, 0xFEFE, 0x01F9, 0x02F8, 0x0605, 0x0608, 0x070E, 0x0D0D, + 0x0EFF, 0x0E05, 0xFAF0, 0x10F4, 0x0E06, 0x0E0C, 0x0D10, 0xF6F0, 0x04FE, + 0xFBFC, 0x05FE, 0x0204, 0x0402, 0x0710, 0xFC02, 0xFE03, 0xFD04, 0x0004, + 0xF10A, 0x0CFF, 0x0DF3, 0xF3FD, 0xF4F1, 0xF40A, 0xF5FF, 0xF50C, 0xF6F1, + 0xF608, 0xF70D, 0xFB0B, 0xFEF6, 0xFFF4, 0x00F4, 0x030D, 0x0CF6, 0xF1FB, + 0x0CF9, 0x0DF9, 0xF1FC, 0xF100, 0xF10C, 0xF403, 0xF409, 0xF5FD, 0xF502, + 0xF50E, 0xF6FA, 0xF601, 0xF605, 0xF60E, 0xF7FF, 0xF8F4, 0xF807, 0xF80A, + 0xF90A, 0xFA0F, 0xFB0C, 0xFB0D, 0xFB0F, 0xFD0D, 0xFE09, 0xFF09, 0x00F6, + 0x00F8, 0x010B, 0x010F, 0x020A, 0x040D, 0x05FA, 0x050B, 0x06F3, 0x060C, + 0x08F2, 0x0800, 0x080B, 0x080D, 0x09F6, 0x09F7, 0x09FA, 0x090C, 0x0AFB, + 0x0AFE, 0x0BF1, 0x0BF8, 0x0BFD, 0x0B04, 0x0CF5, 0x0CFD, 0x0C04, 0x0C0C, + 0x0DFC, 0x0EF3, 0xF8F7, 0x0E00, 0x0FF7, 0xF8FE, 0xFA04, 0xFCF8, 0xFDF8, + 0xFFF2, 0x040B, 0x05F8, 0x0607, 0x060E, 0x090F, 0x0306, 0x0EFE, 0x0E04, + 0xF0FB, 0x0E10, 0x0403, 0x0603, 0x0E0E, 0xF2F2, 0xFD02, 0xF3F0, 0x0810, + 0x0302, 0xFE06, 0xF4F7, 0xF702, 0xF801, 0xF805, 0xFAF2, 0xFBF7, 0xFB09, + 0xFCF6, 0xFF08, 0x010E, 0x060F, 0x0707, 0x0804, 0x0909, 0x03FC, 0x05FC, + 0x090E, 0x0E03, 0x08F0, 0x05FF, 0xF0FF, 0xFCFD, 0xFA01, 0xFB01, 0xFDFE, + 0x0110, 0x0404, 0x00FE, 0xF0F5, 0x0606, 0xF1FF, 0x0FF1, 0xF3FA, 0xF102, + 0xF105, 0x1002, 0xF108, 0xF109, 0xF2F7, 0xF3F8, 0xF4FD, 0xF407, 0xF5F3, + 0xF6F8, 0xF6FB, 0xF6FF, 0xF602, 0xF603, 0xF7F9, 0xF704, 0xF707, 0xF70A, + 0xF809, 0xFAF3, 0xFA0D, 0xFCF3, 0xFDF3, 0xFEF4, 0xFEF5, 0xFFF5, 0x010A, + 0x030B, 0x04F3, 0x04F4, 0x040C, 0x05F3, 0x050A, 0x050D, 0x06F4, 0x06F5, + 0x07F5, 0x080C, 0x09F2, 0x09F4, 0x09F5, 0x090A, 0x0AF3, 0x0A01, 0x0BF2, + 0x0BF5, 0x0BF9, 0x0B0D, 0x0CF3, 0x0CFB, 0x0DF4, 0x0FF8, 0x0F09, 0x0F0B, + 0xF1FD, 0xF4F2, 0xF7F7, 0xF7FA, 0xF906, 0xF907, 0xFA07, 0xFA0E, 0xFB05, + 0xFB0E, 0xFC0F, 0xFDF1, 0xFDF7, 0xFE0F, 0x0007, 0x000E, 0x01F7, 0x03F6, + 0x04F8, 0x0406, 0x050F, 0x06F2, 0x0600, 0x07FE, 0x0706, 0x08FE, 0x0801, + 0x0802, 0x0806, 0x0A09, 0xF210, 0x0A0A, 0x0B09, 0xF0F6, 0x0106, 0x03FA, + 0xF003, 0xFA10, 0xF0F2, 0x0504, 0x0E02, 0xF201, 0xFFFE, 0xF0F9, 0xF810, + 0x04F0, 0x0B10, 0x0F10, 0x10FA, 0x1007, 0x100B, 0x01FE, 0x0303, 0xF0F8, + 0x0AF0, 0x10FB, 0x1003, 0xF0F7, 0xF910, 0x0102, 0x02FF, 0xFE00, 0xFEFB, + 0xFF10, 0xF203, 0xF206, 0xF208, 0xF7F6, 0xF7FC, 0xFC06, 0xFD0A, 0xFFF1, + 0x01F8, 0x020F, 0x03F1, 0x0309, 0x04F1, 0x05F1, 0x05F2, 0x06FB, 0x07F8, + 0x070C, 0x09F9, 0x0902, 0xFA03, 0x0B07, 0x0B0E, 0xFF02, 0xFC00, 0x0304, + 0x0910, 0x0405, 0xFAFC, 0xFC03, 0xFAFD, 0xFAFE, 0xFCF9, 0xFCFA, 0x04FB, + 0x0501, 0x0200, 0xF0FA, 0xF005, 0xF006, 0x04FD, 0xFDFD, 0x10F8, 0xF710, + 0xF300, 0xF303, 0xF304, 0xF4FB, 0xF400, 0xF40C, 0xF500, 0xFF0D, 0x000B, + 0x0AF9, 0x0BFF, 0x0DFE, 0xF10B, 0x0DFF, 0x0D0B, 0xF2FC, 0xF3FB, 0xF30A, + 0xF30B, 0xF30E, 0xF4F8, 0xF506, 0xF507, 0xF6FD, 0xF604, 0xF60A, 0xF80B, + 0xFA0B, 0xFE0D, 0x00F2, 0x01F6, 0x0108, 0x02F3, 0x03F4, 0x05F4, 0x070D, + 0x08F3, 0x09F3, 0x0900, 0x0AF5, 0x0AF6, 0x0A04, 0x0B02, 0x0C03, 0x0C05, + 0x0C06, 0x0C09, 0x0D02, 0x0D06, 0x0D09, 0x0FF3, 0xF7F2, 0x0F04, 0x0F0C, + 0xF703, 0xF8FA, 0xFAF6, 0xFC09, 0xFD0F, 0xFFF9, 0xFF0F, 0x01F2, 0x02F1, + 0x03F2, 0x03F7, 0x03F9, 0x05FB, 0x07FB, 0x09FB, 0x0905, 0x0907, 0x0EFA, + 0x0F05, 0x0F06, 0xF000, 0xFB04, 0xF0F3, 0xFFFA, 0x1000, 0x0A10, 0x0CF0 }; - const uint8_t * const ff_on2avc_cb_bits[] = { on2avc_cb1_bits, on2avc_cb2_bits, on2avc_cb3_bits, on2avc_cb4_bits, on2avc_cb5_bits, on2avc_cb6_bits, on2avc_cb7_bits, on2avc_cb8_bits, @@ -6012,21 +2387,18 @@ const uint8_t * const ff_on2avc_cb_bits[] = { }; const uint16_t * const ff_on2avc_cb_syms[] = { - on2avc_cb1_2_syms, on2avc_cb1_2_syms, on2avc_cb3_4_syms, on2avc_cb3_4_syms, - on2avc_cb5_6_syms, on2avc_cb5_6_syms, on2avc_cb7_8_syms, on2avc_cb7_8_syms, - on2avc_cb9_10_syms, on2avc_cb9_10_syms, on2avc_cb11_syms, on2avc_cb12_syms, + on2avc_cb_1_syms, on2avc_cb_2_syms, on2avc_cb_3_syms, on2avc_cb_4_syms, + on2avc_cb_5_syms, on2avc_cb_6_syms, on2avc_cb_7_syms, on2avc_cb_8_syms, + on2avc_cb_9_syms, on2avc_cb_10_syms, on2avc_cb11_syms, on2avc_cb12_syms, on2avc_cb13_syms, on2avc_cb14_syms, on2avc_cb15_syms }; -const uint8_t ff_on2avc_cb_codes_sizes[] = { - 2, 1, 4, 2, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2 -}; - const int ff_on2avc_cb_elems[] = { - ON2AVC_CB1_2_CODES, ON2AVC_CB1_2_CODES, ON2AVC_CB3_4_CODES, ON2AVC_CB3_4_CODES, - ON2AVC_CB5_6_CODES, ON2AVC_CB5_6_CODES, ON2AVC_CB7_8_CODES, ON2AVC_CB7_8_CODES, - ON2AVC_CB9_10_CODES, ON2AVC_CB9_10_CODES, ON2AVC_CB11_CODES, ON2AVC_CB12_CODES, - ON2AVC_CB13_CODES, ON2AVC_CB14_CODES, ON2AVC_CB15_CODES, + ON2AVC_CB_1_2_CODES, ON2AVC_CB_1_2_CODES, ON2AVC_CB_3_4_CODES, + ON2AVC_CB_3_4_CODES, ON2AVC_CB_5_6_CODES, ON2AVC_CB_5_6_CODES, + ON2AVC_CB_7_8_CODES, ON2AVC_CB_7_8_CODES, ON2AVC_CB_9_10_CODES, + ON2AVC_CB_9_10_CODES, ON2AVC_CB_11_CODES, ON2AVC_CB_12_CODES, + ON2AVC_CB_13_CODES, ON2AVC_CB_14_CODES, ON2AVC_CB_15_CODES }; const float ff_on2avc_window_long_32000[1024] = { diff --git a/libavcodec/on2avcdata.h b/libavcodec/on2avcdata.h index 2395b80e68..dee8c3e102 100644 --- a/libavcodec/on2avcdata.h +++ b/libavcodec/on2avcdata.h @@ -38,13 +38,11 @@ extern const On2AVCMode ff_on2avc_modes_40[8]; extern const On2AVCMode ff_on2avc_modes_44[8]; #define ON2AVC_SCALE_DIFFS 121 -extern const uint32_t ff_on2avc_scale_diff_codes[]; -extern const uint8_t ff_on2avc_scale_diff_bits[]; +extern const uint8_t ff_on2avc_scale_diff_syms[]; +extern const uint8_t ff_on2avc_scale_diff_bits[]; -extern const void * const ff_on2avc_cb_codes[]; extern const uint8_t * const ff_on2avc_cb_bits[]; extern const uint16_t * const ff_on2avc_cb_syms[]; -extern const uint8_t ff_on2avc_cb_codes_sizes[]; extern const int ff_on2avc_cb_elems[]; extern const float ff_on2avc_window_long_32000[1024]; From patchwork Fri Nov 20 07:18:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23753 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 7888B44A644 for ; Fri, 20 Nov 2020 09:24:23 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 64F0068B9CD; Fri, 20 Nov 2020 09:24:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 43B3968B986 for ; Fri, 20 Nov 2020 09:24:19 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id gj5so11497189ejb.8 for ; Thu, 19 Nov 2020 23:24:19 -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=WLXiK08raROjXwNtGYAOwx9Anj+rYT4sgHO1uSH+vTE=; b=cBCzuat1ZJ7f2/2olRyTRYHJgaNPAcrPE/I5Ty+KWdKXJ1M06OBplGOWFfjG/NuadO 8fNQTD3k7bev86YVDoByetmloyV9K5kWKO4TMI6y/VrPFGe1YIw7v1X7PXlXuAGeajQp +d4ylQFZU/LVP3JSTUY+vr+8rDcZG9sd8Af85R+GHR9DLOa8jzktB4TjdfnjYUGzPWVU 2+ioRs90OlrWaHJjDQN8ipDb5xv1qzXA7T4mcNXF4pIEJzeyGdaBeSa6nYPqgV045lTB uv8cgWL4uuW2rviL7VTRxqGKynPrYv21H43NOD7sotdsYHaWFtALTc0Kx89or9AmDRsu YAZQ== 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=WLXiK08raROjXwNtGYAOwx9Anj+rYT4sgHO1uSH+vTE=; b=rbUjdUMW4AC5jipWnZdA7GmLrSYIkW64QHAgA4OaMcyN0xYaIKrJfGPrWhYq/uDC3T TdsSTbpPJ1rLm2ErwA6iGo7fq241pA1psImvUDn2whgXneI0IBd5KYKu4ihkbNEtOy35 iPDDL3zigHMG94khz8q9XWHI7Yd8GZ/41nu/+CgGliKwcMugoqIjBK6h7iaj/4URVBuG dNHBNZ41xhEXajDcYdf3bhwDT21LuP3KX1F8Mhk/McPBkvK+C9h1QpS8PYxXZ7KLP6jb dhjFwCxEMG/8GKrdI2PElpF6GwOKWk+NjPy5CTXuBfXDSwolKsNAspV6BcGG4MQ039g8 dNMQ== X-Gm-Message-State: AOAM532XTP8OIZMvDQ6hPqTjzqYbN4qxipAkFwQuzqghRufrQF2cBrat s31AFqBoyQP91DdQCV9x7KQOAmAOGM2YXg== X-Google-Smtp-Source: ABdhPJyXukZhXujHt+R6XZwLx1OFSyA9sU4kQbMHlDuyt/zub4bz+DOldK59Z8N2hon0SGzCDl6c7Q== X-Received: by 2002:a17:906:b14e:: with SMTP id bt14mr741596ejb.226.1605857057754; Thu, 19 Nov 2020 23:24:17 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:17 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:44 +0100 Message-Id: <20201120072116.818090-12-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 011/162] avcodec/on2avcdata: Combine tables for codebooks 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" Using one big table for the codebook symbols and lengths makes it possible to remove the pointers to the individual tables. Signed-off-by: Andreas Rheinhardt --- libavcodec/on2avc.c | 8 ++- libavcodec/on2avcdata.c | 132 ++++++++++------------------------------ libavcodec/on2avcdata.h | 4 +- 3 files changed, 40 insertions(+), 104 deletions(-) diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c index 2db42e2bf2..64480c0701 100644 --- a/libavcodec/on2avc.c +++ b/libavcodec/on2avc.c @@ -906,6 +906,8 @@ static av_cold void on2avc_free_vlcs(On2AVCContext *c) static av_cold int on2avc_decode_init(AVCodecContext *avctx) { On2AVCContext *c = avctx->priv_data; + const uint8_t *lens = ff_on2avc_cb_lens; + const uint16_t *syms = ff_on2avc_cb_syms; int i, ret; if (avctx->channels > 2U) { @@ -964,10 +966,12 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) for (i = 1; i < 16; i++) { int idx = i - 1; ret = ff_init_vlc_from_lengths(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx], - ff_on2avc_cb_bits[idx], 1, - ff_on2avc_cb_syms[idx], 2, 2, 0, 0, avctx); + lens, 1, + syms, 2, 2, 0, 0, avctx); if (ret < 0) goto vlc_fail; + lens += ff_on2avc_cb_elems[idx]; + syms += ff_on2avc_cb_elems[idx]; } return 0; diff --git a/libavcodec/on2avcdata.c b/libavcodec/on2avcdata.c index 52ede3f4da..bde50615ce 100644 --- a/libavcodec/on2avcdata.c +++ b/libavcodec/on2avcdata.c @@ -143,19 +143,16 @@ const uint8_t ff_on2avc_scale_diff_bits[ON2AVC_SCALE_DIFFS] = { #define ON2AVC_CB_14_CODES 729 #define ON2AVC_CB_15_CODES 1089 -static const uint8_t on2avc_cb1_bits[ON2AVC_CB_1_2_CODES] = { +const uint8_t ff_on2avc_cb_lens[] = { + /* Codebook 1 - 41 entries */ 1, 6, 6, 6, 6, 6, 8, 8, 9, 9, 9, 9, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 7, 9, 9, 9, 9, 7, 9, 9, 9, 9, -}; - -static const uint8_t on2avc_cb2_bits[ON2AVC_CB_1_2_CODES] = { + /* Codebook 2 - 41 entries */ 5, 7, 7, 7, 7, 5, 5, 5, 7, 7, 7, 7, 5, 5, 5, 5, 5, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 3, 5, 5, 5, 5, -}; - -static const uint8_t on2avc_cb3_bits[ON2AVC_CB_3_4_CODES] = { + /* Codebook 3 - 313 entries */ 1, 7, 7, 7, 9, 9, 10, 11, 12, 14, 14, 14, 15, 15, 10, 10, 7, 9, 9, 9, 10, 11, 12, 12, 7, 10, 11, 11, 12, 12, 12, 13, 14, 15, 15, 11, 11, 9, 9, 7, 9, 10, 11, 12, 12, 9, 9, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, @@ -173,9 +170,7 @@ static const uint8_t on2avc_cb3_bits[ON2AVC_CB_3_4_CODES] = { 9, 10, 12, 12, 12, 13, 14, 15, 16, 16, 9, 10, 10, 9, 10, 11, 12, 12, 9, 10, 11, 12, 13, 13, 9, 9, 9, 11, 12, 13, 14, 14, 11, 11, 8, 9, 11, 12, 13, 13, 11, 12, 13, 15, 15, 15, 15, -}; - -static const uint8_t on2avc_cb4_bits[ON2AVC_CB_3_4_CODES] = { + /* Codebook 4 - 313 entries */ 7, 7, 7, 9, 9, 9, 10, 11, 12, 12, 6, 6, 6, 7, 9, 9, 9, 9, 6, 6, 6, 7, 9, 9, 9, 9, 6, 6, 6, 7, 7, 6, 6, 9, 9, 9, 11, 12, 12, 11, 11, 9, 9, 9, 11, 11, 11, 12, 12, 7, 9, 9, 9, 9, 7, 9, 9, @@ -193,9 +188,7 @@ static const uint8_t on2avc_cb4_bits[ON2AVC_CB_3_4_CODES] = { 11, 11, 10, 10, 8, 8, 8, 10, 10, 10, 10, 8, 10, 11, 11, 10, 10, 8, 9, 10, 11, 13, 13, 13, 13, 9, 10, 10, 10, 11, 11, 10, 10, 6, 6, 5, 5, 5, 6, 8, 9, 9, 8, 9, 10, 11, 11, -}; - -static const uint8_t on2avc_cb5_bits[ON2AVC_CB_5_6_CODES] = { + /* Codebook 5 - 1201 entries */ 1, 7, 8, 10, 10, 10, 11, 12, 14, 14, 14, 14, 7, 10, 11, 14, 14, 14, 14, 13, 13, 10, 12, 13, 15, 15, 15, 15, 12, 12, 10, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 14, 14, 14, 14, 11, 12, 12, 7, @@ -260,9 +253,7 @@ static const uint8_t on2avc_cb5_bits[ON2AVC_CB_5_6_CODES] = { 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 14, 14, 14, 14, 13, 14, 14, 11, 13, 13, 13, 13, -}; - -static const uint8_t on2avc_cb6_bits[ON2AVC_CB_5_6_CODES] = { + /* Codebook 6 - 1201 entries */ 8, 10, 12, 13, 13, 12, 13, 14, 16, 17, 17, 16, 16, 10, 11, 11, 8, 10, 11, 11, 10, 10, 10, 10, 11, 12, 13, 14, 14, 11, 11, 10, 10, 10, 11, 12, 12, 8, 10, 11, 12, 12, 10, 11, 11, 8, 10, 10, 10, 11, 13, 13, 13, 13, 10, 11, 12, @@ -327,9 +318,7 @@ static const uint8_t on2avc_cb6_bits[ON2AVC_CB_5_6_CODES] = { 9, 10, 11, 12, 12, 9, 9, 9, 10, 10, 9, 9, 12, 12, 12, 12, 11, 11, 10, 10, 9, 10, 11, 13, 13, 13, 13, 9, 9, 9, 9, 12, 12, 12, 12, 11, 11, 10, 10, 9, 10, 10, -}; - -static const uint8_t on2avc_cb7_bits[ON2AVC_CB_7_8_CODES] = { + /* Codebook 7 - 3281 entries */ 1, 7, 11, 12, 12, 12, 13, 14, 15, 15, 13, 13, 13, 13, 13, 13, 13, 14, 14, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, @@ -503,9 +492,7 @@ static const uint8_t on2avc_cb7_bits[ON2AVC_CB_7_8_CODES] = { 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 11, 12, 12, 10, 11, 11, -}; - -static const uint8_t on2avc_cb8_bits[ON2AVC_CB_7_8_CODES] = { + /* Codebook 8 - 3281 entries */ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, @@ -679,9 +666,7 @@ static const uint8_t on2avc_cb8_bits[ON2AVC_CB_7_8_CODES] = { 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -}; - -static const uint8_t on2avc_cb9_bits[ON2AVC_CB_9_10_CODES] = { + /* Codebook 9 - 121 entries */ 1, 5, 8, 9, 10, 11, 11, 9, 10, 11, 11, 10, 12, 12, 12, 12, 11, 11, 11, 11, 9, 10, 11, 12, 13, 13, 10, 11, 11, 10, 10, 8, 9, 11, 12, 12, 11, 11, 5, 8, 9, 10, 10, 8, 9, 10, 10, 8, 8, 8, 9, 10, 11, 12, 12, 8, 9, @@ -689,9 +674,7 @@ static const uint8_t on2avc_cb9_bits[ON2AVC_CB_9_10_CODES] = { 10, 8, 8, 8, 9, 9, 5, 9, 10, 11, 11, 9, 10, 11, 11, 8, 9, 9, 8, 8, 8, 8, 5, 5, 5, 9, 11, 12, 12, 11, 11, 9, 9, 8, 9, 10, 10, 8, 8, 8, 9, 10, 10, 4, 4, -}; - -static const uint8_t on2avc_cb10_bits[ON2AVC_CB_9_10_CODES] = { + /* Codebook 10 - 121 entries */ 9, 9, 9, 9, 8, 9, 9, 7, 8, 9, 9, 8, 9, 9, 8, 8, 8, 8, 8, 8, 5, 6, 8, 8, 8, 8, 7, 8, 8, 7, 7, 7, 8, 9, 9, 7, 8, 8, 7, 7, 7, 8, 9, 9, 6, 7, 7, 5, 6, 7, 7, 6, 7, 8, 9, 9, 6, @@ -699,9 +682,7 @@ static const uint8_t on2avc_cb10_bits[ON2AVC_CB_9_10_CODES] = { 7, 7, 5, 7, 8, 8, 8, 8, 8, 8, 5, 6, 7, 7, 6, 7, 8, 8, 6, 7, 8, 8, 5, 6, 7, 8, 8, 7, 7, 8, 9, 9, 8, 8, 6, 7, 8, 8, 6, 7, 8, 8, 6, 7, 7, -}; - -static const uint8_t on2avc_cb11_bits[ON2AVC_CB_11_CODES] = { + /* Codebook 11 - 225 entries */ 2, 10, 10, 10, 10, 9, 10, 11, 11, 10, 10, 10, 10, 9, 9, 9, 10, 11, 11, 9, 10, 10, 10, 11, 12, 12, 10, 11, 11, 9, 9, 9, 10, 10, 9, 9, 8, 10, 11, 11, 10, 10, 9, 10, 10, 10, 10, 10, 11, 11, 9, 10, 10, 9, 10, 10, 8, @@ -714,9 +695,7 @@ static const uint8_t on2avc_cb11_bits[ON2AVC_CB_11_CODES] = { 10, 10, 10, 9, 10, 10, 9, 9, 8, 9, 9, 7, 8, 10, 10, 10, 10, 7, 8, 9, 10, 10, 7, 9, 10, 10, 9, 10, 10, 8, 8, 9, 9, 9, 10, 10, 7, 8, 9, 10, 10, 8, 9, 10, 10, 9, 9, 9, 10, 10, 4, 4, 4, 4, -}; - -static const uint8_t on2avc_cb12_bits[ON2AVC_CB_12_CODES] = { + /* Codebook 12 - 441 entries */ 2, 10, 11, 11, 11, 12, 12, 11, 11, 10, 12, 12, 12, 12, 10, 11, 11, 12, 12, 12, 12, 11, 11, 10, 11, 11, 10, 12, 13, 13, 12, 12, 10, 12, 12, 12, 12, 10, 11, 12, 12, 10, 12, 12, 12, 12, 11, 12, 12, 11, 12, 12, 11, 11, 11, 11, 10, @@ -741,9 +720,7 @@ static const uint8_t on2avc_cb12_bits[ON2AVC_CB_12_CODES] = { 11, 11, 10, 11, 12, 12, 9, 10, 11, 11, 10, 11, 11, 10, 10, 10, 11, 12, 12, 10, 11, 11, 10, 10, 10, 10, 9, 9, 10, 11, 11, 10, 10, 9, 11, 11, 11, 11, 4, 4, 4, 4, -}; - -static const uint8_t on2avc_cb13_bits[ON2AVC_CB_13_CODES] = { + /* Codebook 13 - 625 entries */ 1, 8, 10, 10, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, @@ -777,9 +754,7 @@ static const uint8_t on2avc_cb13_bits[ON2AVC_CB_13_CODES] = { 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 10, 11, 11, 10, 10, 5, 5, 5, 7, 8, 10, 10, 11, 12, 14, 14, 14, 14, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 10, 10, 8, 9, 9, -}; - -static const uint8_t on2avc_cb14_bits[ON2AVC_CB_14_CODES] = { + /* Codebook 14 - 729 entries */ 1, 6, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, @@ -819,9 +794,7 @@ static const uint8_t on2avc_cb14_bits[ON2AVC_CB_14_CODES] = { 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, -}; - -static const uint8_t on2avc_cb15_bits[ON2AVC_CB_15_CODES] = { + /* Codebook 15 - 1089 entries */ 2, 5, 8, 8, 12, 12, 12, 12, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 11, 11, 11, 11, 8, 11, 12, 13, 14, 14, 11, 12, 12, 11, @@ -882,23 +855,20 @@ static const uint8_t on2avc_cb15_bits[ON2AVC_CB_15_CODES] = { 11, 10, 11, 11, 10, 10 }; -static const uint16_t on2avc_cb_1_syms[ON2AVC_CB_1_2_CODES] = { +const uint16_t ff_on2avc_cb_syms[] = { + /* Codebook 1 - 41 entries */ 0x0000, 0x0F10, 0x01F0, 0x0011, 0xFF00, 0x00FF, 0x1111, 0xFFFF, 0x1FF1, 0xF11F, 0x11FF, 0xFF11, 0x0FF0, 0x0110, 0xF010, 0x010F, 0x10F0, 0x0F01, 0x1010, 0xF001, 0x0F0F, 0xF0F0, 0x0101, 0x100F, 0xF00F, 0x1001, 0x1F00, 0x00F1, 0x001F, 0xF100, 0x1100, 0xF1F1, 0xF1FF, 0x1F11, 0xFF1F, 0x11F1, 0x1F1F, 0x1FFF, 0xF111, 0xFFF1, 0x111F, -}; - -static const uint16_t on2avc_cb_2_syms[ON2AVC_CB_1_2_CODES] = { + /* Codebook 2 - 41 entries */ 0x00FF, 0xFFFF, 0x1111, 0x11FF, 0xFF11, 0xFF00, 0x0011, 0x100F, 0x1FF1, 0xF11F, 0x1FFF, 0x11F1, 0xF001, 0x10F0, 0x0F10, 0x010F, 0xF010, 0x1F11, 0xF111, 0xF1FF, 0x111F, 0x0F01, 0x01F0, 0x0110, 0x1001, 0x0FF0, 0xF00F, 0x1010, 0xF0F0, 0x0101, 0x0F0F, 0x1100, 0xFFF1, 0xFF1F, 0x1F1F, 0xF1F1, 0x0000, 0xF100, 0x1F00, 0x00F1, 0x001F, -}; - -static const uint16_t on2avc_cb_3_syms[ON2AVC_CB_3_4_CODES] = { + /* Codebook 3 - 313 entries */ 0x0000, 0xE000, 0x0F10, 0x000E, 0x01F2, 0x0F1E, 0xEE00, 0x1021, 0x22E0, 0x02E2, 0xE1F2, 0xEEE0, 0xE2E2, 0xE20E, 0x0FEF, 0x2200, 0x0002, 0xF2F0, 0xFFFF, 0x1E10, 0x00E2, 0xFE0F, 0x0EE2, 0x022E, 0xF001, 0xF111, 0x20F1, @@ -934,9 +904,7 @@ static const uint16_t on2avc_cb_3_syms[ON2AVC_CB_3_4_CODES] = { 0x0E2E, 0x2FF2, 0xFF11, 0xFFF1, 0x0121, 0xF2E1, 0x020E, 0xEFE1, 0x211E, 0xE00E, 0x1E2F, 0x1122, 0x1111, 0xFEF0, 0x1221, 0xE2FF, 0x1212, 0x2F21, 0x0E22, 0xF2FE, 0xFEFE, 0xE002, 0xEE22, 0xE202, 0xE222, -}; - -static const uint16_t on2avc_cb_4_syms[ON2AVC_CB_3_4_CODES] = { + /* Codebook 4 - 313 entries */ 0x1FF1, 0xF111, 0x111F, 0xF01E, 0xE011, 0x20FF, 0xFFEE, 0xF2FE, 0x220E, 0x20EE, 0x0110, 0x0F01, 0x0011, 0xF1F1, 0x20F1, 0x2F0F, 0x10F2, 0x110E, 0xF010, 0xF001, 0x10F0, 0xFFF1, 0xFF02, 0xE01F, 0x021F, 0xFE01, 0x010F, @@ -972,9 +940,7 @@ static const uint16_t on2avc_cb_4_syms[ON2AVC_CB_3_4_CODES] = { 0x0EE2, 0x02EE, 0x022E, 0x1221, 0xEFFE, 0xE1E1, 0x12EF, 0x00EE, 0x2200, 0x2112, 0xE1F2, 0xFF11, 0x11FF, 0x1100, 0x00FF, 0xFF00, 0xF11F, 0xE1F0, 0xFEEF, 0xEEFF, 0x1012, 0x1122, 0x1F22, 0xEE00, 0xEE20, -}; - -static const uint16_t on2avc_cb_5_syms[ON2AVC_CB_5_6_CODES] = { + /* Codebook 5 - 1201 entries */ 0x0000, 0x1100, 0x3F00, 0xF1FF, 0x010D, 0x0F30, 0xFE30, 0x10FE, 0xD021, 0xE23F, 0xE3EF, 0xFF33, 0xFF00, 0x03F0, 0x0301, 0xF1EE, 0xF3D1, 0xF30E, 0x023D, 0xFEDE, 0xFE0F, 0x1F11, 0xF11D, 0x10E3, 0xEDF2, 0xEEEE, 0xEE1F, @@ -1109,9 +1075,7 @@ static const uint16_t on2avc_cb_5_syms[ON2AVC_CB_5_6_CODES] = { 0x2EEE, 0x2F21, 0x2F23, 0x2103, 0x2123, 0x3FD1, 0x3FE2, 0xD21E, 0x3102, 0x3230, 0xEF23, 0xE2FD, 0x0D1E, 0x2EFD, 0xFDDF, 0x2FD2, 0x322F, 0x002E, 0xFE2F, 0xF2F2, 0xF221, 0x1EE1, -}; - -static const uint16_t on2avc_cb_6_syms[ON2AVC_CB_5_6_CODES] = { + /* Codebook 6 - 1201 entries */ 0xFF1F, 0x1EF0, 0x0D32, 0x3E30, 0x0D0F, 0x2E02, 0x0D10, 0xD0E3, 0xD33D, 0xDDD3, 0xD030, 0x0DD0, 0x3DD3, 0x1E10, 0x2DE1, 0x20EE, 0x11F1, 0xF0F2, 0xFE1E, 0x1D22, 0xEEFF, 0xE0F1, 0xFEEF, 0xE101, 0xDEF2, 0x2EE2, 0x00FD, @@ -1246,9 +1210,7 @@ static const uint16_t on2avc_cb_6_syms[ON2AVC_CB_5_6_CODES] = { 0xDF1F, 0x0321, 0x022E, 0xD1D3, 0xE03D, 0x3FDD, 0x320D, 0x1F0E, 0x1F1D, 0x1F13, 0x1102, 0xD22D, 0xE3E3, 0x0330, 0x233E, 0x0FED, 0x1203, 0xFEFE, 0x1E1E, 0x20FF, 0x10E3, 0x132E, -}; - -static const uint16_t on2avc_cb_7_syms[ON2AVC_CB_7_8_CODES] = { + /* Codebook 7 - 3281 entries */ 0x0000, 0x00FF, 0x3F00, 0xCC00, 0x1C10, 0x1140, 0xFCEF, 0x4220, 0x43C1, 0xCCCE, 0xFF40, 0xF2DC, 0xF21C, 0x1E4F, 0x114C, 0x2E1F, 0x30F0, 0xC020, 0xC2E0, 0x0022, 0x01C1, 0x014F, 0x1012, 0x104D, 0xEF21, 0xFEDC, 0xFFE2, @@ -1614,9 +1576,7 @@ static const uint16_t on2avc_cb_7_syms[ON2AVC_CB_7_8_CODES] = { 0x0E0C, 0x02E2, 0x03DC, 0x12DC, 0x142F, 0x2E11, 0x2FEF, 0x22F1, 0x24DF, 0x2431, 0x3EF0, 0x3001, 0x32F0, 0x4DEF, 0x4FE1, 0xC10F, 0xDC0F, 0xF0FE, 0xDC2F, 0x0F03, 0x01D4, 0x0CE0, 0x0103, -}; - -static const uint16_t on2avc_cb_8_syms[ON2AVC_CB_7_8_CODES] = { + /* Codebook 8 - 3281 entries */ 0x0E24, 0x0E3D, 0x0FDC, 0x0FFC, 0x0F3E, 0x0134, 0x02CC, 0x024C, 0x03D0, 0x030F, 0x04CE, 0x04F3, 0x1C41, 0x1D1D, 0x1D20, 0x1D33, 0x1E03, 0x10D0, 0x10D2, 0x102D, 0x103E, 0x1030, 0x11D3, 0x12D0, 0x13F3, 0x134E, 0x144D, @@ -1982,9 +1942,7 @@ static const uint16_t on2avc_cb_8_syms[ON2AVC_CB_7_8_CODES] = { 0xD33D, 0xD4D4, 0xEC3D, 0xEC33, 0xED03, 0xED1C, 0xED2D, 0xED2F, 0xEE33, 0xEFE3, 0xE0D1, 0xE3ED, 0xE3FC, 0xE32D, 0xE40E, 0xFCD2, 0xFC4D, 0xFDCE, 0xF31D, 0xF32C, 0x0D23, 0x0D43, 0x0ED3, -}; - -static const uint16_t on2avc_cb_9_syms[ON2AVC_CB_9_10_CODES] = { + /* Codebook 9 - 121 entries */ 0x0000, 0xFF00, 0x05FF, 0x02FB, 0xFE02, 0xFDFE, 0x03FE, 0x05FE, 0x0301, 0x0400, 0x02FD, 0x0103, 0xFCFE, 0x02FC, 0x0303, 0x04FD, 0x0004, 0x00FC, 0x0302, 0x04FF, 0x0502, 0xFC05, 0xFC01, 0xFDFC, 0xFC04, 0x03FC, 0x0504, @@ -1999,9 +1957,7 @@ static const uint16_t on2avc_cb_9_syms[ON2AVC_CB_9_10_CODES] = { 0xFFFF, 0x0101, 0xFD01, 0xFEFC, 0x04FC, 0x0404, 0xFE04, 0x0402, 0x01FD, 0xFDFF, 0xFB02, 0x02FE, 0x05FB, 0x0505, 0xFFFE, 0xFE01, 0x0102, 0x0202, 0x0203, 0xFD02, 0x0100, 0x0001, -}; - -static const uint16_t on2avc_cb_10_syms[ON2AVC_CB_9_10_CODES] = { + /* Codebook 10 - 121 entries */ 0x04FE, 0x0401, 0x04FB, 0x04FD, 0xFDFD, 0xFFFC, 0xFCFC, 0xFE00, 0x03FB, 0xFC03, 0x04FF, 0xFD00, 0x03FC, 0x0404, 0x0405, 0xFCFB, 0xFD05, 0xFB03, 0x05FD, 0x03FD, 0x0101, 0x05FF, 0x0504, 0xFBFC, 0xFD03, 0x0003, 0x05FE, @@ -2016,9 +1972,7 @@ static const uint16_t on2avc_cb_10_syms[ON2AVC_CB_9_10_CODES] = { 0x02FE, 0x02FD, 0x02FC, 0xFD04, 0xFD02, 0x0305, 0xFCFF, 0x04FC, 0xFC04, 0xFC01, 0xFF04, 0xFE02, 0xFBFD, 0xFC02, 0xFCFD, 0x0002, 0x0303, 0x01FC, 0x0104, 0x00FE, 0xFDFB, 0x0503, -}; - -static const uint16_t on2avc_cb11_syms[ON2AVC_CB_11_CODES] = { + /* Codebook 11 - 225 entries */ 0x0000, 0xFA04, 0xFBFA, 0xFAFB, 0xFE04, 0x0103, 0xFDFC, 0xFB03, 0x0504, 0x04FF, 0xFF07, 0x04FE, 0x0506, 0x01FA, 0xFDFE, 0xFAFF, 0x07FF, 0xFD05, 0x05F9, 0x0302, 0xFE07, 0xF902, 0x0701, 0x0005, 0xF907, 0x07F9, 0xFC02, @@ -2044,9 +1998,7 @@ static const uint16_t on2avc_cb11_syms[ON2AVC_CB_11_CODES] = { 0x04FC, 0x0503, 0x03FF, 0xFFFD, 0x04FA, 0xFEFC, 0x0402, 0x03FB, 0x0505, 0xFE00, 0x01FD, 0x02FC, 0x0706, 0xFBFE, 0xFDFF, 0xFFFC, 0xF9FB, 0xFBFC, 0xFCFE, 0xF901, 0xFCFF, 0x05FD, 0x0405, 0x0100, 0xFF00, 0x0001, 0x00FF, -}; - -static const uint16_t on2avc_cb12_syms[ON2AVC_CB_12_CODES] = { + /* Codebook 12 - 441 entries */ 0x0000, 0xFD03, 0x09FE, 0xFBFF, 0xF701, 0xF7F8, 0x0606, 0xFBFC, 0x0904, 0x08FF, 0xFB05, 0x0207, 0x04F6, 0x0AFA, 0x0801, 0xF703, 0xFD05, 0xF904, 0xFAF6, 0xFA02, 0x03F9, 0xF7FD, 0xFBFD, 0x04FF, 0x03F7, 0x0502, 0x0208, @@ -2096,9 +2048,7 @@ static const uint16_t on2avc_cb12_syms[ON2AVC_CB_12_CODES] = { 0x0901, 0xF708, 0x07F9, 0x00F9, 0x01FB, 0xFA04, 0xFBF9, 0x03FB, 0x03FC, 0x0708, 0x0808, 0x0300, 0xFDFD, 0x06FF, 0xF9F9, 0xF6FC, 0xF700, 0x0305, 0xF802, 0xF706, 0xF9FA, 0xFC06, 0x07FE, 0x0001, 0x0100, 0xFF00, 0x00FF, -}; - -static const uint16_t on2avc_cb13_syms[ON2AVC_CB_13_CODES] = { + /* Codebook 13 - 625 entries */ 0x0000, 0x0201, 0xFDFF, 0x03FE, 0x0302, 0xF909, 0xF90A, 0xFA00, 0xFA0A, 0x00F7, 0x08F6, 0x09F6, 0x09F8, 0x0901, 0x0AF7, 0x0A03, 0x0BF4, 0xF6F7, 0xF6FB, 0xF6FF, 0xF600, 0xF706, 0xF801, 0xF806, 0xF808, 0xFDF6, 0xFF09, @@ -2169,9 +2119,7 @@ static const uint16_t on2avc_cb13_syms[ON2AVC_CB_13_CODES] = { 0xF608, 0xF703, 0xF707, 0xF807, 0xF5F4, 0xF70B, 0xFAFA, 0xFA03, 0xFCFA, 0xFD0C, 0x00FC, 0x06F5, 0x06FF, 0x0702, 0xF5FE, 0x0705, 0x0C05, 0xFEF4, 0x00FD, 0xFE02, 0xFEFD, 0x0301, -}; - -static const uint16_t on2avc_cb14_syms[ON2AVC_CB_14_CODES] = { + /* Codebook 14 - 729 entries */ 0x0000, 0x01FF, 0xF9F8, 0xF9F9, 0xF907, 0xFA04, 0xFBF8, 0xFB07, 0xFB08, 0xFB0A, 0xFC07, 0xFC0A, 0xFDF5, 0xFDF6, 0xFEF5, 0xFFFB, 0xFF08, 0xFF0B, 0x01F5, 0x02F6, 0x03F9, 0x04FA, 0x04FB, 0x04FC, 0x040C, 0x05FF, 0x06FD, @@ -2253,9 +2201,7 @@ static const uint16_t on2avc_cb14_syms[ON2AVC_CB_14_CODES] = { 0x0B08, 0x0CF5, 0x0CF6, 0x0CF8, 0x0CFA, 0x0CFE, 0xF30D, 0x0C02, 0x0C08, 0xF4F7, 0xF405, 0xF5F4, 0xF5F5, 0xF5F7, 0xF6F8, 0xF6F9, 0xF6FA, 0xF6FD, 0xF602, 0xF7F7, 0xF701, 0xF706, 0xF8F6, 0xF8FC, 0xF8FD, 0xF806, 0xF9F6, -}; - -static const uint16_t on2avc_cb15_syms[ON2AVC_CB_15_CODES] = { + /* Codebook 15 - 1089 entries */ 0x0000, 0x00FF, 0xFEFF, 0x0201, 0xFAFF, 0xFBFB, 0xFF06, 0x06FE, 0x100E, 0xF2F6, 0xF2FF, 0xF205, 0xF3F3, 0xF6F2, 0xF8F5, 0xF90B, 0xFAF8, 0xFAF9, 0xFA06, 0xFCF2, 0x0008, 0x0209, 0x030E, 0x04F2, 0x040E, 0x040F, 0x05F7, @@ -2379,20 +2325,6 @@ static const uint16_t on2avc_cb15_syms[ON2AVC_CB_15_CODES] = { 0x0F05, 0x0F06, 0xF000, 0xFB04, 0xF0F3, 0xFFFA, 0x1000, 0x0A10, 0x0CF0 }; -const uint8_t * const ff_on2avc_cb_bits[] = { - on2avc_cb1_bits, on2avc_cb2_bits, on2avc_cb3_bits, on2avc_cb4_bits, - on2avc_cb5_bits, on2avc_cb6_bits, on2avc_cb7_bits, on2avc_cb8_bits, - on2avc_cb9_bits, on2avc_cb10_bits, on2avc_cb11_bits, on2avc_cb12_bits, - on2avc_cb13_bits, on2avc_cb14_bits, on2avc_cb15_bits -}; - -const uint16_t * const ff_on2avc_cb_syms[] = { - on2avc_cb_1_syms, on2avc_cb_2_syms, on2avc_cb_3_syms, on2avc_cb_4_syms, - on2avc_cb_5_syms, on2avc_cb_6_syms, on2avc_cb_7_syms, on2avc_cb_8_syms, - on2avc_cb_9_syms, on2avc_cb_10_syms, on2avc_cb11_syms, on2avc_cb12_syms, - on2avc_cb13_syms, on2avc_cb14_syms, on2avc_cb15_syms -}; - const int ff_on2avc_cb_elems[] = { ON2AVC_CB_1_2_CODES, ON2AVC_CB_1_2_CODES, ON2AVC_CB_3_4_CODES, ON2AVC_CB_3_4_CODES, ON2AVC_CB_5_6_CODES, ON2AVC_CB_5_6_CODES, diff --git a/libavcodec/on2avcdata.h b/libavcodec/on2avcdata.h index dee8c3e102..c5e7c80b68 100644 --- a/libavcodec/on2avcdata.h +++ b/libavcodec/on2avcdata.h @@ -41,8 +41,8 @@ extern const On2AVCMode ff_on2avc_modes_44[8]; extern const uint8_t ff_on2avc_scale_diff_syms[]; extern const uint8_t ff_on2avc_scale_diff_bits[]; -extern const uint8_t * const ff_on2avc_cb_bits[]; -extern const uint16_t * const ff_on2avc_cb_syms[]; +extern const uint8_t ff_on2avc_cb_lens[]; +extern const uint16_t ff_on2avc_cb_syms[]; extern const int ff_on2avc_cb_elems[]; extern const float ff_on2avc_window_long_32000[1024]; 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++) { From patchwork Fri Nov 20 07:18:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23916 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 87A8A44AD6B for ; Fri, 20 Nov 2020 09:56:04 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 73A3068BEB5; Fri, 20 Nov 2020 09:56:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D9DAA68BEB2 for ; Fri, 20 Nov 2020 09:55:57 +0200 (EET) Received: by mail-wr1-f67.google.com with SMTP id b6so9058198wrt.4 for ; Thu, 19 Nov 2020 23:55:57 -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=ejCV1T6PjA2UVOoFv6S/2eW6A4Yp7o+N6BiZB3fRkCs=; b=dNakOhPF9A1DOmUgS0mbnwIV00VwxxPyU1Bf/Wu3lwjPYALlIr1gCf+AwVHaYxfLM8 pPnXbcELLCDnXKEV+NPMuKWXECPqqr0pYUhFKu0Nz+Ml98n/5/lCVK8gXAHkvGatMYM8 SAW5w/L2+R2ph6sCuLc31zyDPafm0kZ5XuNZCTiO9J60o35j/SWPQiB5PQjooQ7LUUZB 10KyHzTM/Mce5ayF7PIUWYCiyVAh+u0ZSwiC7phc11kjfaHrIh/SHsaxZF5pTFJN3tDr 8fXQV3sqhFcRsPyU6JBe1QACg/puBSqT/CFxYG/acZ8Onp3kNUaC2GO1qK7JXu3E/ZNE ZpBA== 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=ejCV1T6PjA2UVOoFv6S/2eW6A4Yp7o+N6BiZB3fRkCs=; b=iPAwGI0qCGNfC9YlzO2myv3RDpkEFwpwkxWRdmkUjg7Daos4EgKMF+1J9tbCWY7X5H VaGokr3AOhsnCswccCXQzzfme1dgs4DjU0VhzQKOb4CuC83cqlmTVn2xMVh2aCDhLaWq 94veEnYFQxQMU+aTWHdNRCLfIB0XOoQaewnk9LCZB/NZrXOHQit1aDayb5XT8CBPLBAT BHJ8AXXG/9p4OdrZ0J020qMlAShm9Zz3SLm+2XofQc3ndnZIUG1jgzg5UtRC2i6KWoUL vV4qct1wZNU+QL9qP8TDMHol+IeTe684cWi03CdYEItjX42sR8EX5+lJBllKH29jSV1a Mq/w== X-Gm-Message-State: AOAM532TVq6bZWD7Mjw3xsvndJ4XTILAxUpQMF6gdCE1yxDqT9QthG0c ZKLv1cKbo7DAG5hMvowztgYgBoqLUfCNnQ== X-Google-Smtp-Source: ABdhPJwPXkVkqXgMZlLuTG1fbOEBpFWbjPv5wOMobTux5moW2hSrrP8lMsz33nh2dlkiZ+XAH0JOiw== X-Received: by 2002:aa7:cdd3:: with SMTP id h19mr34990845edw.330.1605857059540; Thu, 19 Nov 2020 23:24:19 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:19 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:46 +0100 Message-Id: <20201120072116.818090-14-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 013/162] avcodec/imc: Make Huffman tables 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 IMC decoder uses Huffman tables which are created at runtime from length tables of type uint8_t and code tables of type uint16_t together with an implicit symbols table (i.e. symbol[i] == i). This commit changes this: All three tables are subjected to the same permutation to order the codes from left to right in the tree; afterwards the codes can be omitted because they are easily computable at runtime from the lengths, whereas the symbols need to be explicitly coded now. But said symbols fit into an uint8_t, so one saves space. Signed-off-by: Andreas Rheinhardt --- libavcodec/imc.c | 7 +++-- libavcodec/imcdata.h | 66 ++++++++++++++++++++++---------------------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index 70ad5b1dbd..5a1649ab62 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -239,9 +239,10 @@ static av_cold int imc_decode_init(AVCodecContext *avctx) for (j = 0; j < 4; j++) { huffman_vlc[i][j].table = &vlc_tables[vlc_offsets[i * 4 + j]]; huffman_vlc[i][j].table_allocated = vlc_offsets[i * 4 + j + 1] - vlc_offsets[i * 4 + j]; - init_vlc(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i], - imc_huffman_lens[i][j], 1, 1, - imc_huffman_bits[i][j], 2, 2, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i], + imc_huffman_lens[i][j], 1, + imc_huffman_syms[i][j], 1, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); } } diff --git a/libavcodec/imcdata.h b/libavcodec/imcdata.h index 64e7c7185e..46037bd555 100644 --- a/libavcodec/imcdata.h +++ b/libavcodec/imcdata.h @@ -114,55 +114,55 @@ static const uint8_t imc_huffman_sizes[4] = { static const uint8_t imc_huffman_lens[4][4][18] = { { - { 16, 15, 13, 11, 8, 5, 3, 1, 2, 4, 6, 9, 10, 12, 14, 16, 7, 0 }, - { 10, 8, 7, 6, 4, 4, 3, 2, 2, 3, 4, 6, 7, 9, 11, 11, 7, 0 }, - { 15, 15, 14, 11, 8, 6, 4, 2, 1, 4, 5, 7, 9, 10, 12, 13, 4, 0 }, - { 13, 11, 10, 8, 6, 4, 2, 2, 2, 3, 5, 7, 9, 12, 15, 15, 14, 0 }, + { 1, 2, 5, 6, 11, 12, 15, 16, 16, 14, 13, 10, 9, 8, 7, 4, 3 }, + { 2, 3, 3, 4, 4, 4, 6, 6, 7, 7, 7, 8, 9, 10, 11, 11, 2 }, + { 1, 4, 4, 7, 9, 10, 12, 15, 15, 14, 13, 11, 8, 6, 5, 4, 2 }, + { 2, 2, 4, 8, 9, 14, 15, 15, 13, 12, 11, 10, 7, 6, 5, 3, 2 }, }, { - { 14, 12, 10, 8, 7, 4, 2, 2, 2, 3, 5, 7, 9, 11, 13, 14, 7, 0 }, - { 14, 13, 11, 8, 6, 4, 3, 2, 2, 3, 5, 7, 9, 10, 12, 14, 3, 0 }, - { 13, 12, 10, 7, 5, 4, 3, 2, 2, 3, 4, 6, 8, 9, 11, 13, 4, 0 }, - { 13, 12, 10, 7, 5, 4, 3, 2, 2, 3, 4, 6, 8, 9, 11, 13, 4, 0 }, + { 2, 2, 3, 4, 7, 7, 10, 11, 12, 14, 14, 13, 9, 8, 7, 5, 2 }, + { 2, 3, 14, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 3, 2 }, + { 2, 3, 3, 4, 4, 5, 7, 9, 11, 12, 13, 13, 10, 8, 6, 4, 2 }, + { 2, 3, 3, 4, 4, 5, 7, 9, 11, 12, 13, 13, 10, 8, 6, 4, 2 }, }, { - { 16, 14, 12, 10, 8, 5, 3, 1, 2, 4, 7, 9, 11, 13, 15, 17, 6, 17 }, - { 15, 13, 11, 8, 6, 4, 2, 2, 2, 3, 5, 7, 10, 12, 14, 16, 9, 16 }, - { 14, 12, 11, 9, 8, 6, 3, 1, 2, 5, 7, 10, 13, 15, 16, 17, 4, 17 }, - { 16, 14, 12, 9, 7, 5, 2, 2, 2, 3, 4, 6, 8, 11, 13, 15, 10, 16 }, + { 3, 5, 8, 9, 12, 15, 17, 17, 16, 14, 13, 11, 10, 7, 6, 4, 2, 1 }, + { 4, 7, 8, 10, 11, 12, 15, 16, 16, 14, 13, 9, 6, 5, 3, 2, 2, 2 }, + { 4, 5, 6, 7, 12, 13, 17, 17, 16, 15, 14, 11, 10, 9, 8, 3, 2, 1 }, + { 2, 5, 7, 8, 14, 15, 16, 16, 13, 12, 11, 10, 9, 6, 4, 3, 2, 2 }, }, { - { 13, 11, 10, 8, 7, 5, 2, 2, 2, 4, 6, 9, 12, 14, 15, 16, 3, 16 }, - { 11, 11, 10, 9, 8, 7, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 6, 5 }, - { 9, 9, 7, 6, 5, 4, 3, 3, 2, 3, 4, 5, 4, 5, 5, 6, 8, 6 }, - { 13, 12, 10, 8, 5, 3, 3, 2, 2, 3, 4, 7, 9, 11, 14, 15, 6, 15 }, + { 2, 4, 7, 9, 10, 12, 13, 15, 16, 16, 14, 11, 8, 6, 5, 3, 2, 2 }, + { 3, 5, 5, 7, 10, 11, 11, 9, 8, 6, 5, 4, 4, 3, 3, 3, 3, 3 }, + { 5, 8, 9, 9, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2 }, + { 2, 3, 5, 7, 8, 11, 12, 13, 15, 15, 14, 10, 9, 6, 4, 3, 3, 2 }, } }; -static const uint16_t imc_huffman_bits[4][4][18] = { +static const uint8_t imc_huffman_syms[4][4][18] = { { - { 0xCC32, 0x6618, 0x1987, 0x0660, 0x00CD, 0x0018, 0x0007, 0x0000, 0x0002, 0x000D, 0x0032, 0x0199, 0x0331, 0x0CC2, 0x330D, 0xCC33, 0x0067, 0x0000 }, - { 0x02FE, 0x00BE, 0x005E, 0x002D, 0x000A, 0x0009, 0x0003, 0x0003, 0x0000, 0x0002, 0x0008, 0x002C, 0x005D, 0x017E, 0x05FE, 0x05FF, 0x005C, 0x0000 }, - { 0x5169, 0x5168, 0x28B5, 0x0517, 0x00A3, 0x0029, 0x0008, 0x0003, 0x0000, 0x0009, 0x0015, 0x0050, 0x0144, 0x028A, 0x0A2C, 0x145B, 0x000B, 0x0000 }, - { 0x1231, 0x048D, 0x0247, 0x0090, 0x0025, 0x0008, 0x0001, 0x0003, 0x0000, 0x0005, 0x0013, 0x0049, 0x0122, 0x0919, 0x48C3, 0x48C2, 0x2460, 0x0000 }, + { 7, 8, 5, 10, 3, 13, 1, 0, 15, 14, 2, 12, 11, 4, 16, 9, 6 }, + { 8, 9, 6, 10, 5, 4, 11, 3, 16, 12, 2, 1, 13, 0, 14, 15, 7 }, + { 8, 6, 9, 11, 12, 13, 14, 1, 0, 2, 15, 3, 4, 5, 10, 16, 7 }, + { 8, 6, 5, 3, 12, 16, 15, 14, 0, 13, 1, 2, 11, 4, 10, 9, 7 }, }, { - { 0x2D1D, 0x0B46, 0x02D0, 0x00B5, 0x0059, 0x000A, 0x0003, 0x0001, 0x0000, 0x0004, 0x0017, 0x005B, 0x0169, 0x05A2, 0x168F, 0x2D1C, 0x0058, 0x0000 }, - { 0x1800, 0x0C01, 0x0301, 0x0061, 0x0019, 0x0007, 0x0004, 0x0003, 0x0000, 0x0005, 0x000D, 0x0031, 0x00C1, 0x0181, 0x0601, 0x1801, 0x0002, 0x0000 }, - { 0x1556, 0x0AAA, 0x02AB, 0x0054, 0x0014, 0x000B, 0x0002, 0x0003, 0x0000, 0x0003, 0x0008, 0x002B, 0x00AB, 0x0154, 0x0554, 0x1557, 0x0009, 0x0000 }, - { 0x1556, 0x0AAA, 0x02AB, 0x0054, 0x0014, 0x000B, 0x0002, 0x0003, 0x0000, 0x0003, 0x0008, 0x002B, 0x00AB, 0x0154, 0x0554, 0x1557, 0x0009, 0x0000 }, + { 8, 7, 9, 5, 16, 4, 2, 13, 1, 15, 0, 14, 12, 3, 11, 10, 6 }, + { 8, 16, 0, 15, 1, 14, 2, 13, 12, 3, 11, 4, 10, 5, 6, 9, 7 }, + { 8, 6, 9, 10, 16, 4, 3, 13, 14, 1, 0, 15, 2, 12, 11, 5, 7 }, + { 8, 6, 9, 10, 16, 4, 3, 13, 14, 1, 0, 15, 2, 12, 11, 5, 7 }, }, { - { 0x2993, 0x0A65, 0x0298, 0x00A7, 0x0028, 0x0004, 0x0000, 0x0001, 0x0001, 0x0003, 0x0015, 0x0052, 0x014D, 0x0533, 0x14C8, 0x5324, 0x000B, 0x5325 }, - { 0x09B8, 0x026F, 0x009A, 0x0012, 0x0005, 0x0000, 0x0001, 0x0002, 0x0003, 0x0001, 0x0003, 0x0008, 0x004C, 0x0136, 0x04DD, 0x1373, 0x0027, 0x1372 }, - { 0x0787, 0x01E0, 0x00F1, 0x003D, 0x001F, 0x0006, 0x0001, 0x0001, 0x0001, 0x0002, 0x000E, 0x0079, 0x03C2, 0x0F0D, 0x1E19, 0x3C30, 0x0000, 0x3C31 }, - { 0x4B06, 0x12C0, 0x04B1, 0x0097, 0x0024, 0x0008, 0x0002, 0x0003, 0x0000, 0x0003, 0x0005, 0x0013, 0x004A, 0x0259, 0x0961, 0x2582, 0x012D, 0x4B07 }, + { 6, 5, 4, 11, 2, 14, 15, 17, 0, 1, 13, 12, 3, 10, 16, 9, 8, 7 }, + { 5, 11, 3, 12, 2, 13, 0, 17, 15, 14, 1, 16, 4, 10, 9, 6, 7, 8 }, + { 16, 9, 5, 10, 1, 12, 15, 17, 14, 13, 0, 2, 11, 3, 4, 6, 8, 7 }, + { 8, 5, 4, 12, 1, 15, 0, 17, 14, 2, 13, 16, 3, 11, 10, 9, 6, 7 }, }, { - { 0x0A5A, 0x0297, 0x014A, 0x0053, 0x0028, 0x000B, 0x0003, 0x0000, 0x0002, 0x0004, 0x0015, 0x00A4, 0x052C, 0x14B7, 0x296C, 0x52DB, 0x0003, 0x52DA }, - { 0x0193, 0x0192, 0x00C8, 0x0065, 0x0033, 0x0018, 0x0007, 0x0004, 0x0000, 0x0004, 0x0005, 0x0007, 0x0006, 0x0003, 0x0005, 0x0005, 0x000D, 0x0004 }, - { 0x0012, 0x0013, 0x0005, 0x0003, 0x0000, 0x0003, 0x0005, 0x0004, 0x0003, 0x0003, 0x0005, 0x0005, 0x0004, 0x0004, 0x0003, 0x0005, 0x0008, 0x0004 }, - { 0x0D66, 0x06B2, 0x01AD, 0x006A, 0x000C, 0x0005, 0x0004, 0x0000, 0x0003, 0x0002, 0x0007, 0x0034, 0x00D7, 0x0358, 0x1ACF, 0x359C, 0x001B, 0x359D }, + { 7, 9, 4, 11, 2, 12, 0, 14, 17, 15, 13, 1, 3, 10, 5, 16, 8, 6 }, + { 8, 17, 15, 5, 2, 1, 0, 3, 4, 16, 6, 7, 14, 13, 9, 10, 12, 11 }, + { 4, 16, 0, 1, 2, 3, 17, 15, 14, 13, 11, 5, 12, 10, 9, 7, 6, 8 }, + { 7, 9, 4, 11, 3, 13, 1, 0, 15, 17, 14, 2, 12, 16, 10, 6, 5, 8 }, } }; From patchwork Fri Nov 20 07:18:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23756 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 C378B44A644 for ; Fri, 20 Nov 2020 09:24:28 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6E1D968B9E4; Fri, 20 Nov 2020 09:24:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8F39E68B98D for ; Fri, 20 Nov 2020 09:24:21 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id gj5so11497316ejb.8 for ; Thu, 19 Nov 2020 23:24: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:reply-to :mime-version:content-transfer-encoding; bh=6RY40Wlc7OW4GgiwMBJczcczS0w1R8NQP1b0hUDkRbc=; b=PF43mYee4AJ5x+wMn4bHuOeW9KcyRircV5B9oNhb7cuUpz5os9P1SbmNEK5rq4epdE /qe52BqYnSP1G6N2FkiwOk+45WiRxSmByTsg2v+mtPRPizzVlFTyAiHo30UnXrlcPddJ Gwyvf+coHCNnlWJUIaBnz3FcDtFl5pepYhZN9mGPIT+lp23vwPvWAjzZrhldOp9rPdXU /a0oOkIhRkSJd2D0hQRq06IGeHWl++tbp0lAHCbQAHvxncRFujSDFciOOBxJUTi9IvAD Pmmt3j4Rg4JeeSSsUFGgEg6MRA2wy6PYdYYfwLDMK6/X3Jf4pfQxmTKQ8o1MQRhouys1 p6pg== 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=6RY40Wlc7OW4GgiwMBJczcczS0w1R8NQP1b0hUDkRbc=; b=FL0V1ks5eRK7j7vO/r2oHRsJCu42YkmLKnQLJkPDUbObCCXLQf1lmNd9Iti/Jhayma tOfqCAjABjaQyGdfL1iGtuNt5DQ30fa6A3rOQvN4p2A0vwef3fHyDULaeNEr9zTtf/XT LGyEt/Wo0Ze3ReMAjjcSlzK1+hdSu2DK9xffVh2s1m6FFPwk5Iv20Zv9vUJeI7KIw/jv up0oS834I19UoFiw1wF285FZO88fnPpsuLshMkfPeWpsj5Uo/V6VkJ1hxedK8ci68xdX VjL/UhzvWN+/zxNU9z13UpsTXGwTmra7FWZC/OCmiN45ZSgxKns5vSqeV/aggpEJCY5V Ffjg== X-Gm-Message-State: AOAM532pSjDZ62SVfuCmqTl7s/qNVIZAIqwLucKWuIYsnPGfkelXmn48 udzQnF7cAVbggxCJakwSOMvp/w44mU7dmw== X-Google-Smtp-Source: ABdhPJxAV9hkCJpGEpOghWvD7EFYPJWwlfM8ekzo79emtvGwD90rk5tzy+Uh3ue5aAdHzZ53VK7diQ== X-Received: by 2002:a17:906:46d5:: with SMTP id k21mr32258255ejs.495.1605857060902; Thu, 19 Nov 2020 23:24:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:19 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:47 +0100 Message-Id: <20201120072116.818090-15-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 014/162] avcodec/imc: Avoid offsets table when creating 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/imc.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index 5a1649ab62..deb88d4d5d 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -113,11 +113,6 @@ static VLC huffman_vlc[4][4]; #define IMC_VLC_BITS 9 #define VLC_TABLES_SIZE 9512 -static const int vlc_offsets[17] = { - 0, 640, 1156, 1732, 2308, 2852, 3396, 3924, - 4452, 5220, 5860, 6628, 7268, 7908, 8424, 8936, VLC_TABLES_SIZE -}; - static VLC_TYPE vlc_tables[VLC_TABLES_SIZE][2]; static inline double freq2bark(double freq) @@ -235,14 +230,15 @@ static av_cold int imc_decode_init(AVCodecContext *avctx) q->sqrt_tab[i] = sqrt(i); /* initialize the VLC tables */ - for (i = 0; i < 4 ; i++) { + for (int i = 0, offset = 0; i < 4 ; i++) { for (j = 0; j < 4; j++) { - huffman_vlc[i][j].table = &vlc_tables[vlc_offsets[i * 4 + j]]; - huffman_vlc[i][j].table_allocated = vlc_offsets[i * 4 + j + 1] - vlc_offsets[i * 4 + j]; + huffman_vlc[i][j].table = &vlc_tables[offset]; + huffman_vlc[i][j].table_allocated = VLC_TABLES_SIZE - offset;; ff_init_vlc_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i], imc_huffman_lens[i][j], 1, imc_huffman_syms[i][j], 1, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + 0, INIT_VLC_STATIC_OVERLONG, NULL); + offset += huffman_vlc[i][j].table_size; } } From patchwork Fri Nov 20 07:18:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23758 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 044E244A644 for ; Fri, 20 Nov 2020 09:24:34 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 89C8C68B9E7; Fri, 20 Nov 2020 09:24:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 37E6F68B9DA for ; Fri, 20 Nov 2020 09:24:27 +0200 (EET) Received: by mail-ej1-f47.google.com with SMTP id gj5so11497564ejb.8 for ; Thu, 19 Nov 2020 23:24:27 -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=uIeak+ebiVJ9MJOE0mPL66InRYHVyaYLb5C4xCmzJQI=; b=AV+ZocqJgAb1XqXosVk1/YUkbVLjMisbGWUzVpwxt5DfWI2AGG9jwfinBlv3vTKVqr mgd+3MI4+9bGnvSkVPlu8QDPUg991kkq/sqVCPLDSnfOsL4mL0MNEXDdE3WYX9boCZaY hgx3zU1imXHjFkXJpL80kcaubAczp9vQXFO2zF6CrmTvvujAEpSAlHpbwOaSfZiv42eE zGz2aOKgtiTZHDr4GiGdBbV8NXuRy64jna0I2SSSF8Zh9W8t4tPJJupm+iavT6HkbFEd K0Jr5Taqg2/lF7nKRYPp+giKwntCGgkRwSQPnglN3+G8NbleQNRffokFUKGVhDPWw2pm yj4Q== 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=uIeak+ebiVJ9MJOE0mPL66InRYHVyaYLb5C4xCmzJQI=; b=omZKbU75Wsm6V62pU1Arvvt7UXYIIMJb8ows9t2JS0vdQvSdqaAbQ5ltYJzoXj6EgM pUKf59csmqrKOw7Nur5T0QP4HCXvOqs+scGkUeHBAQoeErcaiZY7eiepfR1Uutl89Lyt J0W1I3fhY6bCQr0DIuZuwrUqefxuUWur2GYWxlF7T4TYhYZMl+KcbJAIaF2QNzdaiidc gd0SFswAlMurn3T9w7e2QCtRH/gVY2e2ONv7kzGWsHL1/7TuFnLcxdoz/Yn7SunDHWAU CtsSDF/lL4gQgC/uZuPrmVui2RBOCg58vuc7Ezy5BiwJXIPTYymBVL5DkotB61RLNF2Z TBaw== X-Gm-Message-State: AOAM530TWjesANGOIfj6KH4W3GIxOBfHDgECfgaclTLLkoGJLL53aORS lVNDJeSXMgDpECw8hWBpEaltquJU+zQ3Yg== X-Google-Smtp-Source: ABdhPJwgJHu9HHzN4QTLc+k9+LZWiSCDiTdPwp+8avFEuYfi0wxC2Z1F8rxD0mv3Zib+lb22G6X7Bw== X-Received: by 2002:a17:906:b0c5:: with SMTP id bk5mr14492102ejb.217.1605857062726; Thu, 19 Nov 2020 23:24:22 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:21 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:48 +0100 Message-Id: <20201120072116.818090-16-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 015/162] avcodec/clearvideo: Avoid code tables for 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" The ClearVideo decoder uses VLC tables that are initialized at runtime from static length, symbol and codes tables. Yet the code tables can be omitted by subjecting all of these tables to the permutation that orders the codes from left to right in the tree. After this is done, the codes can be easily computed at runtime from the lengths and therefore omitted. This saves about 10KB. Only one minor complication is encountered when doing so: The tree corresponding to the AC VLC codes is incomplete; but this can be handled by adding an entry with negative length. Furthermore, there are also VLCs that are only initialized with lengths and codes tables with codes of type uint16_t. These have also been switched to ff_init_vlc_from_lengths() as this means that one can replace the uint16_t codes tables with uint8_t symbols tables. Signed-off-by: Andreas Rheinhardt --- libavcodec/clearvideo.c | 154 +-- libavcodec/clearvideodata.h | 2477 ++++++++++++----------------------- 2 files changed, 910 insertions(+), 1721 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 73c0367f71..ef09b137c4 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -696,159 +696,143 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "Error initialising DC VLC\n"); return ret; } - ret = ff_init_vlc_sparse(&c->ac_vlc, 9, NUM_AC_CODES, - clv_ac_bits, 1, 1, - clv_ac_codes, 1, 1, - clv_ac_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ac_vlc, 9, NUM_AC_CODES, + clv_ac_bits, 1, + clv_ac_syms, 2, 2, 0, 0, avctx); if (ret) { av_log(avctx, AV_LOG_ERROR, "Error initialising AC VLC\n"); return ret; } - ret = init_vlc(&c->ylev[0].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsy_0_bits), - clv_flagsy_0_bits, 1, 1, - clv_flagsy_0_codes, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ylev[0].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsy_0_bits), + clv_flagsy_0_bits, 1, + clv_flagsy_0_syms, 1, 1, 0, 0, avctx); if (ret) return ret; - ret = init_vlc(&c->ylev[1].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsy_1_bits), - clv_flagsy_1_bits, 1, 1, - clv_flagsy_1_codes, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ylev[1].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsy_1_bits), + clv_flagsy_1_bits, 1, + clv_flagsy_1_syms, 1, 1, 0, 0, avctx); if (ret) return ret; - ret = init_vlc(&c->ylev[2].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsy_2_bits), - clv_flagsy_2_bits, 1, 1, - clv_flagsy_2_codes, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ylev[2].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsy_2_bits), + clv_flagsy_2_bits, 1, + clv_flagsy_2_syms, 1, 1, 0, 0, avctx); if (ret) return ret; - ret = init_vlc(&c->ulev[0].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsu_0_bits), - clv_flagsu_0_bits, 1, 1, - clv_flagsu_0_codes, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ulev[0].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsu_0_bits), + clv_flagsu_0_bits, 1, + clv_flagsu_0_syms, 1, 1, 0, 0, avctx); if (ret) return ret; - ret = init_vlc(&c->ulev[1].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsu_1_bits), - clv_flagsu_1_bits, 1, 1, - clv_flagsu_1_codes, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ulev[1].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsu_1_bits), + clv_flagsu_1_bits, 1, + clv_flagsu_1_syms, 1, 1, 0, 0, avctx); if (ret) return ret; - ret = init_vlc(&c->vlev[0].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsv_0_bits), - clv_flagsv_0_bits, 1, 1, - clv_flagsv_0_codes, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->vlev[0].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsv_0_bits), + clv_flagsv_0_bits, 1, + clv_flagsv_0_syms, 1, 1, 0, 0, avctx); if (ret) return ret; - ret = init_vlc(&c->vlev[1].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsv_1_bits), - clv_flagsv_1_bits, 1, 1, - clv_flagsv_1_codes, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->vlev[1].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsv_1_bits), + clv_flagsv_1_bits, 1, + clv_flagsv_1_syms, 1, 1, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->ylev[0].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_0_bits), - clv_mvy_0_bits, 1, 1, - clv_mvy_0_codes, 2, 2, - clv_mvy_0_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ylev[0].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_0_bits), + clv_mvy_0_bits, 1, + clv_mvy_0_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->ylev[1].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_1_bits), - clv_mvy_1_bits, 1, 1, - clv_mvy_1_codes, 2, 2, - clv_mvy_1_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ylev[1].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_1_bits), + clv_mvy_1_bits, 1, + clv_mvy_1_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->ylev[2].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_2_bits), - clv_mvy_2_bits, 1, 1, - clv_mvy_2_codes, 2, 2, - clv_mvy_2_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ylev[2].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_2_bits), + clv_mvy_2_bits, 1, + clv_mvy_2_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->ylev[3].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_3_bits), - clv_mvy_3_bits, 1, 1, - clv_mvy_3_codes, 2, 2, - clv_mvy_3_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ylev[3].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_3_bits), + clv_mvy_3_bits, 1, + clv_mvy_3_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->ulev[1].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvu_1_bits), - clv_mvu_1_bits, 1, 1, - clv_mvu_1_codes, 2, 2, - clv_mvu_1_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ulev[1].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvu_1_bits), + clv_mvu_1_bits, 1, + clv_mvu_1_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->ulev[2].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvu_2_bits), - clv_mvu_2_bits, 1, 1, - clv_mvu_2_codes, 2, 2, - clv_mvu_2_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ulev[2].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvu_2_bits), + clv_mvu_2_bits, 1, + clv_mvu_2_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->vlev[1].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvv_1_bits), - clv_mvv_1_bits, 1, 1, - clv_mvv_1_codes, 2, 2, - clv_mvv_1_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->vlev[1].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvv_1_bits), + clv_mvv_1_bits, 1, + clv_mvv_1_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->vlev[2].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvv_2_bits), - clv_mvv_2_bits, 1, 1, - clv_mvv_2_codes, 2, 2, - clv_mvv_2_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->vlev[2].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvv_2_bits), + clv_mvv_2_bits, 1, + clv_mvv_2_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->ylev[1].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasy_1_bits), - clv_biasy_1_bits, 1, 1, - clv_biasy_1_codes, 2, 2, - clv_biasy_1_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ylev[1].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasy_1_bits), + clv_biasy_1_bits, 1, + clv_biasy_1_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->ylev[2].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasy_2_bits), - clv_biasy_2_bits, 1, 1, - clv_biasy_2_codes, 2, 2, - clv_biasy_2_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ylev[2].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasy_2_bits), + clv_biasy_2_bits, 1, + clv_biasy_2_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->ylev[3].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasy_3_bits), - clv_biasy_3_bits, 1, 1, - clv_biasy_3_codes, 2, 2, - clv_biasy_3_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ylev[3].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasy_3_bits), + clv_biasy_3_bits, 1, + clv_biasy_3_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->ulev[1].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasu_1_bits), - clv_biasu_1_bits, 1, 1, - clv_biasu_1_codes, 2, 2, - clv_biasu_1_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ulev[1].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasu_1_bits), + clv_biasu_1_bits, 1, + clv_biasu_1_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->ulev[2].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasu_2_bits), - clv_biasu_2_bits, 1, 1, - clv_biasu_2_codes, 2, 2, - clv_biasu_2_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->ulev[2].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasu_2_bits), + clv_biasu_2_bits, 1, + clv_biasu_2_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->vlev[1].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasv_1_bits), - clv_biasv_1_bits, 1, 1, - clv_biasv_1_codes, 2, 2, - clv_biasv_1_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->vlev[1].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasv_1_bits), + clv_biasv_1_bits, 1, + clv_biasv_1_syms, 2, 2, 0, 0, avctx); if (ret) return ret; - ret = ff_init_vlc_sparse(&c->vlev[2].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasv_2_bits), - clv_biasv_2_bits, 1, 1, - clv_biasv_2_codes, 2, 2, - clv_biasv_2_syms, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&c->vlev[2].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasv_2_bits), + clv_biasv_2_bits, 1, + clv_biasv_2_syms, 2, 2, 0, 0, avctx); if (ret) return ret; diff --git a/libavcodec/clearvideodata.h b/libavcodec/clearvideodata.h index 43d12dee43..b4893b3bf7 100644 --- a/libavcodec/clearvideodata.h +++ b/libavcodec/clearvideodata.h @@ -25,7 +25,7 @@ #include "libavutil/common.h" #define NUM_DC_CODES 127 -#define NUM_AC_CODES 103 +#define NUM_AC_CODES 104 static const uint8_t clv_dc_codes[NUM_DC_CODES] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, @@ -66,1767 +66,972 @@ static const uint8_t clv_dc_bits[NUM_DC_CODES] = { }; static const uint16_t clv_ac_syms[NUM_AC_CODES] = { - 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, - 0x0009, 0x000A, 0x000B, 0x000C, 0x0011, 0x0012, 0x0013, 0x0014, - 0x0015, 0x0016, 0x0021, 0x0022, 0x0023, 0x0024, 0x0031, 0x0032, - 0x0033, 0x0041, 0x0042, 0x0043, 0x0051, 0x0052, 0x0053, 0x0061, - 0x0062, 0x0063, 0x0071, 0x0072, 0x0081, 0x0082, 0x0091, 0x0092, - 0x00A1, 0x00A2, 0x00B1, 0x00C1, 0x00D1, 0x00E1, 0x00F1, 0x0101, - 0x0111, 0x0121, 0x0131, 0x0141, 0x0151, 0x0161, 0x0171, 0x0181, - 0x0191, 0x01A1, 0x1001, 0x1002, 0x1003, 0x1011, 0x1012, 0x1021, - 0x1031, 0x1041, 0x1051, 0x1061, 0x1071, 0x1081, 0x1091, 0x10A1, - 0x10B1, 0x10C1, 0x10D1, 0x10E1, 0x10F1, 0x1101, 0x1111, 0x1121, - 0x1131, 0x1141, 0x1151, 0x1161, 0x1171, 0x1181, 0x1191, 0x11A1, - 0x11B1, 0x11C1, 0x11D1, 0x11E1, 0x11F1, 0x1201, 0x1211, 0x1221, - 0x1231, 0x1241, 0x1251, 0x1261, 0x1271, 0x1281, 0x1BFF, -}; - -static const uint8_t clv_ac_codes[NUM_AC_CODES] = { - 0x02, 0x0F, 0x15, 0x17, 0x1F, 0x25, 0x24, 0x21, - 0x20, 0x07, 0x06, 0x20, 0x06, 0x14, 0x1E, 0x0F, - 0x21, 0x50, 0x0E, 0x1D, 0x0E, 0x51, 0x0D, 0x23, - 0x0D, 0x0C, 0x22, 0x52, 0x0B, 0x0C, 0x53, 0x13, - 0x0B, 0x54, 0x12, 0x0A, 0x11, 0x09, 0x10, 0x08, - 0x16, 0x55, 0x15, 0x14, 0x1C, 0x1B, 0x21, 0x20, - 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x22, 0x23, - 0x56, 0x57, 0x07, 0x19, 0x05, 0x0F, 0x04, 0x0E, - 0x0D, 0x0C, 0x13, 0x12, 0x11, 0x10, 0x1A, 0x19, - 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x18, 0x17, - 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x07, 0x06, - 0x05, 0x04, 0x24, 0x25, 0x26, 0x27, 0x58, 0x59, - 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x03, -}; - + 0x0000, 0x1012, 0x1003, 0x000B, 0x000A, 0x11C1, 0x11B1, 0x11A1, 0x1191, + 0x0092, 0x0082, 0x0072, 0x0062, 0x0052, 0x0033, 0x0023, 0x0014, 0x000C, + 0x0015, 0x0171, 0x0181, 0x11D1, 0x11E1, 0x11F1, 0x1201, 0x0016, 0x0024, + 0x0043, 0x0053, 0x0063, 0x00A2, 0x0191, 0x01A1, 0x1211, 0x1221, 0x1231, + 0x1241, 0x1251, 0x1261, 0x1271, 0x1281, 0x1BFF, 0x0009, 0x0008, 0x1181, + 0x1171, 0x1161, 0x1151, 0x1141, 0x1131, 0x1121, 0x1111, 0x1002, 0x0161, + 0x0151, 0x0141, 0x0131, 0x0121, 0x0111, 0x0101, 0x00F1, 0x0042, 0x0032, + 0x0007, 0x0006, 0x1101, 0x10F1, 0x10E1, 0x10D1, 0x10C1, 0x10B1, 0x10A1, + 0x1091, 0x00E1, 0x00D1, 0x0022, 0x0013, 0x0005, 0x1081, 0x1071, 0x1061, + 0x1051, 0x00C1, 0x00B1, 0x00A1, 0x0004, 0x1041, 0x1031, 0x1021, 0x1011, + 0x0091, 0x0081, 0x0071, 0x0061, 0x0012, 0x0003, 0x0051, 0x0041, 0x0031, + 0x1001, 0x0001, 0x0011, 0x0021, 0x0002 +}; + +/* The -9 refers to an open end in the tree. */ static const uint8_t clv_ac_bits[NUM_AC_CODES] = { - 2, 4, 6, 7, 8, 9, 9, 10, - 10, 11, 11, 11, 3, 6, 8, 10, - 11, 12, 4, 8, 10, 12, 5, 9, - 10, 5, 9, 12, 5, 10, 12, 6, - 10, 12, 6, 10, 6, 10, 6, 10, - 7, 12, 7, 7, 8, 8, 9, 9, - 9, 9, 9, 9, 9, 9, 11, 11, - 12, 12, 4, 9, 11, 6, 11, 6, - 6, 6, 7, 7, 7, 7, 8, 8, - 8, 8, 8, 8, 8, 8, 9, 9, - 9, 9, 9, 9, 9, 9, 10, 10, - 10, 10, 11, 11, 11, 11, 12, 12, - 12, 12, 12, 12, 12, 12, 7, + -9, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, + 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 7, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 5, 5, 5, 4, 2, 3, 4, 4 }; static const uint8_t clv_flagsy_0_bits[] = { - 3, 4, 4, 4, 4, 4, 6, 5, 4, 7, 4, 5, 4, 7, 5, 2, + 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 7, 7 }; -static const uint16_t clv_flagsy_0_codes[] = { - 0x0002, 0x0009, 0x000B, 0x0006, 0x000C, 0x0007, 0x003E, 0x001C, - 0x000D, 0x007E, 0x000A, 0x001D, 0x0008, 0x007F, 0x001E, 0x0000, +static const uint8_t clv_flagsy_0_syms[] = { + 15, 0, 3, 5, 12, 1, 10, 2, 4, 8, 7, 11, 14, 6, 9, 13 }; static const uint8_t clv_flagsy_1_bits[] = { - 2, 4, 4, 3, 4, 4, 7, 6, 4, 6, 4, 6, 4, 8, 8, 3, + 2, 3, 3, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 7, 8, 8 }; -static const uint16_t clv_flagsy_1_codes[] = { - 0x0000, 0x000A, 0x000C, 0x0003, 0x000B, 0x0009, 0x007E, 0x003D, - 0x000D, 0x003E, 0x000E, 0x003C, 0x0008, 0x00FE, 0x00FF, 0x0002, +static const uint8_t clv_flagsy_1_syms[] = { + 0, 15, 3, 12, 5, 1, 4, 2, 8, 10, 11, 7, 9, 6, 13, 14 }; static const uint8_t clv_flagsy_2_bits[] = { - 1, 4, 4, 4, 4, 5, 7, 5, 4, 6, 5, 8, 4, 9, 10, 10, + 1, 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 7, 8, 9, 10, 10 }; -static const uint16_t clv_flagsy_2_codes[] = { - 0x0000, 0x000C, 0x000B, 0x0008, 0x000A, 0x001C, 0x007E, 0x001D, - 0x000D, 0x003E, 0x001E, 0x00FE, 0x0009, 0x01FE, 0x03FE, 0x03FF, +static const uint8_t clv_flagsy_2_syms[] = { + 0, 3, 12, 4, 2, 1, 8, 5, 7, 10, 9, 6, 11, 13, 14, 15 }; static const uint8_t clv_flagsu_0_bits[] = { - 1, 4, 4, 4, 5, 5, 9, 7, 5, 9, 4, 7, 4, 8, 7, 4, + 1, 4, 4, 4, 4, 4, 4, 5, 5, 5, 7, 7, 7, 8, 9, 9 }; -static const uint16_t clv_flagsu_0_codes[] = { - 0x0000, 0x000B, 0x000D, 0x0009, 0x001D, 0x001C, 0x01FF, 0x007D, - 0x001E, 0x01FE, 0x000C, 0x007C, 0x000A, 0x00FE, 0x007E, 0x0008, +static const uint8_t clv_flagsu_0_syms[] = { + 0, 15, 3, 12, 1, 10, 2, 5, 4, 8, 11, 7, 14, 13, 9, 6 }; static const uint8_t clv_flagsu_1_bits[] = { - 1, 4, 4, 4, 4, 4, 8, 6, 4, 8, 5, 8, 4, 10, 9, 10, + 1, 4, 4, 4, 4, 4, 4, 4, 5, 6, 8, 8, 8, 9, 10, 10 }; -static const uint16_t clv_flagsu_1_codes[] = { - 0x0000, 0x000C, 0x0008, 0x000A, 0x000B, 0x000E, 0x00FD, 0x003E, - 0x000D, 0x00FC, 0x001E, 0x00FE, 0x0009, 0x03FE, 0x01FE, 0x03FF, +static const uint8_t clv_flagsu_1_syms[] = { + 0, 2, 12, 3, 4, 1, 8, 5, 10, 7, 9, 6, 11, 14, 13, 15 }; static const uint8_t clv_flagsv_0_bits[] = { - 1, 4, 5, 4, 5, 5, 8, 10, 5, 9, 5, 6, 4, 10, 7, 3, + 1, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 10 }; -static const uint16_t clv_flagsv_0_codes[] = { - 0x0000, 0x000A, 0x001B, 0x000C, 0x001E, 0x001C, 0x00FE, 0x03FE, - 0x001D, 0x01FE, 0x001A, 0x003E, 0x000B, 0x03FF, 0x007E, 0x0004, +static const uint8_t clv_flagsv_0_syms[] = { + 0, 15, 1, 12, 3, 10, 2, 5, 8, 4, 11, 14, 6, 9, 7, 13 }; static const uint8_t clv_flagsv_1_bits[] = { - 1, 4, 4, 4, 4, 5, 8, 6, 3, 7, 5, 10, 5, 11, 9, 11, + 1, 3, 4, 4, 4, 4, 5, 5, 5, 6, 7, 8, 9, 10, 11, 11 }; -static const uint16_t clv_flagsv_1_codes[] = { - 0x0000, 0x000D, 0x000C, 0x000A, 0x000B, 0x001D, 0x00FE, 0x003E, - 0x0004, 0x007E, 0x001E, 0x03FE, 0x001C, 0x07FE, 0x01FE, 0x07FF, +static const uint8_t clv_flagsv_1_syms[] = { + 0, 8, 3, 4, 2, 1, 12, 5, 10, 7, 9, 6, 14, 11, 13, 15 }; static const uint8_t clv_mvy_0_bits[] = { - 16, 14, 13, 13, 13, 12, 11, 11, 9, 11, 11, 12, 13, 13, 13, 14, - 16, 15, 14, 14, 14, 13, 13, 12, 10, 7, 10, 12, 13, 13, 14, 14, - 14, 15, 15, 14, 14, 14, 13, 13, 11, 10, 7, 10, 11, 13, 13, 14, - 14, 14, 15, 15, 14, 14, 13, 13, 12, 11, 10, 7, 10, 11, 12, 13, - 13, 14, 14, 15, 16, 15, 14, 12, 12, 12, 11, 10, 6, 10, 11, 12, - 12, 12, 14, 15, 16, 15, 14, 13, 13, 12, 11, 10, 9, 6, 9, 10, - 11, 12, 13, 13, 14, 15, 14, 14, 13, 12, 12, 11, 10, 8, 6, 8, - 10, 11, 12, 12, 13, 14, 14, 14, 13, 13, 13, 11, 11, 9, 7, 4, - 7, 9, 11, 11, 12, 13, 13, 14, 11, 10, 10, 9, 9, 8, 7, 5, - 1, 5, 7, 8, 9, 9, 10, 10, 11, 14, 13, 13, 12, 11, 11, 9, - 7, 4, 7, 9, 11, 11, 13, 13, 13, 14, 14, 14, 13, 12, 12, 11, - 10, 8, 6, 8, 10, 11, 12, 12, 13, 14, 14, 15, 14, 13, 13, 12, - 11, 10, 9, 7, 9, 10, 11, 12, 13, 13, 14, 15, 16, 15, 14, 12, - 12, 12, 11, 10, 6, 10, 11, 12, 12, 12, 14, 15, 16, 15, 14, 14, - 13, 13, 12, 11, 10, 7, 10, 11, 12, 13, 13, 14, 14, 15, 15, 14, - 14, 14, 13, 13, 11, 10, 7, 10, 11, 13, 13, 14, 14, 14, 15, 15, - 14, 14, 14, 13, 13, 12, 10, 7, 10, 12, 13, 13, 14, 14, 14, 15, - 16, 14, 13, 13, 13, 12, 11, 11, 9, 11, 11, 12, 13, 13, 13, 14, - 16, 6, -}; - -static const uint16_t clv_mvy_0_codes[] = { - 0xFFFD, 0x3FE5, 0x1FD8, 0x1FC4, 0x1FBC, 0x0FCB, 0x07CF, 0x07C4, - 0x01D7, 0x07C6, 0x07CE, 0x0FCA, 0x1FBD, 0x1FC2, 0x1FD9, 0x3FE4, - 0xFFFE, 0x7FF0, 0x3FEF, 0x3FD2, 0x3FC9, 0x1FCC, 0x1FC0, 0x0FB6, - 0x03D6, 0x0070, 0x03D7, 0x0FB7, 0x1FC1, 0x1FCD, 0x3FCB, 0x3FD0, - 0x3FED, 0x7FF2, 0x7FFB, 0x3FDC, 0x3FD9, 0x3FD4, 0x1FB6, 0x1FAE, - 0x07C0, 0x03BC, 0x006D, 0x03BD, 0x07C1, 0x1FAF, 0x1FB7, 0x3FD1, - 0x3FDB, 0x3FDF, 0x7FF9, 0x7FEE, 0x3FF0, 0x3FC7, 0x1FC9, 0x1FA7, - 0x0FAD, 0x07D2, 0x03CE, 0x006C, 0x03CF, 0x07D0, 0x0FAF, 0x1FA6, - 0x1FC6, 0x3FC4, 0x3FF1, 0x7FED, 0xFFFB, 0x7FF6, 0x3FE6, 0x0FCC, - 0x0FC4, 0x0FB0, 0x07B0, 0x03C6, 0x0031, 0x03C7, 0x07B1, 0x0FB1, - 0x0FC5, 0x0FCD, 0x3FEA, 0x7FF7, 0xFFF9, 0x7FE9, 0x3FCE, 0x1FCF, - 0x1FB2, 0x0FB8, 0x07BC, 0x03D0, 0x01DA, 0x002F, 0x01DB, 0x03D1, - 0x07BE, 0x0FBA, 0x1FB4, 0x1FD0, 0x3FCD, 0x7FEB, 0x3FE1, 0x3FC1, - 0x1FD3, 0x0FC3, 0x0FBE, 0x07B6, 0x03C4, 0x00E4, 0x002D, 0x00E5, - 0x03C5, 0x07B7, 0x0FBF, 0x0FC1, 0x1FD2, 0x3FC3, 0x3FE2, 0x3FBF, - 0x1FDB, 0x1FAD, 0x1FA5, 0x07CB, 0x07BB, 0x01D5, 0x0068, 0x0008, - 0x0065, 0x01D2, 0x07B8, 0x07C8, 0x0FD0, 0x1FAA, 0x1FDA, 0x3FBC, - 0x07D4, 0x03CA, 0x03C0, 0x01D8, 0x01D0, 0x00E6, 0x0069, 0x0014, - 0x0000, 0x0015, 0x006A, 0x00E7, 0x01D1, 0x01D9, 0x03C1, 0x03CB, - 0x07D5, 0x3FBE, 0x1FDC, 0x1FAB, 0x0FD1, 0x07C9, 0x07B9, 0x01D3, - 0x0066, 0x0009, 0x0067, 0x01D4, 0x07BA, 0x07CA, 0x1FA4, 0x1FAC, - 0x1FDD, 0x3FBD, 0x3FE0, 0x3FC0, 0x1FD5, 0x0FC0, 0x0FBC, 0x07B4, - 0x03C2, 0x00E2, 0x002C, 0x00E3, 0x03C3, 0x07B5, 0x0FBD, 0x0FC2, - 0x1FD7, 0x3FC2, 0x3FE3, 0x7FEA, 0x3FCC, 0x1FCE, 0x1FB3, 0x0FB9, - 0x07BD, 0x03D2, 0x01DC, 0x0064, 0x01DD, 0x03D3, 0x07BF, 0x0FBB, - 0x1FB5, 0x1FD1, 0x3FCF, 0x7FE8, 0xFFFA, 0x7FF4, 0x3FEB, 0x0FCE, - 0x0FC6, 0x0FB2, 0x07B2, 0x03C8, 0x0030, 0x03C9, 0x07B3, 0x0FB3, - 0x0FC7, 0x0FCF, 0x3FE9, 0x7FF5, 0xFFF8, 0x7FF3, 0x3FF3, 0x3FC6, - 0x1FC8, 0x1FA8, 0x0FAC, 0x07D1, 0x03CC, 0x006B, 0x03CD, 0x07D3, - 0x0FAE, 0x1FA9, 0x1FC7, 0x3FC5, 0x3FF2, 0x7FEC, 0x7FFA, 0x3FDE, - 0x3FDA, 0x3FD7, 0x1FB9, 0x1FB0, 0x07C2, 0x03BE, 0x006E, 0x03BF, - 0x07C3, 0x1FB1, 0x1FB8, 0x3FD3, 0x3FD8, 0x3FDD, 0x7FF8, 0x7FEF, - 0x3FEE, 0x3FD6, 0x3FC8, 0x1FCB, 0x1FBE, 0x0FB5, 0x03D4, 0x006F, - 0x03D5, 0x0FB4, 0x1FBF, 0x1FCA, 0x3FCA, 0x3FD5, 0x3FEC, 0x7FF1, - 0xFFFF, 0x3FE8, 0x1FD4, 0x1FC5, 0x1FBA, 0x0FC9, 0x07CD, 0x07C7, - 0x01D6, 0x07C5, 0x07CC, 0x0FC8, 0x1FBB, 0x1FC3, 0x1FD6, 0x3FE7, - 0xFFFC, 0x002E, + 1, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, + 16, 16, 16, 16, 16 }; static const uint16_t clv_mvy_0_syms[] = { - 0xF8F8, 0xF9F8, 0xFAF8, 0xFBF8, 0xFCF8, 0xFDF8, 0xFEF8, 0xFFF8, - 0x00F8, 0x01F8, 0x02F8, 0x03F8, 0x04F8, 0x05F8, 0x06F8, 0x07F8, - 0x08F8, 0xF8F9, 0xF9F9, 0xFAF9, 0xFBF9, 0xFCF9, 0xFDF9, 0xFEF9, - 0xFFF9, 0x00F9, 0x01F9, 0x02F9, 0x03F9, 0x04F9, 0x05F9, 0x06F9, - 0x07F9, 0x08F9, 0xF8FA, 0xF9FA, 0xFAFA, 0xFBFA, 0xFCFA, 0xFDFA, - 0xFEFA, 0xFFFA, 0x00FA, 0x01FA, 0x02FA, 0x03FA, 0x04FA, 0x05FA, - 0x06FA, 0x07FA, 0x08FA, 0xF8FB, 0xF9FB, 0xFAFB, 0xFBFB, 0xFCFB, - 0xFDFB, 0xFEFB, 0xFFFB, 0x00FB, 0x01FB, 0x02FB, 0x03FB, 0x04FB, - 0x05FB, 0x06FB, 0x07FB, 0x08FB, 0xF8FC, 0xF9FC, 0xFAFC, 0xFBFC, - 0xFCFC, 0xFDFC, 0xFEFC, 0xFFFC, 0x00FC, 0x01FC, 0x02FC, 0x03FC, - 0x04FC, 0x05FC, 0x06FC, 0x07FC, 0x08FC, 0xF8FD, 0xF9FD, 0xFAFD, - 0xFBFD, 0xFCFD, 0xFDFD, 0xFEFD, 0xFFFD, 0x00FD, 0x01FD, 0x02FD, - 0x03FD, 0x04FD, 0x05FD, 0x06FD, 0x07FD, 0x08FD, 0xF8FE, 0xF9FE, - 0xFAFE, 0xFBFE, 0xFCFE, 0xFDFE, 0xFEFE, 0xFFFE, 0x00FE, 0x01FE, - 0x02FE, 0x03FE, 0x04FE, 0x05FE, 0x06FE, 0x07FE, 0x08FE, 0xF8FF, - 0xF9FF, 0xFAFF, 0xFBFF, 0xFCFF, 0xFDFF, 0xFEFF, 0xFFFF, 0x00FF, - 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF, 0x07FF, 0x08FF, - 0xF800, 0xF900, 0xFA00, 0xFB00, 0xFC00, 0xFD00, 0xFE00, 0xFF00, - 0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, - 0x0800, 0xF801, 0xF901, 0xFA01, 0xFB01, 0xFC01, 0xFD01, 0xFE01, - 0xFF01, 0x0001, 0x0101, 0x0201, 0x0301, 0x0401, 0x0501, 0x0601, - 0x0701, 0x0801, 0xF802, 0xF902, 0xFA02, 0xFB02, 0xFC02, 0xFD02, - 0xFE02, 0xFF02, 0x0002, 0x0102, 0x0202, 0x0302, 0x0402, 0x0502, - 0x0602, 0x0702, 0x0802, 0xF803, 0xF903, 0xFA03, 0xFB03, 0xFC03, - 0xFD03, 0xFE03, 0xFF03, 0x0003, 0x0103, 0x0203, 0x0303, 0x0403, - 0x0503, 0x0603, 0x0703, 0x0803, 0xF804, 0xF904, 0xFA04, 0xFB04, - 0xFC04, 0xFD04, 0xFE04, 0xFF04, 0x0004, 0x0104, 0x0204, 0x0304, - 0x0404, 0x0504, 0x0604, 0x0704, 0x0804, 0xF805, 0xF905, 0xFA05, - 0xFB05, 0xFC05, 0xFD05, 0xFE05, 0xFF05, 0x0005, 0x0105, 0x0205, - 0x0305, 0x0405, 0x0505, 0x0605, 0x0705, 0x0805, 0xF806, 0xF906, - 0xFA06, 0xFB06, 0xFC06, 0xFD06, 0xFE06, 0xFF06, 0x0006, 0x0106, - 0x0206, 0x0306, 0x0406, 0x0506, 0x0606, 0x0706, 0x0806, 0xF807, - 0xF907, 0xFA07, 0xFB07, 0xFC07, 0xFD07, 0xFE07, 0xFF07, 0x0007, - 0x0107, 0x0207, 0x0307, 0x0407, 0x0507, 0x0607, 0x0707, 0x0807, - 0xF808, 0xF908, 0xFA08, 0xFB08, 0xFC08, 0xFD08, 0xFE08, 0xFF08, - 0x0008, 0x0108, 0x0208, 0x0308, 0x0408, 0x0508, 0x0608, 0x0708, - 0x0808, 0x0909, + 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0x0002, 0x00FE, 0x0909, 0x00FD, + 0x0004, 0x00FC, 0x0003, 0x01FF, 0xFF01, 0x0101, 0xFFFF, 0xFE00, 0x0200, + 0x0005, 0x00FB, 0x00FA, 0x0006, 0x0007, 0x00F9, 0xFF02, 0x0102, 0xFFFE, + 0x01FE, 0xFD00, 0x0300, 0xFC00, 0x0400, 0x02FF, 0xFE01, 0x0201, 0xFEFF, + 0x0008, 0x00F8, 0xFB00, 0x0500, 0xFFFD, 0x01FD, 0xFF03, 0x0103, 0xFFFA, + 0x01FA, 0xFF06, 0x0106, 0xFA00, 0x0600, 0xFE02, 0x0202, 0xFEFE, 0x02FE, + 0xFFFC, 0x01FC, 0xFF04, 0x0104, 0xF900, 0x0700, 0xFF05, 0x0105, 0xFFFB, + 0x01FB, 0xFEFD, 0x02FD, 0xFE03, 0x0203, 0xFF07, 0x0107, 0xFFF9, 0x01F9, + 0xFEFC, 0x02FC, 0xFE04, 0x0204, 0xFD02, 0x0302, 0xFDFE, 0x03FE, 0x03FF, + 0xFD01, 0x0301, 0xFDFF, 0xFDFD, 0xFD03, 0x03FD, 0x0303, 0xFEFA, 0x02FA, + 0xFE06, 0x0206, 0xFFF8, 0x0108, 0x01F8, 0xFF08, 0x04FF, 0xFC01, 0x0401, + 0xFCFF, 0x0208, 0xFE08, 0x02F8, 0xFEF8, 0x02FB, 0xFE05, 0xFEFB, 0x0205, + 0xF800, 0x0800, 0xFD05, 0xFDFB, 0x0305, 0x03FB, 0xFDFC, 0x03FC, 0xFD04, + 0x0304, 0x0207, 0xFE07, 0xFEF9, 0x02F9, 0xFCFD, 0xFC03, 0x04FD, 0x0403, + 0xFC02, 0x0402, 0xFCFE, 0x04FE, 0xFB02, 0x05FE, 0x0502, 0xFBFE, 0xFCFC, + 0x04FC, 0xFC04, 0x0404, 0x0308, 0xFD08, 0x03F8, 0xFDF8, 0xFBFC, 0x05FC, + 0xFB04, 0x0504, 0x05FF, 0xFB01, 0x0501, 0xFBFF, 0x04FB, 0xFCFB, 0xFC05, + 0x0405, 0x06FF, 0xFA01, 0x0601, 0xFAFF, 0xFDFA, 0x03FA, 0xFD06, 0x0306, + 0xFBFD, 0xFB03, 0x05FD, 0x0503, 0xFCFA, 0x04FA, 0x0406, 0xFC06, 0xFC08, + 0x0408, 0xFCF8, 0x04F8, 0xFD07, 0x0307, 0xFDF9, 0x03F9, 0x05F8, 0x0508, + 0xFBF8, 0xFB08, 0x05FB, 0x0505, 0xFB05, 0xFBFB, 0x0407, 0xFC07, 0xFCF9, + 0x04F9, 0xFA03, 0xFAFD, 0x06FD, 0x0603, 0x06FE, 0xFAFE, 0xFA08, 0xFA02, + 0x0608, 0x0602, 0xFAF8, 0x06F8, 0x07FF, 0xF9FF, 0xF901, 0x0701, 0x08FF, + 0x0801, 0xF801, 0xF8FF, 0xF902, 0xF9FE, 0x0702, 0x07FE, 0x06FB, 0x0605, + 0xFA05, 0xFAFB, 0xFB07, 0xFBF9, 0x0507, 0x05F9, 0xF903, 0x07FD, 0xF9FD, + 0x0703, 0x06F9, 0x05FA, 0xFAF9, 0x0506, 0xFBFA, 0x0607, 0xFA07, 0xFB06, + 0x0606, 0xFAFA, 0xFA06, 0x06FA, 0xF9FA, 0x0706, 0xF906, 0x07FA, 0xF802, + 0xF8FE, 0x08FE, 0x0802, 0x07F8, 0xF9F8, 0xFAFC, 0x0708, 0xF908, 0x0604, + 0x06FC, 0xFA04, 0x0707, 0x07F9, 0xF907, 0xF9F9, 0xF9FB, 0x07FB, 0x0705, + 0xF905, 0x0803, 0xF8FD, 0xF803, 0x08FD, 0x0805, 0x08FB, 0xF8FB, 0xF807, + 0xF8F9, 0x0807, 0x08F9, 0xF805, 0xF904, 0x0704, 0xF9FC, 0x07FC, 0x0806, + 0x08FA, 0xF806, 0xF8FA, 0x0804, 0x08FC, 0xF804, 0xF8FC, 0x0808, 0xF8F8, + 0x08F8, 0xF808, }; static const uint8_t clv_mvy_1_bits[] = { - 15, 15, 15, 15, 14, 14, 13, 13, 11, 9, 11, 13, 13, 14, 14, 15, - 15, 15, 15, 15, 14, 14, 13, 13, 12, 12, 12, 10, 9, 10, 12, 12, - 12, 13, 13, 14, 14, 15, 15, 15, 14, 14, 13, 13, 13, 12, 11, 8, - 11, 12, 13, 13, 13, 14, 14, 15, 15, 14, 14, 14, 14, 13, 12, 12, - 12, 10, 8, 10, 12, 12, 12, 13, 14, 14, 14, 14, 15, 14, 14, 13, - 13, 12, 12, 11, 10, 8, 10, 11, 12, 12, 13, 13, 14, 14, 15, 14, - 14, 13, 13, 13, 12, 12, 11, 9, 7, 9, 11, 12, 12, 13, 13, 13, - 14, 14, 14, 14, 13, 13, 13, 12, 11, 10, 9, 7, 9, 10, 11, 12, - 13, 13, 13, 14, 14, 14, 13, 13, 12, 12, 11, 11, 10, 8, 7, 8, - 10, 11, 11, 12, 12, 13, 13, 14, 13, 13, 13, 12, 11, 11, 10, 9, - 6, 4, 6, 9, 10, 11, 12, 12, 13, 13, 13, 12, 11, 10, 10, 10, - 9, 9, 7, 5, 1, 5, 7, 9, 9, 10, 10, 10, 11, 12, 13, 13, - 13, 12, 11, 11, 10, 9, 6, 4, 6, 9, 10, 11, 11, 12, 13, 13, - 13, 14, 13, 13, 12, 12, 11, 11, 10, 8, 7, 8, 10, 11, 11, 12, - 12, 13, 13, 14, 14, 14, 13, 13, 13, 12, 11, 10, 9, 7, 9, 10, - 11, 12, 13, 13, 13, 14, 14, 14, 14, 13, 13, 13, 12, 12, 11, 9, - 7, 9, 11, 12, 12, 13, 13, 13, 14, 14, 15, 14, 14, 13, 13, 12, - 12, 11, 10, 8, 10, 11, 12, 12, 13, 13, 14, 14, 15, 14, 14, 14, - 14, 13, 12, 12, 12, 10, 8, 10, 12, 12, 12, 13, 14, 14, 14, 14, - 15, 15, 14, 14, 13, 13, 13, 12, 11, 8, 11, 12, 13, 13, 13, 14, - 14, 15, 15, 15, 14, 14, 13, 13, 12, 12, 12, 10, 9, 10, 12, 12, - 12, 13, 13, 14, 14, 15, 15, 15, 15, 15, 14, 14, 13, 13, 11, 9, - 11, 13, 13, 14, 14, 15, 15, 15, 15, 5, -}; - -static const uint16_t clv_mvy_1_codes[] = { - 0x7FF9, 0x7FF6, 0x7FEB, 0x7FE3, 0x3FCF, 0x3FB3, 0x1FBD, 0x1FA1, - 0x07AD, 0x01CE, 0x07AF, 0x1FA0, 0x1FBB, 0x3FB0, 0x3FCC, 0x7FE2, - 0x7FE9, 0x7FF4, 0x7FFB, 0x7FF1, 0x3FE7, 0x3FBD, 0x1FA5, 0x1F9B, - 0x0FB4, 0x0FAF, 0x0FAA, 0x03CC, 0x01CD, 0x03CD, 0x0FAB, 0x0FAD, - 0x0FB1, 0x1F9C, 0x1FA3, 0x3FBE, 0x3FE6, 0x7FF0, 0x7FFC, 0x7FE5, - 0x3FB5, 0x3FAE, 0x1FB4, 0x1FAA, 0x1F97, 0x0F85, 0x07A2, 0x00DD, - 0x07A3, 0x0F86, 0x1F99, 0x1FAD, 0x1FB2, 0x3FAC, 0x3FB7, 0x7FE4, - 0x7FFD, 0x3FEA, 0x3FD8, 0x3FC3, 0x3FBB, 0x1FC9, 0x0FBC, 0x0F97, - 0x0F8F, 0x03B8, 0x00DA, 0x03B9, 0x0F90, 0x0F98, 0x0FB9, 0x1FC6, - 0x3FBA, 0x3FC0, 0x3FD9, 0x3FEB, 0x7FEF, 0x3FEE, 0x3FD7, 0x1FC3, - 0x1F96, 0x0FC0, 0x0FA8, 0x07AA, 0x03BE, 0x00D9, 0x03BF, 0x07AB, - 0x0FA7, 0x0FBF, 0x1F98, 0x1FC5, 0x3FD6, 0x3FEF, 0x7FEE, 0x3FDC, - 0x3FCA, 0x1FBF, 0x1F8B, 0x1F87, 0x0FA2, 0x0F94, 0x07A5, 0x01D4, - 0x0069, 0x01D5, 0x07A6, 0x0F95, 0x0FA3, 0x1F89, 0x1F8D, 0x1FC0, - 0x3FC6, 0x3FDE, 0x3FE0, 0x3FD3, 0x1FB8, 0x1F8F, 0x1F84, 0x0F89, - 0x07BC, 0x03C6, 0x01C6, 0x0067, 0x01C7, 0x03C7, 0x07BD, 0x0F87, - 0x1F82, 0x1F8A, 0x1FB6, 0x3FD1, 0x3FE2, 0x3FC5, 0x1FCE, 0x1FAE, - 0x0FB5, 0x0F8B, 0x07B4, 0x07B0, 0x03B4, 0x00DE, 0x0064, 0x00DF, - 0x03B5, 0x07B1, 0x07B5, 0x0F8C, 0x0FB6, 0x1FAF, 0x1FD1, 0x3FCB, - 0x1FD3, 0x1FCC, 0x1FA7, 0x0F9B, 0x07BE, 0x079C, 0x03C0, 0x01C8, - 0x002E, 0x0008, 0x002F, 0x01C9, 0x03C1, 0x079D, 0x0F82, 0x0F9A, - 0x1FA9, 0x1FCA, 0x1FD4, 0x0F9F, 0x07B6, 0x03C8, 0x03B2, 0x03B0, - 0x01D6, 0x01D0, 0x006A, 0x0014, 0x0000, 0x0015, 0x006B, 0x01D1, - 0x01D7, 0x03B1, 0x03B3, 0x03C9, 0x07B7, 0x0FA0, 0x1FD5, 0x1FCB, - 0x1FAB, 0x0F9C, 0x07BF, 0x079E, 0x03C2, 0x01CA, 0x0030, 0x0009, - 0x0031, 0x01CB, 0x03C3, 0x079F, 0x07C0, 0x0F9D, 0x1FAC, 0x1FCD, - 0x1FD2, 0x3FC8, 0x1FD0, 0x1FB0, 0x0FB7, 0x0F8D, 0x07B8, 0x07B2, - 0x03B6, 0x00E0, 0x0065, 0x00E1, 0x03B7, 0x07B3, 0x07B9, 0x0F8E, - 0x0FB8, 0x1FB1, 0x1FCF, 0x3FC9, 0x3FE1, 0x3FD2, 0x1FB7, 0x1F8E, - 0x1F83, 0x0F88, 0x07BA, 0x03C4, 0x01C4, 0x0066, 0x01C5, 0x03C5, - 0x07BB, 0x0F8A, 0x1F85, 0x1F90, 0x1FB9, 0x3FD0, 0x3FE3, 0x3FDD, - 0x3FC7, 0x1FC1, 0x1F91, 0x1F88, 0x0FA4, 0x0F96, 0x07A7, 0x01D2, - 0x0068, 0x01D3, 0x07A4, 0x0F93, 0x0FA1, 0x1F86, 0x1F8C, 0x1FBE, - 0x3FC4, 0x3FDF, 0x7FED, 0x3FEC, 0x3FD4, 0x1FC4, 0x1F92, 0x0FBD, - 0x0FA5, 0x07A8, 0x03BC, 0x00D8, 0x03BD, 0x07A9, 0x0FA6, 0x0FBE, - 0x1F93, 0x1FC2, 0x3FD5, 0x3FED, 0x7FEC, 0x3FE8, 0x3FDB, 0x3FC1, - 0x3FB9, 0x1FC7, 0x0FBA, 0x0F9E, 0x0F91, 0x03BA, 0x00DB, 0x03BB, - 0x0F92, 0x0F99, 0x0FBB, 0x1FC8, 0x3FB8, 0x3FC2, 0x3FDA, 0x3FE9, - 0x7FFF, 0x7FE7, 0x3FB6, 0x3FAF, 0x1FB3, 0x1FA6, 0x1F94, 0x0F83, - 0x07A0, 0x00DC, 0x07A1, 0x0F84, 0x1F95, 0x1FA8, 0x1FB5, 0x3FAD, - 0x3FB4, 0x7FE6, 0x7FFE, 0x7FF3, 0x3FE5, 0x3FBC, 0x1FA4, 0x1F9D, - 0x0FB2, 0x0FAE, 0x0FA9, 0x03CA, 0x01CC, 0x03CB, 0x0FAC, 0x0FB0, - 0x0FB3, 0x1F9A, 0x1FA2, 0x3FBF, 0x3FE4, 0x7FF2, 0x7FF8, 0x7FF5, - 0x7FEA, 0x7FE0, 0x3FCD, 0x3FB1, 0x1FBA, 0x1F9F, 0x07AE, 0x01CF, - 0x07AC, 0x1F9E, 0x1FBC, 0x3FB2, 0x3FCE, 0x7FE1, 0x7FE8, 0x7FF7, - 0x7FFA, 0x0016, + 1, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15 }; static const uint16_t clv_mvy_1_syms[] = { - 0xF7F7, 0xF8F7, 0xF9F7, 0xFAF7, 0xFBF7, 0xFCF7, 0xFDF7, 0xFEF7, - 0xFFF7, 0x00F7, 0x01F7, 0x02F7, 0x03F7, 0x04F7, 0x05F7, 0x06F7, - 0x07F7, 0x08F7, 0x09F7, 0xF7F8, 0xF8F8, 0xF9F8, 0xFAF8, 0xFBF8, - 0xFCF8, 0xFDF8, 0xFEF8, 0xFFF8, 0x00F8, 0x01F8, 0x02F8, 0x03F8, - 0x04F8, 0x05F8, 0x06F8, 0x07F8, 0x08F8, 0x09F8, 0xF7F9, 0xF8F9, - 0xF9F9, 0xFAF9, 0xFBF9, 0xFCF9, 0xFDF9, 0xFEF9, 0xFFF9, 0x00F9, - 0x01F9, 0x02F9, 0x03F9, 0x04F9, 0x05F9, 0x06F9, 0x07F9, 0x08F9, - 0x09F9, 0xF7FA, 0xF8FA, 0xF9FA, 0xFAFA, 0xFBFA, 0xFCFA, 0xFDFA, - 0xFEFA, 0xFFFA, 0x00FA, 0x01FA, 0x02FA, 0x03FA, 0x04FA, 0x05FA, - 0x06FA, 0x07FA, 0x08FA, 0x09FA, 0xF7FB, 0xF8FB, 0xF9FB, 0xFAFB, - 0xFBFB, 0xFCFB, 0xFDFB, 0xFEFB, 0xFFFB, 0x00FB, 0x01FB, 0x02FB, - 0x03FB, 0x04FB, 0x05FB, 0x06FB, 0x07FB, 0x08FB, 0x09FB, 0xF7FC, - 0xF8FC, 0xF9FC, 0xFAFC, 0xFBFC, 0xFCFC, 0xFDFC, 0xFEFC, 0xFFFC, - 0x00FC, 0x01FC, 0x02FC, 0x03FC, 0x04FC, 0x05FC, 0x06FC, 0x07FC, - 0x08FC, 0x09FC, 0xF7FD, 0xF8FD, 0xF9FD, 0xFAFD, 0xFBFD, 0xFCFD, - 0xFDFD, 0xFEFD, 0xFFFD, 0x00FD, 0x01FD, 0x02FD, 0x03FD, 0x04FD, - 0x05FD, 0x06FD, 0x07FD, 0x08FD, 0x09FD, 0xF7FE, 0xF8FE, 0xF9FE, - 0xFAFE, 0xFBFE, 0xFCFE, 0xFDFE, 0xFEFE, 0xFFFE, 0x00FE, 0x01FE, - 0x02FE, 0x03FE, 0x04FE, 0x05FE, 0x06FE, 0x07FE, 0x08FE, 0x09FE, - 0xF7FF, 0xF8FF, 0xF9FF, 0xFAFF, 0xFBFF, 0xFCFF, 0xFDFF, 0xFEFF, - 0xFFFF, 0x00FF, 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF, - 0x07FF, 0x08FF, 0x09FF, 0xF700, 0xF800, 0xF900, 0xFA00, 0xFB00, - 0xFC00, 0xFD00, 0xFE00, 0xFF00, 0x0000, 0x0100, 0x0200, 0x0300, - 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0xF701, 0xF801, - 0xF901, 0xFA01, 0xFB01, 0xFC01, 0xFD01, 0xFE01, 0xFF01, 0x0001, - 0x0101, 0x0201, 0x0301, 0x0401, 0x0501, 0x0601, 0x0701, 0x0801, - 0x0901, 0xF702, 0xF802, 0xF902, 0xFA02, 0xFB02, 0xFC02, 0xFD02, - 0xFE02, 0xFF02, 0x0002, 0x0102, 0x0202, 0x0302, 0x0402, 0x0502, - 0x0602, 0x0702, 0x0802, 0x0902, 0xF703, 0xF803, 0xF903, 0xFA03, - 0xFB03, 0xFC03, 0xFD03, 0xFE03, 0xFF03, 0x0003, 0x0103, 0x0203, - 0x0303, 0x0403, 0x0503, 0x0603, 0x0703, 0x0803, 0x0903, 0xF704, - 0xF804, 0xF904, 0xFA04, 0xFB04, 0xFC04, 0xFD04, 0xFE04, 0xFF04, - 0x0004, 0x0104, 0x0204, 0x0304, 0x0404, 0x0504, 0x0604, 0x0704, - 0x0804, 0x0904, 0xF705, 0xF805, 0xF905, 0xFA05, 0xFB05, 0xFC05, - 0xFD05, 0xFE05, 0xFF05, 0x0005, 0x0105, 0x0205, 0x0305, 0x0405, - 0x0505, 0x0605, 0x0705, 0x0805, 0x0905, 0xF706, 0xF806, 0xF906, - 0xFA06, 0xFB06, 0xFC06, 0xFD06, 0xFE06, 0xFF06, 0x0006, 0x0106, - 0x0206, 0x0306, 0x0406, 0x0506, 0x0606, 0x0706, 0x0806, 0x0906, - 0xF707, 0xF807, 0xF907, 0xFA07, 0xFB07, 0xFC07, 0xFD07, 0xFE07, - 0xFF07, 0x0007, 0x0107, 0x0207, 0x0307, 0x0407, 0x0507, 0x0607, - 0x0707, 0x0807, 0x0907, 0xF708, 0xF808, 0xF908, 0xFA08, 0xFB08, - 0xFC08, 0xFD08, 0xFE08, 0xFF08, 0x0008, 0x0108, 0x0208, 0x0308, - 0x0408, 0x0508, 0x0608, 0x0708, 0x0808, 0x0908, 0xF709, 0xF809, - 0xF909, 0xFA09, 0xFB09, 0xFC09, 0xFD09, 0xFE09, 0xFF09, 0x0009, - 0x0109, 0x0209, 0x0309, 0x0409, 0x0509, 0x0609, 0x0709, 0x0809, - 0x0909, 0x0A0A, + 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0x0A0A, 0xFFFF, 0x01FF, 0xFF01, + 0x0101, 0x00FE, 0x0002, 0x0003, 0x00FD, 0x0004, 0x00FC, 0xFE00, 0x0200, + 0x0005, 0x00FB, 0x00FA, 0x0006, 0x0007, 0x00F9, 0xFFFE, 0x01FE, 0xFF02, + 0x0102, 0xFF03, 0x0103, 0xFFFD, 0x01FD, 0xFEFF, 0x02FF, 0xFE01, 0x0201, + 0x0008, 0x00F8, 0x00F7, 0x0009, 0xFD00, 0x0300, 0xFF04, 0x0104, 0xFFFC, + 0x01FC, 0xFC00, 0x0400, 0xFB00, 0x0500, 0xFA00, 0x0600, 0xFEFE, 0x02FE, + 0xFE02, 0x0202, 0xFFFA, 0x01FA, 0xFF06, 0x0106, 0xFF05, 0x0105, 0xFFFB, + 0x01FB, 0xFDFF, 0x03FF, 0xFD01, 0x0301, 0xFE03, 0x0203, 0xFEFD, 0x02FD, + 0xF900, 0x0700, 0xFF08, 0x0108, 0xFFF8, 0x01F8, 0xFCFF, 0x04FF, 0xFC01, + 0x0401, 0xFF07, 0x0107, 0xFFF9, 0x01F9, 0x0204, 0xFEFC, 0x02FC, 0xFE04, + 0xFE05, 0x0205, 0xFEFB, 0x02FB, 0x0109, 0xFFF7, 0xFF09, 0x01F7, 0xFDFE, + 0x03FE, 0xFD02, 0x0302, 0xFCFE, 0x04FE, 0xF800, 0x0800, 0xFC02, 0x0402, + 0xFD03, 0x0303, 0xFDFD, 0x03FD, 0xFBFF, 0xFB01, 0x0501, 0x05FF, 0xFE07, + 0x0207, 0xFEF9, 0x02F9, 0x04FD, 0xFC03, 0xFCFD, 0x0403, 0xFBFE, 0x05FE, + 0xFB02, 0x0502, 0xFEFA, 0x02FA, 0xFE06, 0x0206, 0x0304, 0xFDFC, 0x03FC, + 0xFD04, 0xFDFA, 0x03FA, 0x0306, 0x06FF, 0xFAFF, 0xFA01, 0x0601, 0xFD06, + 0xF700, 0x0900, 0x0404, 0xFCFC, 0x04FC, 0xFC04, 0xFD05, 0x0305, 0x03FB, + 0xFDFB, 0xFE08, 0xFEF8, 0x02F8, 0x0208, 0x03F8, 0xFD08, 0xFDF8, 0x0308, + 0x04F8, 0xFC08, 0x0408, 0xFCF8, 0xFAFE, 0x06FE, 0xFA02, 0x0602, 0x04FA, + 0xFC06, 0x0406, 0xFCFA, 0xFC05, 0x0405, 0x04FB, 0xFCFB, 0x05FD, 0xFB03, + 0xFBFD, 0x0503, 0x0504, 0xFBFC, 0xFB04, 0x05FC, 0x06FD, 0xFAFC, 0x0604, + 0x06FC, 0xFA03, 0xFAFD, 0x0603, 0xFA04, 0xFB05, 0x0505, 0xFD07, 0x0307, + 0xFBFB, 0xFDF9, 0x05FB, 0x03F9, 0x0508, 0xFBF8, 0x05F8, 0xFB08, 0x0209, + 0xFE09, 0x02F7, 0xFEF7, 0x0608, 0x06F8, 0xFA08, 0xFAF8, 0xFC07, 0xF9FF, + 0x0407, 0x07FF, 0xFCF9, 0xF901, 0x0701, 0x04F9, 0xF9FE, 0x07FE, 0xF902, + 0x0702, 0x05F9, 0xFB07, 0xFBF9, 0x0507, 0x07FD, 0xF903, 0xF9FD, 0x0703, + 0xFD09, 0x03F7, 0x0309, 0xFDF7, 0x0704, 0xF9FC, 0x07FC, 0xF904, 0x0605, + 0xFAFB, 0xFA05, 0x06FB, 0x05FA, 0xFB06, 0x0506, 0xFBFA, 0x08FF, 0xF801, + 0xF8FF, 0x0801, 0xF8FE, 0x0802, 0xF802, 0x08FE, 0x0901, 0xF7FF, 0x09FF, + 0xF701, 0x06F9, 0x0607, 0xFAF9, 0xFA07, 0x04F7, 0xFC09, 0x0409, 0xFCF7, + 0x0707, 0xF9F9, 0xF907, 0x07F9, 0x0606, 0xFA06, 0x06FA, 0xFAFA, 0xF908, + 0xF9F8, 0x07F8, 0x0708, 0x07FA, 0xF906, 0x0706, 0xF9FA, 0x0804, 0xF7FE, + 0x08FC, 0xF804, 0xF702, 0x0902, 0xF8FC, 0x09FE, 0x05F7, 0xFB09, 0x0509, + 0xFBF7, 0x0803, 0x08FD, 0xF803, 0xF8FD, 0xF905, 0x0705, 0x07FB, 0xF9FB, + 0xF8FA, 0x08FA, 0x0806, 0xF806, 0xF7FC, 0xF704, 0x09FC, 0x0904, 0xF7FD, + 0xF703, 0x09FD, 0x0903, 0x0808, 0xF808, 0x08F8, 0xF8F8, 0xF706, 0x0906, + 0xF7FA, 0x09FA, 0xF805, 0x0805, 0xF8FB, 0x08FB, 0xFA09, 0x0609, 0x06F7, + 0xFAF7, 0x08F9, 0xF8F9, 0x0807, 0xF807, 0x0709, 0x07F7, 0xF909, 0xF9F7, + 0x0905, 0xF705, 0x09FB, 0xF7FB, 0x09F8, 0xF7F8, 0x0908, 0xF708, 0x08F7, + 0xF809, 0xF8F7, 0x0809, 0xF709, 0xF7F7, 0x0909, 0x09F7, 0xF7F9, 0x09F9, + 0x0907, 0xF707, }; static const uint8_t clv_mvy_2_bits[] = { - 16, 16, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 13, 13, 12, 11, - 12, 13, 13, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, - 15, 15, 15, 15, 15, 14, 14, 14, 14, 13, 13, 13, 13, 11, 10, 11, - 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 15, - 15, 15, 15, 14, 14, 14, 14, 14, 14, 13, 13, 13, 11, 10, 11, 13, - 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 15, 15, - 15, 14, 14, 14, 14, 14, 14, 13, 13, 13, 12, 11, 9, 11, 12, 13, - 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 16, 16, 15, 15, 14, - 14, 13, 13, 13, 13, 13, 13, 13, 12, 11, 11, 9, 11, 11, 12, 13, - 13, 13, 13, 13, 13, 13, 14, 14, 14, 15, 16, 16, 15, 15, 15, 14, - 13, 13, 13, 13, 13, 13, 13, 12, 11, 11, 9, 11, 11, 12, 13, 13, - 13, 13, 13, 13, 13, 14, 15, 15, 15, 16, 16, 15, 15, 15, 15, 14, - 14, 13, 13, 13, 12, 12, 12, 11, 11, 9, 11, 11, 12, 12, 12, 13, - 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 15, 15, 14, 14, 14, 13, - 13, 13, 12, 12, 12, 12, 11, 10, 8, 10, 11, 12, 12, 12, 12, 13, - 13, 13, 14, 14, 14, 15, 15, 16, 16, 15, 14, 14, 14, 13, 13, 13, - 13, 12, 12, 12, 11, 11, 10, 8, 10, 11, 11, 12, 12, 12, 13, 13, - 13, 13, 14, 14, 14, 15, 16, 15, 15, 14, 14, 13, 13, 13, 13, 13, - 12, 12, 12, 11, 10, 9, 8, 9, 10, 11, 12, 12, 12, 13, 13, 13, - 13, 13, 14, 14, 15, 15, 15, 15, 14, 14, 13, 13, 13, 13, 13, 12, - 12, 11, 11, 10, 10, 7, 10, 10, 11, 11, 12, 12, 13, 13, 13, 13, - 13, 14, 14, 15, 15, 14, 14, 14, 14, 13, 13, 12, 12, 12, 12, 12, - 11, 11, 10, 9, 7, 9, 10, 11, 11, 12, 12, 12, 12, 12, 13, 13, - 14, 14, 14, 14, 15, 13, 13, 13, 13, 13, 12, 12, 12, 11, 11, 11, - 11, 10, 8, 7, 8, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, - 13, 13, 15, 14, 14, 14, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, - 9, 8, 6, 8, 9, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 14, - 14, 14, 16, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 9, 9, 8, - 6, 4, 6, 8, 9, 9, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, - 16, 12, 12, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8, 8, 7, 4, - 2, 4, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, - 16, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 9, 9, 8, 6, 4, - 6, 8, 9, 9, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 16, 14, - 14, 14, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, 9, 8, 6, 8, - 9, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 13, - 13, 13, 13, 13, 12, 12, 12, 11, 11, 11, 11, 10, 8, 7, 8, 10, - 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 15, 14, 14, 14, - 14, 13, 13, 12, 12, 12, 12, 12, 11, 11, 10, 9, 7, 9, 10, 11, - 11, 12, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 14, 14, - 13, 13, 13, 13, 13, 12, 12, 11, 11, 10, 10, 7, 10, 10, 11, 11, - 12, 12, 13, 13, 13, 13, 13, 14, 14, 15, 15, 15, 15, 14, 14, 13, - 13, 13, 13, 13, 12, 12, 12, 11, 10, 9, 8, 9, 10, 11, 12, 12, - 12, 13, 13, 13, 13, 13, 14, 14, 15, 15, 16, 15, 14, 14, 14, 13, - 13, 13, 13, 12, 12, 12, 11, 11, 10, 8, 10, 11, 11, 12, 12, 12, - 13, 13, 13, 13, 14, 14, 14, 15, 16, 16, 15, 15, 14, 14, 14, 13, - 13, 13, 12, 12, 12, 12, 11, 10, 8, 10, 11, 12, 12, 12, 12, 13, - 13, 13, 14, 14, 14, 15, 15, 16, 16, 15, 15, 15, 15, 14, 14, 13, - 13, 13, 12, 12, 12, 11, 11, 9, 11, 11, 12, 12, 12, 13, 13, 13, - 14, 14, 15, 15, 15, 15, 16, 16, 15, 15, 15, 14, 13, 13, 13, 13, - 13, 13, 13, 12, 11, 11, 9, 11, 11, 12, 13, 13, 13, 13, 13, 13, - 13, 14, 15, 15, 15, 16, 16, 15, 15, 14, 14, 13, 13, 13, 13, 13, - 13, 13, 12, 11, 11, 9, 11, 11, 12, 13, 13, 13, 13, 13, 13, 13, - 14, 14, 14, 15, 16, 16, 15, 15, 15, 14, 14, 14, 14, 14, 14, 13, - 13, 13, 12, 11, 9, 11, 12, 13, 13, 13, 14, 14, 14, 14, 14, 14, - 15, 15, 15, 16, 16, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 13, - 13, 13, 11, 10, 11, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, - 15, 15, 16, 16, 15, 15, 15, 15, 15, 14, 14, 14, 14, 13, 13, 13, - 13, 12, 10, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, - 15, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 13, 13, - 12, 11, 12, 13, 13, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, - 16, 7, -}; - -static const uint16_t clv_mvy_2_codes[] = { - 0xFFF5, 0xFFD8, 0x7FE6, 0x7FB9, 0x7FB5, 0x7FB0, 0x7FA0, 0x7F99, - 0x7F93, 0x3FAA, 0x3F9B, 0x3F52, 0x1F76, 0x1EF5, 0x0F0B, 0x06F0, - 0x0F08, 0x1EF0, 0x1F75, 0x3F53, 0x3F9A, 0x3FA8, 0x7F94, 0x7F98, - 0x7F9E, 0x7FAE, 0x7FAF, 0x7FB7, 0x7FE9, 0xFFDB, 0xFFF6, 0xFFFD, - 0x7FD9, 0x7FCC, 0x7FC6, 0x7F9C, 0x7F80, 0x3FA5, 0x3F80, 0x3F6A, - 0x3F31, 0x1F54, 0x1F40, 0x1F11, 0x1F05, 0x075E, 0x0360, 0x075F, - 0x1F07, 0x1F12, 0x1F43, 0x1F56, 0x3F33, 0x3F68, 0x3F83, 0x3FA6, - 0x7F7F, 0x7F9A, 0x7FC9, 0x7FCA, 0x7FDB, 0xFFF8, 0xFFEC, 0x7FDE, - 0x7FE2, 0x7FA6, 0x7F6F, 0x3FA1, 0x3F8D, 0x3F5C, 0x3F39, 0x3F21, - 0x3F18, 0x1F58, 0x1F1E, 0x1EF1, 0x0740, 0x035A, 0x0741, 0x1EF2, - 0x1F1F, 0x1F5A, 0x3F19, 0x3F22, 0x3F3B, 0x3F5E, 0x3F8E, 0x3FA3, - 0x7F6B, 0x7FA2, 0x7FE3, 0x7FE1, 0xFFEE, 0xFFFC, 0x7FC3, 0x7FBC, - 0x7F71, 0x3F96, 0x3F86, 0x3F7A, 0x3F72, 0x3F59, 0x3F46, 0x1F0A, - 0x1EFD, 0x1ED0, 0x0F02, 0x0712, 0x019F, 0x0713, 0x0F03, 0x1ED3, - 0x1EFF, 0x1F09, 0x3F4A, 0x3F5A, 0x3F76, 0x3F7B, 0x3F87, 0x3F97, - 0x7F73, 0x7FBB, 0x7FBF, 0xFFFB, 0xFFEB, 0x7F88, 0x7F5C, 0x3F7C, - 0x3F3C, 0x1F60, 0x1F4C, 0x1F14, 0x1F0C, 0x1F00, 0x1EF9, 0x1ED8, - 0x0F42, 0x075A, 0x0714, 0x0186, 0x0715, 0x075B, 0x0F43, 0x1EDA, - 0x1EFA, 0x1F01, 0x1F0E, 0x1F15, 0x1F4D, 0x1F62, 0x3F3D, 0x3F7D, - 0x3FAC, 0x7F86, 0xFFE8, 0xFFE7, 0x7FA7, 0x7F8C, 0x7F68, 0x3F9C, - 0x1F7C, 0x1F6C, 0x1F69, 0x1EEC, 0x1EE4, 0x1ED5, 0x1ECD, 0x0EF0, - 0x0752, 0x06F6, 0x018C, 0x06F7, 0x0753, 0x0EF1, 0x1ECE, 0x1ED6, - 0x1EE5, 0x1EED, 0x1F6A, 0x1F6E, 0x1F7D, 0x3F9F, 0x7F66, 0x7F8A, - 0x7FA5, 0xFFE6, 0xFFDC, 0x7FDA, 0x7FC0, 0x7FAC, 0x7F61, 0x3F42, - 0x3F0E, 0x1F45, 0x1F2C, 0x1ECA, 0x0F27, 0x0EF6, 0x0EEE, 0x072E, - 0x06F4, 0x0185, 0x06F5, 0x072F, 0x0EEF, 0x0EF7, 0x0F28, 0x1ECB, - 0x1F2F, 0x1F46, 0x3F0F, 0x3F40, 0x7F5F, 0x7FB4, 0x7FC2, 0x7FDC, - 0xFFDA, 0xFFE0, 0x7F72, 0x7F63, 0x3F70, 0x3F1C, 0x3F16, 0x1F82, - 0x1EE2, 0x1EB2, 0x0F4C, 0x0EFC, 0x0EE0, 0x0ED3, 0x0722, 0x036C, - 0x00BF, 0x036D, 0x0723, 0x0ECC, 0x0EE1, 0x0EFF, 0x0F4D, 0x1EB3, - 0x1EE3, 0x1F83, 0x3F17, 0x3F1F, 0x3F75, 0x7F65, 0x7F70, 0xFFE2, - 0xFFD7, 0x7F76, 0x3F2B, 0x3F13, 0x3F0A, 0x1F33, 0x1F23, 0x1EB4, - 0x1EA0, 0x0F46, 0x0F32, 0x0F1A, 0x0756, 0x0728, 0x0356, 0x00B0, - 0x0357, 0x0729, 0x0757, 0x0F1B, 0x0F33, 0x0F47, 0x1EA1, 0x1EB5, - 0x1F20, 0x1F30, 0x3F08, 0x3F10, 0x3F28, 0x7F77, 0xFFD5, 0x7FD5, - 0x7FD1, 0x3F5D, 0x3F25, 0x1F34, 0x1F24, 0x1EE8, 0x1EBC, 0x1EA8, - 0x0F3A, 0x0F2E, 0x0EE2, 0x071C, 0x0374, 0x01A0, 0x00AE, 0x01A1, - 0x0375, 0x071D, 0x0EE3, 0x0F2F, 0x0F3C, 0x1EA9, 0x1EBD, 0x1EE9, - 0x1F25, 0x1F36, 0x3F24, 0x3F61, 0x7FCE, 0x7FD2, 0x7F91, 0x7F7D, - 0x3F6C, 0x3F34, 0x1F72, 0x1F61, 0x1EDD, 0x1EC5, 0x1EA5, 0x0F05, - 0x0ED6, 0x0750, 0x073E, 0x0368, 0x034A, 0x0052, 0x034B, 0x0369, - 0x073F, 0x0751, 0x0ED7, 0x0F07, 0x1EA7, 0x1EC7, 0x1EDF, 0x1F65, - 0x1F70, 0x3F36, 0x3F6F, 0x7F7C, 0x7F8F, 0x3F90, 0x3F66, 0x3F58, - 0x3F4E, 0x1F48, 0x1EBB, 0x0F40, 0x0F18, 0x0F10, 0x0EDA, 0x0ECF, - 0x0732, 0x0704, 0x0354, 0x0190, 0x004F, 0x0191, 0x0355, 0x0705, - 0x0733, 0x0ED0, 0x0EDB, 0x0F11, 0x0F19, 0x0F41, 0x1EB8, 0x1F4B, - 0x3F4F, 0x3F55, 0x3F65, 0x3F92, 0x7F85, 0x1F51, 0x1F39, 0x1F2B, - 0x1F18, 0x1EC2, 0x0F38, 0x0F14, 0x0ECA, 0x074C, 0x0736, 0x0700, - 0x06FC, 0x0350, 0x00BA, 0x004D, 0x00BB, 0x0351, 0x06FD, 0x0701, - 0x0737, 0x074D, 0x0ECB, 0x0F15, 0x0F39, 0x1EC3, 0x1F1B, 0x1F2E, - 0x1F3A, 0x1F53, 0x7F82, 0x3F8A, 0x3F47, 0x3F2E, 0x1F5E, 0x1E9E, - 0x0F24, 0x0F20, 0x0EC6, 0x0746, 0x0726, 0x070E, 0x0370, 0x035E, - 0x018A, 0x00AC, 0x0021, 0x00AD, 0x018B, 0x035F, 0x0371, 0x070F, - 0x0727, 0x0747, 0x0EC7, 0x0F21, 0x0F25, 0x1E9F, 0x1F5F, 0x3F2D, - 0x3F48, 0x3F8B, 0xFFF1, 0x1F78, 0x1F3D, 0x1EAD, 0x0F2B, 0x0EF9, - 0x0EE9, 0x0739, 0x0719, 0x0709, 0x0363, 0x019B, 0x0195, 0x00B3, - 0x0023, 0x0005, 0x0024, 0x00B4, 0x0196, 0x019C, 0x0364, 0x070A, - 0x071A, 0x073A, 0x0EEA, 0x0EFA, 0x0F2C, 0x1EAE, 0x1F3E, 0x1F79, - 0xFFF0, 0x0F0C, 0x0EE6, 0x0EDC, 0x0EC2, 0x0748, 0x0706, 0x0372, - 0x034C, 0x0198, 0x0192, 0x00C0, 0x00BC, 0x00B6, 0x0053, 0x0006, - 0x0000, 0x0007, 0x0054, 0x00B7, 0x00BD, 0x00C1, 0x0193, 0x0199, - 0x034D, 0x0373, 0x0707, 0x0749, 0x0EC3, 0x0EDD, 0x0EE7, 0x0F0D, - 0xFFF2, 0x1F7A, 0x1F3F, 0x1EAF, 0x0F2D, 0x0EFB, 0x0EEB, 0x073B, - 0x071B, 0x070B, 0x0365, 0x019D, 0x0197, 0x00B5, 0x0025, 0x0004, - 0x0022, 0x00B2, 0x0194, 0x019A, 0x0362, 0x0708, 0x0718, 0x0738, - 0x0EE8, 0x0EF8, 0x0F2A, 0x1EAC, 0x1F3C, 0x1F7B, 0xFFF3, 0x3F89, - 0x3F44, 0x3F2F, 0x1F5C, 0x1E9C, 0x0F22, 0x0F1E, 0x0EC4, 0x0744, - 0x0724, 0x070C, 0x036E, 0x035C, 0x0188, 0x00AA, 0x0020, 0x00AB, - 0x0189, 0x035D, 0x036F, 0x070D, 0x0725, 0x0745, 0x0EC5, 0x0F1F, - 0x0F23, 0x1E9D, 0x1F5D, 0x3F2C, 0x3F45, 0x3F88, 0x7F81, 0x1F52, - 0x1F38, 0x1F28, 0x1F19, 0x1EC0, 0x0F36, 0x0F12, 0x0EC8, 0x074A, - 0x0734, 0x06FE, 0x06FA, 0x034E, 0x00B8, 0x004C, 0x00B9, 0x034F, - 0x06FB, 0x06FF, 0x0735, 0x074B, 0x0EC9, 0x0F13, 0x0F37, 0x1EC1, - 0x1F1A, 0x1F29, 0x1F3B, 0x1F50, 0x7F84, 0x3F91, 0x3F64, 0x3F54, - 0x3F4C, 0x1F49, 0x1EB9, 0x0F3B, 0x0F16, 0x0F0E, 0x0ED8, 0x0ECD, - 0x0730, 0x0702, 0x0352, 0x018E, 0x004E, 0x018F, 0x0353, 0x0703, - 0x0731, 0x0ECE, 0x0ED9, 0x0F0F, 0x0F17, 0x0F3D, 0x1EBA, 0x1F4A, - 0x3F4D, 0x3F51, 0x3F67, 0x3F93, 0x7F90, 0x7F7A, 0x3F6E, 0x3F37, - 0x1F71, 0x1F63, 0x1EDC, 0x1EC4, 0x1EA4, 0x0F04, 0x0ED4, 0x074E, - 0x073C, 0x0366, 0x0348, 0x0051, 0x0349, 0x0367, 0x073D, 0x074F, - 0x0ED5, 0x0F06, 0x1EA6, 0x1EC6, 0x1EDE, 0x1F64, 0x1F73, 0x3F35, - 0x3F6D, 0x7F7B, 0x7F8E, 0x7FD4, 0x7FD0, 0x3F5F, 0x3F26, 0x1F35, - 0x1F27, 0x1EEA, 0x1EBE, 0x1EAA, 0x0F3E, 0x0F30, 0x0EE4, 0x071E, - 0x0376, 0x01A2, 0x00AF, 0x01A3, 0x0377, 0x071F, 0x0EE5, 0x0F31, - 0x0F3F, 0x1EAB, 0x1EBF, 0x1EEB, 0x1F26, 0x1F37, 0x3F27, 0x3F62, - 0x7FCF, 0x7FD3, 0xFFD4, 0x7F78, 0x3F29, 0x3F11, 0x3F0B, 0x1F32, - 0x1F22, 0x1EB6, 0x1EA2, 0x0F48, 0x0F34, 0x0F1C, 0x0758, 0x072A, - 0x0358, 0x00B1, 0x0359, 0x072B, 0x0759, 0x0F1D, 0x0F35, 0x0F49, - 0x1EA3, 0x1EB7, 0x1F21, 0x1F31, 0x3F09, 0x3F12, 0x3F2A, 0x7F79, - 0xFFD6, 0xFFE1, 0x7F6D, 0x7F64, 0x3F73, 0x3F1D, 0x3F14, 0x1F81, - 0x1EE0, 0x1EB0, 0x0F4A, 0x0EFD, 0x0EDE, 0x0ED1, 0x0720, 0x036A, - 0x00BE, 0x036B, 0x0721, 0x0ED2, 0x0EDF, 0x0EFE, 0x0F4B, 0x1EB1, - 0x1EE1, 0x1F7E, 0x3F15, 0x3F1E, 0x3F74, 0x7F62, 0x7F75, 0xFFE3, - 0xFFDE, 0x7FDD, 0x7FBE, 0x7FB3, 0x7F60, 0x3F43, 0x3F0C, 0x1F47, - 0x1F2D, 0x1EC8, 0x0F26, 0x0EF4, 0x0EEC, 0x072C, 0x06F2, 0x0184, - 0x06F3, 0x072D, 0x0EED, 0x0EF5, 0x0F29, 0x1EC9, 0x1F2A, 0x1F44, - 0x3F0D, 0x3F41, 0x7F5E, 0x7FB1, 0x7FC1, 0x7FD7, 0xFFDF, 0xFFEA, - 0x7FA3, 0x7F8B, 0x7F69, 0x3F9E, 0x1F7F, 0x1F6D, 0x1F6B, 0x1EEE, - 0x1EE6, 0x1ED4, 0x1ECF, 0x0EF2, 0x0754, 0x06F8, 0x018D, 0x06F9, - 0x0755, 0x0EF3, 0x1ECC, 0x1ED7, 0x1EE7, 0x1EEF, 0x1F68, 0x1F6F, - 0x1F80, 0x3F9D, 0x7F67, 0x7F8D, 0x7FA8, 0xFFE9, 0xFFE5, 0x7F89, - 0x7F5D, 0x3F7F, 0x3F3F, 0x1F67, 0x1F4F, 0x1F17, 0x1F0F, 0x1F02, - 0x1EFB, 0x1ED9, 0x0F45, 0x075C, 0x0716, 0x0187, 0x0717, 0x075D, - 0x0F44, 0x1EDB, 0x1EF8, 0x1F03, 0x1F0D, 0x1F16, 0x1F4E, 0x1F66, - 0x3F3E, 0x3F7E, 0x3FAD, 0x7F87, 0xFFE4, 0xFFF9, 0x7FC4, 0x7FBA, - 0x7F6E, 0x3F95, 0x3F85, 0x3F78, 0x3F77, 0x3F5B, 0x3F49, 0x1F08, - 0x1EFE, 0x1ED2, 0x0F01, 0x0710, 0x019E, 0x0711, 0x0F00, 0x1ED1, - 0x1EFC, 0x1F0B, 0x3F4B, 0x3F57, 0x3F71, 0x3F79, 0x3F84, 0x3F94, - 0x7F74, 0x7FBD, 0x7FC5, 0xFFFE, 0xFFED, 0x7FE0, 0x7FDF, 0x7FA4, - 0x7F6A, 0x3FA0, 0x3F8F, 0x3F63, 0x3F3A, 0x3F23, 0x3F1A, 0x1F59, - 0x1F1D, 0x1EF3, 0x0743, 0x035B, 0x0742, 0x1EF7, 0x1F1C, 0x1F5B, - 0x3F1B, 0x3F20, 0x3F38, 0x3F60, 0x3F8C, 0x3FA2, 0x7F6C, 0x7FA9, - 0x7FE5, 0x7FE4, 0xFFEF, 0xFFFF, 0x7FD6, 0x7FCB, 0x7FC7, 0x7F9B, - 0x7F83, 0x3FA4, 0x3F81, 0x3F69, 0x3F30, 0x1F57, 0x1F41, 0x1F13, - 0x1F06, 0x0EC0, 0x0361, 0x0EC1, 0x1F04, 0x1F10, 0x1F42, 0x1F55, - 0x3F32, 0x3F6B, 0x3F82, 0x3FA7, 0x7F7E, 0x7F9D, 0x7FC8, 0x7FCD, - 0x7FD8, 0xFFFA, 0xFFF7, 0xFFD9, 0x7FE8, 0x7FB6, 0x7FAB, 0x7FAA, - 0x7FA1, 0x7F96, 0x7F95, 0x3FAB, 0x3F98, 0x3F50, 0x1F77, 0x1EF4, - 0x0F0A, 0x06F1, 0x0F09, 0x1EF6, 0x1F74, 0x3F56, 0x3F99, 0x3FA9, - 0x7F92, 0x7F97, 0x7F9F, 0x7FAD, 0x7FB2, 0x7FB8, 0x7FE7, 0xFFDD, - 0xFFF4, 0x0050, + 2, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }; static const uint16_t clv_mvy_2_syms[] = { - 0xF1F1, 0xF2F1, 0xF3F1, 0xF4F1, 0xF5F1, 0xF6F1, 0xF7F1, 0xF8F1, - 0xF9F1, 0xFAF1, 0xFBF1, 0xFCF1, 0xFDF1, 0xFEF1, 0xFFF1, 0x00F1, - 0x01F1, 0x02F1, 0x03F1, 0x04F1, 0x05F1, 0x06F1, 0x07F1, 0x08F1, - 0x09F1, 0x0AF1, 0x0BF1, 0x0CF1, 0x0DF1, 0x0EF1, 0x0FF1, 0xF1F2, - 0xF2F2, 0xF3F2, 0xF4F2, 0xF5F2, 0xF6F2, 0xF7F2, 0xF8F2, 0xF9F2, - 0xFAF2, 0xFBF2, 0xFCF2, 0xFDF2, 0xFEF2, 0xFFF2, 0x00F2, 0x01F2, - 0x02F2, 0x03F2, 0x04F2, 0x05F2, 0x06F2, 0x07F2, 0x08F2, 0x09F2, - 0x0AF2, 0x0BF2, 0x0CF2, 0x0DF2, 0x0EF2, 0x0FF2, 0xF1F3, 0xF2F3, - 0xF3F3, 0xF4F3, 0xF5F3, 0xF6F3, 0xF7F3, 0xF8F3, 0xF9F3, 0xFAF3, - 0xFBF3, 0xFCF3, 0xFDF3, 0xFEF3, 0xFFF3, 0x00F3, 0x01F3, 0x02F3, - 0x03F3, 0x04F3, 0x05F3, 0x06F3, 0x07F3, 0x08F3, 0x09F3, 0x0AF3, - 0x0BF3, 0x0CF3, 0x0DF3, 0x0EF3, 0x0FF3, 0xF1F4, 0xF2F4, 0xF3F4, - 0xF4F4, 0xF5F4, 0xF6F4, 0xF7F4, 0xF8F4, 0xF9F4, 0xFAF4, 0xFBF4, - 0xFCF4, 0xFDF4, 0xFEF4, 0xFFF4, 0x00F4, 0x01F4, 0x02F4, 0x03F4, - 0x04F4, 0x05F4, 0x06F4, 0x07F4, 0x08F4, 0x09F4, 0x0AF4, 0x0BF4, - 0x0CF4, 0x0DF4, 0x0EF4, 0x0FF4, 0xF1F5, 0xF2F5, 0xF3F5, 0xF4F5, - 0xF5F5, 0xF6F5, 0xF7F5, 0xF8F5, 0xF9F5, 0xFAF5, 0xFBF5, 0xFCF5, - 0xFDF5, 0xFEF5, 0xFFF5, 0x00F5, 0x01F5, 0x02F5, 0x03F5, 0x04F5, - 0x05F5, 0x06F5, 0x07F5, 0x08F5, 0x09F5, 0x0AF5, 0x0BF5, 0x0CF5, - 0x0DF5, 0x0EF5, 0x0FF5, 0xF1F6, 0xF2F6, 0xF3F6, 0xF4F6, 0xF5F6, - 0xF6F6, 0xF7F6, 0xF8F6, 0xF9F6, 0xFAF6, 0xFBF6, 0xFCF6, 0xFDF6, - 0xFEF6, 0xFFF6, 0x00F6, 0x01F6, 0x02F6, 0x03F6, 0x04F6, 0x05F6, - 0x06F6, 0x07F6, 0x08F6, 0x09F6, 0x0AF6, 0x0BF6, 0x0CF6, 0x0DF6, - 0x0EF6, 0x0FF6, 0xF1F7, 0xF2F7, 0xF3F7, 0xF4F7, 0xF5F7, 0xF6F7, - 0xF7F7, 0xF8F7, 0xF9F7, 0xFAF7, 0xFBF7, 0xFCF7, 0xFDF7, 0xFEF7, - 0xFFF7, 0x00F7, 0x01F7, 0x02F7, 0x03F7, 0x04F7, 0x05F7, 0x06F7, - 0x07F7, 0x08F7, 0x09F7, 0x0AF7, 0x0BF7, 0x0CF7, 0x0DF7, 0x0EF7, - 0x0FF7, 0xF1F8, 0xF2F8, 0xF3F8, 0xF4F8, 0xF5F8, 0xF6F8, 0xF7F8, - 0xF8F8, 0xF9F8, 0xFAF8, 0xFBF8, 0xFCF8, 0xFDF8, 0xFEF8, 0xFFF8, - 0x00F8, 0x01F8, 0x02F8, 0x03F8, 0x04F8, 0x05F8, 0x06F8, 0x07F8, - 0x08F8, 0x09F8, 0x0AF8, 0x0BF8, 0x0CF8, 0x0DF8, 0x0EF8, 0x0FF8, - 0xF1F9, 0xF2F9, 0xF3F9, 0xF4F9, 0xF5F9, 0xF6F9, 0xF7F9, 0xF8F9, - 0xF9F9, 0xFAF9, 0xFBF9, 0xFCF9, 0xFDF9, 0xFEF9, 0xFFF9, 0x00F9, - 0x01F9, 0x02F9, 0x03F9, 0x04F9, 0x05F9, 0x06F9, 0x07F9, 0x08F9, - 0x09F9, 0x0AF9, 0x0BF9, 0x0CF9, 0x0DF9, 0x0EF9, 0x0FF9, 0xF1FA, - 0xF2FA, 0xF3FA, 0xF4FA, 0xF5FA, 0xF6FA, 0xF7FA, 0xF8FA, 0xF9FA, - 0xFAFA, 0xFBFA, 0xFCFA, 0xFDFA, 0xFEFA, 0xFFFA, 0x00FA, 0x01FA, - 0x02FA, 0x03FA, 0x04FA, 0x05FA, 0x06FA, 0x07FA, 0x08FA, 0x09FA, - 0x0AFA, 0x0BFA, 0x0CFA, 0x0DFA, 0x0EFA, 0x0FFA, 0xF1FB, 0xF2FB, - 0xF3FB, 0xF4FB, 0xF5FB, 0xF6FB, 0xF7FB, 0xF8FB, 0xF9FB, 0xFAFB, - 0xFBFB, 0xFCFB, 0xFDFB, 0xFEFB, 0xFFFB, 0x00FB, 0x01FB, 0x02FB, - 0x03FB, 0x04FB, 0x05FB, 0x06FB, 0x07FB, 0x08FB, 0x09FB, 0x0AFB, - 0x0BFB, 0x0CFB, 0x0DFB, 0x0EFB, 0x0FFB, 0xF1FC, 0xF2FC, 0xF3FC, - 0xF4FC, 0xF5FC, 0xF6FC, 0xF7FC, 0xF8FC, 0xF9FC, 0xFAFC, 0xFBFC, - 0xFCFC, 0xFDFC, 0xFEFC, 0xFFFC, 0x00FC, 0x01FC, 0x02FC, 0x03FC, - 0x04FC, 0x05FC, 0x06FC, 0x07FC, 0x08FC, 0x09FC, 0x0AFC, 0x0BFC, - 0x0CFC, 0x0DFC, 0x0EFC, 0x0FFC, 0xF1FD, 0xF2FD, 0xF3FD, 0xF4FD, - 0xF5FD, 0xF6FD, 0xF7FD, 0xF8FD, 0xF9FD, 0xFAFD, 0xFBFD, 0xFCFD, - 0xFDFD, 0xFEFD, 0xFFFD, 0x00FD, 0x01FD, 0x02FD, 0x03FD, 0x04FD, - 0x05FD, 0x06FD, 0x07FD, 0x08FD, 0x09FD, 0x0AFD, 0x0BFD, 0x0CFD, - 0x0DFD, 0x0EFD, 0x0FFD, 0xF1FE, 0xF2FE, 0xF3FE, 0xF4FE, 0xF5FE, - 0xF6FE, 0xF7FE, 0xF8FE, 0xF9FE, 0xFAFE, 0xFBFE, 0xFCFE, 0xFDFE, - 0xFEFE, 0xFFFE, 0x00FE, 0x01FE, 0x02FE, 0x03FE, 0x04FE, 0x05FE, - 0x06FE, 0x07FE, 0x08FE, 0x09FE, 0x0AFE, 0x0BFE, 0x0CFE, 0x0DFE, - 0x0EFE, 0x0FFE, 0xF1FF, 0xF2FF, 0xF3FF, 0xF4FF, 0xF5FF, 0xF6FF, - 0xF7FF, 0xF8FF, 0xF9FF, 0xFAFF, 0xFBFF, 0xFCFF, 0xFDFF, 0xFEFF, - 0xFFFF, 0x00FF, 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF, - 0x07FF, 0x08FF, 0x09FF, 0x0AFF, 0x0BFF, 0x0CFF, 0x0DFF, 0x0EFF, - 0x0FFF, 0xF100, 0xF200, 0xF300, 0xF400, 0xF500, 0xF600, 0xF700, - 0xF800, 0xF900, 0xFA00, 0xFB00, 0xFC00, 0xFD00, 0xFE00, 0xFF00, - 0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, - 0x0800, 0x0900, 0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00, - 0xF101, 0xF201, 0xF301, 0xF401, 0xF501, 0xF601, 0xF701, 0xF801, - 0xF901, 0xFA01, 0xFB01, 0xFC01, 0xFD01, 0xFE01, 0xFF01, 0x0001, - 0x0101, 0x0201, 0x0301, 0x0401, 0x0501, 0x0601, 0x0701, 0x0801, - 0x0901, 0x0A01, 0x0B01, 0x0C01, 0x0D01, 0x0E01, 0x0F01, 0xF102, - 0xF202, 0xF302, 0xF402, 0xF502, 0xF602, 0xF702, 0xF802, 0xF902, - 0xFA02, 0xFB02, 0xFC02, 0xFD02, 0xFE02, 0xFF02, 0x0002, 0x0102, - 0x0202, 0x0302, 0x0402, 0x0502, 0x0602, 0x0702, 0x0802, 0x0902, - 0x0A02, 0x0B02, 0x0C02, 0x0D02, 0x0E02, 0x0F02, 0xF103, 0xF203, - 0xF303, 0xF403, 0xF503, 0xF603, 0xF703, 0xF803, 0xF903, 0xFA03, - 0xFB03, 0xFC03, 0xFD03, 0xFE03, 0xFF03, 0x0003, 0x0103, 0x0203, - 0x0303, 0x0403, 0x0503, 0x0603, 0x0703, 0x0803, 0x0903, 0x0A03, - 0x0B03, 0x0C03, 0x0D03, 0x0E03, 0x0F03, 0xF104, 0xF204, 0xF304, - 0xF404, 0xF504, 0xF604, 0xF704, 0xF804, 0xF904, 0xFA04, 0xFB04, - 0xFC04, 0xFD04, 0xFE04, 0xFF04, 0x0004, 0x0104, 0x0204, 0x0304, - 0x0404, 0x0504, 0x0604, 0x0704, 0x0804, 0x0904, 0x0A04, 0x0B04, - 0x0C04, 0x0D04, 0x0E04, 0x0F04, 0xF105, 0xF205, 0xF305, 0xF405, - 0xF505, 0xF605, 0xF705, 0xF805, 0xF905, 0xFA05, 0xFB05, 0xFC05, - 0xFD05, 0xFE05, 0xFF05, 0x0005, 0x0105, 0x0205, 0x0305, 0x0405, - 0x0505, 0x0605, 0x0705, 0x0805, 0x0905, 0x0A05, 0x0B05, 0x0C05, - 0x0D05, 0x0E05, 0x0F05, 0xF106, 0xF206, 0xF306, 0xF406, 0xF506, - 0xF606, 0xF706, 0xF806, 0xF906, 0xFA06, 0xFB06, 0xFC06, 0xFD06, - 0xFE06, 0xFF06, 0x0006, 0x0106, 0x0206, 0x0306, 0x0406, 0x0506, - 0x0606, 0x0706, 0x0806, 0x0906, 0x0A06, 0x0B06, 0x0C06, 0x0D06, - 0x0E06, 0x0F06, 0xF107, 0xF207, 0xF307, 0xF407, 0xF507, 0xF607, - 0xF707, 0xF807, 0xF907, 0xFA07, 0xFB07, 0xFC07, 0xFD07, 0xFE07, - 0xFF07, 0x0007, 0x0107, 0x0207, 0x0307, 0x0407, 0x0507, 0x0607, - 0x0707, 0x0807, 0x0907, 0x0A07, 0x0B07, 0x0C07, 0x0D07, 0x0E07, - 0x0F07, 0xF108, 0xF208, 0xF308, 0xF408, 0xF508, 0xF608, 0xF708, - 0xF808, 0xF908, 0xFA08, 0xFB08, 0xFC08, 0xFD08, 0xFE08, 0xFF08, - 0x0008, 0x0108, 0x0208, 0x0308, 0x0408, 0x0508, 0x0608, 0x0708, - 0x0808, 0x0908, 0x0A08, 0x0B08, 0x0C08, 0x0D08, 0x0E08, 0x0F08, - 0xF109, 0xF209, 0xF309, 0xF409, 0xF509, 0xF609, 0xF709, 0xF809, - 0xF909, 0xFA09, 0xFB09, 0xFC09, 0xFD09, 0xFE09, 0xFF09, 0x0009, - 0x0109, 0x0209, 0x0309, 0x0409, 0x0509, 0x0609, 0x0709, 0x0809, - 0x0909, 0x0A09, 0x0B09, 0x0C09, 0x0D09, 0x0E09, 0x0F09, 0xF10A, - 0xF20A, 0xF30A, 0xF40A, 0xF50A, 0xF60A, 0xF70A, 0xF80A, 0xF90A, - 0xFA0A, 0xFB0A, 0xFC0A, 0xFD0A, 0xFE0A, 0xFF0A, 0x000A, 0x010A, - 0x020A, 0x030A, 0x040A, 0x050A, 0x060A, 0x070A, 0x080A, 0x090A, - 0x0A0A, 0x0B0A, 0x0C0A, 0x0D0A, 0x0E0A, 0x0F0A, 0xF10B, 0xF20B, - 0xF30B, 0xF40B, 0xF50B, 0xF60B, 0xF70B, 0xF80B, 0xF90B, 0xFA0B, - 0xFB0B, 0xFC0B, 0xFD0B, 0xFE0B, 0xFF0B, 0x000B, 0x010B, 0x020B, - 0x030B, 0x040B, 0x050B, 0x060B, 0x070B, 0x080B, 0x090B, 0x0A0B, - 0x0B0B, 0x0C0B, 0x0D0B, 0x0E0B, 0x0F0B, 0xF10C, 0xF20C, 0xF30C, - 0xF40C, 0xF50C, 0xF60C, 0xF70C, 0xF80C, 0xF90C, 0xFA0C, 0xFB0C, - 0xFC0C, 0xFD0C, 0xFE0C, 0xFF0C, 0x000C, 0x010C, 0x020C, 0x030C, - 0x040C, 0x050C, 0x060C, 0x070C, 0x080C, 0x090C, 0x0A0C, 0x0B0C, - 0x0C0C, 0x0D0C, 0x0E0C, 0x0F0C, 0xF10D, 0xF20D, 0xF30D, 0xF40D, - 0xF50D, 0xF60D, 0xF70D, 0xF80D, 0xF90D, 0xFA0D, 0xFB0D, 0xFC0D, - 0xFD0D, 0xFE0D, 0xFF0D, 0x000D, 0x010D, 0x020D, 0x030D, 0x040D, - 0x050D, 0x060D, 0x070D, 0x080D, 0x090D, 0x0A0D, 0x0B0D, 0x0C0D, - 0x0D0D, 0x0E0D, 0x0F0D, 0xF10E, 0xF20E, 0xF30E, 0xF40E, 0xF50E, - 0xF60E, 0xF70E, 0xF80E, 0xF90E, 0xFA0E, 0xFB0E, 0xFC0E, 0xFD0E, - 0xFE0E, 0xFF0E, 0x000E, 0x010E, 0x020E, 0x030E, 0x040E, 0x050E, - 0x060E, 0x070E, 0x080E, 0x090E, 0x0A0E, 0x0B0E, 0x0C0E, 0x0D0E, - 0x0E0E, 0x0F0E, 0xF10F, 0xF20F, 0xF30F, 0xF40F, 0xF50F, 0xF60F, - 0xF70F, 0xF80F, 0xF90F, 0xFA0F, 0xFB0F, 0xFC0F, 0xFD0F, 0xFE0F, - 0xFF0F, 0x000F, 0x010F, 0x020F, 0x030F, 0x040F, 0x050F, 0x060F, - 0x070F, 0x080F, 0x090F, 0x0A0F, 0x0B0F, 0x0C0F, 0x0D0F, 0x0E0F, - 0x0F0F, 0x1010, + 0x0000, 0x0001, 0x00FF, 0xFF00, 0x0100, 0x0002, 0x00FE, 0x0101, 0xFFFF, + 0x01FF, 0xFF01, 0x0003, 0x00FD, 0x0004, 0x00FC, 0x1010, 0x0005, 0x00FB, + 0xFE00, 0x0200, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0x00FA, 0x0006, 0x00F9, + 0x0007, 0x0201, 0xFEFF, 0x02FF, 0xFE01, 0xFD00, 0x0300, 0xFF03, 0x0103, + 0xFFFD, 0x01FD, 0xFC00, 0x0400, 0x0008, 0x00F8, 0xFB00, 0x0500, 0x0009, + 0x00F7, 0x00F5, 0x000B, 0xFE02, 0x0202, 0xFEFE, 0x02FE, 0x00F6, 0x000A, + 0xFF04, 0x0104, 0xFFFC, 0x01FC, 0xFA00, 0x0600, 0x0301, 0xFDFF, 0x03FF, + 0xFD01, 0xF900, 0x0700, 0x0401, 0xFCFF, 0x04FF, 0xFC01, 0x000C, 0x00F4, + 0xFFFA, 0x01FA, 0xFF06, 0x0106, 0xFF05, 0x0105, 0xFFFB, 0x01FB, 0xF800, + 0x0800, 0xFE03, 0x0203, 0xFEFD, 0x02FD, 0xFE04, 0x0204, 0xFEFC, 0x02FC, + 0xFFF9, 0x01F9, 0xFF07, 0x0107, 0x00F3, 0x000D, 0xFD02, 0x0302, 0xFDFE, + 0x03FE, 0x00F2, 0x000E, 0x0501, 0xFBFF, 0x05FF, 0xFB01, 0xFE05, 0x0205, + 0xFEFB, 0x02FB, 0xFF08, 0x0108, 0xFFF8, 0x01F8, 0xFC02, 0x0402, 0xFCFE, + 0x04FE, 0xF700, 0x0900, 0xFEFA, 0x02FA, 0xFE06, 0x0206, 0x00F1, 0x000F, + 0xFF09, 0x0109, 0xFFF7, 0x01F7, 0xFFF6, 0x01F6, 0xFF0A, 0x010A, 0xFD03, + 0x0303, 0xFDFD, 0x03FD, 0xFC03, 0x0403, 0xFCFD, 0x04FD, 0xFD04, 0x0304, + 0xFDFC, 0x03FC, 0xF600, 0x0A00, 0x0601, 0xFAFF, 0x06FF, 0xFA01, 0xFB02, + 0x0502, 0xFBFE, 0x05FE, 0xFF0C, 0x010C, 0xFFF4, 0x01F4, 0xFFF5, 0x01F5, + 0xFF0B, 0x010B, 0x0701, 0xF9FF, 0x07FF, 0xF901, 0xFDFA, 0x03FA, 0xFD06, + 0x0306, 0xFE08, 0x0208, 0xFEF8, 0x02F8, 0xFA02, 0x0602, 0xFAFE, 0x06FE, + 0xFEF9, 0x02F9, 0xFE07, 0x0207, 0xFE09, 0x0209, 0xFEF7, 0x02F7, 0xFC04, + 0x0404, 0xFCFC, 0x04FC, 0xFB03, 0x0503, 0xFBFD, 0x05FD, 0x0801, 0xF8FF, + 0x08FF, 0xF801, 0xFD05, 0x0305, 0xFDFB, 0x03FB, 0xFFF3, 0x01F3, 0x010D, + 0xFF0D, 0xF902, 0x0702, 0xF9FE, 0x07FE, 0xF500, 0x0B00, 0xFA03, 0x0603, + 0xFAFD, 0x06FD, 0xFC05, 0x0405, 0xFCFB, 0x04FB, 0xFEF6, 0x02F6, 0xFE0A, + 0x020A, 0xFDF9, 0x03F9, 0xFD07, 0x0307, 0xFEF5, 0x02F5, 0xFE0B, 0x020B, + 0xFFF2, 0x01F2, 0xFF0E, 0x010E, 0xF400, 0x0C00, 0xF802, 0x0802, 0xF8FE, + 0x08FE, 0xF903, 0x0703, 0xF9FD, 0x07FD, 0x03F8, 0xFB04, 0x0504, 0xFBFC, + 0x05FC, 0xFD08, 0x0308, 0xFDF8, 0xFB05, 0x0505, 0xFBFB, 0x05FB, 0xFA04, + 0x0604, 0xFAFC, 0x06FC, 0xF300, 0x0D00, 0xFC08, 0x0408, 0xFCF8, 0x04F8, + 0xFCFA, 0x04FA, 0xFC06, 0x0406, 0xF200, 0x0E00, 0x0901, 0xF7FF, 0x09FF, + 0xF701, 0xFD09, 0x0309, 0xFDF7, 0x03F7, 0xFDF6, 0x03F6, 0xFD0A, 0x030A, + 0xFC09, 0x0409, 0xFCF7, 0x04F7, 0x0A01, 0xF6FF, 0x0AFF, 0xF601, 0xFBF8, + 0xFB08, 0x0508, 0x05F8, 0x020C, 0xFE0C, 0xFEF4, 0x02F4, 0xFA05, 0xFAFB, + 0x0605, 0x06FB, 0x01F1, 0x010F, 0xFF0F, 0xFFF1, 0xF100, 0x0F00, 0xF904, + 0x0704, 0xF9FC, 0x07FC, 0xF803, 0x0803, 0xF8FD, 0x08FD, 0xF804, 0x0804, + 0xF8FC, 0x08FC, 0xFCF9, 0x04F9, 0xFC07, 0x0407, 0xF702, 0x0902, 0xF7FE, + 0x09FE, 0xF602, 0x0A02, 0xF6FE, 0x0AFE, 0xFB09, 0xFBF7, 0x05F7, 0x0509, + 0x0B01, 0xF5FF, 0x0BFF, 0xF501, 0xFBFA, 0x05FA, 0xFB06, 0x0506, 0xFBF9, + 0x05F9, 0xFB07, 0x0507, 0xF703, 0x0903, 0xF7FD, 0x09FD, 0xFAFA, 0xF704, + 0x06FA, 0x0904, 0xFA06, 0x0606, 0xF7FC, 0x09FC, 0xFDF5, 0x03F5, 0x030B, + 0xFD0B, 0xFAF9, 0x06F9, 0xFA07, 0x0607, 0xFA08, 0x0608, 0xFAF8, 0x06F8, + 0xF502, 0x0B02, 0xF5FE, 0x0BFE, 0xF9F9, 0x07F9, 0xF907, 0x0707, 0xF905, + 0xF9FB, 0x0705, 0x07FB, 0xF9FA, 0x07FA, 0xF906, 0x0706, 0x0C01, 0xF4FF, + 0x0CFF, 0xF401, 0xF908, 0x0708, 0xF9F8, 0x07F8, 0xF8F9, 0x08F9, 0xF807, + 0x0807, 0x0AFC, 0xF604, 0x0A04, 0xF6FC, 0xF8FA, 0x08FA, 0xF806, 0x0806, + 0xF603, 0x0A03, 0xF6FD, 0x0AFD, 0xF805, 0xF8FB, 0x0805, 0x08FB, 0xFA09, + 0x0609, 0xFAF7, 0x06F7, 0x040A, 0xFCF6, 0x04F6, 0xFC0A, 0xFDF4, 0x030C, + 0xFD0C, 0x03F4, 0xFB0A, 0xFBF6, 0x05F6, 0x050A, 0xFCF5, 0xFC0B, 0x04F5, + 0x040B, 0xF705, 0xF7FB, 0x0905, 0x09FB, 0xF808, 0x0808, 0xF8F8, 0x08F8, + 0xFAF6, 0x06F6, 0xFA0A, 0x060A, 0xF7FA, 0x09FA, 0xF706, 0x0906, 0xF9F6, + 0x07F6, 0xF90A, 0x070A, 0x02F1, 0xFEF3, 0x02F3, 0xFE0D, 0xFE0F, 0xFEF1, + 0x020F, 0x020D, 0x050B, 0xFBF5, 0x05F5, 0xFB0B, 0x040C, 0xFCF4, 0xFC0C, + 0x04F4, 0xFAF5, 0x06F5, 0xFA0B, 0x060B, 0x020E, 0xFEF2, 0xFE0E, 0x02F2, + 0xFB0C, 0x05F4, 0xFBF4, 0x050C, 0xF9F5, 0x070B, 0x07F5, 0xF90B, 0x030E, + 0xFDF2, 0x03F2, 0xFD0E, 0xF8F5, 0x08F5, 0x080B, 0xF80B, 0xF5FD, 0xF503, + 0x0B03, 0x0BFD, 0x030D, 0xFD0D, 0xFDF3, 0x03F3, 0x09F9, 0x0907, 0xF707, + 0xF7F9, 0xF6FA, 0x0AFA, 0x0A06, 0xF606, 0xF403, 0x0C03, 0x0709, 0xF4FD, + 0xF9F7, 0xF909, 0x0CFD, 0x07F7, 0x0AF9, 0x0A07, 0xF607, 0xF6F9, 0xF5FA, + 0xF506, 0x0BFA, 0x0B06, 0xF303, 0xF3FD, 0x0DFD, 0x0D03, 0x0D01, 0xF3FF, + 0x0DFF, 0xF301, 0xFCF2, 0xFC0E, 0x040E, 0x04F2, 0x0809, 0xF8F7, 0x08F7, + 0xF809, 0xF5FC, 0xF504, 0x0B04, 0x0BFC, 0xF7F5, 0x09F5, 0x090B, 0xF70B, + 0x0E03, 0xF2FD, 0xF203, 0x0EFD, 0xFBF2, 0x050E, 0x05F2, 0xFB0E, 0xFCF3, + 0xFC0D, 0x04F3, 0x040D, 0xF402, 0x0C02, 0xF4FE, 0x0CFE, 0xF6F5, 0xF6FB, + 0x0AF5, 0xF605, 0x0A05, 0x0AFB, 0x0A0B, 0xF60B, 0x080A, 0xF8F6, 0x08F6, + 0xF80A, 0xF7F6, 0xF70A, 0x09F6, 0x090A, 0x0BFB, 0xF505, 0xF5FB, 0x0B05, + 0x030F, 0x03F1, 0xFDF1, 0xFD0F, 0xF2FF, 0x0EFF, 0xF201, 0x0E01, 0xF6F6, + 0x0AF6, 0x0908, 0xF60A, 0x0A0A, 0xF708, 0xF7F8, 0x09F8, 0x0BF9, 0x0B07, + 0xF5F9, 0xF507, 0xF709, 0x0909, 0xF7F7, 0x09F7, 0x0CF9, 0xF407, 0x0C07, + 0xF4F9, 0xF608, 0x0A08, 0xF6F8, 0x0AF8, 0xFBF3, 0x05F3, 0xFB0D, 0x050D, + 0xF5F8, 0xF508, 0x0B08, 0x0BF8, 0x060D, 0xFAF3, 0x06F3, 0xFA0D, 0x0CFA, + 0xF4FA, 0xF406, 0x0C06, 0x0DF9, 0xF307, 0x0D07, 0xF3F9, 0x0D02, 0x0DFE, + 0xF3FE, 0xF302, 0xFA0E, 0xFAF2, 0x060E, 0x06F2, 0xF4FB, 0x0C05, 0x0CFB, + 0xF405, 0x070D, 0xF9F3, 0xF90D, 0x07F3, 0xF5F5, 0x0BF5, 0x0B0B, 0xF50B, + 0x0AF7, 0x0A09, 0xF6F7, 0xF609, 0xF202, 0x0E02, 0xFAF4, 0xF2FE, 0x0EFE, + 0xFA0C, 0x06F4, 0x060C, 0xF404, 0x0C04, 0xF4FC, 0x0CFC, 0xFC0F, 0x0D04, + 0xFCF1, 0x04F1, 0xF304, 0x0DFC, 0x040F, 0x070C, 0xF3FC, 0xF9F4, 0x07F4, + 0xF90C, 0xF8F3, 0xF3FA, 0x08F3, 0xF306, 0x080D, 0x0DFA, 0x0D06, 0xF80D, + 0xF204, 0x0EFC, 0xF2FC, 0x0E04, 0x07F2, 0xF90E, 0xF9F2, 0x070E, 0xF3FB, + 0x0D05, 0xF305, 0x0DFB, 0xF4F8, 0x080C, 0xF8F4, 0xF408, 0x0C08, 0x0CF8, + 0x08F4, 0xF80C, 0xF70C, 0x090C, 0xF7F4, 0x09F4, 0xF4F5, 0x0CF5, 0x0C0B, + 0xF40B, 0xF8F2, 0xF80E, 0x080E, 0x08F2, 0x0A0C, 0xF60C, 0xF6F4, 0x0AF4, + 0x0F02, 0xF102, 0xF1FE, 0x0FFE, 0x090D, 0xF7F3, 0x09F3, 0xF70D, 0xF1FC, + 0xF104, 0x0FFC, 0x0F04, 0x0B0C, 0xF50C, 0xF5F4, 0x0BF4, 0xFB0F, 0x050F, + 0x05F1, 0xFBF1, 0xF5F6, 0x0B0A, 0xF50A, 0x0BF6, 0xF60D, 0xF6F3, 0x0A0D, + 0x0AF3, 0xF70E, 0xF7F2, 0x09F2, 0x090E, 0x06F1, 0x060F, 0xFAF1, 0xFA0F, + 0x0DF5, 0x0D0B, 0xF3F5, 0xF30B, 0x0B09, 0x0BF7, 0xF509, 0xF5F7, 0x0D08, + 0xF3F8, 0xF308, 0x0DF8, 0x0CF6, 0x0C0A, 0xF4F6, 0xF40A, 0xF50D, 0x0BF3, + 0x0B0D, 0xF208, 0xF40C, 0xF5F3, 0x0EF8, 0xF4F4, 0xF2F8, 0x0CF4, 0x0C0C, + 0x0E08, 0xF2F9, 0x0EF9, 0xF207, 0x0E07, 0xF205, 0x0E05, 0x0EFB, 0xF2FB, + 0x0A0E, 0x0AF2, 0xF6F2, 0xF103, 0x0FFD, 0xF60E, 0x0F03, 0xF1FD, 0x0EF5, + 0x0E0B, 0xF2F5, 0xF20B, 0x0DF6, 0xF30A, 0xF3F6, 0x0D0A, 0x0F05, 0x0FFB, + 0xF105, 0xF1FB, 0x070F, 0xF9F1, 0x07F1, 0xF90F, 0xF80F, 0x080F, 0x08F1, + 0xF8F1, 0x0BF2, 0xF50E, 0xF5F2, 0x0B0E, 0x09F1, 0x090F, 0xF7F1, 0xF70F, + 0x0CF3, 0xF20A, 0xF40D, 0x0EF6, 0xF4F3, 0xF2F6, 0x0E0A, 0x0C0D, 0xF60F, + 0xF50F, 0xF4F7, 0x0A0F, 0x0AF1, 0x0BF1, 0xF6F1, 0x0C09, 0x0B0F, 0xF409, + 0x0CF7, 0xF5F1, 0xF40F, 0x0CF1, 0x0C0F, 0xF4F1, 0xF30C, 0x0DF4, 0xF3F4, + 0x0D0C, 0xF309, 0x0EF4, 0xF3F7, 0x0D09, 0x0DF7, 0xF2F4, 0xF20C, 0x0E0C, + 0xF4F2, 0xF40E, 0x0C0E, 0x0CF2, 0x0DF2, 0xF30E, 0xF3F2, 0x0D0E, 0x0EFA, + 0x0E06, 0xF206, 0xF2FA, 0x0FFA, 0x0F06, 0xF106, 0xF1FA, 0xF20E, 0x0E09, + 0x0E0E, 0xF2F2, 0xF2F7, 0x0EF2, 0x0EF7, 0xF209, 0xF2F3, 0xF30D, 0xF20D, + 0x0EF3, 0xF3F3, 0x0DF3, 0x0E0D, 0x0D0D, 0xF3F1, 0x0D0F, 0xF30F, 0x0DF1, + 0xF107, 0x0FF9, 0x0F07, 0xF1F9, 0xF2F1, 0xF20F, 0x0FF7, 0x0EF1, 0xF1F7, + 0x0E0F, 0xF109, 0x0F09, 0xF1F8, 0xF108, 0x0FF8, 0x0F08, 0x0F0B, 0xF10B, + 0x0FF6, 0xF1F6, 0x0FF5, 0x0F0A, 0xF10A, 0xF1F5, 0xF1F3, 0xF10D, 0x0FF3, + 0x0F0D, 0x0FFF, 0xF1FF, 0xF101, 0x0F01, 0x0F0F, 0xF1F1, 0x0FF1, 0xF10F, + 0x0FF2, 0xF10C, 0x0F0E, 0x0FF4, 0xF1F4, 0xF1F2, 0x0F0C, 0xF10E, }; static const uint8_t clv_mvy_3_bits[] = { - 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 13, - 13, 12, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, - 15, 15, 14, 14, 14, 13, 12, 11, 12, 13, 14, 14, 14, 15, 15, 15, - 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, - 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 12, 11, 12, 14, 14, - 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, - 16, 16, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, - 12, 11, 12, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, - 15, 16, 16, 16, 16, 16, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 13, 13, 12, 10, 12, 13, 13, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 15, 15, 15, 15, - 14, 14, 14, 14, 13, 13, 13, 13, 13, 12, 12, 10, 12, 12, 13, 13, - 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 15, 15, - 15, 15, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 11, - 10, 11, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, - 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 13, 13, 13, 13, 12, 12, - 12, 12, 12, 11, 10, 9, 10, 11, 12, 12, 12, 12, 12, 13, 13, 13, - 13, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 13, 13, - 12, 12, 12, 12, 12, 12, 12, 11, 11, 10, 9, 10, 11, 11, 12, 12, - 12, 12, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 15, 16, 15, 15, - 15, 15, 14, 14, 13, 13, 12, 12, 12, 12, 12, 11, 11, 11, 10, 9, - 10, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 14, 14, 15, 15, 15, - 15, 16, 15, 15, 14, 14, 14, 14, 14, 13, 13, 12, 12, 12, 12, 12, - 11, 11, 11, 10, 9, 10, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, - 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 14, 14, 14, 13, 13, 12, - 12, 12, 12, 12, 12, 11, 11, 11, 10, 8, 10, 11, 11, 11, 12, 12, - 12, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 15, 15, 15, 14, 14, - 14, 14, 13, 13, 12, 12, 12, 12, 12, 11, 11, 11, 10, 10, 8, 10, - 10, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 15, - 15, 15, 14, 14, 14, 14, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, - 10, 10, 9, 7, 9, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, - 13, 14, 14, 14, 14, 15, 15, 14, 14, 14, 14, 13, 13, 13, 12, 12, - 12, 12, 11, 11, 11, 10, 10, 9, 7, 9, 10, 10, 11, 11, 11, 12, - 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 14, 14, 14, 14, - 13, 13, 12, 12, 12, 12, 11, 11, 11, 11, 10, 9, 9, 7, 9, 9, - 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 15, - 15, 14, 14, 14, 13, 13, 13, 13, 12, 11, 11, 11, 11, 10, 10, 10, - 9, 8, 6, 8, 9, 10, 10, 10, 11, 11, 11, 11, 12, 13, 13, 13, - 13, 14, 14, 14, 15, 15, 14, 14, 14, 13, 13, 12, 12, 11, 11, 11, - 11, 10, 10, 9, 9, 8, 6, 4, 6, 8, 9, 9, 10, 10, 11, 11, - 11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 13, 13, 13, 12, 12, 12, - 12, 11, 10, 10, 10, 10, 9, 9, 8, 8, 7, 5, 2, 5, 7, 8, - 8, 9, 9, 10, 10, 10, 10, 11, 12, 12, 12, 12, 13, 13, 13, 15, - 14, 14, 14, 13, 13, 12, 12, 11, 11, 11, 11, 10, 10, 9, 9, 8, - 6, 4, 6, 8, 9, 9, 10, 10, 11, 11, 11, 11, 12, 12, 13, 13, - 14, 14, 14, 15, 15, 14, 14, 14, 13, 13, 13, 13, 12, 11, 11, 11, - 11, 10, 10, 10, 9, 8, 6, 8, 9, 10, 10, 10, 11, 11, 11, 11, - 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 14, 14, 14, 14, 13, 13, - 12, 12, 12, 12, 11, 11, 11, 11, 10, 9, 9, 7, 9, 9, 10, 11, - 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 14, - 14, 14, 14, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 10, 10, 9, - 7, 9, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, - 14, 14, 15, 15, 14, 14, 14, 14, 13, 13, 13, 12, 12, 12, 12, 11, - 11, 11, 10, 10, 9, 7, 9, 10, 10, 11, 11, 11, 12, 12, 12, 12, - 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 14, 14, 14, 14, 13, 13, - 12, 12, 12, 12, 12, 11, 11, 11, 10, 10, 8, 10, 10, 11, 11, 11, - 12, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, - 14, 14, 14, 13, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11, 10, 8, - 10, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 14, 14, 14, 15, - 15, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, 12, 12, 12, 12, 12, - 11, 11, 11, 10, 9, 10, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, - 14, 14, 14, 14, 14, 15, 15, 16, 15, 15, 15, 15, 14, 14, 13, 13, - 12, 12, 12, 12, 12, 11, 11, 11, 10, 9, 10, 11, 11, 11, 12, 12, - 12, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 15, 15, 15, 14, - 14, 14, 13, 13, 12, 12, 12, 12, 12, 12, 12, 11, 11, 10, 9, 10, - 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, - 15, 15, 15, 15, 15, 14, 14, 14, 13, 13, 13, 13, 12, 12, 12, 12, - 12, 11, 10, 9, 10, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, - 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, - 13, 13, 13, 13, 13, 13, 13, 11, 10, 11, 13, 13, 13, 13, 13, 13, - 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 15, 15, - 15, 15, 14, 14, 14, 14, 13, 13, 13, 13, 13, 12, 12, 10, 12, 12, - 13, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, - 16, 16, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, - 13, 12, 10, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, - 15, 15, 15, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 14, - 14, 14, 14, 14, 13, 13, 12, 11, 12, 13, 13, 14, 14, 14, 14, 14, - 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 15, 15, 15, - 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 12, 11, 12, 14, 14, - 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 13, - 12, 11, 12, 13, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, - 15, 14, 14, 13, 13, 12, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, - 15, 15, 16, 16, 16, 16, 16, 16, 16, 7, -}; - -static const uint16_t clv_mvy_3_codes[] = { - 0xFFF6, 0xFFEE, 0xFFDC, 0xFFD7, 0xFFB4, 0xFFAA, 0xFFA0, 0x7FCC, - 0x7F8E, 0x7F7B, 0x7F77, 0x7F13, 0x7F11, 0x3F56, 0x3F48, 0x1F16, - 0x1E94, 0x0F28, 0x06F0, 0x0F2A, 0x1E96, 0x1F1C, 0x3F46, 0x3F58, - 0x7F15, 0x7F0E, 0x7F76, 0x7F80, 0x7F90, 0x7FC8, 0xFFA2, 0xFFA7, - 0xFFB5, 0xFFD8, 0xFFDD, 0xFFEC, 0xFFF5, 0xFFF1, 0xFFEA, 0xFFE4, - 0xFFD1, 0xFFC1, 0xFFA8, 0x7F70, 0x7F5C, 0x7F44, 0x7F40, 0x7F2A, - 0x7F16, 0x7EDF, 0x3ED6, 0x3ECA, 0x3ECC, 0x1EB5, 0x0EDE, 0x06D3, - 0x0EDF, 0x1EB6, 0x3ECE, 0x3ED0, 0x3ED8, 0x7EE5, 0x7F19, 0x7F31, - 0x7F3E, 0x7F45, 0x7F5B, 0x7F6F, 0xFFA9, 0xFFC0, 0xFFCE, 0xFFE5, - 0xFFE8, 0xFFF2, 0xFFFE, 0xFFE2, 0xFFBE, 0x7FBB, 0x7F75, 0x7F6B, - 0x7F58, 0x7EF9, 0x7EDC, 0x3F68, 0x3F27, 0x3F28, 0x3EDF, 0x3ED2, - 0x3EC1, 0x3EA6, 0x3E87, 0x0F0F, 0x06B3, 0x0F10, 0x3E89, 0x3EA8, - 0x3EC3, 0x3ED5, 0x3EE0, 0x3F2B, 0x3F26, 0x3F67, 0x7EDA, 0x7EFB, - 0x7F56, 0x7F6A, 0x7F72, 0x7FC1, 0xFFBC, 0xFFE0, 0xFFFF, 0xFFF8, - 0xFFD3, 0xFFB9, 0x7FAC, 0x7F94, 0x7F8B, 0x7F62, 0x7F4A, 0x7F05, - 0x7EEE, 0x3F44, 0x3EA4, 0x3E78, 0x3E6F, 0x3E54, 0x1EEF, 0x1EA9, - 0x0ED4, 0x06A8, 0x0ED5, 0x1EA8, 0x1EEC, 0x3E51, 0x3E69, 0x3E75, - 0x3EA3, 0x3F43, 0x7EF1, 0x7F04, 0x7F4B, 0x7F5D, 0x7F89, 0x7F95, - 0x7FAA, 0xFFBB, 0xFFC8, 0xFFF9, 0xFFD9, 0xFFCA, 0x7FC3, 0x7F8C, - 0x7F38, 0x7F02, 0x3F5A, 0x3F4A, 0x3F30, 0x3EFF, 0x3EF4, 0x3EE9, - 0x3E95, 0x3E73, 0x3E43, 0x1F08, 0x1E81, 0x0E84, 0x0349, 0x0E85, - 0x1E82, 0x1F07, 0x3E45, 0x3E74, 0x3E96, 0x3EEA, 0x3EF1, 0x3F00, - 0x3F32, 0x3F4F, 0x3F5C, 0x7F01, 0x7F3B, 0x7F8D, 0x7FC2, 0xFFCF, - 0xFFD6, 0xFFC7, 0xFFB1, 0xFFA6, 0x7FA1, 0x7F2F, 0x7F24, 0x7F0A, - 0x3EF6, 0x3E97, 0x3E83, 0x3E7F, 0x1F04, 0x1EE1, 0x1ECB, 0x1EAE, - 0x1E7E, 0x0EBA, 0x0E8C, 0x0333, 0x0E8D, 0x0EBB, 0x1E7F, 0x1EAF, - 0x1ECC, 0x1EE2, 0x1F05, 0x3E80, 0x3E84, 0x3E98, 0x3EF9, 0x7F06, - 0x7F1B, 0x7F2D, 0x7F9F, 0xFFAF, 0xFFB0, 0xFFC6, 0x7FB5, 0x7FB1, - 0x7F36, 0x7F25, 0x3F63, 0x3F3A, 0x3F1B, 0x3EBB, 0x3E63, 0x3E5B, - 0x3E40, 0x1F14, 0x1EF5, 0x1EEB, 0x1EBE, 0x1E92, 0x1E6A, 0x070C, - 0x032D, 0x070D, 0x1E6B, 0x1E93, 0x1EBF, 0x1EE8, 0x1EF3, 0x1F15, - 0x3E3F, 0x3E5C, 0x3E64, 0x3EB9, 0x3F1C, 0x3F3C, 0x3F62, 0x7F22, - 0x7F39, 0x7FAF, 0x7FAE, 0x7FC6, 0x7F7F, 0x7F53, 0x7F32, 0x3F66, - 0x3EF0, 0x3E65, 0x1EDA, 0x1ED3, 0x1E98, 0x1E74, 0x0F20, 0x0F1D, - 0x0EEA, 0x0EA9, 0x0E70, 0x0718, 0x033E, 0x0179, 0x033F, 0x0719, - 0x0E71, 0x0EAB, 0x0EE9, 0x0F1F, 0x0F22, 0x1E76, 0x1E9B, 0x1ED5, - 0x1EDD, 0x3E68, 0x3EF3, 0x3F6C, 0x7F33, 0x7F4E, 0x7F7D, 0x7FCB, - 0x7FBD, 0x7F21, 0x7EF6, 0x3F0C, 0x3EBE, 0x3EAE, 0x1EA3, 0x1E85, - 0x0F0C, 0x0F06, 0x0EEE, 0x0EE6, 0x0ECA, 0x0EA2, 0x0E78, 0x0720, - 0x06BA, 0x0326, 0x015D, 0x0327, 0x06BB, 0x0721, 0x0E79, 0x0EA3, - 0x0ECB, 0x0EE7, 0x0EEF, 0x0F07, 0x0F0D, 0x1E86, 0x1EA4, 0x3EAF, - 0x3EBF, 0x3F0A, 0x7EF8, 0x7F1E, 0x7FBF, 0xFF9F, 0x7FB3, 0x7F96, - 0x7F0B, 0x7EF5, 0x3E85, 0x3E4E, 0x1EB3, 0x1E6E, 0x0F2D, 0x0EBD, - 0x0E97, 0x0E93, 0x0E86, 0x071A, 0x06E4, 0x06BC, 0x0338, 0x015A, - 0x0339, 0x06BD, 0x06E5, 0x071B, 0x0E87, 0x0E94, 0x0E98, 0x0EBE, - 0x0F2E, 0x1E6F, 0x1EB4, 0x3E4F, 0x3E88, 0x7EF4, 0x7F07, 0x7F99, - 0x7FB7, 0xFF9D, 0x7FA8, 0x7EEB, 0x3F5D, 0x3EB2, 0x3EAA, 0x3E5D, - 0x3E49, 0x1EFE, 0x1E89, 0x0F16, 0x0F12, 0x0EE0, 0x0E7A, 0x0E6A, - 0x070E, 0x06FA, 0x06B4, 0x0314, 0x0158, 0x0315, 0x06B5, 0x06FB, - 0x070F, 0x0E6B, 0x0E7B, 0x0EE1, 0x0F13, 0x0F17, 0x1E8A, 0x1EFF, - 0x3E4A, 0x3E5E, 0x3EAB, 0x3EB3, 0x3F59, 0x7EEC, 0x7FA2, 0x7F82, - 0x7F5E, 0x7F28, 0x3EDA, 0x3EC9, 0x3E7A, 0x1ED6, 0x1ECE, 0x0EFC, - 0x0EF0, 0x0E9A, 0x0E7E, 0x0E66, 0x0E5E, 0x0722, 0x06C0, 0x06A0, - 0x02FA, 0x00A8, 0x02FB, 0x06A1, 0x06C1, 0x0723, 0x0E5F, 0x0E67, - 0x0E7F, 0x0E9B, 0x0EF1, 0x0EFD, 0x1ECF, 0x1ED7, 0x3E79, 0x3ECD, - 0x3EDB, 0x7F26, 0x7F5A, 0x7F83, 0x7F54, 0x7EE8, 0x3F54, 0x3F0E, - 0x3EFB, 0x3E47, 0x1EC1, 0x1EB9, 0x0EF9, 0x0EF3, 0x0EC1, 0x0E8F, - 0x0E74, 0x0714, 0x06F4, 0x06B0, 0x0336, 0x030A, 0x009F, 0x030B, - 0x0337, 0x06B1, 0x06F5, 0x0715, 0x0E75, 0x0E91, 0x0EC3, 0x0EF6, - 0x0EFB, 0x1EBB, 0x1EC3, 0x3E41, 0x3EF8, 0x3F10, 0x3F4D, 0x7EE9, - 0x7F52, 0x7F9A, 0x3F3F, 0x3F1F, 0x3F03, 0x3EA0, 0x1F0F, 0x1E72, - 0x1E62, 0x0EDA, 0x0ED2, 0x0EB2, 0x0E64, 0x0708, 0x06EA, 0x06DA, - 0x0346, 0x032A, 0x0176, 0x004B, 0x0177, 0x032B, 0x0347, 0x06DB, - 0x06EB, 0x0709, 0x0E65, 0x0EB3, 0x0ED3, 0x0EDB, 0x1E63, 0x1E6C, - 0x1F0E, 0x3E9E, 0x3F01, 0x3F1D, 0x3F3D, 0x7F9B, 0x7EDE, 0x3F36, - 0x3F2E, 0x3F07, 0x3E99, 0x1F0D, 0x1EA1, 0x1E8C, 0x0EB4, 0x0EAC, - 0x0E5A, 0x0E50, 0x0702, 0x06D4, 0x06C6, 0x032E, 0x0310, 0x0162, - 0x0046, 0x0163, 0x0311, 0x032F, 0x06C7, 0x06D5, 0x0703, 0x0E51, - 0x0E5B, 0x0EAD, 0x0EB5, 0x1E8F, 0x1EA7, 0x1F0C, 0x3E9A, 0x3F02, - 0x3F2D, 0x3F35, 0x7EE0, 0x7F66, 0x3F11, 0x3EE1, 0x3EBC, 0x3E56, - 0x1EC4, 0x1E64, 0x0F04, 0x0EC7, 0x0E56, 0x0E4C, 0x06EC, 0x06DC, - 0x069C, 0x0694, 0x0320, 0x016C, 0x0154, 0x0044, 0x0155, 0x016D, - 0x0321, 0x0695, 0x069D, 0x06DD, 0x06ED, 0x0E4D, 0x0E57, 0x0EC4, - 0x0F05, 0x1E65, 0x1EC5, 0x3E55, 0x3EB7, 0x3EE3, 0x3F13, 0x7F67, - 0x7FA7, 0x3F49, 0x3F22, 0x3EE5, 0x1EF6, 0x1EE5, 0x1E9C, 0x1E78, - 0x0EA4, 0x06F6, 0x06DE, 0x06CE, 0x06AA, 0x0340, 0x0318, 0x02FE, - 0x015E, 0x009A, 0x001C, 0x009B, 0x015F, 0x02FF, 0x0319, 0x0341, - 0x06AB, 0x06CF, 0x06DF, 0x06F7, 0x0EA5, 0x1E79, 0x1E9D, 0x1EE7, - 0x1EF7, 0x3EE6, 0x3F23, 0x3F4B, 0x7FA3, 0x7F49, 0x3F14, 0x3E8D, - 0x3E6B, 0x1F17, 0x1EF8, 0x0F24, 0x0ECC, 0x06FE, 0x06CA, 0x06A4, - 0x0698, 0x030C, 0x0302, 0x0170, 0x0168, 0x00A0, 0x001E, 0x0004, - 0x001F, 0x00A1, 0x0169, 0x0171, 0x0303, 0x030D, 0x0699, 0x06A5, - 0x06CB, 0x06FF, 0x0ECD, 0x0F25, 0x1EF9, 0x1F18, 0x3E6C, 0x3E8E, - 0x3F15, 0x7F46, 0x1EF0, 0x1EDE, 0x1EC8, 0x0F1A, 0x0F00, 0x0E9E, - 0x0E54, 0x06C4, 0x031E, 0x031C, 0x0306, 0x02F8, 0x017A, 0x0166, - 0x00A6, 0x00A4, 0x0048, 0x000C, 0x0000, 0x000D, 0x0049, 0x00A5, - 0x00A7, 0x0167, 0x017B, 0x02F9, 0x0307, 0x031D, 0x031F, 0x06C5, - 0x0E55, 0x0E9F, 0x0F01, 0x0F1B, 0x1EC9, 0x1EDF, 0x1EF1, 0x7F47, - 0x3F12, 0x3E8F, 0x3E6D, 0x1F1B, 0x1EFA, 0x0F26, 0x0ECE, 0x0700, - 0x06CC, 0x06A6, 0x069A, 0x030E, 0x0304, 0x0172, 0x016A, 0x00A2, - 0x0020, 0x0005, 0x0021, 0x00A3, 0x016B, 0x0173, 0x0305, 0x030F, - 0x069B, 0x06A7, 0x06CD, 0x0701, 0x0ECF, 0x0F27, 0x1EFB, 0x1F1D, - 0x3E6E, 0x3E90, 0x3F17, 0x7F48, 0x7FA9, 0x3F50, 0x3F24, 0x3EE7, - 0x1EFC, 0x1EE9, 0x1E9E, 0x1E7A, 0x0EA6, 0x06F8, 0x06E0, 0x06D0, - 0x06AC, 0x0342, 0x031A, 0x0300, 0x0160, 0x009C, 0x001D, 0x009D, - 0x0161, 0x0301, 0x031B, 0x0343, 0x06AD, 0x06D1, 0x06E1, 0x06F9, - 0x0EA7, 0x1E7B, 0x1E9F, 0x1EEA, 0x1EFD, 0x3EE8, 0x3F21, 0x3F52, - 0x7F9E, 0x7F68, 0x3F16, 0x3EE2, 0x3EBA, 0x3E57, 0x1EC6, 0x1E66, - 0x0F08, 0x0EC5, 0x0E58, 0x0E4E, 0x06EE, 0x06E2, 0x069E, 0x0696, - 0x0322, 0x016E, 0x0156, 0x0045, 0x0157, 0x016F, 0x0323, 0x0697, - 0x069F, 0x06E3, 0x06EF, 0x0E4F, 0x0E59, 0x0EC6, 0x0F09, 0x1E67, - 0x1EC7, 0x3E58, 0x3EB8, 0x3EE4, 0x3F18, 0x7F69, 0x7EE2, 0x3F38, - 0x3F33, 0x3F04, 0x3E9C, 0x1F0A, 0x1EA5, 0x1E8D, 0x0EB6, 0x0EAE, - 0x0E5C, 0x0E52, 0x0704, 0x06D6, 0x06C8, 0x0330, 0x0312, 0x0164, - 0x0047, 0x0165, 0x0313, 0x0331, 0x06C9, 0x06D7, 0x0705, 0x0E53, - 0x0E5D, 0x0EAF, 0x0EB7, 0x1E8E, 0x1EA6, 0x1F0B, 0x3E9B, 0x3F05, - 0x3F31, 0x3F39, 0x7EE1, 0x7F9C, 0x3F40, 0x3F1E, 0x3F06, 0x3E9D, - 0x1F10, 0x1E70, 0x1E60, 0x0ED8, 0x0ED0, 0x0EB0, 0x0E62, 0x0706, - 0x06E8, 0x06D8, 0x0344, 0x0328, 0x0174, 0x004A, 0x0175, 0x0329, - 0x0345, 0x06D9, 0x06E9, 0x0707, 0x0E63, 0x0EB1, 0x0ED1, 0x0ED9, - 0x1E61, 0x1E71, 0x1F11, 0x3E9F, 0x3F08, 0x3F20, 0x3F3E, 0x7F9D, - 0x7F4F, 0x7EE6, 0x3F53, 0x3F0D, 0x3EFA, 0x3E46, 0x1EC0, 0x1EB8, - 0x0EF8, 0x0EF2, 0x0EC0, 0x0E8E, 0x0E72, 0x0712, 0x06F2, 0x06AE, - 0x0334, 0x0308, 0x009E, 0x0309, 0x0335, 0x06AF, 0x06F3, 0x0713, - 0x0E73, 0x0E90, 0x0EC2, 0x0EF4, 0x0EFA, 0x1EBA, 0x1EC2, 0x3E48, - 0x3EFC, 0x3F0B, 0x3F51, 0x7EE7, 0x7F51, 0x7F84, 0x7F61, 0x7F27, - 0x3EDC, 0x3EC5, 0x3E7C, 0x1ED8, 0x1ED0, 0x0EFE, 0x0EF5, 0x0E9C, - 0x0E80, 0x0E68, 0x0E60, 0x0724, 0x06C2, 0x06A2, 0x02FC, 0x00A9, - 0x02FD, 0x06A3, 0x06C3, 0x0725, 0x0E61, 0x0E69, 0x0E81, 0x0E9D, - 0x0EF7, 0x0EFF, 0x1ED1, 0x1ED9, 0x3E7B, 0x3ECF, 0x3ED9, 0x7F29, - 0x7F65, 0x7F85, 0x7FA0, 0x7EEA, 0x3F60, 0x3EB4, 0x3EAC, 0x3E5F, - 0x3E4B, 0x1F00, 0x1E8B, 0x0F18, 0x0F14, 0x0EE2, 0x0E7C, 0x0E6C, - 0x0710, 0x06FC, 0x06B6, 0x0316, 0x0159, 0x0317, 0x06B7, 0x06FD, - 0x0711, 0x0E6D, 0x0E7D, 0x0EE3, 0x0F15, 0x0F19, 0x1E88, 0x1F01, - 0x3E4C, 0x3E60, 0x3EA9, 0x3EB1, 0x3F5B, 0x7EED, 0x7FA5, 0xFF9E, - 0x7FBE, 0x7F98, 0x7F0D, 0x7EF3, 0x3E8C, 0x3E50, 0x1EB7, 0x1E73, - 0x0F2F, 0x0EBF, 0x0E99, 0x0E95, 0x0E88, 0x071C, 0x06E6, 0x06BE, - 0x033A, 0x015B, 0x033B, 0x06BF, 0x06E7, 0x071D, 0x0E89, 0x0E92, - 0x0E96, 0x0EBC, 0x0F2C, 0x1E6D, 0x1EB0, 0x3E4D, 0x3E8B, 0x7EF2, - 0x7F08, 0x7F97, 0x7FB0, 0xFF9C, 0x7FB2, 0x7F23, 0x7EFA, 0x3F0F, - 0x3EBD, 0x3EAD, 0x1EA0, 0x1E87, 0x0F0A, 0x0F02, 0x0EED, 0x0EE4, - 0x0EC8, 0x0EA0, 0x0E76, 0x071E, 0x06B8, 0x0324, 0x015C, 0x0325, - 0x06B9, 0x071F, 0x0E77, 0x0EA1, 0x0EC9, 0x0EE5, 0x0EEC, 0x0F03, - 0x0F0B, 0x1E84, 0x1EA2, 0x3EB0, 0x3EC4, 0x3F09, 0x7EF7, 0x7F1D, - 0x7FBC, 0x7FCD, 0x7F81, 0x7F50, 0x7F34, 0x3F65, 0x3EED, 0x3E67, - 0x1EDB, 0x1ED2, 0x1E99, 0x1E77, 0x0F21, 0x0F1C, 0x0EE8, 0x0EA8, - 0x0E6E, 0x0716, 0x033C, 0x0178, 0x033D, 0x0717, 0x0E6F, 0x0EAA, - 0x0EEB, 0x0F1E, 0x0F23, 0x1E75, 0x1E9A, 0x1ED4, 0x1EDC, 0x3E66, - 0x3EEE, 0x3F6B, 0x7F35, 0x7F55, 0x7F7A, 0x7FCA, 0x7FB6, 0x7FB8, - 0x7F37, 0x7F1F, 0x3F61, 0x3F37, 0x3F1A, 0x3EB5, 0x3E62, 0x3E5A, - 0x1F1E, 0x1F13, 0x1EF2, 0x1EE6, 0x1EBC, 0x1E91, 0x1E68, 0x070A, - 0x032C, 0x070B, 0x1E69, 0x1E90, 0x1EBD, 0x1EE4, 0x1EF4, 0x1F12, - 0x3E3E, 0x3E59, 0x3E61, 0x3EB6, 0x3F19, 0x3F3B, 0x3F64, 0x7F1C, - 0x7F3D, 0x7FB4, 0x7FB9, 0xFFC5, 0xFFB6, 0xFFAD, 0x7FA4, 0x7F2C, - 0x7F20, 0x7F09, 0x3EF5, 0x3E93, 0x3E82, 0x3E7E, 0x1F02, 0x1EE3, - 0x1ECA, 0x1EAD, 0x1E7C, 0x0EB8, 0x0E8A, 0x0332, 0x0E8B, 0x0EB9, - 0x1E7D, 0x1EAC, 0x1ECD, 0x1EE0, 0x1F03, 0x3E7D, 0x3E81, 0x3E91, - 0x3EF7, 0x7F0C, 0x7F1A, 0x7F2E, 0x7FA6, 0xFFA4, 0xFFB7, 0xFFC4, - 0xFFD4, 0xFFCC, 0x7FC5, 0x7F8A, 0x7F3C, 0x7EFF, 0x3F5E, 0x3F4E, - 0x3F2F, 0x3EFD, 0x3EEF, 0x3EEB, 0x3E92, 0x3E71, 0x3E42, 0x1F09, - 0x1E83, 0x0E82, 0x0348, 0x0E83, 0x1E80, 0x1F06, 0x3E44, 0x3E72, - 0x3E94, 0x3EEC, 0x3EF2, 0x3EFE, 0x3F34, 0x3F4C, 0x3F5F, 0x7EFE, - 0x7F3A, 0x7F86, 0x7FC4, 0xFFD2, 0xFFD5, 0xFFFA, 0xFFCD, 0xFFBA, - 0x7FAB, 0x7F92, 0x7F87, 0x7F63, 0x7F4C, 0x7F03, 0x7EF0, 0x3F42, - 0x3EA1, 0x3E76, 0x3E6A, 0x3E52, 0x1EEE, 0x1EAB, 0x0ED6, 0x06A9, - 0x0ED7, 0x1EAA, 0x1EED, 0x3E53, 0x3E70, 0x3E77, 0x3EA2, 0x3F41, - 0x7EEF, 0x7F00, 0x7F4D, 0x7F60, 0x7F88, 0x7F93, 0x7FAD, 0xFFB8, - 0xFFCB, 0xFFFB, 0xFFFC, 0xFFE1, 0xFFBF, 0x7FBA, 0x7F73, 0x7F6C, - 0x7F57, 0x7EFC, 0x7EDD, 0x3F6A, 0x3F2A, 0x3F25, 0x3EDD, 0x3ED3, - 0x3EC2, 0x3EA7, 0x3E86, 0x0F11, 0x06B2, 0x0F0E, 0x3E8A, 0x3EA5, - 0x3EC0, 0x3ED1, 0x3EDE, 0x3F2C, 0x3F29, 0x3F69, 0x7EDB, 0x7EFD, - 0x7F59, 0x7F6D, 0x7F74, 0x7FC0, 0xFFC3, 0xFFE3, 0xFFFD, 0xFFF0, - 0xFFE9, 0xFFE7, 0xFFC9, 0xFFBD, 0xFFAE, 0x7F71, 0x7F5F, 0x7F42, - 0x7F41, 0x7F30, 0x7F17, 0x7EE4, 0x3ED7, 0x3EC7, 0x3ECB, 0x1EB1, - 0x0EDC, 0x06D2, 0x0EDD, 0x1EB2, 0x3EC6, 0x3EC8, 0x3ED4, 0x7EE3, - 0x7F18, 0x7F2B, 0x7F3F, 0x7F43, 0x7F64, 0x7F6E, 0xFFAB, 0xFFC2, - 0xFFD0, 0xFFE6, 0xFFEF, 0xFFF3, 0xFFF7, 0xFFEB, 0xFFDE, 0xFFDA, - 0xFFB3, 0xFFAC, 0xFFA3, 0x7FC9, 0x7F8F, 0x7F7C, 0x7F79, 0x7F0F, - 0x7F10, 0x3F55, 0x3F45, 0x1F1A, 0x1E95, 0x0F2B, 0x06F1, 0x0F29, - 0x1E97, 0x1F19, 0x3F47, 0x3F57, 0x7F14, 0x7F12, 0x7F78, 0x7F7E, - 0x7F91, 0x7FC7, 0xFFA1, 0xFFA5, 0xFFB2, 0xFFDB, 0xFFDF, 0xFFED, - 0xFFF4, 0x004C, + 2, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16 }; static const uint16_t clv_mvy_3_syms[] = { - 0xEEEE, 0xEFEE, 0xF0EE, 0xF1EE, 0xF2EE, 0xF3EE, 0xF4EE, 0xF5EE, - 0xF6EE, 0xF7EE, 0xF8EE, 0xF9EE, 0xFAEE, 0xFBEE, 0xFCEE, 0xFDEE, - 0xFEEE, 0xFFEE, 0x00EE, 0x01EE, 0x02EE, 0x03EE, 0x04EE, 0x05EE, - 0x06EE, 0x07EE, 0x08EE, 0x09EE, 0x0AEE, 0x0BEE, 0x0CEE, 0x0DEE, - 0x0EEE, 0x0FEE, 0x10EE, 0x11EE, 0x12EE, 0xEEEF, 0xEFEF, 0xF0EF, - 0xF1EF, 0xF2EF, 0xF3EF, 0xF4EF, 0xF5EF, 0xF6EF, 0xF7EF, 0xF8EF, - 0xF9EF, 0xFAEF, 0xFBEF, 0xFCEF, 0xFDEF, 0xFEEF, 0xFFEF, 0x00EF, - 0x01EF, 0x02EF, 0x03EF, 0x04EF, 0x05EF, 0x06EF, 0x07EF, 0x08EF, - 0x09EF, 0x0AEF, 0x0BEF, 0x0CEF, 0x0DEF, 0x0EEF, 0x0FEF, 0x10EF, - 0x11EF, 0x12EF, 0xEEF0, 0xEFF0, 0xF0F0, 0xF1F0, 0xF2F0, 0xF3F0, - 0xF4F0, 0xF5F0, 0xF6F0, 0xF7F0, 0xF8F0, 0xF9F0, 0xFAF0, 0xFBF0, - 0xFCF0, 0xFDF0, 0xFEF0, 0xFFF0, 0x00F0, 0x01F0, 0x02F0, 0x03F0, - 0x04F0, 0x05F0, 0x06F0, 0x07F0, 0x08F0, 0x09F0, 0x0AF0, 0x0BF0, - 0x0CF0, 0x0DF0, 0x0EF0, 0x0FF0, 0x10F0, 0x11F0, 0x12F0, 0xEEF1, - 0xEFF1, 0xF0F1, 0xF1F1, 0xF2F1, 0xF3F1, 0xF4F1, 0xF5F1, 0xF6F1, - 0xF7F1, 0xF8F1, 0xF9F1, 0xFAF1, 0xFBF1, 0xFCF1, 0xFDF1, 0xFEF1, - 0xFFF1, 0x00F1, 0x01F1, 0x02F1, 0x03F1, 0x04F1, 0x05F1, 0x06F1, - 0x07F1, 0x08F1, 0x09F1, 0x0AF1, 0x0BF1, 0x0CF1, 0x0DF1, 0x0EF1, - 0x0FF1, 0x10F1, 0x11F1, 0x12F1, 0xEEF2, 0xEFF2, 0xF0F2, 0xF1F2, - 0xF2F2, 0xF3F2, 0xF4F2, 0xF5F2, 0xF6F2, 0xF7F2, 0xF8F2, 0xF9F2, - 0xFAF2, 0xFBF2, 0xFCF2, 0xFDF2, 0xFEF2, 0xFFF2, 0x00F2, 0x01F2, - 0x02F2, 0x03F2, 0x04F2, 0x05F2, 0x06F2, 0x07F2, 0x08F2, 0x09F2, - 0x0AF2, 0x0BF2, 0x0CF2, 0x0DF2, 0x0EF2, 0x0FF2, 0x10F2, 0x11F2, - 0x12F2, 0xEEF3, 0xEFF3, 0xF0F3, 0xF1F3, 0xF2F3, 0xF3F3, 0xF4F3, - 0xF5F3, 0xF6F3, 0xF7F3, 0xF8F3, 0xF9F3, 0xFAF3, 0xFBF3, 0xFCF3, - 0xFDF3, 0xFEF3, 0xFFF3, 0x00F3, 0x01F3, 0x02F3, 0x03F3, 0x04F3, - 0x05F3, 0x06F3, 0x07F3, 0x08F3, 0x09F3, 0x0AF3, 0x0BF3, 0x0CF3, - 0x0DF3, 0x0EF3, 0x0FF3, 0x10F3, 0x11F3, 0x12F3, 0xEEF4, 0xEFF4, - 0xF0F4, 0xF1F4, 0xF2F4, 0xF3F4, 0xF4F4, 0xF5F4, 0xF6F4, 0xF7F4, - 0xF8F4, 0xF9F4, 0xFAF4, 0xFBF4, 0xFCF4, 0xFDF4, 0xFEF4, 0xFFF4, - 0x00F4, 0x01F4, 0x02F4, 0x03F4, 0x04F4, 0x05F4, 0x06F4, 0x07F4, - 0x08F4, 0x09F4, 0x0AF4, 0x0BF4, 0x0CF4, 0x0DF4, 0x0EF4, 0x0FF4, - 0x10F4, 0x11F4, 0x12F4, 0xEEF5, 0xEFF5, 0xF0F5, 0xF1F5, 0xF2F5, - 0xF3F5, 0xF4F5, 0xF5F5, 0xF6F5, 0xF7F5, 0xF8F5, 0xF9F5, 0xFAF5, - 0xFBF5, 0xFCF5, 0xFDF5, 0xFEF5, 0xFFF5, 0x00F5, 0x01F5, 0x02F5, - 0x03F5, 0x04F5, 0x05F5, 0x06F5, 0x07F5, 0x08F5, 0x09F5, 0x0AF5, - 0x0BF5, 0x0CF5, 0x0DF5, 0x0EF5, 0x0FF5, 0x10F5, 0x11F5, 0x12F5, - 0xEEF6, 0xEFF6, 0xF0F6, 0xF1F6, 0xF2F6, 0xF3F6, 0xF4F6, 0xF5F6, - 0xF6F6, 0xF7F6, 0xF8F6, 0xF9F6, 0xFAF6, 0xFBF6, 0xFCF6, 0xFDF6, - 0xFEF6, 0xFFF6, 0x00F6, 0x01F6, 0x02F6, 0x03F6, 0x04F6, 0x05F6, - 0x06F6, 0x07F6, 0x08F6, 0x09F6, 0x0AF6, 0x0BF6, 0x0CF6, 0x0DF6, - 0x0EF6, 0x0FF6, 0x10F6, 0x11F6, 0x12F6, 0xEEF7, 0xEFF7, 0xF0F7, - 0xF1F7, 0xF2F7, 0xF3F7, 0xF4F7, 0xF5F7, 0xF6F7, 0xF7F7, 0xF8F7, - 0xF9F7, 0xFAF7, 0xFBF7, 0xFCF7, 0xFDF7, 0xFEF7, 0xFFF7, 0x00F7, - 0x01F7, 0x02F7, 0x03F7, 0x04F7, 0x05F7, 0x06F7, 0x07F7, 0x08F7, - 0x09F7, 0x0AF7, 0x0BF7, 0x0CF7, 0x0DF7, 0x0EF7, 0x0FF7, 0x10F7, - 0x11F7, 0x12F7, 0xEEF8, 0xEFF8, 0xF0F8, 0xF1F8, 0xF2F8, 0xF3F8, - 0xF4F8, 0xF5F8, 0xF6F8, 0xF7F8, 0xF8F8, 0xF9F8, 0xFAF8, 0xFBF8, - 0xFCF8, 0xFDF8, 0xFEF8, 0xFFF8, 0x00F8, 0x01F8, 0x02F8, 0x03F8, - 0x04F8, 0x05F8, 0x06F8, 0x07F8, 0x08F8, 0x09F8, 0x0AF8, 0x0BF8, - 0x0CF8, 0x0DF8, 0x0EF8, 0x0FF8, 0x10F8, 0x11F8, 0x12F8, 0xEEF9, - 0xEFF9, 0xF0F9, 0xF1F9, 0xF2F9, 0xF3F9, 0xF4F9, 0xF5F9, 0xF6F9, - 0xF7F9, 0xF8F9, 0xF9F9, 0xFAF9, 0xFBF9, 0xFCF9, 0xFDF9, 0xFEF9, - 0xFFF9, 0x00F9, 0x01F9, 0x02F9, 0x03F9, 0x04F9, 0x05F9, 0x06F9, - 0x07F9, 0x08F9, 0x09F9, 0x0AF9, 0x0BF9, 0x0CF9, 0x0DF9, 0x0EF9, - 0x0FF9, 0x10F9, 0x11F9, 0x12F9, 0xEEFA, 0xEFFA, 0xF0FA, 0xF1FA, - 0xF2FA, 0xF3FA, 0xF4FA, 0xF5FA, 0xF6FA, 0xF7FA, 0xF8FA, 0xF9FA, - 0xFAFA, 0xFBFA, 0xFCFA, 0xFDFA, 0xFEFA, 0xFFFA, 0x00FA, 0x01FA, - 0x02FA, 0x03FA, 0x04FA, 0x05FA, 0x06FA, 0x07FA, 0x08FA, 0x09FA, - 0x0AFA, 0x0BFA, 0x0CFA, 0x0DFA, 0x0EFA, 0x0FFA, 0x10FA, 0x11FA, - 0x12FA, 0xEEFB, 0xEFFB, 0xF0FB, 0xF1FB, 0xF2FB, 0xF3FB, 0xF4FB, - 0xF5FB, 0xF6FB, 0xF7FB, 0xF8FB, 0xF9FB, 0xFAFB, 0xFBFB, 0xFCFB, - 0xFDFB, 0xFEFB, 0xFFFB, 0x00FB, 0x01FB, 0x02FB, 0x03FB, 0x04FB, - 0x05FB, 0x06FB, 0x07FB, 0x08FB, 0x09FB, 0x0AFB, 0x0BFB, 0x0CFB, - 0x0DFB, 0x0EFB, 0x0FFB, 0x10FB, 0x11FB, 0x12FB, 0xEEFC, 0xEFFC, - 0xF0FC, 0xF1FC, 0xF2FC, 0xF3FC, 0xF4FC, 0xF5FC, 0xF6FC, 0xF7FC, - 0xF8FC, 0xF9FC, 0xFAFC, 0xFBFC, 0xFCFC, 0xFDFC, 0xFEFC, 0xFFFC, - 0x00FC, 0x01FC, 0x02FC, 0x03FC, 0x04FC, 0x05FC, 0x06FC, 0x07FC, - 0x08FC, 0x09FC, 0x0AFC, 0x0BFC, 0x0CFC, 0x0DFC, 0x0EFC, 0x0FFC, - 0x10FC, 0x11FC, 0x12FC, 0xEEFD, 0xEFFD, 0xF0FD, 0xF1FD, 0xF2FD, - 0xF3FD, 0xF4FD, 0xF5FD, 0xF6FD, 0xF7FD, 0xF8FD, 0xF9FD, 0xFAFD, - 0xFBFD, 0xFCFD, 0xFDFD, 0xFEFD, 0xFFFD, 0x00FD, 0x01FD, 0x02FD, - 0x03FD, 0x04FD, 0x05FD, 0x06FD, 0x07FD, 0x08FD, 0x09FD, 0x0AFD, - 0x0BFD, 0x0CFD, 0x0DFD, 0x0EFD, 0x0FFD, 0x10FD, 0x11FD, 0x12FD, - 0xEEFE, 0xEFFE, 0xF0FE, 0xF1FE, 0xF2FE, 0xF3FE, 0xF4FE, 0xF5FE, - 0xF6FE, 0xF7FE, 0xF8FE, 0xF9FE, 0xFAFE, 0xFBFE, 0xFCFE, 0xFDFE, - 0xFEFE, 0xFFFE, 0x00FE, 0x01FE, 0x02FE, 0x03FE, 0x04FE, 0x05FE, - 0x06FE, 0x07FE, 0x08FE, 0x09FE, 0x0AFE, 0x0BFE, 0x0CFE, 0x0DFE, - 0x0EFE, 0x0FFE, 0x10FE, 0x11FE, 0x12FE, 0xEEFF, 0xEFFF, 0xF0FF, - 0xF1FF, 0xF2FF, 0xF3FF, 0xF4FF, 0xF5FF, 0xF6FF, 0xF7FF, 0xF8FF, - 0xF9FF, 0xFAFF, 0xFBFF, 0xFCFF, 0xFDFF, 0xFEFF, 0xFFFF, 0x00FF, - 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF, 0x07FF, 0x08FF, - 0x09FF, 0x0AFF, 0x0BFF, 0x0CFF, 0x0DFF, 0x0EFF, 0x0FFF, 0x10FF, - 0x11FF, 0x12FF, 0xEE00, 0xEF00, 0xF000, 0xF100, 0xF200, 0xF300, - 0xF400, 0xF500, 0xF600, 0xF700, 0xF800, 0xF900, 0xFA00, 0xFB00, - 0xFC00, 0xFD00, 0xFE00, 0xFF00, 0x0000, 0x0100, 0x0200, 0x0300, - 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0x0A00, 0x0B00, - 0x0C00, 0x0D00, 0x0E00, 0x0F00, 0x1000, 0x1100, 0x1200, 0xEE01, - 0xEF01, 0xF001, 0xF101, 0xF201, 0xF301, 0xF401, 0xF501, 0xF601, - 0xF701, 0xF801, 0xF901, 0xFA01, 0xFB01, 0xFC01, 0xFD01, 0xFE01, - 0xFF01, 0x0001, 0x0101, 0x0201, 0x0301, 0x0401, 0x0501, 0x0601, - 0x0701, 0x0801, 0x0901, 0x0A01, 0x0B01, 0x0C01, 0x0D01, 0x0E01, - 0x0F01, 0x1001, 0x1101, 0x1201, 0xEE02, 0xEF02, 0xF002, 0xF102, - 0xF202, 0xF302, 0xF402, 0xF502, 0xF602, 0xF702, 0xF802, 0xF902, - 0xFA02, 0xFB02, 0xFC02, 0xFD02, 0xFE02, 0xFF02, 0x0002, 0x0102, - 0x0202, 0x0302, 0x0402, 0x0502, 0x0602, 0x0702, 0x0802, 0x0902, - 0x0A02, 0x0B02, 0x0C02, 0x0D02, 0x0E02, 0x0F02, 0x1002, 0x1102, - 0x1202, 0xEE03, 0xEF03, 0xF003, 0xF103, 0xF203, 0xF303, 0xF403, - 0xF503, 0xF603, 0xF703, 0xF803, 0xF903, 0xFA03, 0xFB03, 0xFC03, - 0xFD03, 0xFE03, 0xFF03, 0x0003, 0x0103, 0x0203, 0x0303, 0x0403, - 0x0503, 0x0603, 0x0703, 0x0803, 0x0903, 0x0A03, 0x0B03, 0x0C03, - 0x0D03, 0x0E03, 0x0F03, 0x1003, 0x1103, 0x1203, 0xEE04, 0xEF04, - 0xF004, 0xF104, 0xF204, 0xF304, 0xF404, 0xF504, 0xF604, 0xF704, - 0xF804, 0xF904, 0xFA04, 0xFB04, 0xFC04, 0xFD04, 0xFE04, 0xFF04, - 0x0004, 0x0104, 0x0204, 0x0304, 0x0404, 0x0504, 0x0604, 0x0704, - 0x0804, 0x0904, 0x0A04, 0x0B04, 0x0C04, 0x0D04, 0x0E04, 0x0F04, - 0x1004, 0x1104, 0x1204, 0xEE05, 0xEF05, 0xF005, 0xF105, 0xF205, - 0xF305, 0xF405, 0xF505, 0xF605, 0xF705, 0xF805, 0xF905, 0xFA05, - 0xFB05, 0xFC05, 0xFD05, 0xFE05, 0xFF05, 0x0005, 0x0105, 0x0205, - 0x0305, 0x0405, 0x0505, 0x0605, 0x0705, 0x0805, 0x0905, 0x0A05, - 0x0B05, 0x0C05, 0x0D05, 0x0E05, 0x0F05, 0x1005, 0x1105, 0x1205, - 0xEE06, 0xEF06, 0xF006, 0xF106, 0xF206, 0xF306, 0xF406, 0xF506, - 0xF606, 0xF706, 0xF806, 0xF906, 0xFA06, 0xFB06, 0xFC06, 0xFD06, - 0xFE06, 0xFF06, 0x0006, 0x0106, 0x0206, 0x0306, 0x0406, 0x0506, - 0x0606, 0x0706, 0x0806, 0x0906, 0x0A06, 0x0B06, 0x0C06, 0x0D06, - 0x0E06, 0x0F06, 0x1006, 0x1106, 0x1206, 0xEE07, 0xEF07, 0xF007, - 0xF107, 0xF207, 0xF307, 0xF407, 0xF507, 0xF607, 0xF707, 0xF807, - 0xF907, 0xFA07, 0xFB07, 0xFC07, 0xFD07, 0xFE07, 0xFF07, 0x0007, - 0x0107, 0x0207, 0x0307, 0x0407, 0x0507, 0x0607, 0x0707, 0x0807, - 0x0907, 0x0A07, 0x0B07, 0x0C07, 0x0D07, 0x0E07, 0x0F07, 0x1007, - 0x1107, 0x1207, 0xEE08, 0xEF08, 0xF008, 0xF108, 0xF208, 0xF308, - 0xF408, 0xF508, 0xF608, 0xF708, 0xF808, 0xF908, 0xFA08, 0xFB08, - 0xFC08, 0xFD08, 0xFE08, 0xFF08, 0x0008, 0x0108, 0x0208, 0x0308, - 0x0408, 0x0508, 0x0608, 0x0708, 0x0808, 0x0908, 0x0A08, 0x0B08, - 0x0C08, 0x0D08, 0x0E08, 0x0F08, 0x1008, 0x1108, 0x1208, 0xEE09, - 0xEF09, 0xF009, 0xF109, 0xF209, 0xF309, 0xF409, 0xF509, 0xF609, - 0xF709, 0xF809, 0xF909, 0xFA09, 0xFB09, 0xFC09, 0xFD09, 0xFE09, - 0xFF09, 0x0009, 0x0109, 0x0209, 0x0309, 0x0409, 0x0509, 0x0609, - 0x0709, 0x0809, 0x0909, 0x0A09, 0x0B09, 0x0C09, 0x0D09, 0x0E09, - 0x0F09, 0x1009, 0x1109, 0x1209, 0xEE0A, 0xEF0A, 0xF00A, 0xF10A, - 0xF20A, 0xF30A, 0xF40A, 0xF50A, 0xF60A, 0xF70A, 0xF80A, 0xF90A, - 0xFA0A, 0xFB0A, 0xFC0A, 0xFD0A, 0xFE0A, 0xFF0A, 0x000A, 0x010A, - 0x020A, 0x030A, 0x040A, 0x050A, 0x060A, 0x070A, 0x080A, 0x090A, - 0x0A0A, 0x0B0A, 0x0C0A, 0x0D0A, 0x0E0A, 0x0F0A, 0x100A, 0x110A, - 0x120A, 0xEE0B, 0xEF0B, 0xF00B, 0xF10B, 0xF20B, 0xF30B, 0xF40B, - 0xF50B, 0xF60B, 0xF70B, 0xF80B, 0xF90B, 0xFA0B, 0xFB0B, 0xFC0B, - 0xFD0B, 0xFE0B, 0xFF0B, 0x000B, 0x010B, 0x020B, 0x030B, 0x040B, - 0x050B, 0x060B, 0x070B, 0x080B, 0x090B, 0x0A0B, 0x0B0B, 0x0C0B, - 0x0D0B, 0x0E0B, 0x0F0B, 0x100B, 0x110B, 0x120B, 0xEE0C, 0xEF0C, - 0xF00C, 0xF10C, 0xF20C, 0xF30C, 0xF40C, 0xF50C, 0xF60C, 0xF70C, - 0xF80C, 0xF90C, 0xFA0C, 0xFB0C, 0xFC0C, 0xFD0C, 0xFE0C, 0xFF0C, - 0x000C, 0x010C, 0x020C, 0x030C, 0x040C, 0x050C, 0x060C, 0x070C, - 0x080C, 0x090C, 0x0A0C, 0x0B0C, 0x0C0C, 0x0D0C, 0x0E0C, 0x0F0C, - 0x100C, 0x110C, 0x120C, 0xEE0D, 0xEF0D, 0xF00D, 0xF10D, 0xF20D, - 0xF30D, 0xF40D, 0xF50D, 0xF60D, 0xF70D, 0xF80D, 0xF90D, 0xFA0D, - 0xFB0D, 0xFC0D, 0xFD0D, 0xFE0D, 0xFF0D, 0x000D, 0x010D, 0x020D, - 0x030D, 0x040D, 0x050D, 0x060D, 0x070D, 0x080D, 0x090D, 0x0A0D, - 0x0B0D, 0x0C0D, 0x0D0D, 0x0E0D, 0x0F0D, 0x100D, 0x110D, 0x120D, - 0xEE0E, 0xEF0E, 0xF00E, 0xF10E, 0xF20E, 0xF30E, 0xF40E, 0xF50E, - 0xF60E, 0xF70E, 0xF80E, 0xF90E, 0xFA0E, 0xFB0E, 0xFC0E, 0xFD0E, - 0xFE0E, 0xFF0E, 0x000E, 0x010E, 0x020E, 0x030E, 0x040E, 0x050E, - 0x060E, 0x070E, 0x080E, 0x090E, 0x0A0E, 0x0B0E, 0x0C0E, 0x0D0E, - 0x0E0E, 0x0F0E, 0x100E, 0x110E, 0x120E, 0xEE0F, 0xEF0F, 0xF00F, - 0xF10F, 0xF20F, 0xF30F, 0xF40F, 0xF50F, 0xF60F, 0xF70F, 0xF80F, - 0xF90F, 0xFA0F, 0xFB0F, 0xFC0F, 0xFD0F, 0xFE0F, 0xFF0F, 0x000F, - 0x010F, 0x020F, 0x030F, 0x040F, 0x050F, 0x060F, 0x070F, 0x080F, - 0x090F, 0x0A0F, 0x0B0F, 0x0C0F, 0x0D0F, 0x0E0F, 0x0F0F, 0x100F, - 0x110F, 0x120F, 0xEE10, 0xEF10, 0xF010, 0xF110, 0xF210, 0xF310, - 0xF410, 0xF510, 0xF610, 0xF710, 0xF810, 0xF910, 0xFA10, 0xFB10, - 0xFC10, 0xFD10, 0xFE10, 0xFF10, 0x0010, 0x0110, 0x0210, 0x0310, - 0x0410, 0x0510, 0x0610, 0x0710, 0x0810, 0x0910, 0x0A10, 0x0B10, - 0x0C10, 0x0D10, 0x0E10, 0x0F10, 0x1010, 0x1110, 0x1210, 0xEE11, - 0xEF11, 0xF011, 0xF111, 0xF211, 0xF311, 0xF411, 0xF511, 0xF611, - 0xF711, 0xF811, 0xF911, 0xFA11, 0xFB11, 0xFC11, 0xFD11, 0xFE11, - 0xFF11, 0x0011, 0x0111, 0x0211, 0x0311, 0x0411, 0x0511, 0x0611, - 0x0711, 0x0811, 0x0911, 0x0A11, 0x0B11, 0x0C11, 0x0D11, 0x0E11, - 0x0F11, 0x1011, 0x1111, 0x1211, 0xEE12, 0xEF12, 0xF012, 0xF112, - 0xF212, 0xF312, 0xF412, 0xF512, 0xF612, 0xF712, 0xF812, 0xF912, - 0xFA12, 0xFB12, 0xFC12, 0xFD12, 0xFE12, 0xFF12, 0x0012, 0x0112, - 0x0212, 0x0312, 0x0412, 0x0512, 0x0612, 0x0712, 0x0812, 0x0912, - 0x0A12, 0x0B12, 0x0C12, 0x0D12, 0x0E12, 0x0F12, 0x1012, 0x1112, - 0x1212, 0x1313, + 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0x00FE, 0x0002, 0xFFFF, 0x01FF, + 0xFF01, 0x0101, 0x00FD, 0x0003, 0x00FC, 0x0004, 0xFE00, 0x0200, 0x0005, + 0x00FB, 0x1313, 0xFFFE, 0x01FE, 0xFF02, 0x0102, 0x0006, 0x00FA, 0xFEFF, + 0x02FF, 0xFE01, 0x0201, 0xFD00, 0x0300, 0xFC00, 0x0400, 0x00F9, 0x0007, + 0xFFFD, 0x01FD, 0xFF03, 0x0103, 0x00F8, 0x0008, 0x00F7, 0x0009, 0x000A, + 0x00F6, 0xFEFE, 0x02FE, 0xFE02, 0x0202, 0xFFFC, 0x01FC, 0xFF04, 0x0104, + 0xFB00, 0x0500, 0xFDFF, 0x03FF, 0xFD01, 0x0301, 0xFEFD, 0x02FD, 0xFE03, + 0x0203, 0xFCFF, 0x04FF, 0xFC01, 0x0401, 0xFF05, 0x0105, 0xFFFB, 0x01FB, + 0x000B, 0x00F5, 0xFA00, 0x0600, 0xF900, 0x0700, 0xFFF9, 0x01F9, 0xFF07, + 0x0107, 0xFDFE, 0x03FE, 0xFD02, 0x0302, 0xFBFF, 0x05FF, 0xFB01, 0x0501, + 0xF800, 0x0800, 0xFF06, 0x0106, 0xFFFA, 0x01FA, 0xFAFF, 0x06FF, 0xFA01, + 0x0601, 0xFEFC, 0x02FC, 0xFE04, 0x0204, 0xFFF8, 0x01F8, 0xFF08, 0x0108, + 0xFCFE, 0x04FE, 0xFC02, 0x0402, 0xF700, 0x0900, 0xF600, 0x0A00, 0xFDFD, + 0x03FD, 0xFD03, 0x0303, 0xFF0A, 0x010A, 0xFFF6, 0x01F6, 0xFE05, 0x0205, + 0xFEFB, 0x02FB, 0x000C, 0x00F4, 0xFDFC, 0x03FC, 0xFD04, 0x0304, 0x000D, + 0x00F3, 0xFE06, 0x0206, 0xFEFA, 0x02FA, 0xFFF7, 0x01F7, 0xFF09, 0x0109, + 0xFF0B, 0x010B, 0xFFF5, 0x01F5, 0xFBFE, 0x05FE, 0xFB02, 0x0502, 0xFD05, + 0x0305, 0xFDFB, 0x03FB, 0x000E, 0x00F2, 0xFCFD, 0x04FD, 0xFC03, 0x0403, + 0xF9FF, 0x07FF, 0xF901, 0x0701, 0xFBFD, 0x05FD, 0xFB03, 0x0503, 0xFEF9, + 0x02F9, 0xFE07, 0x0207, 0xF8FF, 0x08FF, 0xF801, 0x0801, 0x00F1, 0x000F, + 0xFAFE, 0x06FE, 0xFA02, 0x0602, 0xFD06, 0x0306, 0xFDFA, 0x03FA, 0x0010, + 0x00F0, 0xFEF8, 0x02F8, 0xFE08, 0x0208, 0xFE0A, 0x020A, 0xFEF6, 0x02F6, + 0xFEF7, 0x02F7, 0xFE09, 0x0209, 0xFDF9, 0x03F9, 0xFD07, 0x0307, 0xF500, + 0x0B00, 0xFCFC, 0x04FC, 0xFC04, 0x0404, 0xF7FF, 0x09FF, 0xF701, 0x0901, + 0xF9FE, 0x07FE, 0xF902, 0x0702, 0x0011, 0x00EF, 0xFBFC, 0x05FC, 0xFB04, + 0x0504, 0xFC05, 0x0405, 0xFCFB, 0x04FB, 0xFAFD, 0x06FD, 0xF8FE, 0x08FE, + 0xF802, 0x0802, 0xFA03, 0x0603, 0xFDF7, 0x03F7, 0xFD09, 0x0309, 0xFB05, + 0x0505, 0xFBFB, 0x05FB, 0xF9FD, 0x07FD, 0xF903, 0x0703, 0x00EE, 0x0012, + 0xFC06, 0x0406, 0xFCFA, 0x04FA, 0xF7FE, 0x09FE, 0xF702, 0x0902, 0xFDF8, + 0x03F8, 0xFD08, 0x0308, 0xF6FF, 0x0AFF, 0xF601, 0x0A01, 0xFAFC, 0x06FC, + 0xFA04, 0x0604, 0xFA05, 0x0605, 0xFAFB, 0x06FB, 0xFF0C, 0x010C, 0xFFF4, + 0x01F4, 0xFCF8, 0x04F8, 0xFC08, 0x0408, 0xFB06, 0x0506, 0xFBFA, 0x05FA, + 0xFE0B, 0x020B, 0xFEF5, 0x02F5, 0xFCF7, 0x04F7, 0xFC09, 0x0409, 0xFD0A, + 0x030A, 0xFDF6, 0x03F6, 0xFCF9, 0x04F9, 0xFC07, 0x0407, 0xF8FD, 0x08FD, + 0xF803, 0x0803, 0xF9FC, 0x07FC, 0xF904, 0x0704, 0xF400, 0x0C00, 0xF7FD, + 0x09FD, 0xF703, 0x0903, 0xF8FC, 0x08FC, 0xF804, 0x0804, 0xFBF9, 0x05F9, + 0xFB07, 0x0507, 0xF905, 0x0705, 0xF9FB, 0x07FB, 0xFAF9, 0x06F9, 0xFA07, + 0x0607, 0xFBF8, 0x05F8, 0xFB08, 0x0508, 0xFD0B, 0x030B, 0xFDF5, 0x03F5, + 0xFA06, 0x0606, 0xFAFA, 0x06FA, 0xFC0A, 0x040A, 0xFCF6, 0x04F6, 0xFAF8, + 0x06F8, 0xFA08, 0x0608, 0xF9F9, 0x07F9, 0xF907, 0x0707, 0xFF0E, 0x010E, + 0xFFF2, 0x01F2, 0xFBF7, 0x05F7, 0xFB09, 0x0509, 0xFF0D, 0x010D, 0xFFF3, + 0x01F3, 0xF906, 0xF9FA, 0x0706, 0x07FA, 0x0609, 0xFAF7, 0x06F7, 0xFA09, + 0x0709, 0xF9F7, 0x07F7, 0xF909, 0xF8F9, 0x08F9, 0xF807, 0x0807, 0xF300, + 0x0D00, 0xFB0A, 0x050A, 0xFBF6, 0x05F6, 0xF6FE, 0x0AFE, 0xF602, 0x0A02, + 0xFC0B, 0xFCF5, 0x040B, 0x04F5, 0xF7FC, 0x09FC, 0xF704, 0x0904, 0xF805, + 0x0805, 0xF8FB, 0x08FB, 0xF6FC, 0x0AFC, 0xF604, 0x0A04, 0xFE0D, 0x020D, + 0xFEF3, 0x02F3, 0x0809, 0xF8F7, 0x08F7, 0xF809, 0xF806, 0xF8FA, 0x0806, + 0x08FA, 0x0AFD, 0xF603, 0x0A03, 0xF6FD, 0xFA0A, 0x060A, 0xFAF6, 0x06F6, + 0xF5FF, 0x0BFF, 0xF501, 0x0B01, 0xF705, 0x0905, 0xF7FB, 0x09FB, 0xFFF1, + 0x01F1, 0xFF0F, 0x010F, 0xF605, 0x0A05, 0xF6FB, 0x0AFB, 0xFF11, 0x0111, + 0xFFEF, 0x01EF, 0xF9F8, 0x07F8, 0xF908, 0x0708, 0xF90A, 0x070A, 0xF9F6, + 0x07F6, 0xFB0B, 0x05F5, 0xFBF5, 0x050B, 0x080A, 0xF80A, 0xF8F6, 0x08F6, + 0xF7F9, 0x09F9, 0xF706, 0xF7FA, 0x0906, 0xF707, 0x09FA, 0x0907, 0xF606, + 0xF6FA, 0x0A06, 0x0AFA, 0xF6F9, 0x0AF9, 0xF607, 0x0A07, 0xF200, 0x0E00, + 0xF70A, 0x090A, 0xF5FD, 0x0BFD, 0xF7F6, 0x09F6, 0xF503, 0x0B03, 0xF60A, + 0x0A0A, 0xF6F6, 0x0AF6, 0x0110, 0xFFF0, 0x01F0, 0xFF10, 0xF8F8, 0x08F8, + 0xF808, 0x0808, 0xF7F8, 0x09F8, 0xF708, 0x0908, 0xF100, 0x0F00, 0xFA0B, + 0xFAF5, 0x060B, 0x06F5, 0xF9F5, 0xF90B, 0x07F5, 0x070B, 0xF4FF, 0x0CFF, + 0xF401, 0x0C01, 0xFFEE, 0x0112, 0x01EE, 0xFF12, 0x0909, 0xF7F7, 0x09F7, + 0xF709, 0xF505, 0x0B05, 0xF5FB, 0x0BFB, 0xF4FD, 0x0CFD, 0xF403, 0x0C03, + 0xFE0C, 0x020C, 0xFEF4, 0x02F4, 0x0CFB, 0x0A09, 0xF6F7, 0x0AF7, 0xF405, + 0x0C05, 0xF4FB, 0xF609, 0xF8F5, 0x080B, 0x08F5, 0xF80B, 0xF5FE, 0x0BFE, + 0xF502, 0x0B02, 0xFD0D, 0x030D, 0xFDF3, 0x03F3, 0x020E, 0xFEF2, 0x02F2, + 0xFE0E, 0x0B0A, 0xF5F6, 0x0BF6, 0xF50A, 0x0A08, 0xF6F8, 0x0AF8, 0xF608, + 0xF5FC, 0xF504, 0x0B04, 0x0BFC, 0x030C, 0xFD0C, 0xFDF4, 0x03F4, 0xFEEE, + 0xFE12, 0x02EE, 0x0212, 0xF7F5, 0xF70B, 0x090B, 0x09F5, 0xF4FE, 0x0CFE, + 0xF402, 0x0C02, 0xF40A, 0xF4FC, 0x0C0A, 0xF4F6, 0x0CF6, 0xF404, 0x0C04, + 0x0CFC, 0x02F1, 0xFEF1, 0x020F, 0xFE0F, 0x040D, 0xFC0D, 0xFCF3, 0x04F3, + 0x0B09, 0xFE11, 0x0211, 0xF5F7, 0x0BF7, 0xFEEF, 0x02EF, 0xF509, 0xF506, + 0xF5FA, 0x0B06, 0x0BFA, 0xFC0C, 0x040C, 0xFCF4, 0x04F4, 0xF406, 0xF4FA, + 0x0C06, 0x0CFA, 0xF3FD, 0x0DFD, 0xF303, 0x0D03, 0xF000, 0x1000, 0xFB0D, + 0xFBF3, 0x05F3, 0x050D, 0xF5F9, 0x0BF9, 0xF507, 0x0B07, 0xF60B, 0xF6F5, + 0x0A0B, 0x0AF5, 0xF4F9, 0x0CF9, 0xF407, 0x0C07, 0xF5F5, 0xF50B, 0x0B0B, + 0x0BF5, 0xEF00, 0x1100, 0x060D, 0xFAF3, 0x06F3, 0xFA0D, 0x050C, 0xF3FE, + 0xFB0C, 0x0DFE, 0x05F4, 0xF302, 0x0D02, 0xFBF4, 0x03F1, 0x030F, 0xFD0F, + 0xFDF1, 0xEE00, 0x1200, 0xFA0C, 0x06F4, 0x060C, 0xFAF4, 0xF2FE, 0x0EFE, + 0xF3FF, 0x0DFF, 0xF301, 0x0D01, 0xF202, 0x0E02, 0xF5F8, 0x0BF8, 0xF508, + 0x0B08, 0xF90D, 0x070D, 0xF9F3, 0x07F3, 0x030E, 0x03F2, 0xFDF2, 0xFD0E, + 0xF304, 0x0D04, 0x0DFC, 0xF3FC, 0x0DFB, 0xF3FB, 0xF305, 0x0D05, 0x070C, + 0xF90C, 0xF9F4, 0x07F4, 0xFDEE, 0xF2FF, 0x0EFF, 0x0312, 0xFD12, 0xF201, + 0x03EE, 0x0E01, 0xF80C, 0x080C, 0x08F4, 0xF8F4, 0x0DFA, 0xFC0E, 0xFCF2, + 0x040E, 0x04F2, 0xF306, 0xF3FA, 0x0D06, 0xF4F8, 0x0CF8, 0xF408, 0x0C08, + 0x0C09, 0xF4F7, 0x0CF7, 0xF409, 0x04F1, 0xFC0F, 0x040F, 0xFCF1, 0x0EFD, + 0xF2FD, 0xF203, 0x0E03, 0x090C, 0xF70C, 0xF7F4, 0x09F4, 0xF3F8, 0x0DF8, + 0xF308, 0x0D08, 0x0A0C, 0xF60C, 0xF6F4, 0x0AF4, 0xF4F5, 0x0C0B, 0xF40B, + 0x0CF5, 0x05F1, 0xFB0F, 0xF1FF, 0x0FFF, 0xF101, 0x0F01, 0xFBF1, 0x050F, + 0xFB0E, 0x050E, 0xFBF2, 0x05F2, 0x06F1, 0xFA0F, 0x060F, 0xFAF1, 0x0DF9, + 0xF3F9, 0x0D07, 0xF307, 0x080D, 0xF80D, 0xF8F3, 0x08F3, 0x090D, 0xF70D, + 0xF7F3, 0x09F3, 0xF3F7, 0xFE10, 0xFEF0, 0x0DF7, 0x02F0, 0x0210, 0x0D09, + 0xF309, 0xF0FF, 0x10FF, 0xF001, 0x1001, 0x0A0D, 0xFA0E, 0xF60D, 0x060E, + 0xFAF2, 0x06F2, 0xF6F3, 0x0AF3, 0xF2FC, 0x0EFC, 0x0E04, 0xF204, 0xF205, + 0x0EFB, 0x0E05, 0xF2FB, 0xF90F, 0x070F, 0x07F1, 0xF9F1, 0x0310, 0xFDF0, + 0xFD10, 0x03F0, 0x0E08, 0xF2F8, 0x0EF8, 0xF208, 0xF30A, 0xF3F6, 0x0DF6, + 0x0D0A, 0x0F08, 0xF1F8, 0x0FF8, 0xF108, 0xF50C, 0x0B0C, 0x0FFD, 0x0F03, + 0x0BF4, 0xF103, 0xF5F4, 0xF1FD, 0xF20A, 0xF2F6, 0x0EF6, 0x0410, 0xFCF0, + 0xFC10, 0x04F0, 0x0E0A, 0xF207, 0x0311, 0xFC11, 0x0411, 0xF2F9, 0xFCEF, + 0xFD11, 0xFDEF, 0x0EF9, 0x03EF, 0x0E07, 0x04EF, 0x0510, 0xFBF0, 0xFB10, + 0x0511, 0x05F0, 0xFBEF, 0xFB11, 0x05EF, 0x0F07, 0xF1F9, 0x0FF9, 0xF107, + 0xFA10, 0x0610, 0xFAF0, 0x06F0, 0xF0FD, 0xF003, 0x10FD, 0x1003, 0xF1FE, + 0x0FFE, 0xF102, 0x0F02, 0xF9F2, 0x07F2, 0xF90E, 0x070E, 0xF30B, 0x0D0B, + 0xF80E, 0xF3F5, 0x08F2, 0x080E, 0x0DF5, 0xF8F2, 0xF50D, 0xF5F3, 0x0B0D, + 0x0EFA, 0x0BF3, 0xF206, 0xF2FA, 0x0E06, 0xF70E, 0x090E, 0xF7F2, 0x09F2, + 0x0FFB, 0x0FFC, 0xF1FB, 0xF104, 0x0F04, 0xF105, 0xF1FC, 0x0F05, 0x0F0A, + 0x0FF6, 0x0F06, 0xF1F6, 0xF106, 0xF1FA, 0xF10A, 0x0FFA, 0xEFFD, 0xEF01, + 0x11FD, 0xEFFF, 0x11FF, 0xEF03, 0x1101, 0x1103, 0x0C0C, 0xF40C, 0xF4F4, + 0x0CF4, 0x10FB, 0xF005, 0xF0FB, 0x1005, 0x1002, 0xF0FE, 0x10FE, 0xF002, + 0xF910, 0x08F0, 0xF8F0, 0xF9F0, 0x0810, 0xF810, 0x07F0, 0x0710, 0x10FC, + 0xF0FC, 0xF60E, 0xF6F2, 0x1004, 0x0AF2, 0xF004, 0x0A0E, 0x11FC, 0xEFFC, + 0xF30C, 0xEF04, 0x1104, 0xF3F4, 0x0D0C, 0x0DF4, 0x11FB, 0x1105, 0xEFFB, + 0xEF05, 0x080F, 0xF80F, 0x08F1, 0xF8F1, 0xFC12, 0x04EE, 0x0412, 0xFCEE, + 0xEFFE, 0xF5F2, 0x11FE, 0x0B0E, 0x10FA, 0xF50E, 0x0BF2, 0xEF02, 0x1006, + 0x1102, 0xF006, 0xF0FA, 0xFB12, 0xFBEE, 0x0512, 0x05EE, 0x10F8, 0xF4F2, + 0x1008, 0x0CF2, 0xF0F8, 0xF40E, 0x0C0E, 0xF008, 0xF20C, 0x0EF4, 0xF2F4, + 0x0E0C, 0xF20B, 0xF2F5, 0x09F0, 0xF7F0, 0x0910, 0xF710, 0x0E0B, 0x0EF5, + 0x0AF0, 0x0A10, 0xF6F0, 0xF610, 0xEEFC, 0xFAEF, 0x12FC, 0x1204, 0xEE04, + 0x0611, 0xFA11, 0x06EF, 0xEF06, 0x1106, 0xEFFA, 0x11FA, 0xEF08, 0xEFF8, + 0x11F8, 0x1108, 0xF7F1, 0x090F, 0xF70F, 0x09F1, 0x0E09, 0xF209, 0x0EF7, + 0xF2F7, 0xF0F6, 0x100A, 0x10F6, 0xF5F0, 0xF00A, 0x0BF0, 0xF510, 0x0B10, + 0x0D0E, 0xF30E, 0x0A0F, 0x0DF2, 0xF3F2, 0xF60F, 0x0AF1, 0xF6F1, 0x0CF3, + 0x0FF7, 0x0F09, 0xF40D, 0xF4F3, 0xF1F7, 0x0C0D, 0xF109, 0x07EE, 0xF912, + 0xFA12, 0xFAEE, 0x0712, 0xF9EE, 0x0612, 0x06EE, 0xF9EF, 0xF911, 0x0711, + 0x07EF, 0x0D0D, 0x0DF3, 0x0F0C, 0x110A, 0x11F6, 0xF10C, 0xF30D, 0xEFF6, + 0x0FF4, 0xEF0A, 0xF3F3, 0xF1F4, 0x10F9, 0xF007, 0xF0F9, 0x1007, 0xF8EF, + 0x0811, 0xF20D, 0x0EF3, 0x0E0D, 0xF2F3, 0xF811, 0x08EF, 0xF1F5, 0x0FF5, + 0xF10B, 0x0F0B, 0xF0F4, 0xF00C, 0xF2F2, 0x10F4, 0x0E0E, 0x0EF2, 0xF20E, + 0x100C, 0x09EF, 0x0911, 0xF7EF, 0xF711, 0xF611, 0x0A11, 0xF6EF, 0x0AEF, + 0x12FF, 0xEE01, 0x1201, 0xEEFF, 0xF5F1, 0x0BF1, 0xF50F, 0x0B0F, 0x10F5, + 0xEE06, 0xF00B, 0x1206, 0x12FA, 0xF0F5, 0xEEFA, 0x100B, 0x0CF0, 0xF410, + 0xF4F0, 0x0C10, 0x11F9, 0x0BEF, 0xF5EF, 0x0CF1, 0xEFF9, 0xF511, 0x0C0F, + 0xEF07, 0xF4F1, 0xF40F, 0x0B11, 0x1107, 0xEEFD, 0x12FD, 0xEE03, 0x1203, + 0x0DF0, 0xF3F0, 0xF310, 0x0D10, 0x0C11, 0x0CEF, 0xF4EF, 0xF411, 0x0EF0, + 0xF210, 0x0E10, 0xF2F0, 0x08EE, 0xF8EE, 0x0812, 0xF812, 0x110B, 0xF7EE, + 0xF712, 0x11F5, 0x0912, 0xEFF5, 0x09EE, 0xEF0B, 0xEEF9, 0x12F9, 0xEE07, + 0x1207, 0x0F0E, 0xF30F, 0x0D0F, 0x0DF1, 0xF10E, 0xF3F1, 0xF1F2, 0x0FF2, + 0xF6EE, 0xF612, 0x0AEE, 0x0A12, 0xF20F, 0x0E0F, 0xF2F1, 0x0EF1, 0xF0F7, + 0x1009, 0xF009, 0x10F7, 0xEEFB, 0x12FB, 0xEE05, 0x1205, 0x1202, 0x0FF3, + 0xEE08, 0xF1F3, 0x12F8, 0x12FE, 0xF10D, 0x1208, 0x0F0D, 0xEEFE, 0xEEF8, + 0xEE02, 0x0FF1, 0xF10F, 0xF1F1, 0x0F0F, 0x12F4, 0x11F4, 0x1109, 0xEFF4, + 0xEE0A, 0xEFF7, 0x110C, 0xEEF4, 0xEE0C, 0x11F7, 0xEF0C, 0x120C, 0xF110, + 0xF1F0, 0x120A, 0xEEF6, 0xEF09, 0x12F6, 0x0F10, 0x0FF0, 0x10F2, 0xF0F2, + 0x100E, 0xF00E, 0xEEF5, 0x0B12, 0x0BEE, 0xF512, 0x120B, 0x12F5, 0xF5EE, + 0xEE0B, 0x1209, 0x12F7, 0xEE09, 0xEEF7, 0xF4EE, 0x0C12, 0x0CEE, 0xF412, + 0x100D, 0x0D12, 0xF0F3, 0x0DEE, 0xF3EF, 0x0DEF, 0xF3EE, 0x0D11, 0xF312, + 0xF00D, 0xF311, 0x10F3, 0x11F3, 0xEFF3, 0x0E12, 0xF212, 0xF2EE, 0x0EEE, + 0xEF0D, 0x110D, 0x100F, 0xF0F1, 0xF00F, 0x10F1, 0x10F0, 0xF211, 0xF0F0, + 0xF010, 0x0EEF, 0xF2EF, 0x0E11, 0x1010, 0x120D, 0xEE0D, 0x12F3, 0xEEF3, + 0x11F1, 0xF111, 0xEFF2, 0x110F, 0xEF0E, 0xEF0F, 0x0FEF, 0x11F2, 0x0F11, + 0xF1EF, 0x110E, 0xEFF1, 0xEE0E, 0x120E, 0x12F2, 0xF1EE, 0x0FEE, 0xEEF2, + 0xF112, 0x0F12, 0xF0EE, 0x10EE, 0xF012, 0x1012, 0x11F0, 0xEF10, 0xEFF0, + 0x1110, 0xF0EF, 0x10EF, 0x1011, 0xF011, 0x11EF, 0xEF11, 0xEFEF, 0xEF12, + 0x11EE, 0x1112, 0xEFEE, 0x1111, 0xEE11, 0xEEEF, 0x12EF, 0x1211, 0x1212, + 0x12EE, 0xEEEE, 0xEE12, 0xEEF1, 0x12F1, 0xEE0F, 0x120F, 0xEE10, 0x1210, + 0xEEF0, 0x12F0, }; static const uint8_t clv_mvu_1_bits[] = { - 16, 14, 14, 14, 13, 12, 12, 10, 12, 12, 13, 14, 14, 14, 16, 15, - 13, 13, 12, 12, 11, 11, 7, 11, 11, 12, 12, 13, 13, 15, 16, 16, - 16, 13, 12, 10, 10, 6, 10, 10, 12, 13, 16, 16, 16, 14, 14, 11, - 11, 11, 11, 9, 7, 9, 11, 11, 11, 11, 14, 14, 15, 13, 13, 12, - 9, 8, 8, 4, 8, 8, 9, 12, 13, 13, 15, 14, 14, 11, 11, 10, - 9, 8, 4, 8, 9, 10, 11, 12, 14, 14, 12, 12, 11, 10, 10, 8, - 6, 3, 6, 8, 10, 10, 11, 12, 12, 11, 10, 9, 6, 6, 6, 5, - 4, 5, 6, 6, 6, 9, 10, 11, 12, 12, 11, 10, 10, 8, 6, 3, - 6, 7, 10, 10, 11, 12, 12, 14, 14, 11, 11, 10, 9, 8, 4, 8, - 9, 10, 11, 11, 14, 14, 15, 13, 13, 12, 9, 8, 8, 4, 8, 8, - 9, 12, 13, 13, 15, 14, 14, 11, 11, 11, 11, 9, 7, 9, 11, 11, - 11, 11, 14, 14, 16, 16, 16, 13, 12, 10, 10, 6, 10, 10, 12, 13, - 16, 16, 16, 15, 13, 13, 12, 12, 11, 11, 7, 11, 11, 12, 12, 13, - 13, 15, 16, 14, 14, 14, 13, 12, 12, 10, 12, 12, 13, 14, 14, 14, - 16, 7, -}; - -static const uint16_t clv_mvu_1_codes[] = { - 0xFFFC, 0x3FED, 0x3FE5, 0x3FE3, 0x1FD9, 0x0FD9, 0x0FD6, 0x03CE, - 0x0FD3, 0x0FD8, 0x1FD6, 0x3FE0, 0x3FE8, 0x3FEC, 0xFFFE, 0x7FF3, - 0x1FE7, 0x1FDA, 0x0FCF, 0x0FCC, 0x07DD, 0x07CC, 0x006B, 0x07CD, - 0x07DE, 0x0FCE, 0x0FD2, 0x1FDD, 0x1FEC, 0x7FF0, 0xFFF6, 0xFFFA, - 0xFFF2, 0x1FDE, 0x0FDB, 0x03D8, 0x03CA, 0x002E, 0x03CB, 0x03D9, - 0x0FDC, 0x1FDF, 0xFFF3, 0xFFF9, 0xFFF5, 0x3FF3, 0x3FDD, 0x07DA, - 0x07D2, 0x07CA, 0x07C2, 0x01DE, 0x0069, 0x01DF, 0x07C3, 0x07CB, - 0x07D3, 0x07DB, 0x3FDF, 0x3FF6, 0x7FF7, 0x1FED, 0x1FE5, 0x0FDF, - 0x01D8, 0x00E3, 0x00DF, 0x0007, 0x00E0, 0x00E4, 0x01D9, 0x0FE0, - 0x1FE3, 0x1FE9, 0x7FF4, 0x3FF5, 0x3FE7, 0x07E4, 0x07C6, 0x03D2, - 0x01E2, 0x00E9, 0x0006, 0x00EA, 0x01E3, 0x03D3, 0x07C7, 0x0FCA, - 0x3FE9, 0x3FF0, 0x0FE8, 0x0FE5, 0x07D5, 0x03DD, 0x03D5, 0x00DC, - 0x002B, 0x0001, 0x002C, 0x00DD, 0x03D6, 0x03DE, 0x07D6, 0x0FE4, - 0x0FE9, 0x07E0, 0x03C8, 0x01D6, 0x0032, 0x0030, 0x0028, 0x0012, - 0x0004, 0x0013, 0x0029, 0x0031, 0x0033, 0x01D7, 0x03C9, 0x07E1, - 0x0FEA, 0x0FE6, 0x07D7, 0x03DF, 0x03D7, 0x00DE, 0x002D, 0x0000, - 0x002A, 0x006D, 0x03D4, 0x03DC, 0x07D4, 0x0FE3, 0x0FE7, 0x3FF1, - 0x3FE4, 0x07E2, 0x07C4, 0x03D0, 0x01E0, 0x00E7, 0x0005, 0x00E8, - 0x01E1, 0x03D1, 0x07C5, 0x07E3, 0x3FEA, 0x3FF7, 0x7FF6, 0x1FE6, - 0x1FE4, 0x0FE1, 0x01DA, 0x00E5, 0x00E1, 0x0008, 0x00E2, 0x00E6, - 0x01DB, 0x0FE2, 0x1FE2, 0x1FEB, 0x7FF5, 0x3FF4, 0x3FDC, 0x07D9, - 0x07D0, 0x07C8, 0x07C0, 0x01DC, 0x0068, 0x01DD, 0x07C1, 0x07C9, - 0x07D1, 0x07D8, 0x3FDE, 0x3FF2, 0xFFFB, 0xFFF4, 0xFFF0, 0x1FE1, - 0x0FDD, 0x03DA, 0x03CC, 0x002F, 0x03CD, 0x03DB, 0x0FDE, 0x1FE0, - 0xFFF1, 0xFFF7, 0xFFF8, 0x7FF2, 0x1FEA, 0x1FDC, 0x0FD1, 0x0FCD, - 0x07DC, 0x07CF, 0x006C, 0x07CE, 0x07DF, 0x0FCB, 0x0FD0, 0x1FDB, - 0x1FE8, 0x7FF1, 0xFFFD, 0x3FEE, 0x3FEB, 0x3FE1, 0x1FD7, 0x0FD7, - 0x0FD5, 0x03CF, 0x0FD4, 0x0FDA, 0x1FD8, 0x3FE2, 0x3FE6, 0x3FEF, - 0xFFFF, 0x006A, + 3, 3, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }; static const uint16_t clv_mvu_1_syms[] = { - 0xF9F9, 0xFAF9, 0xFBF9, 0xFCF9, 0xFDF9, 0xFEF9, 0xFFF9, 0x00F9, - 0x01F9, 0x02F9, 0x03F9, 0x04F9, 0x05F9, 0x06F9, 0x07F9, 0xF9FA, - 0xFAFA, 0xFBFA, 0xFCFA, 0xFDFA, 0xFEFA, 0xFFFA, 0x00FA, 0x01FA, - 0x02FA, 0x03FA, 0x04FA, 0x05FA, 0x06FA, 0x07FA, 0xF9FB, 0xFAFB, - 0xFBFB, 0xFCFB, 0xFDFB, 0xFEFB, 0xFFFB, 0x00FB, 0x01FB, 0x02FB, - 0x03FB, 0x04FB, 0x05FB, 0x06FB, 0x07FB, 0xF9FC, 0xFAFC, 0xFBFC, - 0xFCFC, 0xFDFC, 0xFEFC, 0xFFFC, 0x00FC, 0x01FC, 0x02FC, 0x03FC, - 0x04FC, 0x05FC, 0x06FC, 0x07FC, 0xF9FD, 0xFAFD, 0xFBFD, 0xFCFD, - 0xFDFD, 0xFEFD, 0xFFFD, 0x00FD, 0x01FD, 0x02FD, 0x03FD, 0x04FD, - 0x05FD, 0x06FD, 0x07FD, 0xF9FE, 0xFAFE, 0xFBFE, 0xFCFE, 0xFDFE, - 0xFEFE, 0xFFFE, 0x00FE, 0x01FE, 0x02FE, 0x03FE, 0x04FE, 0x05FE, - 0x06FE, 0x07FE, 0xF9FF, 0xFAFF, 0xFBFF, 0xFCFF, 0xFDFF, 0xFEFF, - 0xFFFF, 0x00FF, 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF, - 0x07FF, 0xF900, 0xFA00, 0xFB00, 0xFC00, 0xFD00, 0xFE00, 0xFF00, - 0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, - 0xF901, 0xFA01, 0xFB01, 0xFC01, 0xFD01, 0xFE01, 0xFF01, 0x0001, - 0x0101, 0x0201, 0x0301, 0x0401, 0x0501, 0x0601, 0x0701, 0xF902, - 0xFA02, 0xFB02, 0xFC02, 0xFD02, 0xFE02, 0xFF02, 0x0002, 0x0102, - 0x0202, 0x0302, 0x0402, 0x0502, 0x0602, 0x0702, 0xF903, 0xFA03, - 0xFB03, 0xFC03, 0xFD03, 0xFE03, 0xFF03, 0x0003, 0x0103, 0x0203, - 0x0303, 0x0403, 0x0503, 0x0603, 0x0703, 0xF904, 0xFA04, 0xFB04, - 0xFC04, 0xFD04, 0xFE04, 0xFF04, 0x0004, 0x0104, 0x0204, 0x0304, - 0x0404, 0x0504, 0x0604, 0x0704, 0xF905, 0xFA05, 0xFB05, 0xFC05, - 0xFD05, 0xFE05, 0xFF05, 0x0005, 0x0105, 0x0205, 0x0305, 0x0405, - 0x0505, 0x0605, 0x0705, 0xF906, 0xFA06, 0xFB06, 0xFC06, 0xFD06, - 0xFE06, 0xFF06, 0x0006, 0x0106, 0x0206, 0x0306, 0x0406, 0x0506, - 0x0606, 0x0706, 0xF907, 0xFA07, 0xFB07, 0xFC07, 0xFD07, 0xFE07, - 0xFF07, 0x0007, 0x0107, 0x0207, 0x0307, 0x0407, 0x0507, 0x0607, - 0x0707, 0x0808, + 0x0001, 0x00FF, 0x0000, 0x0002, 0x00FE, 0x00FD, 0x0003, 0xFF00, 0x0100, + 0xFE00, 0x0200, 0x0101, 0xFFFF, 0x01FF, 0xFF01, 0x00FB, 0x0005, 0xFD00, + 0x0300, 0xFC00, 0x0400, 0x0004, 0x00FC, 0x0808, 0x00FA, 0x0006, 0x0201, + 0xFEFF, 0x02FF, 0xFE01, 0xFFFD, 0x01FD, 0xFF03, 0x0103, 0xFEFD, 0x02FD, + 0xFE03, 0x0203, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFB00, 0x0500, 0xFDFD, + 0x03FD, 0xFD03, 0x0303, 0xFF04, 0x0104, 0xFFFC, 0x01FC, 0xFE02, 0x0202, + 0xFEFE, 0x02FE, 0xFA00, 0x0600, 0xFFFB, 0x01FB, 0xFF05, 0x0105, 0x00F9, + 0x0007, 0xFD02, 0x0302, 0xFDFE, 0x03FE, 0x0301, 0xFDFF, 0x03FF, 0xFD01, + 0xFEFB, 0x02FB, 0xFE05, 0x0205, 0x0401, 0xFCFF, 0x04FF, 0xFC01, 0xFE04, + 0x0204, 0xFEFC, 0x02FC, 0xFC02, 0x0402, 0xFCFE, 0x04FE, 0xFD04, 0x0304, + 0xFDFC, 0x03FC, 0xFFFA, 0x01FA, 0x0106, 0xFF06, 0xFC04, 0x0404, 0xFCFC, + 0x04FC, 0x0501, 0xFBFF, 0x05FF, 0xFB01, 0x0504, 0xFB04, 0xFBFC, 0x05FC, + 0xFE06, 0xFEFA, 0x02FA, 0x0206, 0xF900, 0x0700, 0xFB02, 0x0502, 0xFBFE, + 0x05FE, 0x0306, 0xFDFA, 0xFD06, 0x03FA, 0xFCFA, 0x0406, 0xFC06, 0x04FA, + 0x01F9, 0x0107, 0xFF07, 0xFFF9, 0xFE07, 0x02F9, 0xFEF9, 0x0207, 0xFDFB, + 0x03FB, 0xFD05, 0x0305, 0xFCFD, 0x04FD, 0xFC03, 0x0403, 0x0601, 0x06FF, + 0xFAFF, 0xFA01, 0x0701, 0xF9FF, 0x07FF, 0xF901, 0x03F9, 0xFD07, 0x0307, + 0xFDF9, 0xFBFA, 0x0506, 0xFB06, 0x05FA, 0xFCFB, 0x04FB, 0x0405, 0xFC05, + 0x0503, 0x05FD, 0xFB03, 0xFBFD, 0xFA03, 0xFAFA, 0x0606, 0x06FD, 0xFA06, + 0x0603, 0x06FA, 0xFAFD, 0xFA04, 0xFAFC, 0x0604, 0x06FC, 0x04F9, 0xFC07, + 0x0407, 0xFCF9, 0xFA02, 0xFBF9, 0x0507, 0xFAFE, 0x05F9, 0x06FE, 0x0602, + 0xFB07, 0x06F9, 0xFAF9, 0xFA07, 0x0607, 0x07FE, 0xF902, 0x0704, 0xF9FC, + 0xF904, 0xF9FE, 0x07FC, 0x0702, 0x07FA, 0x0706, 0xF906, 0xF9FA, 0x07FD, + 0x0703, 0xF903, 0xF9FD, 0xFB05, 0x0505, 0xFBFB, 0x05FB, 0xFA05, 0x07FB, + 0xF9FB, 0x0605, 0x0705, 0x06FB, 0xFAFB, 0xF905, 0xF9F9, 0xF907, 0x07F9, + 0x0707, }; static const uint8_t clv_mvu_2_bits[] = { - 16, 16, 16, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 15, 15, - 15, 15, 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, - 13, 14, 14, 14, 14, 14, 15, 15, 15, 16, 16, 15, 15, 14, 14, 14, - 14, 14, 14, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 16, 16, - 15, 15, 14, 13, 13, 13, 13, 13, 12, 12, 12, 13, 13, 13, 13, 13, - 14, 15, 15, 16, 14, 14, 14, 14, 13, 12, 12, 12, 12, 11, 10, 11, - 12, 12, 12, 12, 13, 14, 14, 14, 14, 14, 14, 14, 13, 12, 12, 12, - 12, 11, 10, 9, 10, 11, 12, 12, 12, 12, 13, 14, 14, 14, 15, 14, - 13, 13, 12, 12, 12, 12, 11, 10, 8, 10, 11, 12, 12, 12, 12, 13, - 13, 14, 15, 14, 14, 14, 13, 12, 12, 11, 11, 10, 9, 7, 9, 10, - 11, 11, 12, 12, 13, 14, 14, 14, 14, 14, 13, 12, 12, 11, 11, 10, - 9, 8, 7, 8, 9, 10, 11, 11, 12, 12, 13, 14, 14, 14, 13, 13, - 12, 11, 9, 9, 8, 7, 6, 5, 6, 7, 8, 9, 9, 11, 12, 13, - 13, 14, 14, 13, 13, 13, 11, 11, 10, 8, 7, 4, 1, 4, 7, 8, - 10, 11, 11, 13, 13, 13, 14, 14, 13, 13, 12, 11, 9, 9, 8, 7, - 6, 5, 6, 7, 8, 9, 9, 11, 12, 13, 13, 14, 14, 14, 13, 12, - 11, 11, 11, 9, 9, 8, 7, 8, 9, 10, 11, 11, 12, 12, 13, 14, - 14, 14, 14, 14, 13, 12, 12, 11, 11, 10, 9, 7, 9, 10, 11, 11, - 12, 12, 13, 14, 14, 14, 15, 14, 13, 13, 12, 12, 12, 12, 11, 10, - 9, 10, 11, 12, 12, 12, 12, 13, 13, 14, 15, 14, 14, 14, 13, 12, - 12, 12, 12, 11, 10, 8, 10, 11, 12, 12, 12, 12, 13, 14, 14, 14, - 14, 14, 14, 14, 13, 12, 12, 12, 12, 11, 10, 11, 12, 12, 12, 12, - 13, 14, 14, 14, 14, 16, 15, 15, 14, 13, 13, 13, 13, 13, 12, 12, - 12, 13, 13, 13, 13, 13, 14, 15, 15, 16, 16, 15, 15, 14, 14, 14, - 14, 14, 14, 13, 12, 13, 14, 14, 14, 14, 14, 14, 15, 15, 16, 16, - 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, 13, 14, 14, 14, 14, 14, - 15, 15, 15, 16, 16, 16, 16, 15, 15, 15, 15, 14, 14, 14, 14, 14, - 14, 14, 15, 15, 15, 15, 16, 16, 16, 6, -}; - -static const uint16_t clv_mvu_2_codes[] = { - 0xFFF2, 0xFFEF, 0xFFEA, 0x7FEC, 0x7FD5, 0x7FC5, 0x7FCF, 0x3FD3, - 0x3FC9, 0x3FB4, 0x3F72, 0x3FAE, 0x3FDC, 0x3FE1, 0x7FC4, 0x7FC8, - 0x7FD7, 0x7FF0, 0xFFE9, 0xFFEC, 0xFFF8, 0xFFF4, 0x7FF3, 0x7FDE, - 0x7FD3, 0x3FC0, 0x3F99, 0x3FA8, 0x3FAC, 0x3F8E, 0x1FA8, 0x1F79, - 0x1FA2, 0x3F89, 0x3F93, 0x3F95, 0x3F9C, 0x3FB8, 0x7FD2, 0x7FE6, - 0x7FDA, 0xFFF7, 0xFFFE, 0x7FED, 0x7FE2, 0x3FD5, 0x3FD7, 0x3FB3, - 0x3FA2, 0x3F80, 0x3F7A, 0x1F88, 0x1F70, 0x1F8A, 0x3F83, 0x3F84, - 0x3FAA, 0x3FC4, 0x3FDA, 0x3FDF, 0x7FDB, 0x7FE3, 0xFFF1, 0xFFFB, - 0x7FE1, 0x7FC7, 0x3FB0, 0x1FAA, 0x1FAB, 0x1FA3, 0x1F8E, 0x1F81, - 0x0FA7, 0x0F7F, 0x0FA8, 0x1F82, 0x1F8F, 0x1FA4, 0x1FAC, 0x1FAD, - 0x3FB5, 0x7FC6, 0x7FDD, 0xFFF3, 0x3FDD, 0x3FBE, 0x3FB9, 0x3F7C, - 0x1F77, 0x0FB5, 0x0F9D, 0x0F99, 0x0F90, 0x0794, 0x03BE, 0x0795, - 0x0F92, 0x0F9A, 0x0F9E, 0x0FB6, 0x1F78, 0x3F78, 0x3FB2, 0x3FBF, - 0x3FD2, 0x3FA7, 0x3F8C, 0x3F75, 0x1F9E, 0x0F93, 0x0F94, 0x0F7B, - 0x0F73, 0x07B4, 0x03BB, 0x01D9, 0x03BC, 0x07B5, 0x0F74, 0x0F7C, - 0x0F95, 0x0F96, 0x1FA0, 0x3F76, 0x3F8F, 0x3FA5, 0x7FE5, 0x3FC7, - 0x1F95, 0x1F71, 0x0FAB, 0x0FAC, 0x0F9F, 0x0F7D, 0x0796, 0x03BF, - 0x00DE, 0x03C0, 0x0797, 0x0F7E, 0x0FA0, 0x0FAD, 0x0FAE, 0x1F72, - 0x1F97, 0x3FD1, 0x7FD8, 0x3FA9, 0x3FA0, 0x3F6D, 0x1F99, 0x0F87, - 0x0F77, 0x07A8, 0x079C, 0x03C5, 0x01CA, 0x0067, 0x01CB, 0x03C6, - 0x079D, 0x07A9, 0x0F78, 0x0F8A, 0x1F9F, 0x3F6E, 0x3F98, 0x3F9A, - 0x3FCA, 0x3F70, 0x1FAF, 0x0F8D, 0x0F6F, 0x07AC, 0x07A0, 0x03B7, - 0x01CE, 0x00DA, 0x0063, 0x00DB, 0x01CF, 0x03B8, 0x07A1, 0x07AD, - 0x0F70, 0x0F91, 0x1FB2, 0x3F73, 0x3FD6, 0x3F7D, 0x1F91, 0x1F85, - 0x0FA3, 0x07A2, 0x01D4, 0x01D0, 0x00E0, 0x0068, 0x002C, 0x0014, - 0x002D, 0x0069, 0x00E1, 0x01D1, 0x01D5, 0x07A3, 0x0FA4, 0x1F89, - 0x1F92, 0x3F81, 0x3FA6, 0x1F7B, 0x1F7C, 0x1F7D, 0x07B0, 0x07AE, - 0x03C7, 0x00DC, 0x0064, 0x0008, 0x0000, 0x0009, 0x0065, 0x00DD, - 0x03C8, 0x07AF, 0x07B1, 0x1F7E, 0x1F7F, 0x1F80, 0x3F9E, 0x3F85, - 0x1F93, 0x1F8B, 0x0FA5, 0x07A4, 0x01D6, 0x01D2, 0x00E2, 0x006A, - 0x002E, 0x0015, 0x002F, 0x006B, 0x00E3, 0x01D3, 0x01D7, 0x07A5, - 0x0FA6, 0x1F8C, 0x1F94, 0x3F87, 0x3FCE, 0x3F77, 0x1FB4, 0x0F83, - 0x07B6, 0x07AA, 0x079E, 0x01DA, 0x01CC, 0x00D8, 0x0062, 0x00D9, - 0x01CD, 0x03B6, 0x079F, 0x07AB, 0x0F6E, 0x0F84, 0x1FA9, 0x3F6A, - 0x3FCD, 0x3F90, 0x3F92, 0x3F6B, 0x1F96, 0x0F85, 0x0F75, 0x07A6, - 0x079A, 0x03C3, 0x01C8, 0x0066, 0x01C9, 0x03C4, 0x079B, 0x07A7, - 0x0F76, 0x0F86, 0x1F9D, 0x3F6C, 0x3F96, 0x3F97, 0x7FE9, 0x3FD8, - 0x1F98, 0x1F73, 0x0FAF, 0x0FB0, 0x0FA1, 0x0F80, 0x0798, 0x03C1, - 0x01D8, 0x03C2, 0x0799, 0x0F81, 0x0FA2, 0x0FB1, 0x0FB2, 0x1F74, - 0x1F9A, 0x3FE0, 0x7FEE, 0x3F94, 0x3F8B, 0x3F6F, 0x1F9B, 0x0F88, - 0x0F89, 0x0F79, 0x0F71, 0x07B2, 0x03B9, 0x00DF, 0x03BA, 0x07B3, - 0x0F72, 0x0F7A, 0x0F8B, 0x0F8C, 0x1F9C, 0x3F71, 0x3F8A, 0x3F9B, - 0x3FC8, 0x3FBD, 0x3FC5, 0x3F79, 0x1F75, 0x0FB3, 0x0F9C, 0x0F97, - 0x0F8E, 0x0792, 0x03BD, 0x0793, 0x0F8F, 0x0F98, 0x0F9B, 0x0FB4, - 0x1F76, 0x3F82, 0x3FC3, 0x3FBA, 0x3FC6, 0xFFFD, 0x7FDF, 0x7FCC, - 0x3FBB, 0x1FB0, 0x1FAE, 0x1FA1, 0x1F90, 0x1F83, 0x0FAA, 0x0F82, - 0x0FA9, 0x1F84, 0x1F8D, 0x1FA5, 0x1FB1, 0x1FB3, 0x3FC2, 0x7FCA, - 0x7FE8, 0xFFF5, 0xFFFF, 0x7FDC, 0x7FD9, 0x3FCC, 0x3FD9, 0x3FB7, - 0x3F9F, 0x3F7E, 0x3F86, 0x1F86, 0x0FB7, 0x1F87, 0x3F7B, 0x3F7F, - 0x3FA1, 0x3FBC, 0x3FCB, 0x3FD4, 0x7FF1, 0x7FF2, 0xFFFA, 0xFFFC, - 0x7FE4, 0x7FE7, 0x7FD4, 0x3FAF, 0x3FA3, 0x3F91, 0x3F9D, 0x3F88, - 0x1FA6, 0x1F7A, 0x1FA7, 0x3F8D, 0x3FAB, 0x3FAD, 0x3FA4, 0x3FB6, - 0x7FD0, 0x7FE0, 0x7FEB, 0xFFF0, 0xFFF9, 0xFFEB, 0xFFED, 0x7FEA, - 0x7FD6, 0x7FC9, 0x7FCB, 0x3FD0, 0x3FDE, 0x3FB1, 0x3F74, 0x3FC1, - 0x3FCF, 0x3FDB, 0x7FCD, 0x7FCE, 0x7FD1, 0x7FEF, 0xFFE8, 0xFFEE, - 0xFFF6, 0x0030, + 1, 4, 4, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16 }; static const uint16_t clv_mvu_2_syms[] = { - 0xF6F6, 0xF7F6, 0xF8F6, 0xF9F6, 0xFAF6, 0xFBF6, 0xFCF6, 0xFDF6, - 0xFEF6, 0xFFF6, 0x00F6, 0x01F6, 0x02F6, 0x03F6, 0x04F6, 0x05F6, - 0x06F6, 0x07F6, 0x08F6, 0x09F6, 0x0AF6, 0xF6F7, 0xF7F7, 0xF8F7, - 0xF9F7, 0xFAF7, 0xFBF7, 0xFCF7, 0xFDF7, 0xFEF7, 0xFFF7, 0x00F7, - 0x01F7, 0x02F7, 0x03F7, 0x04F7, 0x05F7, 0x06F7, 0x07F7, 0x08F7, - 0x09F7, 0x0AF7, 0xF6F8, 0xF7F8, 0xF8F8, 0xF9F8, 0xFAF8, 0xFBF8, - 0xFCF8, 0xFDF8, 0xFEF8, 0xFFF8, 0x00F8, 0x01F8, 0x02F8, 0x03F8, - 0x04F8, 0x05F8, 0x06F8, 0x07F8, 0x08F8, 0x09F8, 0x0AF8, 0xF6F9, - 0xF7F9, 0xF8F9, 0xF9F9, 0xFAF9, 0xFBF9, 0xFCF9, 0xFDF9, 0xFEF9, - 0xFFF9, 0x00F9, 0x01F9, 0x02F9, 0x03F9, 0x04F9, 0x05F9, 0x06F9, - 0x07F9, 0x08F9, 0x09F9, 0x0AF9, 0xF6FA, 0xF7FA, 0xF8FA, 0xF9FA, - 0xFAFA, 0xFBFA, 0xFCFA, 0xFDFA, 0xFEFA, 0xFFFA, 0x00FA, 0x01FA, - 0x02FA, 0x03FA, 0x04FA, 0x05FA, 0x06FA, 0x07FA, 0x08FA, 0x09FA, - 0x0AFA, 0xF6FB, 0xF7FB, 0xF8FB, 0xF9FB, 0xFAFB, 0xFBFB, 0xFCFB, - 0xFDFB, 0xFEFB, 0xFFFB, 0x00FB, 0x01FB, 0x02FB, 0x03FB, 0x04FB, - 0x05FB, 0x06FB, 0x07FB, 0x08FB, 0x09FB, 0x0AFB, 0xF6FC, 0xF7FC, - 0xF8FC, 0xF9FC, 0xFAFC, 0xFBFC, 0xFCFC, 0xFDFC, 0xFEFC, 0xFFFC, - 0x00FC, 0x01FC, 0x02FC, 0x03FC, 0x04FC, 0x05FC, 0x06FC, 0x07FC, - 0x08FC, 0x09FC, 0x0AFC, 0xF6FD, 0xF7FD, 0xF8FD, 0xF9FD, 0xFAFD, - 0xFBFD, 0xFCFD, 0xFDFD, 0xFEFD, 0xFFFD, 0x00FD, 0x01FD, 0x02FD, - 0x03FD, 0x04FD, 0x05FD, 0x06FD, 0x07FD, 0x08FD, 0x09FD, 0x0AFD, - 0xF6FE, 0xF7FE, 0xF8FE, 0xF9FE, 0xFAFE, 0xFBFE, 0xFCFE, 0xFDFE, - 0xFEFE, 0xFFFE, 0x00FE, 0x01FE, 0x02FE, 0x03FE, 0x04FE, 0x05FE, - 0x06FE, 0x07FE, 0x08FE, 0x09FE, 0x0AFE, 0xF6FF, 0xF7FF, 0xF8FF, - 0xF9FF, 0xFAFF, 0xFBFF, 0xFCFF, 0xFDFF, 0xFEFF, 0xFFFF, 0x00FF, - 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF, 0x07FF, 0x08FF, - 0x09FF, 0x0AFF, 0xF600, 0xF700, 0xF800, 0xF900, 0xFA00, 0xFB00, - 0xFC00, 0xFD00, 0xFE00, 0xFF00, 0x0000, 0x0100, 0x0200, 0x0300, - 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0x0A00, 0xF601, - 0xF701, 0xF801, 0xF901, 0xFA01, 0xFB01, 0xFC01, 0xFD01, 0xFE01, - 0xFF01, 0x0001, 0x0101, 0x0201, 0x0301, 0x0401, 0x0501, 0x0601, - 0x0701, 0x0801, 0x0901, 0x0A01, 0xF602, 0xF702, 0xF802, 0xF902, - 0xFA02, 0xFB02, 0xFC02, 0xFD02, 0xFE02, 0xFF02, 0x0002, 0x0102, - 0x0202, 0x0302, 0x0402, 0x0502, 0x0602, 0x0702, 0x0802, 0x0902, - 0x0A02, 0xF603, 0xF703, 0xF803, 0xF903, 0xFA03, 0xFB03, 0xFC03, - 0xFD03, 0xFE03, 0xFF03, 0x0003, 0x0103, 0x0203, 0x0303, 0x0403, - 0x0503, 0x0603, 0x0703, 0x0803, 0x0903, 0x0A03, 0xF604, 0xF704, - 0xF804, 0xF904, 0xFA04, 0xFB04, 0xFC04, 0xFD04, 0xFE04, 0xFF04, - 0x0004, 0x0104, 0x0204, 0x0304, 0x0404, 0x0504, 0x0604, 0x0704, - 0x0804, 0x0904, 0x0A04, 0xF605, 0xF705, 0xF805, 0xF905, 0xFA05, - 0xFB05, 0xFC05, 0xFD05, 0xFE05, 0xFF05, 0x0005, 0x0105, 0x0205, - 0x0305, 0x0405, 0x0505, 0x0605, 0x0705, 0x0805, 0x0905, 0x0A05, - 0xF606, 0xF706, 0xF806, 0xF906, 0xFA06, 0xFB06, 0xFC06, 0xFD06, - 0xFE06, 0xFF06, 0x0006, 0x0106, 0x0206, 0x0306, 0x0406, 0x0506, - 0x0606, 0x0706, 0x0806, 0x0906, 0x0A06, 0xF607, 0xF707, 0xF807, - 0xF907, 0xFA07, 0xFB07, 0xFC07, 0xFD07, 0xFE07, 0xFF07, 0x0007, - 0x0107, 0x0207, 0x0307, 0x0407, 0x0507, 0x0607, 0x0707, 0x0807, - 0x0907, 0x0A07, 0xF608, 0xF708, 0xF808, 0xF908, 0xFA08, 0xFB08, - 0xFC08, 0xFD08, 0xFE08, 0xFF08, 0x0008, 0x0108, 0x0208, 0x0308, - 0x0408, 0x0508, 0x0608, 0x0708, 0x0808, 0x0908, 0x0A08, 0xF609, - 0xF709, 0xF809, 0xF909, 0xFA09, 0xFB09, 0xFC09, 0xFD09, 0xFE09, - 0xFF09, 0x0009, 0x0109, 0x0209, 0x0309, 0x0409, 0x0509, 0x0609, - 0x0709, 0x0809, 0x0909, 0x0A09, 0xF60A, 0xF70A, 0xF80A, 0xF90A, - 0xFA0A, 0xFB0A, 0xFC0A, 0xFD0A, 0xFE0A, 0xFF0A, 0x000A, 0x010A, - 0x020A, 0x030A, 0x040A, 0x050A, 0x060A, 0x070A, 0x080A, 0x090A, - 0x0A0A, 0x0B0B, + 0x0000, 0xFF00, 0x0100, 0x00FF, 0x0001, 0xFFFF, 0x01FF, 0xFF01, 0x0101, + 0x0B0B, 0x0002, 0x00FE, 0xFE00, 0x0200, 0x0003, 0x00FD, 0xFEFF, 0x02FF, + 0xFE01, 0x0201, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFD00, 0x0300, 0x00FC, + 0x0005, 0xFDFF, 0x03FF, 0xFD01, 0x0301, 0xFF03, 0x0103, 0xFFFD, 0x01FD, + 0xFE02, 0x0202, 0xFEFE, 0x02FE, 0xFCFF, 0x04FF, 0xFC01, 0x0401, 0xFBFF, + 0x05FF, 0xFB01, 0x0501, 0x0004, 0x00FB, 0xFD02, 0x0302, 0xFDFE, 0x03FE, + 0xFF05, 0x0105, 0xFFFB, 0x01FB, 0x0006, 0x00FA, 0xFFFC, 0x01FC, 0xFF04, + 0x0104, 0xFE03, 0x0203, 0xFEFD, 0x02FD, 0xFC00, 0x0400, 0xFF06, 0x0106, + 0xFFFA, 0x01FA, 0xFEFC, 0x02FC, 0xFE04, 0x0204, 0xFD03, 0x0303, 0xFDFD, + 0x03FD, 0xFC02, 0x0402, 0xFCFE, 0x04FE, 0xFAFF, 0x06FF, 0xFA01, 0x0601, + 0xFC03, 0x0403, 0xFCFD, 0x04FD, 0xFB02, 0x0502, 0xFBFE, 0x05FE, 0xFB00, + 0x0500, 0xFA00, 0x0600, 0xFE05, 0x0205, 0xFEFB, 0x02FB, 0xFA02, 0x0602, + 0xFAFE, 0x06FE, 0xFD05, 0x0305, 0xFDFB, 0x03FB, 0xFB03, 0x0503, 0xFBFD, + 0x05FD, 0xFC05, 0x0405, 0xFCFB, 0x04FB, 0xFDFC, 0x03FC, 0x00F9, 0xFD04, + 0x0304, 0x0007, 0xF902, 0x0702, 0xFA03, 0x0603, 0xFAFD, 0xFA05, 0xFB05, + 0x06FD, 0x0505, 0x0605, 0xF9FE, 0xFE06, 0x0206, 0xFEFA, 0x07FE, 0x02FA, + 0xFAFB, 0xFBFB, 0x05FB, 0x06FB, 0xFD06, 0x0306, 0xFDFA, 0x03FA, 0x0406, + 0xFC06, 0xFCFA, 0x04FA, 0xFCFC, 0x04FC, 0xFC04, 0x0404, 0xF9FF, 0x07FF, + 0xF901, 0x0701, 0xFFF9, 0x01F9, 0x0107, 0xFF07, 0xFAFC, 0xFBFC, 0x05FC, + 0x06FC, 0xFA04, 0xFB04, 0x0504, 0x0604, 0xFB06, 0x0506, 0xFBFA, 0x05FA, + 0x0008, 0x00F8, 0xF9FC, 0x07FC, 0xF904, 0x0704, 0xFA06, 0x0606, 0xFAFA, + 0x06FA, 0x00F7, 0x0009, 0xF700, 0xF800, 0xF900, 0x0700, 0x0800, 0x0900, + 0xFEF9, 0x02F9, 0xFE07, 0x0207, 0xF8FF, 0xFF08, 0x0108, 0xFFF8, 0x08FF, + 0x01F8, 0xF801, 0x0801, 0x0307, 0xFDF9, 0x03F9, 0xFD07, 0xF7FF, 0x09FF, + 0xF701, 0x0901, 0xF8FC, 0xF903, 0x08FC, 0xF804, 0xF9FD, 0x0804, 0xF905, + 0x0705, 0x0703, 0xF9FB, 0x07FD, 0x07FB, 0xFC07, 0x01F7, 0xFCF9, 0x04F9, + 0x0407, 0xFF09, 0x0109, 0xFFF7, 0x0802, 0xFAF9, 0xFBF9, 0x05F9, 0x06F9, + 0xFB07, 0xF8FE, 0xFA07, 0x0507, 0x08FE, 0x0607, 0xF802, 0x0902, 0xF803, + 0x0803, 0xF8FD, 0x08FD, 0xF805, 0xF7FE, 0x0805, 0x00F6, 0x09FE, 0x000A, + 0xF8FB, 0x08FB, 0xF702, 0x07FA, 0xF906, 0xFEF8, 0x0208, 0xF9FA, 0xF6FF, + 0xFD08, 0x0308, 0xFDF8, 0x0AFF, 0x0706, 0x02F8, 0x03F8, 0xF601, 0xFE08, + 0x0A01, 0xFE09, 0x02F7, 0x0905, 0xF705, 0xF7FB, 0x0209, 0xFEF7, 0x09FB, + 0xF603, 0xFC09, 0xF703, 0x03F7, 0xF605, 0x04F7, 0x0903, 0x0A03, 0x09FD, + 0xFBF7, 0x0AFD, 0x0A05, 0x05F7, 0xFD09, 0x0A00, 0xFC08, 0xF7FD, 0x0408, + 0xFCF8, 0xFB09, 0x0509, 0x0AFB, 0xF600, 0xF6FB, 0xFCF7, 0xF6FD, 0x04F8, + 0x0309, 0xFDF7, 0x0409, 0x01F6, 0xFA09, 0xF9F9, 0xFF0A, 0x08FA, 0xFBF8, + 0xFFF6, 0x07F9, 0x0609, 0xFB08, 0x06F7, 0xF8FA, 0x0906, 0xF907, 0x0508, + 0xF706, 0xF7FA, 0x09FA, 0xFAF7, 0x010A, 0x0707, 0x0806, 0x05F8, 0xF806, + 0x0A06, 0xF7FC, 0xF606, 0xFEF6, 0xF6FE, 0x0608, 0xF908, 0x0A02, 0xF602, + 0x020A, 0xFD0A, 0x09FC, 0x0AFA, 0xFDF6, 0x0708, 0xF9F8, 0x0AFE, 0xFAF8, + 0xF704, 0xFA08, 0x06F8, 0x030A, 0x02F6, 0xF6FA, 0xFE0A, 0x07F8, 0x0904, + 0x03F6, 0x04F6, 0xFBF6, 0x08F9, 0xF8F9, 0x05F6, 0xFB0A, 0x0807, 0xFC0A, + 0xF807, 0x040A, 0x050A, 0xFCF6, 0x0709, 0x060A, 0x07F7, 0xF9F7, 0xF909, + 0xFAF6, 0xFA0A, 0x06F6, 0x0AFC, 0xF808, 0x09F7, 0x08F8, 0xF708, 0x09F9, + 0xF8F7, 0xF707, 0x0809, 0xF7F9, 0xF8F8, 0x09F8, 0xF709, 0xF6FC, 0x08F7, + 0xF809, 0x0907, 0xF604, 0xF90A, 0x0909, 0xF9F6, 0xF7F8, 0x0A04, 0x070A, + 0x07F6, 0x0808, 0x0908, 0xF7F7, 0x080A, 0x08F6, 0xF8F6, 0xF70A, 0x09F6, + 0xF80A, 0x090A, 0xF7F6, 0x0A09, 0x0AF8, 0xF6F6, 0x0AF9, 0xF6F7, 0x0A07, + 0x0A0A, 0x0AF7, 0x0AF6, 0xF60A, 0x0A08, 0xF6F9, 0xF609, 0xF607, 0xF6F8, + 0xF608, }; static const uint8_t clv_mvv_1_bits[] = { - 16, 15, 13, 13, 13, 12, 10, 10, 10, 12, 13, 13, 13, 15, 16, 16, - 15, 14, 13, 12, 11, 10, 9, 10, 11, 12, 13, 14, 15, 16, 15, 14, - 13, 13, 11, 10, 10, 5, 10, 10, 11, 13, 13, 14, 15, 12, 12, 12, - 11, 10, 10, 9, 5, 9, 10, 10, 11, 12, 12, 12, 14, 12, 12, 12, - 11, 9, 8, 5, 8, 9, 11, 12, 12, 12, 14, 14, 11, 11, 9, 9, - 9, 7, 5, 7, 9, 9, 9, 11, 11, 14, 13, 12, 11, 10, 10, 8, - 6, 3, 6, 8, 10, 10, 11, 12, 13, 11, 10, 9, 7, 6, 6, 4, - 4, 4, 6, 7, 7, 10, 10, 11, 13, 12, 11, 10, 10, 8, 6, 3, - 6, 8, 10, 10, 11, 12, 13, 14, 11, 11, 9, 9, 9, 7, 5, 7, - 9, 9, 9, 11, 11, 14, 14, 12, 12, 12, 11, 9, 8, 5, 8, 9, - 11, 12, 12, 12, 14, 12, 12, 12, 11, 10, 10, 9, 5, 9, 10, 10, - 11, 12, 12, 12, 15, 14, 13, 13, 11, 10, 10, 5, 10, 10, 11, 13, - 13, 14, 15, 16, 15, 14, 13, 12, 11, 10, 9, 10, 11, 12, 13, 14, - 15, 16, 16, 15, 13, 13, 13, 12, 10, 10, 10, 12, 13, 13, 13, 15, - 16, 7, -}; - -static const uint16_t clv_mvv_1_codes[] = { - 0xFFFD, 0x7FF8, 0x1FF2, 0x1FDC, 0x1FDB, 0x0FD2, 0x03D6, 0x03BF, - 0x03D3, 0x0FD0, 0x1FDA, 0x1FDE, 0x1FF0, 0x7FF9, 0xFFFE, 0xFFFA, - 0x7FFB, 0x3FF3, 0x1FE9, 0x0FD6, 0x07CB, 0x03E1, 0x01C8, 0x03E2, - 0x07CC, 0x0FD9, 0x1FE8, 0x3FF6, 0x7FFA, 0xFFF9, 0x7FF1, 0x3FEE, - 0x1FE4, 0x1FE0, 0x07D4, 0x03DB, 0x03CB, 0x0014, 0x03CC, 0x03DC, - 0x07D6, 0x1FE3, 0x1FE7, 0x3FEC, 0x7FF3, 0x0FEA, 0x0FE0, 0x0FDE, - 0x07DE, 0x03C9, 0x03C3, 0x01DC, 0x0013, 0x01DD, 0x03C4, 0x03CA, - 0x07DF, 0x0FDF, 0x0FE3, 0x0FEB, 0x3FF1, 0x0FE7, 0x0FCF, 0x0FC8, - 0x07D8, 0x01D2, 0x00E0, 0x0010, 0x00E1, 0x01D4, 0x07D9, 0x0FC9, - 0x0FCC, 0x0FE6, 0x3FF5, 0x3FEA, 0x07E2, 0x07D2, 0x01D7, 0x01D0, - 0x01CC, 0x006A, 0x000F, 0x006B, 0x01CD, 0x01D1, 0x01D9, 0x07D3, - 0x07E3, 0x3FEB, 0x1FEE, 0x0FD5, 0x07C7, 0x03D8, 0x03D0, 0x00DD, - 0x002D, 0x0001, 0x002E, 0x00DE, 0x03D1, 0x03D9, 0x07C8, 0x0FD8, - 0x1FEF, 0x07CE, 0x03C5, 0x01DE, 0x006C, 0x0032, 0x0030, 0x0005, - 0x0004, 0x0006, 0x0031, 0x0066, 0x006D, 0x03BE, 0x03C6, 0x07CF, - 0x1FEC, 0x0FDA, 0x07C9, 0x03DA, 0x03D2, 0x00DF, 0x002F, 0x0000, - 0x002C, 0x00DC, 0x03CF, 0x03D7, 0x07C6, 0x0FD4, 0x1FED, 0x3FE9, - 0x07E0, 0x07D0, 0x01D3, 0x01CE, 0x01CA, 0x0068, 0x000E, 0x0069, - 0x01CB, 0x01CF, 0x01D5, 0x07D1, 0x07E1, 0x3FE8, 0x3FF4, 0x0FE4, - 0x0FCD, 0x0FCB, 0x07DA, 0x01D6, 0x00E2, 0x0011, 0x00E3, 0x01D8, - 0x07DB, 0x0FCA, 0x0FCE, 0x0FE5, 0x3FF7, 0x0FE8, 0x0FE1, 0x0FDD, - 0x07DD, 0x03C7, 0x03C1, 0x01DA, 0x0012, 0x01DB, 0x03C2, 0x03C8, - 0x07DC, 0x0FDC, 0x0FE2, 0x0FE9, 0x7FF0, 0x3FEF, 0x1FE5, 0x1FE1, - 0x07D7, 0x03DD, 0x03CD, 0x0015, 0x03CE, 0x03DE, 0x07D5, 0x1FE2, - 0x1FE6, 0x3FED, 0x7FF2, 0xFFF8, 0x7FF4, 0x3FF2, 0x1FEB, 0x0FD7, - 0x07CD, 0x03DF, 0x01C9, 0x03E0, 0x07CA, 0x0FDB, 0x1FEA, 0x3FF0, - 0x7FF5, 0xFFFB, 0xFFFC, 0x7FF6, 0x1FF3, 0x1FDD, 0x1FD9, 0x0FD1, - 0x03D5, 0x03C0, 0x03D4, 0x0FD3, 0x1FD8, 0x1FDF, 0x1FF1, 0x7FF7, - 0xFFFF, 0x0067, + 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, + 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16 }; static const uint16_t clv_mvv_1_syms[] = { - 0xF9F9, 0xFAF9, 0xFBF9, 0xFCF9, 0xFDF9, 0xFEF9, 0xFFF9, 0x00F9, - 0x01F9, 0x02F9, 0x03F9, 0x04F9, 0x05F9, 0x06F9, 0x07F9, 0xF9FA, - 0xFAFA, 0xFBFA, 0xFCFA, 0xFDFA, 0xFEFA, 0xFFFA, 0x00FA, 0x01FA, - 0x02FA, 0x03FA, 0x04FA, 0x05FA, 0x06FA, 0x07FA, 0xF9FB, 0xFAFB, - 0xFBFB, 0xFCFB, 0xFDFB, 0xFEFB, 0xFFFB, 0x00FB, 0x01FB, 0x02FB, - 0x03FB, 0x04FB, 0x05FB, 0x06FB, 0x07FB, 0xF9FC, 0xFAFC, 0xFBFC, - 0xFCFC, 0xFDFC, 0xFEFC, 0xFFFC, 0x00FC, 0x01FC, 0x02FC, 0x03FC, - 0x04FC, 0x05FC, 0x06FC, 0x07FC, 0xF9FD, 0xFAFD, 0xFBFD, 0xFCFD, - 0xFDFD, 0xFEFD, 0xFFFD, 0x00FD, 0x01FD, 0x02FD, 0x03FD, 0x04FD, - 0x05FD, 0x06FD, 0x07FD, 0xF9FE, 0xFAFE, 0xFBFE, 0xFCFE, 0xFDFE, - 0xFEFE, 0xFFFE, 0x00FE, 0x01FE, 0x02FE, 0x03FE, 0x04FE, 0x05FE, - 0x06FE, 0x07FE, 0xF9FF, 0xFAFF, 0xFBFF, 0xFCFF, 0xFDFF, 0xFEFF, - 0xFFFF, 0x00FF, 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF, - 0x07FF, 0xF900, 0xFA00, 0xFB00, 0xFC00, 0xFD00, 0xFE00, 0xFF00, - 0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, - 0xF901, 0xFA01, 0xFB01, 0xFC01, 0xFD01, 0xFE01, 0xFF01, 0x0001, - 0x0101, 0x0201, 0x0301, 0x0401, 0x0501, 0x0601, 0x0701, 0xF902, - 0xFA02, 0xFB02, 0xFC02, 0xFD02, 0xFE02, 0xFF02, 0x0002, 0x0102, - 0x0202, 0x0302, 0x0402, 0x0502, 0x0602, 0x0702, 0xF903, 0xFA03, - 0xFB03, 0xFC03, 0xFD03, 0xFE03, 0xFF03, 0x0003, 0x0103, 0x0203, - 0x0303, 0x0403, 0x0503, 0x0603, 0x0703, 0xF904, 0xFA04, 0xFB04, - 0xFC04, 0xFD04, 0xFE04, 0xFF04, 0x0004, 0x0104, 0x0204, 0x0304, - 0x0404, 0x0504, 0x0604, 0x0704, 0xF905, 0xFA05, 0xFB05, 0xFC05, - 0xFD05, 0xFE05, 0xFF05, 0x0005, 0x0105, 0x0205, 0x0305, 0x0405, - 0x0505, 0x0605, 0x0705, 0xF906, 0xFA06, 0xFB06, 0xFC06, 0xFD06, - 0xFE06, 0xFF06, 0x0006, 0x0106, 0x0206, 0x0306, 0x0406, 0x0506, - 0x0606, 0x0706, 0xF907, 0xFA07, 0xFB07, 0xFC07, 0xFD07, 0xFE07, - 0xFF07, 0x0007, 0x0107, 0x0207, 0x0307, 0x0407, 0x0507, 0x0607, - 0x0707, 0x0808, + 0x0001, 0x00FF, 0x0000, 0xFF00, 0x0100, 0x0002, 0x00FE, 0x00FD, 0x0003, + 0x0004, 0x00FC, 0x00FB, 0x0005, 0x0101, 0xFFFF, 0x01FF, 0xFF01, 0xFE00, + 0x0200, 0xFD00, 0x0300, 0x0808, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFC00, + 0x0400, 0x0201, 0xFEFF, 0x02FF, 0xFE01, 0xFFFD, 0x01FD, 0xFF03, 0x0103, + 0x00FA, 0x0006, 0xFE02, 0x0202, 0xFEFE, 0x02FE, 0xFD02, 0x0302, 0xFDFE, + 0x03FE, 0xFEFD, 0xFC02, 0x02FD, 0x0402, 0xFE03, 0xFCFE, 0x0203, 0x04FE, + 0xFF04, 0x0104, 0xFFFC, 0x01FC, 0xFB00, 0x0500, 0x00F9, 0x0007, 0xFE04, + 0x0204, 0xFEFC, 0x02FC, 0xFA00, 0x0600, 0xFD04, 0x0304, 0xFDFC, 0x03FC, + 0xFFFB, 0x01FB, 0xFF05, 0x0105, 0x0301, 0xFDFF, 0x03FF, 0xFD01, 0x01F9, + 0x0107, 0xFF07, 0xFFF9, 0x0401, 0xFCFF, 0x04FF, 0xFC01, 0xFEFB, 0x02FB, + 0xFE05, 0x0205, 0xFF06, 0x0106, 0xFFFA, 0x01FA, 0x0501, 0xFBFF, 0x05FF, + 0xFB01, 0x0206, 0xFEFA, 0x02FA, 0xFE06, 0xF900, 0x0700, 0xFB02, 0x0502, + 0xFBFE, 0x05FE, 0xFDFB, 0x0305, 0x03FB, 0xFD05, 0xFDFD, 0x03FD, 0xFD03, + 0x0303, 0x0404, 0xFC04, 0xFCFC, 0x04FC, 0xFA02, 0x0602, 0xFAFE, 0x06FE, + 0xFCFD, 0x04FD, 0x0403, 0xFC03, 0x05FD, 0xFB03, 0x0503, 0xFBFD, 0x02F9, + 0xFE07, 0xFEF9, 0x0207, 0x0601, 0xFAFF, 0xFDFA, 0xFD06, 0x06FF, 0x03FA, + 0xFA01, 0x0306, 0x0504, 0xFB04, 0xFBFC, 0x05FC, 0xFAFC, 0xFA04, 0x0604, + 0x06FC, 0xFA03, 0x0603, 0x06FD, 0xFAFD, 0xF904, 0x0704, 0xF9FC, 0x07FC, + 0x0307, 0xFD07, 0x03F9, 0xFDF9, 0xFCF9, 0xFC07, 0x04F9, 0x0407, 0xFCFB, + 0xFC05, 0x0405, 0x04FB, 0xFBFB, 0xFB05, 0x0505, 0x05FB, 0x04FA, 0xFCFA, + 0x0406, 0xFC06, 0xF901, 0x0701, 0xF9FF, 0x07FF, 0x05F9, 0x0507, 0xFBF9, + 0xFB07, 0x0702, 0xF902, 0xF9FE, 0x07FE, 0x06FB, 0x0605, 0xFAFB, 0xFA05, + 0x0506, 0xF9FD, 0xFB06, 0xFBFA, 0xF903, 0x07FD, 0x05FA, 0x0703, 0xF905, + 0xF9FB, 0x0705, 0x07FB, 0xFA06, 0x0606, 0xFA07, 0x0607, 0xFAF9, 0x06F9, + 0x06FA, 0xFAFA, 0xF906, 0x07FA, 0xF9FA, 0x0706, 0xF907, 0xF9F9, 0x07F9, + 0x0707, }; static const uint8_t clv_mvv_2_bits[] = { - 16, 15, 15, 15, 15, 15, 14, 14, 14, 13, 12, 13, 14, 14, 14, 15, - 15, 15, 15, 15, 16, 16, 16, 16, 15, 15, 14, 14, 14, 13, 13, 12, - 12, 13, 14, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 14, 14, 14, - 14, 14, 14, 13, 13, 13, 14, 14, 14, 14, 14, 14, 16, 16, 16, 15, - 15, 14, 14, 14, 13, 13, 13, 13, 12, 12, 12, 13, 13, 13, 13, 14, - 14, 14, 15, 15, 16, 14, 14, 14, 13, 12, 12, 12, 10, 10, 10, 10, - 10, 12, 12, 12, 13, 14, 14, 14, 16, 14, 14, 14, 13, 13, 12, 12, - 12, 10, 10, 7, 10, 10, 12, 12, 12, 13, 13, 14, 14, 14, 14, 14, - 13, 12, 12, 12, 12, 10, 9, 8, 7, 8, 9, 10, 12, 12, 12, 12, - 13, 14, 14, 14, 14, 13, 12, 12, 12, 12, 10, 9, 8, 7, 8, 9, - 10, 12, 12, 12, 12, 13, 14, 14, 14, 14, 13, 13, 12, 12, 11, 10, - 9, 8, 7, 8, 9, 10, 11, 12, 12, 13, 13, 14, 14, 14, 13, 13, - 12, 10, 10, 9, 8, 7, 6, 5, 6, 7, 8, 9, 10, 10, 12, 13, - 13, 14, 13, 13, 13, 13, 11, 10, 9, 8, 7, 5, 1, 5, 7, 8, - 9, 10, 11, 13, 13, 13, 13, 14, 13, 13, 12, 10, 10, 9, 8, 7, - 6, 5, 6, 7, 8, 9, 10, 10, 12, 13, 13, 14, 14, 14, 13, 13, - 12, 12, 11, 9, 9, 8, 7, 8, 9, 9, 11, 12, 12, 13, 13, 14, - 14, 14, 14, 13, 12, 12, 12, 12, 10, 9, 8, 7, 8, 9, 10, 12, - 12, 12, 12, 13, 14, 14, 14, 14, 13, 12, 12, 12, 12, 10, 9, 8, - 7, 8, 9, 10, 12, 12, 12, 12, 13, 14, 14, 14, 14, 14, 13, 13, - 12, 12, 12, 10, 10, 7, 10, 10, 12, 12, 12, 13, 13, 14, 14, 14, - 16, 14, 14, 14, 13, 12, 12, 12, 10, 10, 10, 10, 10, 12, 12, 12, - 13, 14, 14, 14, 16, 15, 15, 14, 14, 14, 13, 13, 13, 13, 12, 12, - 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 14, 14, 14, - 14, 14, 14, 13, 13, 13, 14, 14, 14, 14, 14, 14, 16, 16, 16, 16, - 16, 16, 15, 15, 14, 14, 14, 13, 12, 12, 12, 13, 14, 14, 14, 15, - 15, 16, 16, 16, 16, 15, 15, 15, 15, 15, 14, 14, 14, 13, 10, 13, - 14, 14, 14, 15, 15, 15, 15, 15, 16, 6, -}; - -static const uint16_t clv_mvv_2_codes[] = { - 0xFFFF, 0x7FE7, 0x7FD9, 0x7FE6, 0x7FE5, 0x7FCE, 0x3FD6, 0x3FD3, - 0x3F9C, 0x1FB2, 0x0F7A, 0x1FB5, 0x3FA8, 0x3FDD, 0x3FE5, 0x7FD0, - 0x7FEA, 0x7FEC, 0x7FEF, 0x7FDB, 0xFFF3, 0xFFF5, 0xFFE2, 0xFFEB, - 0x7FEB, 0x7FE0, 0x3FA7, 0x3F84, 0x3F79, 0x1FAE, 0x1F70, 0x0F78, - 0x0FAA, 0x1FAA, 0x3F76, 0x3F7E, 0x3FAC, 0x7FE1, 0x7FDD, 0xFFEC, - 0xFFEE, 0xFFF8, 0xFFF9, 0xFFEA, 0xFFE4, 0x3FE1, 0x3FBA, 0x3FC5, - 0x3FB9, 0x3FA1, 0x3FAA, 0x1F8B, 0x1F8D, 0x1F8E, 0x3FA6, 0x3FA9, - 0x3FC4, 0x3FBC, 0x3FC6, 0x3FDB, 0xFFE3, 0xFFE1, 0xFFFB, 0x7FD4, - 0x7FCC, 0x3FCD, 0x3F88, 0x3F7C, 0x1FA1, 0x1FA2, 0x1F95, 0x1F77, - 0x0F95, 0x0F79, 0x0F97, 0x1F78, 0x1F96, 0x1FA3, 0x1FA4, 0x3F7F, - 0x3F8B, 0x3FCB, 0x7FCF, 0x7FD5, 0xFFF6, 0x3FD7, 0x3FE0, 0x3F91, - 0x1F7B, 0x0FB4, 0x0FA5, 0x0FA6, 0x03D5, 0x03CB, 0x03BF, 0x03CC, - 0x03D6, 0x0FA7, 0x0FA8, 0x0FB5, 0x1F7D, 0x3F87, 0x3FD2, 0x3FDF, - 0xFFF0, 0x3F95, 0x3F8A, 0x3F96, 0x1FB7, 0x1F9F, 0x0F9F, 0x0F8F, - 0x0F76, 0x03D1, 0x03BC, 0x0067, 0x03BD, 0x03D2, 0x0F77, 0x0F90, - 0x0FA0, 0x1FA0, 0x1FB9, 0x3F97, 0x3F98, 0x3F99, 0x3FC3, 0x3FAF, - 0x1F81, 0x0FA9, 0x0F91, 0x0F7E, 0x0F68, 0x03B2, 0x01C6, 0x00D4, - 0x0062, 0x00D5, 0x01C7, 0x03B3, 0x0F6A, 0x0F81, 0x0F93, 0x0FAC, - 0x1F83, 0x3FB3, 0x3FB4, 0x3FC7, 0x3FBB, 0x1F86, 0x0FAF, 0x0F98, - 0x0F84, 0x0F6D, 0x03B8, 0x01CC, 0x00DA, 0x0065, 0x00DB, 0x01CD, - 0x03B9, 0x0F6F, 0x0F86, 0x0F9B, 0x0FB1, 0x1F88, 0x3FB8, 0x3FC9, - 0x3FDC, 0x3F80, 0x1FB3, 0x1F93, 0x0F87, 0x0F72, 0x07B0, 0x03B0, - 0x01D4, 0x00E0, 0x0061, 0x00E1, 0x01D5, 0x03B1, 0x07B1, 0x0F73, - 0x0F88, 0x1F94, 0x1FB4, 0x3F81, 0x3FD4, 0x3F9E, 0x1F99, 0x1F73, - 0x0F89, 0x03C4, 0x03C0, 0x01CE, 0x00D0, 0x005C, 0x0028, 0x0010, - 0x0029, 0x005D, 0x00D1, 0x01CF, 0x03C1, 0x03C5, 0x0F8A, 0x1F74, - 0x1F9A, 0x3FA4, 0x1FAC, 0x1F8C, 0x1F7E, 0x1F71, 0x07B2, 0x03CF, - 0x01C4, 0x00DC, 0x005A, 0x0012, 0x0000, 0x0013, 0x005B, 0x00DD, - 0x01C5, 0x03D0, 0x07B3, 0x1F72, 0x1F7F, 0x1F8F, 0x1FAD, 0x3FAB, - 0x1F9B, 0x1F75, 0x0F8B, 0x03C6, 0x03C2, 0x01D0, 0x00D2, 0x005E, - 0x002A, 0x0011, 0x002B, 0x005F, 0x00D3, 0x01D1, 0x03C3, 0x03C7, - 0x0F8C, 0x1F76, 0x1F9C, 0x3FAD, 0x3FCF, 0x3F85, 0x1FBA, 0x1F91, - 0x0F7D, 0x0F70, 0x07AE, 0x01D6, 0x01D2, 0x00DE, 0x0060, 0x00DF, - 0x01D3, 0x01D7, 0x07AF, 0x0F71, 0x0F7F, 0x1F92, 0x1FAF, 0x3F7B, - 0x3FD0, 0x3FC0, 0x3FB1, 0x1F82, 0x0FAB, 0x0F92, 0x0F80, 0x0F69, - 0x03B4, 0x01C8, 0x00D6, 0x0063, 0x00D7, 0x01C9, 0x03B5, 0x0F6B, - 0x0F82, 0x0F94, 0x0FAD, 0x1F84, 0x3FB5, 0x3FC2, 0x3FB6, 0x3FBF, - 0x1F85, 0x0FAE, 0x0F96, 0x0F83, 0x0F6C, 0x03B6, 0x01CA, 0x00D8, - 0x0064, 0x00D9, 0x01CB, 0x03B7, 0x0F6E, 0x0F85, 0x0F99, 0x0FB0, - 0x1F87, 0x3FB0, 0x3FB2, 0x3F93, 0x3F86, 0x3F8E, 0x1FB1, 0x1F9D, - 0x0F9A, 0x0F8D, 0x0F74, 0x03CD, 0x03BA, 0x0066, 0x03BB, 0x03CE, - 0x0F75, 0x0F8E, 0x0F9C, 0x1F9E, 0x1FB0, 0x3F8C, 0x3F94, 0x3F8D, - 0xFFFC, 0x3FCA, 0x3FD5, 0x3F8F, 0x1F79, 0x0FB2, 0x0FA1, 0x0FA2, - 0x03D3, 0x03C9, 0x03BE, 0x03CA, 0x03D4, 0x0FA3, 0x0FA4, 0x0FB3, - 0x1F7A, 0x3F90, 0x3FE3, 0x3FD8, 0xFFF2, 0x7FD7, 0x7FCD, 0x3FE4, - 0x3F92, 0x3F82, 0x1FA6, 0x1FA8, 0x1F98, 0x1F7C, 0x0F9D, 0x0F7B, - 0x0F9E, 0x1F80, 0x1F97, 0x1FA7, 0x1FA5, 0x3F7A, 0x3F89, 0x3FDA, - 0x7FD2, 0x7FD6, 0xFFFE, 0xFFED, 0xFFE8, 0x3FCC, 0x3FBD, 0x3FAE, - 0x3FC1, 0x3F9F, 0x3F9A, 0x1F89, 0x1F90, 0x1F8A, 0x3FA3, 0x3FA0, - 0x3FC8, 0x3FBE, 0x3FB7, 0x3FD1, 0xFFE7, 0xFFE9, 0xFFFD, 0xFFF4, - 0xFFE5, 0xFFEF, 0x7FD8, 0x7FDC, 0x3FA2, 0x3F83, 0x3F78, 0x1FA9, - 0x0FB6, 0x0F7C, 0x0FB7, 0x1FAB, 0x3F77, 0x3F7D, 0x3F9B, 0x7FDE, - 0x7FED, 0xFFE6, 0xFFE0, 0xFFF7, 0xFFF1, 0x7FDA, 0x7FE9, 0x7FE2, - 0x7FE3, 0x7FD1, 0x3FD9, 0x3FE2, 0x3FA5, 0x1FB8, 0x03C8, 0x1FB6, - 0x3F9D, 0x3FDE, 0x3FCE, 0x7FD3, 0x7FEE, 0x7FDF, 0x7FE8, 0x7FE4, - 0xFFFA, 0x002C, + 1, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16 }; static const uint16_t clv_mvv_2_syms[] = { - 0xF6F6, 0xF7F6, 0xF8F6, 0xF9F6, 0xFAF6, 0xFBF6, 0xFCF6, 0xFDF6, - 0xFEF6, 0xFFF6, 0x00F6, 0x01F6, 0x02F6, 0x03F6, 0x04F6, 0x05F6, - 0x06F6, 0x07F6, 0x08F6, 0x09F6, 0x0AF6, 0xF6F7, 0xF7F7, 0xF8F7, - 0xF9F7, 0xFAF7, 0xFBF7, 0xFCF7, 0xFDF7, 0xFEF7, 0xFFF7, 0x00F7, - 0x01F7, 0x02F7, 0x03F7, 0x04F7, 0x05F7, 0x06F7, 0x07F7, 0x08F7, - 0x09F7, 0x0AF7, 0xF6F8, 0xF7F8, 0xF8F8, 0xF9F8, 0xFAF8, 0xFBF8, - 0xFCF8, 0xFDF8, 0xFEF8, 0xFFF8, 0x00F8, 0x01F8, 0x02F8, 0x03F8, - 0x04F8, 0x05F8, 0x06F8, 0x07F8, 0x08F8, 0x09F8, 0x0AF8, 0xF6F9, - 0xF7F9, 0xF8F9, 0xF9F9, 0xFAF9, 0xFBF9, 0xFCF9, 0xFDF9, 0xFEF9, - 0xFFF9, 0x00F9, 0x01F9, 0x02F9, 0x03F9, 0x04F9, 0x05F9, 0x06F9, - 0x07F9, 0x08F9, 0x09F9, 0x0AF9, 0xF6FA, 0xF7FA, 0xF8FA, 0xF9FA, - 0xFAFA, 0xFBFA, 0xFCFA, 0xFDFA, 0xFEFA, 0xFFFA, 0x00FA, 0x01FA, - 0x02FA, 0x03FA, 0x04FA, 0x05FA, 0x06FA, 0x07FA, 0x08FA, 0x09FA, - 0x0AFA, 0xF6FB, 0xF7FB, 0xF8FB, 0xF9FB, 0xFAFB, 0xFBFB, 0xFCFB, - 0xFDFB, 0xFEFB, 0xFFFB, 0x00FB, 0x01FB, 0x02FB, 0x03FB, 0x04FB, - 0x05FB, 0x06FB, 0x07FB, 0x08FB, 0x09FB, 0x0AFB, 0xF6FC, 0xF7FC, - 0xF8FC, 0xF9FC, 0xFAFC, 0xFBFC, 0xFCFC, 0xFDFC, 0xFEFC, 0xFFFC, - 0x00FC, 0x01FC, 0x02FC, 0x03FC, 0x04FC, 0x05FC, 0x06FC, 0x07FC, - 0x08FC, 0x09FC, 0x0AFC, 0xF6FD, 0xF7FD, 0xF8FD, 0xF9FD, 0xFAFD, - 0xFBFD, 0xFCFD, 0xFDFD, 0xFEFD, 0xFFFD, 0x00FD, 0x01FD, 0x02FD, - 0x03FD, 0x04FD, 0x05FD, 0x06FD, 0x07FD, 0x08FD, 0x09FD, 0x0AFD, - 0xF6FE, 0xF7FE, 0xF8FE, 0xF9FE, 0xFAFE, 0xFBFE, 0xFCFE, 0xFDFE, - 0xFEFE, 0xFFFE, 0x00FE, 0x01FE, 0x02FE, 0x03FE, 0x04FE, 0x05FE, - 0x06FE, 0x07FE, 0x08FE, 0x09FE, 0x0AFE, 0xF6FF, 0xF7FF, 0xF8FF, - 0xF9FF, 0xFAFF, 0xFBFF, 0xFCFF, 0xFDFF, 0xFEFF, 0xFFFF, 0x00FF, - 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF, 0x07FF, 0x08FF, - 0x09FF, 0x0AFF, 0xF600, 0xF700, 0xF800, 0xF900, 0xFA00, 0xFB00, - 0xFC00, 0xFD00, 0xFE00, 0xFF00, 0x0000, 0x0100, 0x0200, 0x0300, - 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0x0A00, 0xF601, - 0xF701, 0xF801, 0xF901, 0xFA01, 0xFB01, 0xFC01, 0xFD01, 0xFE01, - 0xFF01, 0x0001, 0x0101, 0x0201, 0x0301, 0x0401, 0x0501, 0x0601, - 0x0701, 0x0801, 0x0901, 0x0A01, 0xF602, 0xF702, 0xF802, 0xF902, - 0xFA02, 0xFB02, 0xFC02, 0xFD02, 0xFE02, 0xFF02, 0x0002, 0x0102, - 0x0202, 0x0302, 0x0402, 0x0502, 0x0602, 0x0702, 0x0802, 0x0902, - 0x0A02, 0xF603, 0xF703, 0xF803, 0xF903, 0xFA03, 0xFB03, 0xFC03, - 0xFD03, 0xFE03, 0xFF03, 0x0003, 0x0103, 0x0203, 0x0303, 0x0403, - 0x0503, 0x0603, 0x0703, 0x0803, 0x0903, 0x0A03, 0xF604, 0xF704, - 0xF804, 0xF904, 0xFA04, 0xFB04, 0xFC04, 0xFD04, 0xFE04, 0xFF04, - 0x0004, 0x0104, 0x0204, 0x0304, 0x0404, 0x0504, 0x0604, 0x0704, - 0x0804, 0x0904, 0x0A04, 0xF605, 0xF705, 0xF805, 0xF905, 0xFA05, - 0xFB05, 0xFC05, 0xFD05, 0xFE05, 0xFF05, 0x0005, 0x0105, 0x0205, - 0x0305, 0x0405, 0x0505, 0x0605, 0x0705, 0x0805, 0x0905, 0x0A05, - 0xF606, 0xF706, 0xF806, 0xF906, 0xFA06, 0xFB06, 0xFC06, 0xFD06, - 0xFE06, 0xFF06, 0x0006, 0x0106, 0x0206, 0x0306, 0x0406, 0x0506, - 0x0606, 0x0706, 0x0806, 0x0906, 0x0A06, 0xF607, 0xF707, 0xF807, - 0xF907, 0xFA07, 0xFB07, 0xFC07, 0xFD07, 0xFE07, 0xFF07, 0x0007, - 0x0107, 0x0207, 0x0307, 0x0407, 0x0507, 0x0607, 0x0707, 0x0807, - 0x0907, 0x0A07, 0xF608, 0xF708, 0xF808, 0xF908, 0xFA08, 0xFB08, - 0xFC08, 0xFD08, 0xFE08, 0xFF08, 0x0008, 0x0108, 0x0208, 0x0308, - 0x0408, 0x0508, 0x0608, 0x0708, 0x0808, 0x0908, 0x0A08, 0xF609, - 0xF709, 0xF809, 0xF909, 0xFA09, 0xFB09, 0xFC09, 0xFD09, 0xFE09, - 0xFF09, 0x0009, 0x0109, 0x0209, 0x0309, 0x0409, 0x0509, 0x0609, - 0x0709, 0x0809, 0x0909, 0x0A09, 0xF60A, 0xF70A, 0xF80A, 0xF90A, - 0xFA0A, 0xFB0A, 0xFC0A, 0xFD0A, 0xFE0A, 0xFF0A, 0x000A, 0x010A, - 0x020A, 0x030A, 0x040A, 0x050A, 0x060A, 0x070A, 0x080A, 0x090A, - 0x0A0A, 0x0B0B, + 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0xFFFF, 0x01FF, 0xFF01, 0x0101, + 0x0B0B, 0xFE00, 0x0200, 0xFEFF, 0x02FF, 0xFE01, 0x0201, 0x0002, 0x00FE, + 0x00FC, 0x0003, 0x0004, 0x00FD, 0x0005, 0x00FB, 0xFDFF, 0x03FF, 0xFD01, + 0x0301, 0xFFFC, 0x01FC, 0xFF03, 0x0103, 0xFF04, 0x0104, 0xFFFD, 0x01FD, + 0xFD00, 0x0300, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFC00, 0x0400, 0xFEFC, + 0x02FC, 0xFE03, 0x0203, 0xFE04, 0x0204, 0xFEFD, 0x02FD, 0xFCFF, 0x04FF, + 0xFC01, 0x0401, 0xFE02, 0x0202, 0xFEFE, 0x02FE, 0xFD02, 0x0302, 0xFDFE, + 0x03FE, 0xFDFC, 0x03FC, 0xFD03, 0x0303, 0xFD04, 0x0304, 0xFDFD, 0x03FD, + 0xFF05, 0x0105, 0xFFFB, 0x01FB, 0x0006, 0x00FA, 0xFBFF, 0x05FF, 0xFB01, + 0x0501, 0xFAFF, 0x06FF, 0xFA01, 0x0601, 0x000A, 0xFF06, 0x0106, 0xFFFA, + 0x01FA, 0xFE05, 0x0205, 0xFB00, 0x0500, 0xFEFB, 0x02FB, 0xFE06, 0x0206, + 0xFEFA, 0x02FA, 0xFC02, 0x0402, 0xFCFE, 0x04FE, 0xFA00, 0x0600, 0xFCFC, + 0xFC03, 0x04FC, 0x0403, 0xFC04, 0xFCFD, 0x0404, 0x04FD, 0xFB02, 0x0502, + 0xFBFE, 0x05FE, 0xFD05, 0x0305, 0xFDFB, 0x03FB, 0x00F7, 0x00F9, 0x00F6, + 0x0007, 0x0009, 0xFA02, 0xFBFC, 0x0602, 0xFB03, 0x05FC, 0x0503, 0xFB04, + 0xFBFD, 0x0504, 0x05FD, 0xFAFE, 0x06FE, 0xF9FF, 0x07FF, 0xF901, 0x0701, + 0xFC05, 0x0405, 0xFCFB, 0x04FB, 0xFAFC, 0xFA03, 0x06FC, 0x0603, 0xFFF9, + 0xFA04, 0x01F9, 0xFAFD, 0x0604, 0xFB05, 0x06FD, 0x0505, 0xFF07, 0x0107, + 0xFBFB, 0x05FB, 0xFC06, 0xFD06, 0x0306, 0x0406, 0xFCFA, 0xFDFA, 0x03FA, + 0x04FA, 0xF9FC, 0x01F7, 0xF903, 0x07FC, 0x0703, 0xF904, 0xF9FD, 0x0704, + 0x07FD, 0xFB06, 0x0506, 0xFBFA, 0x05FA, 0xFF09, 0x0109, 0xFFF7, 0xF900, + 0x0700, 0xF8FF, 0x08FF, 0xF801, 0x0801, 0xFEF9, 0x02F9, 0xFA06, 0x0606, + 0xFAFA, 0xFE07, 0x06FA, 0xF800, 0x0800, 0x0207, 0xF8FC, 0xF803, 0x08FC, + 0x0803, 0xF804, 0xF8FD, 0x0804, 0x08FD, 0xFF08, 0x0108, 0xFFF8, 0xF700, + 0x00F8, 0x01F8, 0x0900, 0x0008, 0xF902, 0x0702, 0xF9FE, 0x07FE, 0xFDF9, + 0x03F9, 0x0307, 0xFD07, 0xF7FF, 0x09FF, 0xF701, 0x0901, 0xFA05, 0x0605, + 0xFAFB, 0x06FB, 0xFBF9, 0xFCF9, 0x04F9, 0x05F9, 0x0507, 0xFB07, 0x0407, + 0xFC07, 0xFE09, 0x02F7, 0x0209, 0xF600, 0x0A00, 0xFEF7, 0x0802, 0x0705, + 0xF905, 0xFFF6, 0xF8FE, 0x08FE, 0x01F6, 0x010A, 0xF9FB, 0xFF0A, 0x07FB, + 0xF802, 0x03F7, 0x0309, 0xFD09, 0xFDF7, 0x0607, 0x0902, 0xFAF9, 0x0409, + 0x04F7, 0x06F9, 0xF7FE, 0x09FE, 0xFA07, 0xFC09, 0xFCF7, 0xF702, 0xF705, + 0x07FA, 0xF9F9, 0x0707, 0xF7FB, 0x07F9, 0x0805, 0x0A05, 0xF805, 0xF906, + 0x0706, 0xF9FA, 0xF907, 0xF605, 0x0905, 0xF6FB, 0xF8FB, 0x08FB, 0x09FB, + 0x0AFB, 0xFE08, 0x0509, 0xFEF6, 0x020A, 0xF6FF, 0xFD08, 0x0308, 0xFDF8, + 0xFB09, 0x0208, 0x0AFF, 0xFE0A, 0x02F8, 0xFBF7, 0x02F6, 0x03F8, 0xFEF8, + 0xF601, 0x05F7, 0x0A01, 0xFB08, 0xF7FC, 0x0904, 0xF703, 0x0A04, 0x09FC, + 0x0AFC, 0x0903, 0xF604, 0x0608, 0x09FD, 0xFCF8, 0xFAF8, 0xF7FD, 0x05F8, + 0xFA08, 0x0508, 0xF704, 0xF603, 0xFC08, 0x0A03, 0xF6FC, 0x04F8, 0xFBF8, + 0x06F8, 0xF6FD, 0x0408, 0x0AFD, 0xF706, 0x08F9, 0xF908, 0xF8F9, 0x040A, + 0xF602, 0x0A02, 0x0708, 0x08FA, 0xFDF6, 0x0AFE, 0xF806, 0xFCF6, 0xF7FA, + 0x0906, 0xFC0A, 0x0807, 0x07F8, 0xF6FE, 0x03F6, 0x030A, 0x09FA, 0xF8FA, + 0xF9F8, 0xFD0A, 0x0806, 0xF807, 0x04F6, 0xF7F9, 0xF707, 0xFBF6, 0x09F9, + 0x05F6, 0xFB0A, 0x0907, 0x050A, 0xF6F9, 0x0AF9, 0x0A07, 0xF607, 0xF909, + 0xF8F6, 0xF70A, 0x09F6, 0xFA09, 0x07F7, 0x0609, 0x070A, 0xFAF7, 0x06F7, + 0xF90A, 0xFA0A, 0x090A, 0xFAF6, 0xF9F6, 0xF7F6, 0x080A, 0xF80A, 0x06F6, + 0xF9F7, 0x07F6, 0x0709, 0x060A, 0x08F6, 0x0909, 0x09F8, 0xF7F7, 0x08F8, + 0xF8F8, 0xF709, 0x0809, 0x0808, 0xF808, 0x0908, 0xF7F8, 0xF8F7, 0x08F7, + 0xF708, 0x09F7, 0xF809, 0x0AFA, 0xF60A, 0x0A06, 0x0AF6, 0xF609, 0xF6F7, + 0xF6FA, 0x0A09, 0x0AF7, 0xF6F8, 0x0A0A, 0x0AF8, 0xF606, 0x0A08, 0xF608, + 0xF6F6, }; static const uint8_t clv_biasy_1_bits[] = { - 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 13, 13, 13, - 13, 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 10, 10, 10, 9, - 8, 8, 7, 7, 5, 2, 1, 3, 5, 7, 7, 8, 9, 9, 10, 10, - 10, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, - 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 16, 12, -}; - -static const uint16_t clv_biasy_1_codes[] = { - 0xFFFE, 0x7FFE, 0x7FFC, 0x7FFA, 0x7FF6, 0x7FF7, 0x7FF3, 0x7FF2, - 0x7FEF, 0x7FEE, 0x3FF5, 0x3FF3, 0x3FF1, 0x1FF7, 0x1FF5, 0x1FF2, - 0x1FF0, 0x1FEE, 0x1FEC, 0x1FEA, 0x1FE8, 0x0FF2, 0x0FF0, 0x0FEE, - 0x0FEB, 0x07F4, 0x07F3, 0x07F1, 0x03F7, 0x03F5, 0x03F3, 0x01F7, - 0x00FA, 0x00F8, 0x007A, 0x0078, 0x001C, 0x0002, 0x0000, 0x0006, - 0x001D, 0x0079, 0x007B, 0x00F9, 0x01F6, 0x01F8, 0x03F2, 0x03F4, - 0x03F6, 0x07F0, 0x07F2, 0x0FEA, 0x0FEC, 0x0FEF, 0x0FF1, 0x0FF3, - 0x1FE9, 0x1FEB, 0x1FED, 0x1FEF, 0x1FF1, 0x1FF3, 0x1FF4, 0x1FF6, - 0x3FF0, 0x3FF2, 0x3FF4, 0x3FF6, 0x7FF0, 0x7FF1, 0x7FF4, 0x7FF8, - 0x7FF5, 0x7FF9, 0x7FFB, 0x7FFD, 0xFFFF, 0x0FED, + 1, 2, 3, 5, 5, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, + 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, + 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 16, 16 }; static const uint16_t clv_biasy_1_syms[] = { - 0xFF68, 0xFF6C, 0xFF70, 0xFF74, 0xFF78, 0xFF7C, 0xFF80, 0xFF84, - 0xFF88, 0xFF8C, 0xFF90, 0xFF94, 0xFF98, 0xFF9C, 0xFFA0, 0xFFA4, - 0xFFA8, 0xFFAC, 0xFFB0, 0xFFB4, 0xFFB8, 0xFFBC, 0xFFC0, 0xFFC4, - 0xFFC8, 0xFFCC, 0xFFD0, 0xFFD4, 0xFFD8, 0xFFDC, 0xFFE0, 0xFFE4, - 0xFFE8, 0xFFEC, 0xFFF0, 0xFFF4, 0xFFF8, 0xFFFC, 0x0000, 0x0004, - 0x0008, 0x000C, 0x0010, 0x0014, 0x0018, 0x001C, 0x0020, 0x0024, - 0x0028, 0x002C, 0x0030, 0x0034, 0x0038, 0x003C, 0x0040, 0x0044, - 0x0048, 0x004C, 0x0050, 0x0054, 0x0058, 0x005C, 0x0060, 0x0064, - 0x0068, 0x006C, 0x0070, 0x0074, 0x0078, 0x007C, 0x0080, 0x0084, - 0x0088, 0x008C, 0x0090, 0x0094, 0x0098, 0x0100, + 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, + 0xFFEC, 0x0014, 0xFFE8, 0x0018, 0xFFE4, 0x001C, 0x0020, 0xFFE0, 0x0024, + 0xFFDC, 0x0028, 0xFFD8, 0x002C, 0xFFD4, 0x0030, 0xFFD0, 0xFFCC, 0x0034, + 0xFFC8, 0x0038, 0x0100, 0xFFC4, 0x003C, 0xFFC0, 0x0040, 0xFFBC, 0x0044, + 0xFFB8, 0x0048, 0xFFB4, 0x004C, 0xFFB0, 0x0050, 0xFFAC, 0x0054, 0xFFA8, + 0x0058, 0xFFA4, 0x005C, 0x0060, 0xFFA0, 0x0064, 0xFF9C, 0x0068, 0xFF98, + 0x006C, 0xFF94, 0x0070, 0xFF90, 0x0074, 0xFF8C, 0xFF88, 0x0078, 0x007C, + 0xFF84, 0xFF80, 0x0080, 0x0088, 0xFF78, 0xFF7C, 0x0084, 0x008C, 0xFF74, + 0x0090, 0xFF70, 0x0094, 0xFF6C, 0xFF68, 0x0098, }; static const uint8_t clv_biasy_2_bits[] = { - 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 14, 14, 14, 14, 13, 13, 13, 13, 12, 12, 12, 12, 12, 11, - 11, 11, 10, 10, 10, 10, 9, 9, 8, 8, 8, 7, 6, 6, 4, 3, - 1, 3, 4, 6, 6, 7, 8, 8, 8, 9, 9, 10, 10, 10, 10, 11, - 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, - 16, 15, -}; - -static const uint16_t clv_biasy_2_codes[] = { - 0xFFFE, 0xFFFC, 0xFFFA, 0xFFF9, 0xFFF6, 0xFFF5, 0xFFF3, 0x7FF7, - 0x7FF5, 0x7FF1, 0x7FF3, 0x7FF0, 0x7FEE, 0x7FEC, 0x7FE9, 0x7FE6, - 0x7FE4, 0x7FE2, 0x3FEF, 0x3FEE, 0x3FEC, 0x3FEA, 0x1FF2, 0x1FF1, - 0x1FEF, 0x1FED, 0x0FF4, 0x0FF3, 0x0FF1, 0x0FEF, 0x0FED, 0x07F4, - 0x07F3, 0x07F1, 0x03F6, 0x03F4, 0x03F2, 0x03F0, 0x01F6, 0x01F4, - 0x00F8, 0x00F6, 0x00F4, 0x0078, 0x003A, 0x0038, 0x000C, 0x0004, - 0x0000, 0x0005, 0x000D, 0x0039, 0x003B, 0x0079, 0x00F5, 0x00F7, - 0x00F9, 0x01F5, 0x01F7, 0x03F1, 0x03F3, 0x03F5, 0x03F7, 0x07F0, - 0x07F2, 0x07F5, 0x0FEC, 0x0FEE, 0x0FF0, 0x0FF2, 0x0FF5, 0x1FEC, - 0x1FEE, 0x1FF0, 0x1FF3, 0x1FF4, 0x3FEB, 0x3FED, 0x3FF0, 0x7FE3, - 0x7FE5, 0x7FE7, 0x7FEA, 0x7FEB, 0x7FED, 0x7FEF, 0x7FF4, 0x7FF2, - 0x7FF6, 0x7FF8, 0xFFF2, 0xFFF4, 0xFFF7, 0xFFF8, 0xFFFB, 0xFFFD, - 0xFFFF, 0x7FE8, + 1, 3, 3, 4, 4, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, + 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, + 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16 }; static const uint16_t clv_biasy_2_syms[] = { - 0xFF40, 0xFF44, 0xFF48, 0xFF4C, 0xFF50, 0xFF54, 0xFF58, 0xFF5C, - 0xFF60, 0xFF64, 0xFF68, 0xFF6C, 0xFF70, 0xFF74, 0xFF78, 0xFF7C, - 0xFF80, 0xFF84, 0xFF88, 0xFF8C, 0xFF90, 0xFF94, 0xFF98, 0xFF9C, - 0xFFA0, 0xFFA4, 0xFFA8, 0xFFAC, 0xFFB0, 0xFFB4, 0xFFB8, 0xFFBC, - 0xFFC0, 0xFFC4, 0xFFC8, 0xFFCC, 0xFFD0, 0xFFD4, 0xFFD8, 0xFFDC, - 0xFFE0, 0xFFE4, 0xFFE8, 0xFFEC, 0xFFF0, 0xFFF4, 0xFFF8, 0xFFFC, - 0x0000, 0x0004, 0x0008, 0x000C, 0x0010, 0x0014, 0x0018, 0x001C, - 0x0020, 0x0024, 0x0028, 0x002C, 0x0030, 0x0034, 0x0038, 0x003C, - 0x0040, 0x0044, 0x0048, 0x004C, 0x0050, 0x0054, 0x0058, 0x005C, - 0x0060, 0x0064, 0x0068, 0x006C, 0x0070, 0x0074, 0x0078, 0x007C, - 0x0080, 0x0084, 0x0088, 0x008C, 0x0090, 0x0094, 0x0098, 0x009C, - 0x00A0, 0x00A4, 0x00A8, 0x00AC, 0x00B0, 0x00B4, 0x00B8, 0x00BC, - 0x00C0, 0x0100, + 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, + 0xFFEC, 0x0014, 0xFFE8, 0x0018, 0xFFE4, 0x001C, 0xFFE0, 0x0020, 0xFFDC, + 0x0024, 0xFFD8, 0x0028, 0xFFD4, 0x002C, 0xFFD0, 0x0030, 0xFFCC, 0x0034, + 0xFFC8, 0x0038, 0x003C, 0xFFC4, 0x0040, 0xFFC0, 0xFFBC, 0x0044, 0x0048, + 0xFFB8, 0x004C, 0xFFB4, 0x0050, 0xFFB0, 0x0054, 0xFFAC, 0xFFA8, 0x0058, + 0x005C, 0xFFA4, 0x0060, 0xFFA0, 0x0064, 0xFF9C, 0xFF98, 0x0068, 0x006C, + 0xFF94, 0x0070, 0xFF90, 0x0074, 0xFF8C, 0xFF88, 0x0078, 0xFF84, 0x007C, + 0xFF80, 0x0080, 0xFF7C, 0x0084, 0x0100, 0xFF78, 0x0088, 0x008C, 0xFF74, + 0x0090, 0xFF70, 0x0094, 0xFF6C, 0xFF64, 0x009C, 0xFF68, 0x0098, 0xFF60, + 0x00A0, 0xFF5C, 0x00A4, 0x00A8, 0xFF58, 0x00AC, 0xFF54, 0xFF50, 0x00B0, + 0x00B4, 0xFF4C, 0xFF48, 0x00B8, 0xFF44, 0x00BC, 0xFF40, 0x00C0, }; static const uint8_t clv_biasy_3_bits[] = { - 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, - 14, 14, 13, 13, 13, 13, 12, 12, 12, 11, 11, 11, 11, 10, 10, 10, - 10, 9, 9, 9, 9, 8, 8, 7, 7, 6, 5, 4, 4, 2, 2, 3, - 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, - 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 14, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 15, -}; - -static const uint16_t clv_biasy_3_codes[] = { - 0xFFFF, 0xFFFC, 0xFFFA, 0x7FFC, 0x7FF9, 0x7FF6, 0x7FF4, 0x7FF2, - 0x7FF1, 0x7FEF, 0x7FEC, 0x7FEB, 0x7FE9, 0x3FF3, 0x3FF0, 0x3FEE, - 0x3FED, 0x3FEA, 0x1FF3, 0x1FF2, 0x1FF0, 0x1FEE, 0x0FF4, 0x0FF3, - 0x0FF1, 0x07F7, 0x07F5, 0x07F3, 0x07F1, 0x03F7, 0x03F4, 0x03F2, - 0x03F0, 0x01F6, 0x01F4, 0x01F2, 0x01F0, 0x00F6, 0x00F4, 0x0078, - 0x0076, 0x0039, 0x001B, 0x000C, 0x000A, 0x0001, 0x0000, 0x0004, - 0x000B, 0x001A, 0x0038, 0x003A, 0x0077, 0x0079, 0x00F5, 0x00F7, - 0x01F1, 0x01F3, 0x01F5, 0x01F7, 0x03F1, 0x03F3, 0x03F5, 0x03F6, - 0x07F0, 0x07F2, 0x07F4, 0x07F6, 0x0FF0, 0x0FF2, 0x0FF5, 0x0FF6, - 0x1FEF, 0x1FF1, 0x1FF4, 0x3FEB, 0x3FEC, 0x3FEF, 0x3FF1, 0x3FF2, - 0x7FE8, 0x7FEA, 0x7FED, 0x7FEE, 0x7FF0, 0x7FF3, 0x7FF5, 0x7FF7, - 0x7FFA, 0x7FFB, 0xFFFB, 0xFFFD, 0xFFFE, 0x7FF8, + 2, 2, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, + 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, + 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16 }; static const uint16_t clv_biasy_3_syms[] = { - 0xFF48, 0xFF4C, 0xFF50, 0xFF54, 0xFF58, 0xFF5C, 0xFF60, 0xFF64, - 0xFF68, 0xFF6C, 0xFF70, 0xFF74, 0xFF78, 0xFF7C, 0xFF80, 0xFF84, - 0xFF88, 0xFF8C, 0xFF90, 0xFF94, 0xFF98, 0xFF9C, 0xFFA0, 0xFFA4, - 0xFFA8, 0xFFAC, 0xFFB0, 0xFFB4, 0xFFB8, 0xFFBC, 0xFFC0, 0xFFC4, - 0xFFC8, 0xFFCC, 0xFFD0, 0xFFD4, 0xFFD8, 0xFFDC, 0xFFE0, 0xFFE4, - 0xFFE8, 0xFFEC, 0xFFF0, 0xFFF4, 0xFFF8, 0xFFFC, 0x0000, 0x0004, - 0x0008, 0x000C, 0x0010, 0x0014, 0x0018, 0x001C, 0x0020, 0x0024, - 0x0028, 0x002C, 0x0030, 0x0034, 0x0038, 0x003C, 0x0040, 0x0044, - 0x0048, 0x004C, 0x0050, 0x0054, 0x0058, 0x005C, 0x0060, 0x0064, - 0x0068, 0x006C, 0x0070, 0x0074, 0x0078, 0x007C, 0x0080, 0x0084, - 0x0088, 0x008C, 0x0090, 0x0094, 0x0098, 0x009C, 0x00A0, 0x00A4, - 0x00A8, 0x00AC, 0x00B0, 0x00B4, 0x00B8, 0x0100, + 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, + 0xFFEC, 0x0014, 0xFFE8, 0x0018, 0xFFE4, 0x001C, 0xFFE0, 0x0020, 0xFFDC, + 0x0024, 0xFFD8, 0x0028, 0xFFD4, 0x002C, 0xFFD0, 0x0030, 0xFFCC, 0x0034, + 0xFFC8, 0x0038, 0xFFC4, 0x003C, 0xFFC0, 0x0040, 0x0044, 0xFFBC, 0x0048, + 0xFFB8, 0x004C, 0xFFB4, 0x0050, 0xFFB0, 0x0054, 0xFFAC, 0x0058, 0xFFA8, + 0x005C, 0xFFA4, 0xFFA0, 0x0060, 0x0064, 0xFF9C, 0x0068, 0xFF98, 0x006C, + 0xFF94, 0xFF90, 0x0070, 0xFF8C, 0x0074, 0x0078, 0xFF88, 0xFF84, 0x007C, + 0xFF80, 0x0080, 0x0084, 0xFF7C, 0x0088, 0xFF78, 0x008C, 0xFF74, 0xFF70, + 0x0090, 0x0094, 0xFF6C, 0x0098, 0xFF68, 0xFF64, 0x009C, 0xFF60, 0x00A0, + 0xFF5C, 0x00A4, 0x0100, 0xFF58, 0x00A8, 0x00AC, 0xFF54, 0xFF50, 0x00B0, + 0xFF4C, 0x00B4, 0x00B8, 0xFF48, }; static const uint8_t clv_biasu_1_bits[] = { - 16, 15, 14, 13, 13, 13, 12, 12, 12, 12, 11, 10, 10, 9, 9, 8, - 7, 6, 5, 2, 1, 3, 5, 7, 7, 8, 9, 9, 10, 10, 11, 12, - 12, 12, 12, 13, 13, 13, 14, 15, 15, 16, -}; - -static const uint16_t clv_biasu_1_codes[] = { - 0xFFFE, 0x7FFC, 0x3FFC, 0x1FFC, 0x1FFA, 0x1FF9, 0x0FFA, 0x0FF7, - 0x0FF8, 0x0FF5, 0x07F8, 0x03FA, 0x03F8, 0x01FA, 0x01F9, 0x00FA, - 0x007B, 0x003C, 0x001C, 0x0002, 0x0000, 0x0006, 0x001D, 0x007A, - 0x007C, 0x00FB, 0x01F8, 0x01FB, 0x03F9, 0x03FB, 0x07F9, 0x0FF4, - 0x0FF6, 0x0FF9, 0x0FFB, 0x1FF8, 0x1FFB, 0x1FFD, 0x3FFD, 0x7FFD, - 0x7FFE, 0xFFFF, + 1, 2, 3, 5, 5, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, + 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 15, + 15, 15, 16, 16 }; static const uint16_t clv_biasu_1_syms[] = { - 0xFFB0, 0xFFB4, 0xFFB8, 0xFFBC, 0xFFC0, 0xFFC4, 0xFFC8, 0xFFCC, - 0xFFD0, 0xFFD4, 0xFFD8, 0xFFDC, 0xFFE0, 0xFFE4, 0xFFE8, 0xFFEC, - 0xFFF0, 0xFFF4, 0xFFF8, 0xFFFC, 0x0000, 0x0004, 0x0008, 0x000C, - 0x0010, 0x0014, 0x0018, 0x001C, 0x0020, 0x0024, 0x0028, 0x002C, - 0x0030, 0x0034, 0x0038, 0x003C, 0x0040, 0x0044, 0x0048, 0x004C, - 0x0050, 0x0100, + 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, + 0xFFEC, 0x0014, 0x0018, 0xFFE8, 0xFFE4, 0x001C, 0xFFE0, 0x0020, 0xFFDC, + 0x0024, 0xFFD8, 0x0028, 0x002C, 0xFFD4, 0x0030, 0xFFCC, 0xFFD0, 0x0034, + 0xFFC8, 0x0038, 0x003C, 0xFFC4, 0xFFC0, 0x0040, 0xFFBC, 0x0044, 0xFFB8, + 0x0048, 0xFFB4, 0x004C, 0x0050, 0xFFB0, 0x0100, }; static const uint8_t clv_biasu_2_bits[] = { - 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 13, 12, 12, 11, 11, 10, - 10, 9, 9, 8, 8, 7, 6, 5, 4, 3, 1, 3, 4, 6, 6, 7, - 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 14, 14, 15, 15, - 15, 16, 16, 16, 16, 14, -}; - -static const uint16_t clv_biasu_2_codes[] = { - 0xFFFC, 0xFFF8, 0xFFFA, 0xFFFD, 0x7FF8, 0x7FFA, 0x7FF7, 0x3FF6, - 0x3FF7, 0x3FF4, 0x1FF9, 0x0FFB, 0x0FF9, 0x07FB, 0x07F9, 0x03FA, - 0x03F8, 0x01FA, 0x01F9, 0x00FB, 0x00F9, 0x007B, 0x003B, 0x001C, - 0x000C, 0x0004, 0x0000, 0x0005, 0x000D, 0x003A, 0x003C, 0x007A, - 0x00F8, 0x00FA, 0x01F8, 0x01FB, 0x03F9, 0x03FB, 0x07F8, 0x07FA, - 0x0FF8, 0x0FFA, 0x1FF8, 0x3FF5, 0x3FF8, 0x3FF9, 0x7FFB, 0x7FF9, - 0x7FF6, 0xFFF9, 0xFFFF, 0xFFFE, 0xFFFB, 0x3FFA, + 1, 3, 3, 4, 4, 5, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, + 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 14, + 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16 }; static const uint16_t clv_biasu_2_syms[] = { - 0xFF98, 0xFF9C, 0xFFA0, 0xFFA4, 0xFFA8, 0xFFAC, 0xFFB0, 0xFFB4, - 0xFFB8, 0xFFBC, 0xFFC0, 0xFFC4, 0xFFC8, 0xFFCC, 0xFFD0, 0xFFD4, - 0xFFD8, 0xFFDC, 0xFFE0, 0xFFE4, 0xFFE8, 0xFFEC, 0xFFF0, 0xFFF4, - 0xFFF8, 0xFFFC, 0x0000, 0x0004, 0x0008, 0x000C, 0x0010, 0x0014, - 0x0018, 0x001C, 0x0020, 0x0024, 0x0028, 0x002C, 0x0030, 0x0034, - 0x0038, 0x003C, 0x0040, 0x0044, 0x0048, 0x004C, 0x0050, 0x0054, - 0x0058, 0x005C, 0x0060, 0x0064, 0x0068, 0x0100, + 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, + 0x0014, 0xFFEC, 0x0018, 0xFFE8, 0x001C, 0xFFE4, 0x0020, 0xFFE0, 0xFFDC, + 0x0024, 0xFFD8, 0x0028, 0xFFD4, 0x002C, 0x0030, 0xFFD0, 0x0034, 0xFFCC, + 0x0038, 0xFFC8, 0x003C, 0xFFC4, 0x0040, 0xFFC0, 0xFFBC, 0x0044, 0xFFB4, + 0xFFB8, 0x0048, 0x004C, 0x0100, 0x0058, 0xFFB0, 0xFFA8, 0x0054, 0xFFAC, + 0x0050, 0xFF9C, 0x005C, 0xFFA0, 0x0068, 0xFF98, 0xFFA4, 0x0064, 0x0060, }; static const uint8_t clv_biasv_1_bits[] = { - 16, 15, 14, 14, 14, 13, 13, 13, 12, 12, 11, 11, 10, 10, 9, 8, - 7, 6, 5, 2, 1, 3, 5, 6, 8, 8, 9, 10, 10, 11, 12, 12, - 12, 13, 13, 13, 14, 14, 15, 15, 16, 14, -}; - -static const uint16_t clv_biasv_1_codes[] = { - 0xFFFF, 0x7FFD, 0x3FFD, 0x3FFB, 0x3FF9, 0x1FFB, 0x1FF8, 0x1FF6, - 0x0FFA, 0x0FF8, 0x07FA, 0x07F8, 0x03FA, 0x03F8, 0x01FB, 0x00FB, - 0x007C, 0x003C, 0x001C, 0x0002, 0x0000, 0x0006, 0x001D, 0x003D, - 0x00FA, 0x00FC, 0x01FA, 0x03F9, 0x03FB, 0x07F9, 0x0FF6, 0x0FF7, - 0x0FF9, 0x1FF7, 0x1FF9, 0x1FFA, 0x3FFA, 0x3FFC, 0x7FFC, 0x7FFE, - 0xFFFE, 0x3FF8, + 1, 2, 3, 5, 5, 6, 6, 7, 8, 8, 8, 9, 9, 10, 10, 10, 10, 11, 11, + 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, + 15, 15, 16, 16 }; static const uint16_t clv_biasv_1_syms[] = { - 0xFFB0, 0xFFB4, 0xFFB8, 0xFFBC, 0xFFC0, 0xFFC4, 0xFFC8, 0xFFCC, - 0xFFD0, 0xFFD4, 0xFFD8, 0xFFDC, 0xFFE0, 0xFFE4, 0xFFE8, 0xFFEC, - 0xFFF0, 0xFFF4, 0xFFF8, 0xFFFC, 0x0000, 0x0004, 0x0008, 0x000C, - 0x0010, 0x0014, 0x0018, 0x001C, 0x0020, 0x0024, 0x0028, 0x002C, - 0x0030, 0x0034, 0x0038, 0x003C, 0x0040, 0x0044, 0x0048, 0x004C, - 0x0050, 0x0100, + 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, + 0xFFEC, 0x0014, 0x0018, 0xFFE8, 0xFFE4, 0x001C, 0xFFE0, 0x0020, 0xFFDC, + 0x0024, 0xFFD8, 0x0028, 0x002C, 0xFFD4, 0x0030, 0xFFD0, 0xFFCC, 0x0034, + 0xFFC8, 0x0038, 0x003C, 0xFFC4, 0x0100, 0xFFC0, 0x0040, 0xFFBC, 0x0044, + 0xFFB8, 0x0048, 0xFFB4, 0x004C, 0x0050, 0xFFB0, }; static const uint8_t clv_biasv_2_bits[] = { - 16, 15, 14, 13, 13, 13, 13, 13, 12, 12, 11, 10, 10, 9, 9, 8, - 7, 6, 5, 4, 3, 1, 3, 4, 5, 7, 7, 8, 9, 9, 10, 10, - 10, 12, 12, 13, 13, 13, 13, 13, 14, 16, 15, 15, -}; - -static const uint16_t clv_biasv_2_codes[] = { - 0xFFFE, 0x7FFD, 0x3FFC, 0x1FFC, 0x1FFB, 0x1FF8, 0x1FF7, 0x1FF4, - 0x0FF8, 0x0FF7, 0x07FA, 0x03FB, 0x03F8, 0x01FA, 0x01F9, 0x00FA, - 0x007B, 0x003C, 0x001C, 0x000C, 0x0004, 0x0000, 0x0005, 0x000D, - 0x001D, 0x007A, 0x007C, 0x00FB, 0x01F8, 0x01FB, 0x03F9, 0x03FA, - 0x03FC, 0x0FF6, 0x0FF9, 0x1FF5, 0x1FF9, 0x1FF6, 0x1FFA, 0x1FFD, - 0x3FFD, 0xFFFF, 0x7FFE, 0x7FFC, + 1, 3, 3, 4, 4, 5, 5, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9, 10, 10, + 10, 10, 10, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, + 14, 15, 15, 15, 16, 16 }; static const uint16_t clv_biasv_2_syms[] = { - 0xFFAC, 0xFFB0, 0xFFB4, 0xFFB8, 0xFFBC, 0xFFC0, 0xFFC4, 0xFFC8, - 0xFFCC, 0xFFD0, 0xFFD4, 0xFFD8, 0xFFDC, 0xFFE0, 0xFFE4, 0xFFE8, - 0xFFEC, 0xFFF0, 0xFFF4, 0xFFF8, 0xFFFC, 0x0000, 0x0004, 0x0008, - 0x000C, 0x0010, 0x0014, 0x0018, 0x001C, 0x0020, 0x0024, 0x0028, - 0x002C, 0x0030, 0x0034, 0x0038, 0x003C, 0x0040, 0x0044, 0x0048, - 0x004C, 0x0050, 0x0054, 0x0100, + 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, + 0xFFEC, 0x0014, 0xFFE8, 0x0018, 0x001C, 0xFFE4, 0xFFE0, 0x0020, 0xFFDC, + 0x0024, 0x0028, 0xFFD8, 0x002C, 0xFFD4, 0x0030, 0xFFD0, 0xFFCC, 0x0034, + 0xFFC8, 0x0038, 0x0040, 0xFFC4, 0xFFC0, 0x003C, 0x0044, 0xFFBC, 0xFFB8, + 0x0048, 0xFFB4, 0x004C, 0x0100, 0xFFB0, 0x0054, 0xFFAC, 0x0050 }; #endif /* AVCODEC_CLEARVIDEODATA_H */ From patchwork Fri Nov 20 07:18:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23757 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 8F73C44A644 for ; Fri, 20 Nov 2020 09:24:32 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6F2AF68B9FA; Fri, 20 Nov 2020 09:24:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 76E5C68B9C8 for ; Fri, 20 Nov 2020 09:24:25 +0200 (EET) Received: by mail-ej1-f47.google.com with SMTP id oq3so11472093ejb.7 for ; Thu, 19 Nov 2020 23:24:25 -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=XINZmxAnWWed7xbUOmxDQEmkYGY+QkARpWuVksMdN2I=; b=LJ/OZXIYDKF2WOXi5IJNQsgquQ2r5c+w7Iap7z00T1ApQXdCX03/UynuqOm+rJtvY3 wga0DnG5p+vev/z24ueo5n6egEuXSDVPhPgThglVImBirFdwljDPRsrFqkBKVeKW4bUR LmlrgUNZnxevQc0brIaujtShuxD1FSqGOMZDrqnDZSyuQDszp34lTSFTVD1Q0mItGOC1 FlG9LfEHh/nPwJSWTdimwFzKrTnXpDH+WpsLj54UQ/Z7SJRlLi4E3HoJGoA1C2haBuVb 2Zu2hg5InpsdbnEM70pqL8fEEac1aynY+JNkqh4lB8GK1EbjIQIV11yndSTNThsvy/eS C1Qg== 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=XINZmxAnWWed7xbUOmxDQEmkYGY+QkARpWuVksMdN2I=; b=ftKUVse/A3Hf9g3hQnVFZQc1YlARq0ameeb8x7uLCGPscZwZBp0XaiYE5GosGy8EMU UW2Bd4FCFlGTCR0Yxhn1vt+IYg0KQUKrMpxIhMDCo76eRvIMLeYn8k2+Ogbrig+I1nrd ldbdWCgjlJfg7tIvvg1Lo3iLhbK51vMUGPZ0HBtQZXLL3KonkoZ//qiEzSdNpRIW3jNr ZJ5eqXKpyemEkK+AhdKdvi9Zt+OpL5N4h2EsyN2UKasuQ4yuDiVAAAxq9YxWdeK4JcTV nbVSw2l0RjowZw6CWxJXXogfAZtmjuGi2HtHRKSO9Pd/qol9L1ufrpVb96LzCApTbN4c b+sQ== X-Gm-Message-State: AOAM533mPENVROMdj89bbBDohRfPpQz5qQXG6BNIsDZIyLvw08zPnN3K 2LdGXOUNc4Nt3JklCDk9QN0pjZ/WjFCrlQ== X-Google-Smtp-Source: ABdhPJzgqDKoHJEpGnw+BphIyyVFeNOLMRF8iB9Wfch/EoRxjhbzSEJa/YY6esGyd8Vv0spxyoQidg== X-Received: by 2002:a17:906:3a55:: with SMTP id a21mr30912914ejf.357.1605857064197; Thu, 19 Nov 2020 23:24:24 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:23 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:49 +0100 Message-Id: <20201120072116.818090-17-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 016/162] avcodec/clearvideo: 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/clearvideo.c | 201 +++++++----------------------------- libavcodec/clearvideodata.h | 104 ++++++++++--------- 2 files changed, 89 insertions(+), 216 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index ef09b137c4..f1dcb03f0e 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -74,7 +74,7 @@ typedef struct CLVContext { int tile_size; int tile_shift; VLC dc_vlc, ac_vlc; - LevelCodes ylev[4], ulev[3], vlev[3]; + LevelCodes lev[4 + 3 + 3]; // 0..3: Y, 4..6: U, 7..9: V int luma_dc_quant, chroma_dc_quant, ac_quant; DECLARE_ALIGNED(16, int16_t, block)[64]; int top_dc[3], left_dc[4]; @@ -594,7 +594,7 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data, TileInfo *tile; MV mv, cmv; - tile = decode_tile_info(&c->gb, c->ylev, 0); + tile = decode_tile_info(&c->gb, &c->lev[0], 0); // Y if (!tile) return AVERROR(ENOMEM); mv = mvi_predict(&c->mvi, i, j, tile->mv); @@ -609,14 +609,14 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data, cmv.x /= 2; cmv.y /= 2; av_freep(&tile); - tile = decode_tile_info(&c->gb, c->ulev, 0); + tile = decode_tile_info(&c->gb, &c->lev[4], 0); // U if (!tile) return AVERROR(ENOMEM); ret = restore_tree(avctx, c->pic, c->prev, 1, x, y, size, tile, cmv); if (ret < 0) mb_ret = ret; av_freep(&tile); - tile = decode_tile_info(&c->gb, c->vlev, 0); + tile = decode_tile_info(&c->gb, &c->lev[7], 0); // V if (!tile) return AVERROR(ENOMEM); ret = restore_tree(avctx, c->pic, c->prev, 2, x, y, size, tile, cmv); @@ -704,162 +704,39 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) return ret; } - ret = ff_init_vlc_from_lengths(&c->ylev[0].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsy_0_bits), - clv_flagsy_0_bits, 1, - clv_flagsy_0_syms, 1, 1, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ylev[1].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsy_1_bits), - clv_flagsy_1_bits, 1, - clv_flagsy_1_syms, 1, 1, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ylev[2].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsy_2_bits), - clv_flagsy_2_bits, 1, - clv_flagsy_2_syms, 1, 1, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ulev[0].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsu_0_bits), - clv_flagsu_0_bits, 1, - clv_flagsu_0_syms, 1, 1, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ulev[1].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsu_1_bits), - clv_flagsu_1_bits, 1, - clv_flagsu_1_syms, 1, 1, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->vlev[0].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsv_0_bits), - clv_flagsv_0_bits, 1, - clv_flagsv_0_syms, 1, 1, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->vlev[1].flags_cb, 9, FF_ARRAY_ELEMS(clv_flagsv_1_bits), - clv_flagsv_1_bits, 1, - clv_flagsv_1_syms, 1, 1, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ylev[0].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_0_bits), - clv_mvy_0_bits, 1, - clv_mvy_0_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ylev[1].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_1_bits), - clv_mvy_1_bits, 1, - clv_mvy_1_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ylev[2].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_2_bits), - clv_mvy_2_bits, 1, - clv_mvy_2_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ylev[3].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvy_3_bits), - clv_mvy_3_bits, 1, - clv_mvy_3_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ulev[1].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvu_1_bits), - clv_mvu_1_bits, 1, - clv_mvu_1_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ulev[2].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvu_2_bits), - clv_mvu_2_bits, 1, - clv_mvu_2_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->vlev[1].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvv_1_bits), - clv_mvv_1_bits, 1, - clv_mvv_1_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->vlev[2].mv_cb, 9, FF_ARRAY_ELEMS(clv_mvv_2_bits), - clv_mvv_2_bits, 1, - clv_mvv_2_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ylev[1].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasy_1_bits), - clv_biasy_1_bits, 1, - clv_biasy_1_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ylev[2].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasy_2_bits), - clv_biasy_2_bits, 1, - clv_biasy_2_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ylev[3].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasy_3_bits), - clv_biasy_3_bits, 1, - clv_biasy_3_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ulev[1].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasu_1_bits), - clv_biasu_1_bits, 1, - clv_biasu_1_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->ulev[2].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasu_2_bits), - clv_biasu_2_bits, 1, - clv_biasu_2_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->vlev[1].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasv_1_bits), - clv_biasv_1_bits, 1, - clv_biasv_1_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - ret = ff_init_vlc_from_lengths(&c->vlev[2].bias_cb, 9, FF_ARRAY_ELEMS(clv_biasv_2_bits), - clv_biasv_2_bits, 1, - clv_biasv_2_syms, 2, 2, 0, 0, avctx); - if (ret) - return ret; - - c->ylev[0].mv_esc = 0x0909; - c->ylev[1].mv_esc = 0x0A0A; - c->ylev[2].mv_esc = 0x1010; - c->ylev[3].mv_esc = 0x1313; - c->ulev[1].mv_esc = 0x0808; - c->ulev[2].mv_esc = 0x0B0B; - c->vlev[1].mv_esc = 0x0808; - c->vlev[2].mv_esc = 0x0B0B; - - c->ylev[1].bias_esc = 0x100; - c->ylev[2].bias_esc = 0x100; - c->ylev[3].bias_esc = 0x100; - c->ulev[1].bias_esc = 0x100; - c->ulev[2].bias_esc = 0x100; - c->vlev[1].bias_esc = 0x100; - c->vlev[2].bias_esc = 0x100; - + for (int i = 0, j = 0;; i++) { + if (0x36F & (1 << i)) { + c->lev[i].mv_esc = clv_mv_escape[i]; + ret = ff_init_vlc_from_lengths(&c->lev[i].mv_cb, 9, clv_mv_sizes[i], + clv_mv_bits[i], 1, + clv_mv_syms[i], 2, 2, 0, 0, avctx); + if (ret < 0) + return ret; + } + if (i == FF_ARRAY_ELEMS(c->lev) - 1) + break; + if (0x1B7 & (1 << i)) { + ret = ff_init_vlc_from_lengths(&c->lev[i].flags_cb, 9, 16, + clv_flags_bits[j], 1, + clv_flags_syms[j], 1, 1, 0, 0, avctx); + if (ret < 0) + return ret; + + c->lev[i + 1].bias_esc = 0x100; + ret = ff_init_vlc_from_lengths(&c->lev[i + 1].bias_cb, 9, clv_bias_sizes[j], + clv_bias_bits[j], 1, + clv_bias_syms[j], 2, 2, 0, 0, avctx); + if (ret < 0) + return ret; + j++; + } + } return 0; } static av_cold int clv_decode_end(AVCodecContext *avctx) { CLVContext *const c = avctx->priv_data; - int i; av_frame_free(&c->prev); av_frame_free(&c->pic); @@ -868,18 +745,10 @@ static av_cold int clv_decode_end(AVCodecContext *avctx) ff_free_vlc(&c->dc_vlc); ff_free_vlc(&c->ac_vlc); - for (i = 0; i < 4; i++) { - ff_free_vlc(&c->ylev[i].mv_cb); - ff_free_vlc(&c->ylev[i].flags_cb); - ff_free_vlc(&c->ylev[i].bias_cb); - } - for (i = 0; i < 3; i++) { - ff_free_vlc(&c->ulev[i].mv_cb); - ff_free_vlc(&c->ulev[i].flags_cb); - ff_free_vlc(&c->ulev[i].bias_cb); - ff_free_vlc(&c->vlev[i].mv_cb); - ff_free_vlc(&c->vlev[i].flags_cb); - ff_free_vlc(&c->vlev[i].bias_cb); + for (int i = 0; i < FF_ARRAY_ELEMS(c->lev); i++) { + ff_free_vlc(&c->lev[i].mv_cb); + ff_free_vlc(&c->lev[i].flags_cb); + ff_free_vlc(&c->lev[i].bias_cb); } return 0; diff --git a/libavcodec/clearvideodata.h b/libavcodec/clearvideodata.h index b4893b3bf7..fa0721cb0c 100644 --- a/libavcodec/clearvideodata.h +++ b/libavcodec/clearvideodata.h @@ -90,60 +90,28 @@ static const uint8_t clv_ac_bits[NUM_AC_CODES] = { 6, 5, 5, 5, 4, 2, 3, 4, 4 }; -static const uint8_t clv_flagsy_0_bits[] = { - 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 7, 7 +static const uint8_t clv_flags_bits[][16] = { + { 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 7, 7 }, // Y_0 + { 2, 3, 3, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 7, 8, 8 }, // Y_1 + { 1, 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 7, 8, 9, 10, 10 }, // Y_2 + { 1, 4, 4, 4, 4, 4, 4, 5, 5, 5, 7, 7, 7, 8, 9, 9 }, // U_0 + { 1, 4, 4, 4, 4, 4, 4, 4, 5, 6, 8, 8, 8, 9, 10, 10 }, // U_1 + { 1, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 10 }, // V_0 + { 1, 3, 4, 4, 4, 4, 5, 5, 5, 6, 7, 8, 9, 10, 11, 11 } // V_1 }; -static const uint8_t clv_flagsy_0_syms[] = { - 15, 0, 3, 5, 12, 1, 10, 2, 4, 8, 7, 11, 14, 6, 9, 13 +static const uint8_t clv_flags_syms[][16] = { + { 15, 0, 3, 5, 12, 1, 10, 2, 4, 8, 7, 11, 14, 6, 9, 13 }, // Y_0 + { 0, 15, 3, 12, 5, 1, 4, 2, 8, 10, 11, 7, 9, 6, 13, 14 }, // Y_1 + { 0, 3, 12, 4, 2, 1, 8, 5, 7, 10, 9, 6, 11, 13, 14, 15 }, // Y_2 + { 0, 15, 3, 12, 1, 10, 2, 5, 4, 8, 11, 7, 14, 13, 9, 6 }, // U_0 + { 0, 2, 12, 3, 4, 1, 8, 5, 10, 7, 9, 6, 11, 14, 13, 15 }, // U_1 + { 0, 15, 1, 12, 3, 10, 2, 5, 8, 4, 11, 14, 6, 9, 7, 13 }, // V_0 + { 0, 8, 3, 4, 2, 1, 12, 5, 10, 7, 9, 6, 14, 11, 13, 15 } // V_1 }; -static const uint8_t clv_flagsy_1_bits[] = { - 2, 3, 3, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 7, 8, 8 -}; - -static const uint8_t clv_flagsy_1_syms[] = { - 0, 15, 3, 12, 5, 1, 4, 2, 8, 10, 11, 7, 9, 6, 13, 14 -}; - -static const uint8_t clv_flagsy_2_bits[] = { - 1, 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 7, 8, 9, 10, 10 -}; - -static const uint8_t clv_flagsy_2_syms[] = { - 0, 3, 12, 4, 2, 1, 8, 5, 7, 10, 9, 6, 11, 13, 14, 15 -}; - -static const uint8_t clv_flagsu_0_bits[] = { - 1, 4, 4, 4, 4, 4, 4, 5, 5, 5, 7, 7, 7, 8, 9, 9 -}; - -static const uint8_t clv_flagsu_0_syms[] = { - 0, 15, 3, 12, 1, 10, 2, 5, 4, 8, 11, 7, 14, 13, 9, 6 -}; - -static const uint8_t clv_flagsu_1_bits[] = { - 1, 4, 4, 4, 4, 4, 4, 4, 5, 6, 8, 8, 8, 9, 10, 10 -}; - -static const uint8_t clv_flagsu_1_syms[] = { - 0, 2, 12, 3, 4, 1, 8, 5, 10, 7, 9, 6, 11, 14, 13, 15 -}; - -static const uint8_t clv_flagsv_0_bits[] = { - 1, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 10 -}; - -static const uint8_t clv_flagsv_0_syms[] = { - 0, 15, 1, 12, 3, 10, 2, 5, 8, 4, 11, 14, 6, 9, 7, 13 -}; - -static const uint8_t clv_flagsv_1_bits[] = { - 1, 3, 4, 4, 4, 4, 5, 5, 5, 6, 7, 8, 9, 10, 11, 11 -}; - -static const uint8_t clv_flagsv_1_syms[] = { - 0, 8, 3, 4, 2, 1, 12, 5, 10, 7, 9, 6, 14, 11, 13, 15 +static const uint16_t clv_mv_escape[] = { + 0x0909, 0x0A0A, 0x1010, 0x1313, 0, 0x0808, 0x0B0B, 0, 0x0808, 0x0B0B }; static const uint8_t clv_mvy_0_bits[] = { @@ -1034,4 +1002,40 @@ static const uint16_t clv_biasv_2_syms[] = { 0x0048, 0xFFB4, 0x004C, 0x0100, 0xFFB0, 0x0054, 0xFFAC, 0x0050 }; +static const uint8_t *const clv_bias_bits[] = { + clv_biasy_1_bits, clv_biasy_2_bits, clv_biasy_3_bits, + clv_biasu_1_bits, clv_biasu_2_bits, + clv_biasv_1_bits, clv_biasv_2_bits +}; + +static const uint16_t *const clv_bias_syms[] = { + clv_biasy_1_syms, clv_biasy_2_syms, clv_biasy_3_syms, + clv_biasu_1_syms, clv_biasu_2_syms, + clv_biasv_1_syms, clv_biasv_2_syms +}; + +static const int clv_bias_sizes[] = { + FF_ARRAY_ELEMS(clv_biasy_1_bits), FF_ARRAY_ELEMS(clv_biasy_2_bits), FF_ARRAY_ELEMS(clv_biasy_3_bits), + FF_ARRAY_ELEMS(clv_biasu_1_bits), FF_ARRAY_ELEMS(clv_biasu_2_bits), + FF_ARRAY_ELEMS(clv_biasv_1_bits), FF_ARRAY_ELEMS(clv_biasv_2_bits) +}; + +static const uint8_t *const clv_mv_bits[] = { + clv_mvy_0_bits, clv_mvy_1_bits, clv_mvy_2_bits, clv_mvy_3_bits, + NULL, clv_mvu_1_bits, clv_mvu_2_bits, + NULL, clv_mvv_1_bits, clv_mvv_2_bits +}; + +static const uint16_t *const clv_mv_syms[] = { + clv_mvy_0_syms, clv_mvy_1_syms, clv_mvy_2_syms, clv_mvy_3_syms, + NULL, clv_mvu_1_syms, clv_mvu_2_syms, + NULL, clv_mvv_1_syms, clv_mvv_2_syms +}; + +static const int clv_mv_sizes[] = { + FF_ARRAY_ELEMS(clv_mvy_0_bits), FF_ARRAY_ELEMS(clv_mvy_1_bits), FF_ARRAY_ELEMS(clv_mvy_2_bits), FF_ARRAY_ELEMS(clv_mvy_3_bits), + 0, FF_ARRAY_ELEMS(clv_mvu_1_bits), FF_ARRAY_ELEMS(clv_mvu_2_bits), + 0, FF_ARRAY_ELEMS(clv_mvv_1_bits), FF_ARRAY_ELEMS(clv_mvv_2_bits) +}; + #endif /* AVCODEC_CLEARVIDEODATA_H */ From patchwork Fri Nov 20 07:18: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: 23759 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 0DE8744A644 for ; Fri, 20 Nov 2020 09:24:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 88F7068B9B8; Fri, 20 Nov 2020 09:24:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6D0C668B9DB for ; Fri, 20 Nov 2020 09:24:27 +0200 (EET) Received: by mail-ed1-f67.google.com with SMTP id l5so8451561edq.11 for ; Thu, 19 Nov 2020 23:24:27 -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=FW/HedGu0dqoi1qSqApXsphYZPlCz0h9whqFr8c/RwE=; b=WMOZ7QafvHjJBTLDBaY1B21iZSsedwt/ok3YT/fTHxlWyNt69WvFNJ4//5x760jzOk 4UpqwL2X9CcqIVCsHNGXj4mX2TbCMoLi+Tqn7mGYffwCu6/hT6Pyqk5dZRO1B/6SxoS/ NpV8lh4xNuovYY47X08dSJR3MdvYqHslTS6VWZlmVGpdGITA+XMFLOBMHqWE+44B/1Jc 7z65CrJzhWtG/EyZYOeQ9qxyjYF5bx5K8PBiteKNQvHxz6vSxouSJI57Fon6fVvWdDjT cMb1CeGHUprOJYHyw0BuOQmWxhZCAIK+aLrgLg4jAmO40MCmfn3nCjpdQOg3fD7nUPbu 5sMw== 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=FW/HedGu0dqoi1qSqApXsphYZPlCz0h9whqFr8c/RwE=; b=HbwRBAAHeFUPix84OOqDBn9rlidUJIUrBk+OEB2TE1y/sF0nWb57DVOZcpxJmLO0h2 zXIEDJBYDsT/HvdUdVZurq0YJQZLVnFRNAJu2WB2lOhENq2AOTOQthr6prcS0FzJFNB+ H/QWZI3g2qF4CTGB9RjM0+4kHRSqcj7ZSVI2ldV6k7bT2QT6m83Bl1xYj7KS0kfFMuv2 lh7t08lEGo1342qdep/HFYmRI3YWOnfRyDA+h6yx4x7r/rrS45jRNfGB/CsF7P5Z5kBe qTkbiIhHz/fS4GSJ8bAvJIFkHLarYqgTN6ATayRaIP7popBZXGIokLQvUSAVY3fXCW9R eHBA== X-Gm-Message-State: AOAM530SWHjjWNYzFbZMsRaW1EqKrCTS1Uji9wTHaPvPQqxS5+noogDV sCyspje+tjDYiJ26//VSRxEYy2pZmU2Stg== X-Google-Smtp-Source: ABdhPJwJpZSRjP8r6W3tf0lRjeIxwMeO7aGGbSyX57TkXVWHjjZ5HqGWNJ4K0Vk0r212MlJKStX5IQ== X-Received: by 2002:a50:99d6:: with SMTP id n22mr35158706edb.261.1605857065419; Thu, 19 Nov 2020 23:24:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:24 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:50 +0100 Message-Id: <20201120072116.818090-18-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 017/162] avcodec/clearvideo: Avoid huge VLC length tables 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" After the motion vector and bias values tables have been reordered so that the codes are ordered from left to right, it emerged that the length of these entries are actually ascending for every table. Therefore it is possible to encode them in a run-length style and create the actual length tables during runtime. This commit implements this. Signed-off-by: Andreas Rheinhardt --- libavcodec/clearvideo.c | 34 ++- libavcodec/clearvideodata.h | 413 +++--------------------------------- 2 files changed, 62 insertions(+), 385 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index f1dcb03f0e..39e3991053 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -646,9 +646,31 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data, return mb_ret < 0 ? mb_ret : buf_size; } +static av_cold int build_vlc(VLC *vlc, const uint8_t counts[16], + const uint16_t **syms) +{ + uint8_t lens[MAX_VLC_ENTRIES]; + unsigned num = 0; + int ret; + + for (int i = 0; i < 16; i++) { + unsigned count = counts[i]; + if (count == 255) /* Special case for Y_3 table */ + count = 303; + for (count += num; num < count; num++) + lens[num] = i + 1; + } + ret = ff_init_vlc_from_lengths(vlc, 9, num, lens, 1, *syms, 2, 2, 0, 0, NULL); + if (ret < 0) + return ret; + *syms += num; + return 0; +} + static av_cold int clv_decode_init(AVCodecContext *avctx) { CLVContext *const c = avctx->priv_data; + const uint16_t *mv_syms = clv_mv_syms, *bias_syms = clv_bias_syms; int ret, w, h; if (avctx->extradata_size == 110) { @@ -704,14 +726,13 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) return ret; } - for (int i = 0, j = 0;; i++) { + for (int i = 0, j = 0, k = 0;; i++) { if (0x36F & (1 << i)) { c->lev[i].mv_esc = clv_mv_escape[i]; - ret = ff_init_vlc_from_lengths(&c->lev[i].mv_cb, 9, clv_mv_sizes[i], - clv_mv_bits[i], 1, - clv_mv_syms[i], 2, 2, 0, 0, avctx); + ret = build_vlc(&c->lev[i].mv_cb, clv_mv_len_counts[k], &mv_syms); if (ret < 0) return ret; + k++; } if (i == FF_ARRAY_ELEMS(c->lev) - 1) break; @@ -723,9 +744,8 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) return ret; c->lev[i + 1].bias_esc = 0x100; - ret = ff_init_vlc_from_lengths(&c->lev[i + 1].bias_cb, 9, clv_bias_sizes[j], - clv_bias_bits[j], 1, - clv_bias_syms[j], 2, 2, 0, 0, avctx); + ret = build_vlc(&c->lev[i + 1].bias_cb, + clv_bias_len_counts[j], &bias_syms); if (ret < 0) return ret; j++; diff --git a/libavcodec/clearvideodata.h b/libavcodec/clearvideodata.h index fa0721cb0c..d2c658eb5d 100644 --- a/libavcodec/clearvideodata.h +++ b/libavcodec/clearvideodata.h @@ -24,6 +24,7 @@ #include "libavutil/common.h" +#define MAX_VLC_ENTRIES 1370 #define NUM_DC_CODES 127 #define NUM_AC_CODES 104 @@ -114,26 +115,19 @@ static const uint16_t clv_mv_escape[] = { 0x0909, 0x0A0A, 0x1010, 0x1313, 0, 0x0808, 0x0B0B, 0, 0x0808, 0x0B0B }; -static const uint8_t clv_mvy_0_bits[] = { - 1, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, - 16, 16, 16, 16, 16 +static const uint8_t clv_mv_len_counts[][16] = { + { 1, 0, 0, 2, 2, 6, 13, 6, 14, 28, 38, 38, 58, 56, 20, 8 }, + { 1, 0, 0, 2, 3, 4, 8, 10, 20, 30, 37, 63, 84, 68, 32, 0 }, + { 0, 1, 0, 4, 0, 6, 9, 24, 32, 48, 112, 142, 232, 166, 142, 44 }, + { 0, 1, 0, 2, 2, 6, 9, 16, 40, 82, 146, 228, 191, 255, 244, 100 }, + { 0, 0, 2, 5, 2, 12, 6, 15, 14, 24, 37, 33, 24, 28, 8, 16 }, + { 1, 0, 0, 2, 2, 5, 10, 12, 19, 19, 37, 74, 69, 120, 48, 24 }, + { 0, 0, 2, 3, 8, 7, 8, 8, 23, 37, 30, 36, 28, 16, 12, 8 }, + { 1, 0, 0, 0, 4, 5, 14, 18, 20, 39, 6, 80, 75, 112, 36, 32 }, }; -static const uint16_t clv_mvy_0_syms[] = { +static const uint16_t clv_mv_syms[] = { + /* Y_0 motion vectors - 290 entries */ 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0x0002, 0x00FE, 0x0909, 0x00FD, 0x0004, 0x00FC, 0x0003, 0x01FF, 0xFF01, 0x0101, 0xFFFF, 0xFE00, 0x0200, 0x0005, 0x00FB, 0x00FA, 0x0006, 0x0007, 0x00F9, 0xFF02, 0x0102, 0xFFFE, @@ -167,32 +161,7 @@ static const uint16_t clv_mvy_0_syms[] = { 0xF8F9, 0x0807, 0x08F9, 0xF805, 0xF904, 0x0704, 0xF9FC, 0x07FC, 0x0806, 0x08FA, 0xF806, 0xF8FA, 0x0804, 0x08FC, 0xF804, 0xF8FC, 0x0808, 0xF8F8, 0x08F8, 0xF808, -}; - -static const uint8_t clv_mvy_1_bits[] = { - 1, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15 -}; - -static const uint16_t clv_mvy_1_syms[] = { + /* Y_1 motion vectors - 362 entries */ 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0x0A0A, 0xFFFF, 0x01FF, 0xFF01, 0x0101, 0x00FE, 0x0002, 0x0003, 0x00FD, 0x0004, 0x00FC, 0xFE00, 0x0200, 0x0005, 0x00FB, 0x00FA, 0x0006, 0x0007, 0x00F9, 0xFFFE, 0x01FE, 0xFF02, @@ -234,63 +203,7 @@ static const uint16_t clv_mvy_1_syms[] = { 0x0905, 0xF705, 0x09FB, 0xF7FB, 0x09F8, 0xF7F8, 0x0908, 0xF708, 0x08F7, 0xF809, 0xF8F7, 0x0809, 0xF709, 0xF7F7, 0x0909, 0x09F7, 0xF7F9, 0x09F9, 0x0907, 0xF707, -}; - -static const uint8_t clv_mvy_2_bits[] = { - 2, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 -}; - -static const uint16_t clv_mvy_2_syms[] = { + /* Y_2 motion vectors - 962 entries */ 0x0000, 0x0001, 0x00FF, 0xFF00, 0x0100, 0x0002, 0x00FE, 0x0101, 0xFFFF, 0x01FF, 0xFF01, 0x0003, 0x00FD, 0x0004, 0x00FC, 0x1010, 0x0005, 0x00FB, 0xFE00, 0x0200, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0x00FA, 0x0006, 0x00F9, @@ -398,85 +311,7 @@ static const uint16_t clv_mvy_2_syms[] = { 0x0FF6, 0xF1F6, 0x0FF5, 0x0F0A, 0xF10A, 0xF1F5, 0xF1F3, 0xF10D, 0x0FF3, 0x0F0D, 0x0FFF, 0xF1FF, 0xF101, 0x0F01, 0x0F0F, 0xF1F1, 0x0FF1, 0xF10F, 0x0FF2, 0xF10C, 0x0F0E, 0x0FF4, 0xF1F4, 0xF1F2, 0x0F0C, 0xF10E, -}; - -static const uint8_t clv_mvy_3_bits[] = { - 2, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16 -}; - -static const uint16_t clv_mvy_3_syms[] = { + /* Y_3 motion vectors - 1370 elements */ 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0x00FE, 0x0002, 0xFFFF, 0x01FF, 0xFF01, 0x0101, 0x00FD, 0x0003, 0x00FC, 0x0004, 0xFE00, 0x0200, 0x0005, 0x00FB, 0x1313, 0xFFFE, 0x01FE, 0xFF02, 0x0102, 0x0006, 0x00FA, 0xFEFF, @@ -630,24 +465,7 @@ static const uint16_t clv_mvy_3_syms[] = { 0x11EE, 0x1112, 0xEFEE, 0x1111, 0xEE11, 0xEEEF, 0x12EF, 0x1211, 0x1212, 0x12EE, 0xEEEE, 0xEE12, 0xEEF1, 0x12F1, 0xEE0F, 0x120F, 0xEE10, 0x1210, 0xEEF0, 0x12F0, -}; - -static const uint8_t clv_mvu_1_bits[] = { - 3, 3, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, - 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 -}; - -static const uint16_t clv_mvu_1_syms[] = { + /* U_1 motion vectors - 226 entries */ 0x0001, 0x00FF, 0x0000, 0x0002, 0x00FE, 0x00FD, 0x0003, 0xFF00, 0x0100, 0xFE00, 0x0200, 0x0101, 0xFFFF, 0x01FF, 0xFF01, 0x00FB, 0x0005, 0xFD00, 0x0300, 0xFC00, 0x0400, 0x0004, 0x00FC, 0x0808, 0x00FA, 0x0006, 0x0201, @@ -674,36 +492,7 @@ static const uint16_t clv_mvu_1_syms[] = { 0x0703, 0xF903, 0xF9FD, 0xFB05, 0x0505, 0xFBFB, 0x05FB, 0xFA05, 0x07FB, 0xF9FB, 0x0605, 0x0705, 0x06FB, 0xFAFB, 0xF905, 0xF9F9, 0xF907, 0x07F9, 0x0707, -}; - -static const uint8_t clv_mvu_2_bits[] = { - 1, 4, 4, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16 -}; - -static const uint16_t clv_mvu_2_syms[] = { + /* U_2 motion vectors - 442 entries */ 0x0000, 0xFF00, 0x0100, 0x00FF, 0x0001, 0xFFFF, 0x01FF, 0xFF01, 0x0101, 0x0B0B, 0x0002, 0x00FE, 0xFE00, 0x0200, 0x0003, 0x00FD, 0xFEFF, 0x02FF, 0xFE01, 0x0201, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFD00, 0x0300, 0x00FC, @@ -754,24 +543,7 @@ static const uint16_t clv_mvu_2_syms[] = { 0xF80A, 0x090A, 0xF7F6, 0x0A09, 0x0AF8, 0xF6F6, 0x0AF9, 0xF6F7, 0x0A07, 0x0A0A, 0x0AF7, 0x0AF6, 0xF60A, 0x0A08, 0xF6F9, 0xF609, 0xF607, 0xF6F8, 0xF608, -}; - -static const uint8_t clv_mvv_1_bits[] = { - 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, - 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16 -}; - -static const uint16_t clv_mvv_1_syms[] = { + /* V_1 motion vectors - 226 entries */ 0x0001, 0x00FF, 0x0000, 0xFF00, 0x0100, 0x0002, 0x00FE, 0x00FD, 0x0003, 0x0004, 0x00FC, 0x00FB, 0x0005, 0x0101, 0xFFFF, 0x01FF, 0xFF01, 0xFE00, 0x0200, 0xFD00, 0x0300, 0x0808, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFC00, @@ -798,36 +570,7 @@ static const uint16_t clv_mvv_1_syms[] = { 0xF9FB, 0x0705, 0x07FB, 0xFA06, 0x0606, 0xFA07, 0x0607, 0xFAF9, 0x06F9, 0x06FA, 0xFAFA, 0xF906, 0x07FA, 0xF9FA, 0x0706, 0xF907, 0xF9F9, 0x07F9, 0x0707, -}; - -static const uint8_t clv_mvv_2_bits[] = { - 1, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16 -}; - -static const uint16_t clv_mvv_2_syms[] = { + /* V_2 motion vectors - 442 elements */ 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0xFFFF, 0x01FF, 0xFF01, 0x0101, 0x0B0B, 0xFE00, 0x0200, 0xFEFF, 0x02FF, 0xFE01, 0x0201, 0x0002, 0x00FE, 0x00FC, 0x0003, 0x0004, 0x00FD, 0x0005, 0x00FB, 0xFDFF, 0x03FF, 0xFD01, @@ -880,15 +623,18 @@ static const uint16_t clv_mvv_2_syms[] = { 0xF6F6, }; -static const uint8_t clv_biasy_1_bits[] = { - 1, 2, 3, 5, 5, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, - 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, - 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 16, 16 +static const uint8_t clv_bias_len_counts[][16] = { + { 1, 1, 1, 0, 2, 0, 4, 3, 3, 6, 5, 10, 16, 7, 17, 2 }, + { 1, 0, 2, 2, 0, 4, 2, 6, 4, 8, 6, 10, 9, 7, 23, 14 }, + { 0, 2, 1, 3, 2, 3, 4, 4, 8, 8, 8, 7, 7, 10, 21, 6 }, + { 1, 1, 1, 0, 2, 1, 3, 2, 4, 4, 2, 8, 6, 2, 3, 2 }, + { 1, 0, 2, 2, 1, 3, 2, 4, 4, 4, 4, 4, 2, 7, 6, 8 }, + { 1, 1, 1, 0, 2, 2, 1, 3, 2, 4, 3, 5, 6, 6, 3, 2 }, + { 1, 0, 2, 2, 2, 1, 3, 2, 4, 5, 1, 4, 10, 2, 3, 2 }, }; -static const uint16_t clv_biasy_1_syms[] = { +static const uint16_t clv_bias_syms[] = { + /* Y_1 bias values - 78 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0xFFEC, 0x0014, 0xFFE8, 0x0018, 0xFFE4, 0x001C, 0x0020, 0xFFE0, 0x0024, 0xFFDC, 0x0028, 0xFFD8, 0x002C, 0xFFD4, 0x0030, 0xFFD0, 0xFFCC, 0x0034, @@ -898,18 +644,7 @@ static const uint16_t clv_biasy_1_syms[] = { 0x006C, 0xFF94, 0x0070, 0xFF90, 0x0074, 0xFF8C, 0xFF88, 0x0078, 0x007C, 0xFF84, 0xFF80, 0x0080, 0x0088, 0xFF78, 0xFF7C, 0x0084, 0x008C, 0xFF74, 0x0090, 0xFF70, 0x0094, 0xFF6C, 0xFF68, 0x0098, -}; - -static const uint8_t clv_biasy_2_bits[] = { - 1, 3, 3, 4, 4, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, - 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, - 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16 -}; - -static const uint16_t clv_biasy_2_syms[] = { + /* Y_2 bias values - 98 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0xFFEC, 0x0014, 0xFFE8, 0x0018, 0xFFE4, 0x001C, 0xFFE0, 0x0020, 0xFFDC, 0x0024, 0xFFD8, 0x0028, 0xFFD4, 0x002C, 0xFFD0, 0x0030, 0xFFCC, 0x0034, @@ -921,17 +656,7 @@ static const uint16_t clv_biasy_2_syms[] = { 0x0090, 0xFF70, 0x0094, 0xFF6C, 0xFF64, 0x009C, 0xFF68, 0x0098, 0xFF60, 0x00A0, 0xFF5C, 0x00A4, 0x00A8, 0xFF58, 0x00AC, 0xFF54, 0xFF50, 0x00B0, 0x00B4, 0xFF4C, 0xFF48, 0x00B8, 0xFF44, 0x00BC, 0xFF40, 0x00C0, -}; - -static const uint8_t clv_biasy_3_bits[] = { - 2, 2, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, - 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, - 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16 -}; - -static const uint16_t clv_biasy_3_syms[] = { + /* Y_3 bias values - 94 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0xFFEC, 0x0014, 0xFFE8, 0x0018, 0xFFE4, 0x001C, 0xFFE0, 0x0020, 0xFFDC, 0x0024, 0xFFD8, 0x0028, 0xFFD4, 0x002C, 0xFFD0, 0x0030, 0xFFCC, 0x0034, @@ -943,58 +668,26 @@ static const uint16_t clv_biasy_3_syms[] = { 0x0090, 0x0094, 0xFF6C, 0x0098, 0xFF68, 0xFF64, 0x009C, 0xFF60, 0x00A0, 0xFF5C, 0x00A4, 0x0100, 0xFF58, 0x00A8, 0x00AC, 0xFF54, 0xFF50, 0x00B0, 0xFF4C, 0x00B4, 0x00B8, 0xFF48, -}; - -static const uint8_t clv_biasu_1_bits[] = { - 1, 2, 3, 5, 5, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, - 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 15, - 15, 15, 16, 16 -}; - -static const uint16_t clv_biasu_1_syms[] = { + /* U_1 bias values - 42 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0xFFEC, 0x0014, 0x0018, 0xFFE8, 0xFFE4, 0x001C, 0xFFE0, 0x0020, 0xFFDC, 0x0024, 0xFFD8, 0x0028, 0x002C, 0xFFD4, 0x0030, 0xFFCC, 0xFFD0, 0x0034, 0xFFC8, 0x0038, 0x003C, 0xFFC4, 0xFFC0, 0x0040, 0xFFBC, 0x0044, 0xFFB8, 0x0048, 0xFFB4, 0x004C, 0x0050, 0xFFB0, 0x0100, -}; - -static const uint8_t clv_biasu_2_bits[] = { - 1, 3, 3, 4, 4, 5, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, - 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 14, - 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16 -}; - -static const uint16_t clv_biasu_2_syms[] = { + /* U_2 bias values - 54 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0x0014, 0xFFEC, 0x0018, 0xFFE8, 0x001C, 0xFFE4, 0x0020, 0xFFE0, 0xFFDC, 0x0024, 0xFFD8, 0x0028, 0xFFD4, 0x002C, 0x0030, 0xFFD0, 0x0034, 0xFFCC, 0x0038, 0xFFC8, 0x003C, 0xFFC4, 0x0040, 0xFFC0, 0xFFBC, 0x0044, 0xFFB4, 0xFFB8, 0x0048, 0x004C, 0x0100, 0x0058, 0xFFB0, 0xFFA8, 0x0054, 0xFFAC, 0x0050, 0xFF9C, 0x005C, 0xFFA0, 0x0068, 0xFF98, 0xFFA4, 0x0064, 0x0060, -}; - -static const uint8_t clv_biasv_1_bits[] = { - 1, 2, 3, 5, 5, 6, 6, 7, 8, 8, 8, 9, 9, 10, 10, 10, 10, 11, 11, - 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, - 15, 15, 16, 16 -}; - -static const uint16_t clv_biasv_1_syms[] = { + /* V_1 bias values - 42 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0xFFEC, 0x0014, 0x0018, 0xFFE8, 0xFFE4, 0x001C, 0xFFE0, 0x0020, 0xFFDC, 0x0024, 0xFFD8, 0x0028, 0x002C, 0xFFD4, 0x0030, 0xFFD0, 0xFFCC, 0x0034, 0xFFC8, 0x0038, 0x003C, 0xFFC4, 0x0100, 0xFFC0, 0x0040, 0xFFBC, 0x0044, 0xFFB8, 0x0048, 0xFFB4, 0x004C, 0x0050, 0xFFB0, -}; - -static const uint8_t clv_biasv_2_bits[] = { - 1, 3, 3, 4, 4, 5, 5, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9, 10, 10, - 10, 10, 10, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, - 14, 15, 15, 15, 16, 16 -}; - -static const uint16_t clv_biasv_2_syms[] = { + /* V_2 bias values - 44 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0xFFEC, 0x0014, 0xFFE8, 0x0018, 0x001C, 0xFFE4, 0xFFE0, 0x0020, 0xFFDC, 0x0024, 0x0028, 0xFFD8, 0x002C, 0xFFD4, 0x0030, 0xFFD0, 0xFFCC, 0x0034, @@ -1002,40 +695,4 @@ static const uint16_t clv_biasv_2_syms[] = { 0x0048, 0xFFB4, 0x004C, 0x0100, 0xFFB0, 0x0054, 0xFFAC, 0x0050 }; -static const uint8_t *const clv_bias_bits[] = { - clv_biasy_1_bits, clv_biasy_2_bits, clv_biasy_3_bits, - clv_biasu_1_bits, clv_biasu_2_bits, - clv_biasv_1_bits, clv_biasv_2_bits -}; - -static const uint16_t *const clv_bias_syms[] = { - clv_biasy_1_syms, clv_biasy_2_syms, clv_biasy_3_syms, - clv_biasu_1_syms, clv_biasu_2_syms, - clv_biasv_1_syms, clv_biasv_2_syms -}; - -static const int clv_bias_sizes[] = { - FF_ARRAY_ELEMS(clv_biasy_1_bits), FF_ARRAY_ELEMS(clv_biasy_2_bits), FF_ARRAY_ELEMS(clv_biasy_3_bits), - FF_ARRAY_ELEMS(clv_biasu_1_bits), FF_ARRAY_ELEMS(clv_biasu_2_bits), - FF_ARRAY_ELEMS(clv_biasv_1_bits), FF_ARRAY_ELEMS(clv_biasv_2_bits) -}; - -static const uint8_t *const clv_mv_bits[] = { - clv_mvy_0_bits, clv_mvy_1_bits, clv_mvy_2_bits, clv_mvy_3_bits, - NULL, clv_mvu_1_bits, clv_mvu_2_bits, - NULL, clv_mvv_1_bits, clv_mvv_2_bits -}; - -static const uint16_t *const clv_mv_syms[] = { - clv_mvy_0_syms, clv_mvy_1_syms, clv_mvy_2_syms, clv_mvy_3_syms, - NULL, clv_mvu_1_syms, clv_mvu_2_syms, - NULL, clv_mvv_1_syms, clv_mvv_2_syms -}; - -static const int clv_mv_sizes[] = { - FF_ARRAY_ELEMS(clv_mvy_0_bits), FF_ARRAY_ELEMS(clv_mvy_1_bits), FF_ARRAY_ELEMS(clv_mvy_2_bits), FF_ARRAY_ELEMS(clv_mvy_3_bits), - 0, FF_ARRAY_ELEMS(clv_mvu_1_bits), FF_ARRAY_ELEMS(clv_mvu_2_bits), - 0, FF_ARRAY_ELEMS(clv_mvv_1_bits), FF_ARRAY_ELEMS(clv_mvv_2_bits) -}; - #endif /* AVCODEC_CLEARVIDEODATA_H */ From patchwork Fri Nov 20 07:18:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23768 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 D0592449D14 for ; Fri, 20 Nov 2020 09:27:30 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3719968B9CA; Fri, 20 Nov 2020 09:24:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8E55368B9DE for ; Fri, 20 Nov 2020 09:24:27 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id f20so11490271ejz.4 for ; Thu, 19 Nov 2020 23:24:27 -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=JxOKywne/s59Vyx+nteg8jv+9+T+pBUV488JFnnDhgA=; b=E+s2BELwJuB3dLBut9r1XghiZimzSHZeFJjhXVXoadyKfhjpy5WwEGB83ea+B1/l1t /bdC585Th4pDaSGoxKkqNkx9PFokSHtjTj5nZYzsK5XUgyxoY973q2yC40FzUsdhbzwK ILtO9MBP2N2UiqjRmjPA8A+bH6pD4h8K1/FIuq9tTO11GzAtazW5IYZfVpmZ6P6weGdT kHCGQFlEYQ3GvFCWZEcnUT/pQtazXi6Fk3qIjYXemC0gwXZcwA8m6lPgRBIUduVitIMn ad0GcNUAQFW7APoA6TDrYyr6DB/o63MB9W+k0zvA3U21DO6ZsccBZ0ECUTV0ZBpgYi3O /hXA== 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=JxOKywne/s59Vyx+nteg8jv+9+T+pBUV488JFnnDhgA=; b=thekLVqhHbS9lflVgal0hBxykEFGHQaiDbvogq14lVT/wMqqpxECS6t398HxnG7hoM aG6TmZl195PR40zbaNMgLtfkQKBgB77IeovK9g03nbJTC8TqckN3u0Ee+a4fKJy8+Wan s24JFk3wbvmGldVA6uV7XpBFdHtWvIDDdE4aPZ5jUOKhN3tH/BHoKos+fiQj9qJJQAP0 0MhE34DoPK/pCFDpNbekm1vZRgzDpyucNLjajRUXuN9kIDarq04ugFFumrWTIjuFn+aJ 5UHVZnxkDGyzjZfW29ASLWSXsmuN7goapNBXnGCLNt8VIDVQafVn5OFsiLVbPtEGd4C7 3r5Q== X-Gm-Message-State: AOAM533b3TnRrBQGswO1UkShU0w2XB7Yb1VrLHLG+eatVAJAcgbAP6Ez o9APiakj/lommu6F3axX4dTtac8AEpYSgQ== X-Google-Smtp-Source: ABdhPJwLsKo1ahGo15ODJu+2URTTIKe5lVmgD0+v9xZd9I/Sp4qOIEX6ODTh617ZnrN7RPnc22Z3iw== X-Received: by 2002:a17:907:10d9:: with SMTP id rv25mr32401336ejb.437.1605857066408; Thu, 19 Nov 2020 23:24:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:25 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:51 +0100 Message-Id: <20201120072116.818090-19-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 018/162] avcodec/clearvideo: Improve handling of VLC escape values 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" Both the motion vector as well as the bias VLCs have an escape code; for the motion vectors, this value depended on the specific VLC table, whereas all the bias VLCs used the same value; the escape value has not been inlined in the latter case. But for both kinds of VLCs there are lots of values that are unused for all the VLCs of each kind and each of these can be used as common escape value, thus allowing to inline the escape value. This commit implements this. Signed-off-by: Andreas Rheinhardt --- This one is new. libavcodec/clearvideo.c | 8 ++------ libavcodec/clearvideodata.h | 36 +++++++++++++++++------------------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 39e3991053..3e666b98e9 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -33,8 +33,6 @@ #include "clearvideodata.h" typedef struct LevelCodes { - uint16_t mv_esc; - uint16_t bias_esc; VLC flags_cb; VLC mv_cb; VLC bias_cb; @@ -371,7 +369,7 @@ static TileInfo* decode_tile_info(GetBitContext *gb, LevelCodes *lc, int level) if (lc[level].mv_cb.table) { uint16_t mv_code = get_vlc2(gb, lc[level].mv_cb.table, lc[level].mv_cb.bits, 3); - if (mv_code != lc[level].mv_esc) { + if (mv_code != MV_ESC) { mv.x = (int8_t)(mv_code & 0xff); mv.y = (int8_t)(mv_code >> 8); } else { @@ -383,7 +381,7 @@ static TileInfo* decode_tile_info(GetBitContext *gb, LevelCodes *lc, int level) if (lc[level].bias_cb.table) { uint16_t bias_val = get_vlc2(gb, lc[level].bias_cb.table, lc[level].bias_cb.bits, 2); - if (bias_val != lc[level].bias_esc) { + if (bias_val != BIAS_ESC) { bias = (int16_t)(bias_val); } else { bias = get_sbits(gb, 16); @@ -728,7 +726,6 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) for (int i = 0, j = 0, k = 0;; i++) { if (0x36F & (1 << i)) { - c->lev[i].mv_esc = clv_mv_escape[i]; ret = build_vlc(&c->lev[i].mv_cb, clv_mv_len_counts[k], &mv_syms); if (ret < 0) return ret; @@ -743,7 +740,6 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) if (ret < 0) return ret; - c->lev[i + 1].bias_esc = 0x100; ret = build_vlc(&c->lev[i + 1].bias_cb, clv_bias_len_counts[j], &bias_syms); if (ret < 0) diff --git a/libavcodec/clearvideodata.h b/libavcodec/clearvideodata.h index d2c658eb5d..89bf192bce 100644 --- a/libavcodec/clearvideodata.h +++ b/libavcodec/clearvideodata.h @@ -111,10 +111,6 @@ static const uint8_t clv_flags_syms[][16] = { { 0, 8, 3, 4, 2, 1, 12, 5, 10, 7, 9, 6, 14, 11, 13, 15 } // V_1 }; -static const uint16_t clv_mv_escape[] = { - 0x0909, 0x0A0A, 0x1010, 0x1313, 0, 0x0808, 0x0B0B, 0, 0x0808, 0x0B0B -}; - static const uint8_t clv_mv_len_counts[][16] = { { 1, 0, 0, 2, 2, 6, 13, 6, 14, 28, 38, 38, 58, 56, 20, 8 }, { 1, 0, 0, 2, 3, 4, 8, 10, 20, 30, 37, 63, 84, 68, 32, 0 }, @@ -126,9 +122,10 @@ static const uint8_t clv_mv_len_counts[][16] = { { 1, 0, 0, 0, 4, 5, 14, 18, 20, 39, 6, 80, 75, 112, 36, 32 }, }; +#define MV_ESC 0x13 static const uint16_t clv_mv_syms[] = { /* Y_0 motion vectors - 290 entries */ - 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0x0002, 0x00FE, 0x0909, 0x00FD, + 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0x0002, 0x00FE, MV_ESC, 0x00FD, 0x0004, 0x00FC, 0x0003, 0x01FF, 0xFF01, 0x0101, 0xFFFF, 0xFE00, 0x0200, 0x0005, 0x00FB, 0x00FA, 0x0006, 0x0007, 0x00F9, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFD00, 0x0300, 0xFC00, 0x0400, 0x02FF, 0xFE01, 0x0201, 0xFEFF, @@ -162,7 +159,7 @@ static const uint16_t clv_mv_syms[] = { 0x08FA, 0xF806, 0xF8FA, 0x0804, 0x08FC, 0xF804, 0xF8FC, 0x0808, 0xF8F8, 0x08F8, 0xF808, /* Y_1 motion vectors - 362 entries */ - 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0x0A0A, 0xFFFF, 0x01FF, 0xFF01, + 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, MV_ESC, 0xFFFF, 0x01FF, 0xFF01, 0x0101, 0x00FE, 0x0002, 0x0003, 0x00FD, 0x0004, 0x00FC, 0xFE00, 0x0200, 0x0005, 0x00FB, 0x00FA, 0x0006, 0x0007, 0x00F9, 0xFFFE, 0x01FE, 0xFF02, 0x0102, 0xFF03, 0x0103, 0xFFFD, 0x01FD, 0xFEFF, 0x02FF, 0xFE01, 0x0201, @@ -205,7 +202,7 @@ static const uint16_t clv_mv_syms[] = { 0x0907, 0xF707, /* Y_2 motion vectors - 962 entries */ 0x0000, 0x0001, 0x00FF, 0xFF00, 0x0100, 0x0002, 0x00FE, 0x0101, 0xFFFF, - 0x01FF, 0xFF01, 0x0003, 0x00FD, 0x0004, 0x00FC, 0x1010, 0x0005, 0x00FB, + 0x01FF, 0xFF01, 0x0003, 0x00FD, 0x0004, 0x00FC, MV_ESC, 0x0005, 0x00FB, 0xFE00, 0x0200, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0x00FA, 0x0006, 0x00F9, 0x0007, 0x0201, 0xFEFF, 0x02FF, 0xFE01, 0xFD00, 0x0300, 0xFF03, 0x0103, 0xFFFD, 0x01FD, 0xFC00, 0x0400, 0x0008, 0x00F8, 0xFB00, 0x0500, 0x0009, @@ -314,7 +311,7 @@ static const uint16_t clv_mv_syms[] = { /* Y_3 motion vectors - 1370 elements */ 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0x00FE, 0x0002, 0xFFFF, 0x01FF, 0xFF01, 0x0101, 0x00FD, 0x0003, 0x00FC, 0x0004, 0xFE00, 0x0200, 0x0005, - 0x00FB, 0x1313, 0xFFFE, 0x01FE, 0xFF02, 0x0102, 0x0006, 0x00FA, 0xFEFF, + 0x00FB, MV_ESC, 0xFFFE, 0x01FE, 0xFF02, 0x0102, 0x0006, 0x00FA, 0xFEFF, 0x02FF, 0xFE01, 0x0201, 0xFD00, 0x0300, 0xFC00, 0x0400, 0x00F9, 0x0007, 0xFFFD, 0x01FD, 0xFF03, 0x0103, 0x00F8, 0x0008, 0x00F7, 0x0009, 0x000A, 0x00F6, 0xFEFE, 0x02FE, 0xFE02, 0x0202, 0xFFFC, 0x01FC, 0xFF04, 0x0104, @@ -468,7 +465,7 @@ static const uint16_t clv_mv_syms[] = { /* U_1 motion vectors - 226 entries */ 0x0001, 0x00FF, 0x0000, 0x0002, 0x00FE, 0x00FD, 0x0003, 0xFF00, 0x0100, 0xFE00, 0x0200, 0x0101, 0xFFFF, 0x01FF, 0xFF01, 0x00FB, 0x0005, 0xFD00, - 0x0300, 0xFC00, 0x0400, 0x0004, 0x00FC, 0x0808, 0x00FA, 0x0006, 0x0201, + 0x0300, 0xFC00, 0x0400, 0x0004, 0x00FC, MV_ESC, 0x00FA, 0x0006, 0x0201, 0xFEFF, 0x02FF, 0xFE01, 0xFFFD, 0x01FD, 0xFF03, 0x0103, 0xFEFD, 0x02FD, 0xFE03, 0x0203, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFB00, 0x0500, 0xFDFD, 0x03FD, 0xFD03, 0x0303, 0xFF04, 0x0104, 0xFFFC, 0x01FC, 0xFE02, 0x0202, @@ -494,7 +491,7 @@ static const uint16_t clv_mv_syms[] = { 0x0707, /* U_2 motion vectors - 442 entries */ 0x0000, 0xFF00, 0x0100, 0x00FF, 0x0001, 0xFFFF, 0x01FF, 0xFF01, 0x0101, - 0x0B0B, 0x0002, 0x00FE, 0xFE00, 0x0200, 0x0003, 0x00FD, 0xFEFF, 0x02FF, + MV_ESC, 0x0002, 0x00FE, 0xFE00, 0x0200, 0x0003, 0x00FD, 0xFEFF, 0x02FF, 0xFE01, 0x0201, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFD00, 0x0300, 0x00FC, 0x0005, 0xFDFF, 0x03FF, 0xFD01, 0x0301, 0xFF03, 0x0103, 0xFFFD, 0x01FD, 0xFE02, 0x0202, 0xFEFE, 0x02FE, 0xFCFF, 0x04FF, 0xFC01, 0x0401, 0xFBFF, @@ -546,7 +543,7 @@ static const uint16_t clv_mv_syms[] = { /* V_1 motion vectors - 226 entries */ 0x0001, 0x00FF, 0x0000, 0xFF00, 0x0100, 0x0002, 0x00FE, 0x00FD, 0x0003, 0x0004, 0x00FC, 0x00FB, 0x0005, 0x0101, 0xFFFF, 0x01FF, 0xFF01, 0xFE00, - 0x0200, 0xFD00, 0x0300, 0x0808, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFC00, + 0x0200, 0xFD00, 0x0300, MV_ESC, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFC00, 0x0400, 0x0201, 0xFEFF, 0x02FF, 0xFE01, 0xFFFD, 0x01FD, 0xFF03, 0x0103, 0x00FA, 0x0006, 0xFE02, 0x0202, 0xFEFE, 0x02FE, 0xFD02, 0x0302, 0xFDFE, 0x03FE, 0xFEFD, 0xFC02, 0x02FD, 0x0402, 0xFE03, 0xFCFE, 0x0203, 0x04FE, @@ -572,7 +569,7 @@ static const uint16_t clv_mv_syms[] = { 0x0707, /* V_2 motion vectors - 442 elements */ 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0xFFFF, 0x01FF, 0xFF01, 0x0101, - 0x0B0B, 0xFE00, 0x0200, 0xFEFF, 0x02FF, 0xFE01, 0x0201, 0x0002, 0x00FE, + MV_ESC, 0xFE00, 0x0200, 0xFEFF, 0x02FF, 0xFE01, 0x0201, 0x0002, 0x00FE, 0x00FC, 0x0003, 0x0004, 0x00FD, 0x0005, 0x00FB, 0xFDFF, 0x03FF, 0xFD01, 0x0301, 0xFFFC, 0x01FC, 0xFF03, 0x0103, 0xFF04, 0x0104, 0xFFFD, 0x01FD, 0xFD00, 0x0300, 0xFF02, 0x0102, 0xFFFE, 0x01FE, 0xFC00, 0x0400, 0xFEFC, @@ -633,12 +630,13 @@ static const uint8_t clv_bias_len_counts[][16] = { { 1, 0, 2, 2, 2, 1, 3, 2, 4, 5, 1, 4, 10, 2, 3, 2 }, }; +#define BIAS_ESC 1 static const uint16_t clv_bias_syms[] = { /* Y_1 bias values - 78 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0xFFEC, 0x0014, 0xFFE8, 0x0018, 0xFFE4, 0x001C, 0x0020, 0xFFE0, 0x0024, 0xFFDC, 0x0028, 0xFFD8, 0x002C, 0xFFD4, 0x0030, 0xFFD0, 0xFFCC, 0x0034, - 0xFFC8, 0x0038, 0x0100, 0xFFC4, 0x003C, 0xFFC0, 0x0040, 0xFFBC, 0x0044, + 0xFFC8, 0x0038, BIAS_ESC, 0xFFC4, 0x003C, 0xFFC0, 0x0040, 0xFFBC, 0x0044, 0xFFB8, 0x0048, 0xFFB4, 0x004C, 0xFFB0, 0x0050, 0xFFAC, 0x0054, 0xFFA8, 0x0058, 0xFFA4, 0x005C, 0x0060, 0xFFA0, 0x0064, 0xFF9C, 0x0068, 0xFF98, 0x006C, 0xFF94, 0x0070, 0xFF90, 0x0074, 0xFF8C, 0xFF88, 0x0078, 0x007C, @@ -652,7 +650,7 @@ static const uint16_t clv_bias_syms[] = { 0xFFB8, 0x004C, 0xFFB4, 0x0050, 0xFFB0, 0x0054, 0xFFAC, 0xFFA8, 0x0058, 0x005C, 0xFFA4, 0x0060, 0xFFA0, 0x0064, 0xFF9C, 0xFF98, 0x0068, 0x006C, 0xFF94, 0x0070, 0xFF90, 0x0074, 0xFF8C, 0xFF88, 0x0078, 0xFF84, 0x007C, - 0xFF80, 0x0080, 0xFF7C, 0x0084, 0x0100, 0xFF78, 0x0088, 0x008C, 0xFF74, + 0xFF80, 0x0080, 0xFF7C, 0x0084, BIAS_ESC, 0xFF78, 0x0088, 0x008C, 0xFF74, 0x0090, 0xFF70, 0x0094, 0xFF6C, 0xFF64, 0x009C, 0xFF68, 0x0098, 0xFF60, 0x00A0, 0xFF5C, 0x00A4, 0x00A8, 0xFF58, 0x00AC, 0xFF54, 0xFF50, 0x00B0, 0x00B4, 0xFF4C, 0xFF48, 0x00B8, 0xFF44, 0x00BC, 0xFF40, 0x00C0, @@ -666,33 +664,33 @@ static const uint16_t clv_bias_syms[] = { 0xFF94, 0xFF90, 0x0070, 0xFF8C, 0x0074, 0x0078, 0xFF88, 0xFF84, 0x007C, 0xFF80, 0x0080, 0x0084, 0xFF7C, 0x0088, 0xFF78, 0x008C, 0xFF74, 0xFF70, 0x0090, 0x0094, 0xFF6C, 0x0098, 0xFF68, 0xFF64, 0x009C, 0xFF60, 0x00A0, - 0xFF5C, 0x00A4, 0x0100, 0xFF58, 0x00A8, 0x00AC, 0xFF54, 0xFF50, 0x00B0, + 0xFF5C, 0x00A4, BIAS_ESC, 0xFF58, 0x00A8, 0x00AC, 0xFF54, 0xFF50, 0x00B0, 0xFF4C, 0x00B4, 0x00B8, 0xFF48, /* U_1 bias values - 42 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0xFFEC, 0x0014, 0x0018, 0xFFE8, 0xFFE4, 0x001C, 0xFFE0, 0x0020, 0xFFDC, 0x0024, 0xFFD8, 0x0028, 0x002C, 0xFFD4, 0x0030, 0xFFCC, 0xFFD0, 0x0034, 0xFFC8, 0x0038, 0x003C, 0xFFC4, 0xFFC0, 0x0040, 0xFFBC, 0x0044, 0xFFB8, - 0x0048, 0xFFB4, 0x004C, 0x0050, 0xFFB0, 0x0100, + 0x0048, 0xFFB4, 0x004C, 0x0050, 0xFFB0, BIAS_ESC, /* U_2 bias values - 54 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0x0014, 0xFFEC, 0x0018, 0xFFE8, 0x001C, 0xFFE4, 0x0020, 0xFFE0, 0xFFDC, 0x0024, 0xFFD8, 0x0028, 0xFFD4, 0x002C, 0x0030, 0xFFD0, 0x0034, 0xFFCC, 0x0038, 0xFFC8, 0x003C, 0xFFC4, 0x0040, 0xFFC0, 0xFFBC, 0x0044, 0xFFB4, - 0xFFB8, 0x0048, 0x004C, 0x0100, 0x0058, 0xFFB0, 0xFFA8, 0x0054, 0xFFAC, + 0xFFB8, 0x0048, 0x004C, BIAS_ESC, 0x0058, 0xFFB0, 0xFFA8, 0x0054, 0xFFAC, 0x0050, 0xFF9C, 0x005C, 0xFFA0, 0x0068, 0xFF98, 0xFFA4, 0x0064, 0x0060, /* V_1 bias values - 42 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0xFFEC, 0x0014, 0x0018, 0xFFE8, 0xFFE4, 0x001C, 0xFFE0, 0x0020, 0xFFDC, 0x0024, 0xFFD8, 0x0028, 0x002C, 0xFFD4, 0x0030, 0xFFD0, 0xFFCC, 0x0034, - 0xFFC8, 0x0038, 0x003C, 0xFFC4, 0x0100, 0xFFC0, 0x0040, 0xFFBC, 0x0044, + 0xFFC8, 0x0038, 0x003C, 0xFFC4, BIAS_ESC, 0xFFC0, 0x0040, 0xFFBC, 0x0044, 0xFFB8, 0x0048, 0xFFB4, 0x004C, 0x0050, 0xFFB0, /* V_2 bias values - 44 entries */ 0x0000, 0xFFFC, 0x0004, 0xFFF8, 0x0008, 0xFFF4, 0x000C, 0xFFF0, 0x0010, 0xFFEC, 0x0014, 0xFFE8, 0x0018, 0x001C, 0xFFE4, 0xFFE0, 0x0020, 0xFFDC, 0x0024, 0x0028, 0xFFD8, 0x002C, 0xFFD4, 0x0030, 0xFFD0, 0xFFCC, 0x0034, 0xFFC8, 0x0038, 0x0040, 0xFFC4, 0xFFC0, 0x003C, 0x0044, 0xFFBC, 0xFFB8, - 0x0048, 0xFFB4, 0x004C, 0x0100, 0xFFB0, 0x0054, 0xFFAC, 0x0050 + 0x0048, 0xFFB4, 0x004C, BIAS_ESC, 0xFFB0, 0x0054, 0xFFAC, 0x0050 }; #endif /* AVCODEC_CLEARVIDEODATA_H */ From patchwork Fri Nov 20 07:18:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23769 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 C78BE449D14 for ; Fri, 20 Nov 2020 09:27:39 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6FE9D68BA04; Fri, 20 Nov 2020 09:24:37 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B966668B9DE for ; Fri, 20 Nov 2020 09:24:28 +0200 (EET) Received: by mail-ej1-f47.google.com with SMTP id i19so11470519ejx.9 for ; Thu, 19 Nov 2020 23:24:28 -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=kmwe43vB4tdxMiDpgFoE/yc1FNXm3XgCdK84avwXpZ8=; b=Lkjx2oxmlvxOr8bxNT+d3NjPPWdIZ76Q204DjuNL+H2BeMFLCbNmqqS4fzL0hx3iT6 f0QnMVlO4aN8r7Uslo1nbYeyxUJz3NQGYov2If8LpLlWW9fPcRy6hSw+zEuhurO8tL8F L9Jo6HZSkHRvWudvhm65LgLruFeO95PnaR+lX+n7Pbd4B6b/K5r0T68HLaZEd3Va05PN 1WhoD4s7GwRswEh4c93xnqW4S48em9uh8mgRRhZINdEUAk3+sphbgGEwU+MNRaASOa/A 7ZDF7L5aLKj/KLC6vJQqNtrVHWBqkVsNXpnY0OCaUAtEQSb2QmJOOnRLEbFclPpZrq4z wO2w== 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=kmwe43vB4tdxMiDpgFoE/yc1FNXm3XgCdK84avwXpZ8=; b=pJQU9RdyUqxqvr13i5KdjfNecx/tDaMPEkM4NTgAqj6cbjxe9BZTJiJdmKq085qQhL I/ksdP6qxmDpxxwOBC1Lu84wkGiCXE5+L27pV5Gfqbgmr3NJnjA+QKruY6FGNHQoxMpt Fag+T51DuGSXR39jyD2eFt3Lz2ufxLOZ7s+H2tmWZmbHhDRolPVYm9wg+p5ERk20mX64 crukCtYSeX5u04FyBWDh7HvQsXjMmQ1HTO0IFUnfpa8XY4xpRiyYDpbVo92te6YoVppL wX+MxqLsD9q2VzlHnMoljV2nUP9t5a6jg8rIiItl9wJaEJDcgHRu+noUbB+8uaWpeQRM mRSQ== X-Gm-Message-State: AOAM533M2mt0Q2eEhavChkAkQnhRj5G/z5Rq5PGB1CZlfVKrMERQ1hc8 bpK2Sxgd/vqI2tPoC5CzgkdTDAym759lOg== X-Google-Smtp-Source: ABdhPJwU/RoimjfYNlGFsfWxlgQ4pIT+DeznbwPFUJX2UMyzGNutyLA9l+TJOszEw87HLAS+t5ru0A== X-Received: by 2002:a17:906:1381:: with SMTP id f1mr31225522ejc.87.1605857067858; Thu, 19 Nov 2020 23:24:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:26 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:52 +0100 Message-Id: <20201120072116.818090-20-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 019/162] avcodec/clearvideo: Inline constants 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/clearvideo.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 3e666b98e9..0885b82837 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -32,6 +32,8 @@ #include "mathops.h" #include "clearvideodata.h" +#define CLV_VLC_BITS 9 + typedef struct LevelCodes { VLC flags_cb; VLC mv_cb; @@ -85,14 +87,14 @@ static inline int decode_block(CLVContext *ctx, int16_t *blk, int has_ac, int idx = 1, last = 0, val, skip; memset(blk, 0, sizeof(*blk) * 64); - blk[0] = get_vlc2(gb, ctx->dc_vlc.table, 9, 3); + blk[0] = get_vlc2(gb, ctx->dc_vlc.table, CLV_VLC_BITS, 3); blk[0] -= 63; if (!has_ac) return 0; while (idx < 64 && !last) { - val = get_vlc2(gb, ctx->ac_vlc.table, 9, 2); + val = get_vlc2(gb, ctx->ac_vlc.table, CLV_VLC_BITS, 2); if (val < 0) return AVERROR_INVALIDDATA; if (val != 0x1BFF) { @@ -363,11 +365,11 @@ static TileInfo* decode_tile_info(GetBitContext *gb, LevelCodes *lc, int level) MV mv = { 0 }; if (lc[level].flags_cb.table) { - flags = get_vlc2(gb, lc[level].flags_cb.table, lc[level].flags_cb.bits, 2); + flags = get_vlc2(gb, lc[level].flags_cb.table, CLV_VLC_BITS, 2); } if (lc[level].mv_cb.table) { - uint16_t mv_code = get_vlc2(gb, lc[level].mv_cb.table, lc[level].mv_cb.bits, 3); + uint16_t mv_code = get_vlc2(gb, lc[level].mv_cb.table, CLV_VLC_BITS, 3); if (mv_code != MV_ESC) { mv.x = (int8_t)(mv_code & 0xff); @@ -379,7 +381,7 @@ static TileInfo* decode_tile_info(GetBitContext *gb, LevelCodes *lc, int level) } if (lc[level].bias_cb.table) { - uint16_t bias_val = get_vlc2(gb, lc[level].bias_cb.table, lc[level].bias_cb.bits, 2); + uint16_t bias_val = get_vlc2(gb, lc[level].bias_cb.table, CLV_VLC_BITS, 2); if (bias_val != BIAS_ESC) { bias = (int16_t)(bias_val); @@ -658,7 +660,8 @@ static av_cold int build_vlc(VLC *vlc, const uint8_t counts[16], for (count += num; num < count; num++) lens[num] = i + 1; } - ret = ff_init_vlc_from_lengths(vlc, 9, num, lens, 1, *syms, 2, 2, 0, 0, NULL); + ret = ff_init_vlc_from_lengths(vlc, CLV_VLC_BITS, num, lens, 1, + *syms, 2, 2, 0, 0, NULL); if (ret < 0) return ret; *syms += num; @@ -709,14 +712,14 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); ff_idctdsp_init(&c->idsp, avctx); - ret = init_vlc(&c->dc_vlc, 9, NUM_DC_CODES, + ret = init_vlc(&c->dc_vlc, CLV_VLC_BITS, NUM_DC_CODES, clv_dc_bits, 1, 1, clv_dc_codes, 1, 1, 0); if (ret) { av_log(avctx, AV_LOG_ERROR, "Error initialising DC VLC\n"); return ret; } - ret = ff_init_vlc_from_lengths(&c->ac_vlc, 9, NUM_AC_CODES, + ret = ff_init_vlc_from_lengths(&c->ac_vlc, CLV_VLC_BITS, NUM_AC_CODES, clv_ac_bits, 1, clv_ac_syms, 2, 2, 0, 0, avctx); if (ret) { @@ -734,7 +737,7 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) if (i == FF_ARRAY_ELEMS(c->lev) - 1) break; if (0x1B7 & (1 << i)) { - ret = ff_init_vlc_from_lengths(&c->lev[i].flags_cb, 9, 16, + ret = ff_init_vlc_from_lengths(&c->lev[i].flags_cb, CLV_VLC_BITS, 16, clv_flags_bits[j], 1, clv_flags_syms[j], 1, 1, 0, 0, avctx); if (ret < 0) From patchwork Fri Nov 20 07:18:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23770 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 E41EA449D14 for ; Fri, 20 Nov 2020 09:27:47 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 74D8D68BA15; Fri, 20 Nov 2020 09:24:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7D9BC68B9CA for ; Fri, 20 Nov 2020 09:24:29 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id o9so11538991ejg.1 for ; Thu, 19 Nov 2020 23:24:29 -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=w4WtW0h4FK9x3AEO6h6rQafnXmAzeYW/cICn5PG8z7Y=; b=m0aYJ4oUeNj3yLFXX1PPB+JxhFFoNXSObizf8qP9wORYRshfJ4veliAOVjkKoijuCe Lqb9mmHQevoHs81ql4W2SxBuu1aQEF1jWvc2n6Jd9Vt/pp/UuwEfmcZPdxgi9/sUdPoP lJxHczZQRJU2TB+XnKeDAkVTt1Nn9naSh0JhjRfaiGaphA5gFtF4N3tw0JfW8ltlWRhE SsKbIhvS22uKhQ4vOB7Qqqx10lBIOg7t9hzhEGn2pYuXI9KVkmnKt6XV1ceyzTRVNJqM LDfPRUEgUU+ZFUOUPo0WFLSn90YjlW6beOsiRmeaDhnZNlqLoUXEks+VC1E20JOU5NHJ bzUA== 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=w4WtW0h4FK9x3AEO6h6rQafnXmAzeYW/cICn5PG8z7Y=; b=RUJfR9lCkXGHRaBjZnIUukCoTqFJRHhOTkV1FBRWphhBU8yptNusio+BCohqCM1ijy gUCNVQXSbflT0Q/29ZymDBu4PuMbzIDOIfQk041KoNjLIOXRLQE5alMpR2/WIIGkPztT ckwVRvg9sT0g2bMR6mVM6eRAEYGmOCPLbkMXHEdxx9P68gvXQXj/z9haNEzPDV+PXoYe yyIYYpDL60R+TUo8ti7A6jwZiZMWQchzy1gUL4ExBIUVv/nHbl12k/FJtVcPWn5eW37g wsgr10dMNGuz2oIEFsve3VDqHRD+Dt8HQQyK0BzRie94TeeJqHgPl/VNZrMBZ9HfiYs7 3HQQ== X-Gm-Message-State: AOAM532bPNAkY59J6SXT040DFLHTbpQot8NMfEIdyAj4jl3rvEajp6/2 5xY8O+GkbQ3SzRYDHHEypWoPJZT4Ohs5MA== X-Google-Smtp-Source: ABdhPJxysbCDAwil+hxFVdR3QRyzqvZjx2QPWEYyh6lPGI+hhJ2oBWAxt92y/ZxxEP8iUaLaWVK0GA== X-Received: by 2002:a17:906:f10e:: with SMTP id gv14mr31192877ejb.346.1605857068708; Thu, 19 Nov 2020 23:24:28 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:28 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:53 +0100 Message-Id: <20201120072116.818090-21-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 020/162] avcodec/clearvideo: Use minimal max_depth in get_vlc2() 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/clearvideo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 0885b82837..a5f9cc3ca2 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -369,7 +369,7 @@ static TileInfo* decode_tile_info(GetBitContext *gb, LevelCodes *lc, int level) } if (lc[level].mv_cb.table) { - uint16_t mv_code = get_vlc2(gb, lc[level].mv_cb.table, CLV_VLC_BITS, 3); + uint16_t mv_code = get_vlc2(gb, lc[level].mv_cb.table, CLV_VLC_BITS, 2); if (mv_code != MV_ESC) { mv.x = (int8_t)(mv_code & 0xff); From patchwork Fri Nov 20 07:18:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23760 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 DEB0744A644 for ; Fri, 20 Nov 2020 09:24:40 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C67CC68BA1A; Fri, 20 Nov 2020 09:24:40 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7B80268B989 for ; Fri, 20 Nov 2020 09:24:31 +0200 (EET) Received: by mail-ej1-f50.google.com with SMTP id lv15so5640471ejb.12 for ; Thu, 19 Nov 2020 23:24: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=kjW/TQethMTVw6FJEy4ZYuaAnJfxQU+rp7f29klMYLU=; b=slDrFIgHyTsDNlO6UweRvthKCAflbbkLOD2faeA+G/6zv+KusSTFfRMmviUd3+Exe+ 56OGMg7DbiK3zZKAO0dOG2bagNtPWx1a3xiBvm2tmjTZiMgeQaMFE4eBm+i3041m2gpq 1wd/x8WrYcfzADLE/4sAqiS1zK/4OQmuuVh9G6jod9z3+/UBZATwcnge5/zHb81Fn75o ukODnBzxkasHAX/yKOFAxwwK/PNfXcmhv09W5BsOrhgAM+AcoSOXrQyP1izhxfhahLJr y9pHjgIEdoHpD0gmZ1smXMsC+F7NGEh2P6vuod4Z9Tb92ZVvGHsy59dDSbmKB45llrOk wTPQ== 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=kjW/TQethMTVw6FJEy4ZYuaAnJfxQU+rp7f29klMYLU=; b=l7Qh61pG+8Z3U7YKmapV4CprG0h5nwpNJqOPCBxFKl6HTBI3duQdv3ahn/LmsBHYE3 iA48dwwFseyZtMk262zPc8/19e//n3PTfzk8B7JxOlScd1BzydC/j+/s9ZEwAo1qGCf/ noO/3qHnAO2hyGNb3uJJkhJG87urJQa6eFCj7JF0+Y8GlApEocoQ4KDvJhM2Oo5Tbg/j EI0vL6f/cnqBQMoBar44KiIP0F/N88SblK+LmR4A1vvjJn3Pw5vRE7PU2H/KzjtakqyA O7tKE3mDqaLcU0qyowJP38QdsGMVc1S8QeKBkUswQWro5KvxyAin3nvIsnKkQeMSuVrh /5Gg== X-Gm-Message-State: AOAM532Ef7gBwF11swLb90mDuAUPmW3nQrgCNO1xY2r65bG09mDBGFda TU++I47sD9fLmR373xcrpVlCLUtjCVGvXA== X-Google-Smtp-Source: ABdhPJxdVvWroBU/I+W9CtJ+kCuZMDYzv5c7Gg2F+PITj/S+UhOjOzg+MVjb1nw5t+AXzJ8B3FXTSA== X-Received: by 2002:a17:906:8282:: with SMTP id h2mr32897143ejx.50.1605857069854; Thu, 19 Nov 2020 23:24:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:29 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:54 +0100 Message-Id: <20201120072116.818090-22-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 021/162] avcodec/clearvideo: Apply VLC offset during init 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/clearvideo.c | 7 +++-- libavcodec/clearvideodata.h | 54 ++++++++++++++----------------------- 2 files changed, 23 insertions(+), 38 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index a5f9cc3ca2..ff6445b1de 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -88,7 +88,6 @@ static inline int decode_block(CLVContext *ctx, int16_t *blk, int has_ac, memset(blk, 0, sizeof(*blk) * 64); blk[0] = get_vlc2(gb, ctx->dc_vlc.table, CLV_VLC_BITS, 3); - blk[0] -= 63; if (!has_ac) return 0; @@ -712,9 +711,9 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); ff_idctdsp_init(&c->idsp, avctx); - ret = init_vlc(&c->dc_vlc, CLV_VLC_BITS, NUM_DC_CODES, - clv_dc_bits, 1, 1, - clv_dc_codes, 1, 1, 0); + ret = ff_init_vlc_from_lengths(&c->dc_vlc, CLV_VLC_BITS, NUM_DC_CODES, + clv_dc_lens, 1, + clv_dc_syms, 1, 1, -63, 0, avctx); if (ret) { av_log(avctx, AV_LOG_ERROR, "Error initialising DC VLC\n"); return ret; diff --git a/libavcodec/clearvideodata.h b/libavcodec/clearvideodata.h index 89bf192bce..37d5eb3bb5 100644 --- a/libavcodec/clearvideodata.h +++ b/libavcodec/clearvideodata.h @@ -28,42 +28,28 @@ #define NUM_DC_CODES 127 #define NUM_AC_CODES 104 -static const uint8_t clv_dc_codes[NUM_DC_CODES] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x13, 0x14, 0x07, 0x0B, - 0x0C, 0x08, 0x08, 0x09, 0x04, 0x06, 0x07, 0x05, - 0x04, 0x05, 0x04, 0x06, 0x05, 0x06, 0x07, 0x05, - 0x06, 0x07, 0x06, 0x07, 0x08, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x07, 0x08, 0x09, 0x07, 0x08, - 0x06, 0x07, 0x08, 0x06, 0x04, 0x05, 0x02, 0x01, - 0x03, 0x06, 0x07, 0x07, 0x09, 0x0A, 0x0B, 0x09, - 0x0A, 0x0B, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x09, - 0x0D, 0x0A, 0x0B, 0x08, 0x09, 0x0A, 0x0B, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x06, 0x07, 0x06, 0x08, - 0x07, 0x09, 0x0A, 0x0B, 0x09, 0x0A, 0x0B, 0x0C, - 0x14, 0x0D, 0x0D, 0x0E, 0x0F, 0x15, 0x15, 0x16, - 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, - 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, +static const uint8_t clv_dc_lens[NUM_DC_CODES] = { + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 21, 21, 21, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, + 17, 17, 17, 17, 16, 16, 16, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, + 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 10, 10, 10, + 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 7, 7, + 7, 7, 7, 7, 6, 6, 5, 5, 5, 5, 3, 3, 1, }; -static const uint8_t clv_dc_bits[NUM_DC_CODES] = { - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 21, 22, 22, 19, 20, - 20, 19, 18, 18, 15, 17, 17, 16, - 14, 15, 12, 13, 14, 14, 14, 12, - 12, 12, 11, 11, 11, 10, 10, 10, - 10, 10, 10, 9, 9, 9, 8, 8, - 7, 7, 7, 6, 5, 5, 3, 1, - 3, 5, 5, 6, 7, 7, 7, 8, - 8, 8, 9, 9, 9, 9, 10, 11, - 10, 11, 11, 12, 12, 12, 12, 13, - 14, 14, 14, 14, 15, 15, 16, 17, - 16, 17, 18, 18, 19, 19, 19, 19, - 21, 19, 20, 19, 19, 21, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, +static const uint8_t clv_dc_syms[NUM_DC_CODES] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, + 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x14, 0x15, 0x6E, 0x6F, 0x70, + 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, + 0x7D, 0x7E, 0x13, 0x68, 0x6D, 0x17, 0x18, 0x6A, 0x16, 0x19, 0x64, 0x65, + 0x66, 0x67, 0x69, 0x6B, 0x6C, 0x1A, 0x1B, 0x62, 0x63, 0x1D, 0x1E, 0x5F, + 0x61, 0x1F, 0x5E, 0x60, 0x1C, 0x21, 0x5C, 0x5D, 0x20, 0x24, 0x25, 0x26, + 0x58, 0x59, 0x5A, 0x5B, 0x23, 0x57, 0x22, 0x27, 0x28, 0x29, 0x53, 0x54, + 0x55, 0x56, 0x2A, 0x2B, 0x2C, 0x4F, 0x51, 0x52, 0x2D, 0x2E, 0x2F, 0x30, + 0x31, 0x32, 0x4E, 0x50, 0x33, 0x34, 0x35, 0x4A, 0x4B, 0x4C, 0x4D, 0x36, + 0x37, 0x47, 0x48, 0x49, 0x38, 0x39, 0x3A, 0x44, 0x45, 0x46, 0x3B, 0x43, + 0x3C, 0x3D, 0x41, 0x42, 0x3E, 0x40, 0x3F, }; static const uint16_t clv_ac_syms[NUM_AC_CODES] = { From patchwork Fri Nov 20 07:18: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: 23771 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 DAD23449F1B for ; Fri, 20 Nov 2020 09:28:14 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E7FE068B9EB; Fri, 20 Nov 2020 09:24:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5958468B9EF for ; Fri, 20 Nov 2020 09:24:32 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id cq7so8475525edb.4 for ; Thu, 19 Nov 2020 23:24:32 -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=YvjJybSTnFpQnOf1X04nM/Vm5CUx/7uMmiWj4APoYjg=; b=iMHbDAbMXrhdE4e3tp419Mw/l+M023bUOdSPIwIR2zJ+LHJzm+29eP0gmkoi6/UMlp y8HV0OozQREPOQtC7Su1sR+5jRVzAo+y7qVRLgTMdRc2+f8hChgUErMFriMXIpdb9hrv LwYavFqAiJzESjvtgHG7MJziiHvfTEvSar3HZuKGtgdLKOhf0oVAJjgrByg4EHy1kIrV XL/h6sw+jT7CWTCcIn3uJhCm/18EgAVGt+f/xrL512BoQOV/WaM1Opyjsol2plPqKkzo Iw3husnTmpBsVnh3PhMA9K4Uc5H12nRhCNt1KjvatOqL6HmHJygFmdAlIeAg5vAhJxiR 26Ig== 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=YvjJybSTnFpQnOf1X04nM/Vm5CUx/7uMmiWj4APoYjg=; b=pZp4Nk3/aYSzI7+m9Qz3HkWoJGZV2Np0hfo1zD6IUE5m76JNEG4liAOqbkZ3r4cP/8 yy4wJjhdinS0TCDw6J/v/QbAWjjAD62QfjJnpfQjAw1n2n5YpsSu7zSEt6gfXyqPU2ZR WKs5qewd1e39Tqa8FOORjwlriVpo+1IPZHmQw7VqR61QqYbpDqpAuYpAVFVYeQffbIbF uUXGcpcumPChTTkzt1q3bUXW6AcJGr1+c8aZytzBmhfk+Q1irup5+9yhtpIgMKGBZKXS QFTluwiYqwjRftbX03Q9jNCsjCS4OuyNiZM8z5vFwQDcJ9+NOmp03WIvTiyrliIvpUC6 oZlg== X-Gm-Message-State: AOAM531FGeOx/EQ55HPK0AuUyCZbm3fIpg8f01Z35TvtNKNESZZ/MnFR Fgj15Qy8feTv5XXeF3HhxDzvOFuC5XPXVA== X-Google-Smtp-Source: ABdhPJwNay9NCUktZ3zqdP6k6dKwiP39L5/42PBHHpEm2tU1SLLz/wNczz+tFAmxkN/MnbPfduAJiw== X-Received: by 2002:a50:f604:: with SMTP id c4mr33512604edn.117.1605857071367; Thu, 19 Nov 2020 23:24:31 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:30 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:55 +0100 Message-Id: <20201120072116.818090-23-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 022/162] avcodec/clearvideo: Make VLC tables static 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/clearvideo.c | 117 +++++++++++++++++++--------------------- 1 file changed, 55 insertions(+), 62 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index ff6445b1de..7342557cd2 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -24,6 +24,8 @@ * ClearVideo decoder */ +#include "libavutil/thread.h" + #include "avcodec.h" #include "bytestream.h" #include "get_bits.h" @@ -73,13 +75,15 @@ typedef struct CLVContext { MVInfo mvi; int tile_size; int tile_shift; - VLC dc_vlc, ac_vlc; - LevelCodes lev[4 + 3 + 3]; // 0..3: Y, 4..6: U, 7..9: V int luma_dc_quant, chroma_dc_quant, ac_quant; DECLARE_ALIGNED(16, int16_t, block)[64]; int top_dc[3], left_dc[4]; } CLVContext; +static VLC dc_vlc, ac_vlc; +static LevelCodes lev[4 + 3 + 3]; // 0..3: Y, 4..6: U, 7..9: V +static VLC_TYPE vlc_buf[16716][2]; + static inline int decode_block(CLVContext *ctx, int16_t *blk, int has_ac, int ac_quant) { @@ -87,13 +91,13 @@ static inline int decode_block(CLVContext *ctx, int16_t *blk, int has_ac, int idx = 1, last = 0, val, skip; memset(blk, 0, sizeof(*blk) * 64); - blk[0] = get_vlc2(gb, ctx->dc_vlc.table, CLV_VLC_BITS, 3); + blk[0] = get_vlc2(gb, dc_vlc.table, CLV_VLC_BITS, 3); if (!has_ac) return 0; while (idx < 64 && !last) { - val = get_vlc2(gb, ctx->ac_vlc.table, CLV_VLC_BITS, 2); + val = get_vlc2(gb, ac_vlc.table, CLV_VLC_BITS, 2); if (val < 0) return AVERROR_INVALIDDATA; if (val != 0x1BFF) { @@ -356,7 +360,7 @@ static void mvi_update_row(MVInfo *mvi) } } -static TileInfo* decode_tile_info(GetBitContext *gb, LevelCodes *lc, int level) +static TileInfo *decode_tile_info(GetBitContext *gb, const LevelCodes *lc, int level) { TileInfo *ti; int i, flags = 0; @@ -593,7 +597,7 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data, TileInfo *tile; MV mv, cmv; - tile = decode_tile_info(&c->gb, &c->lev[0], 0); // Y + tile = decode_tile_info(&c->gb, &lev[0], 0); // Y if (!tile) return AVERROR(ENOMEM); mv = mvi_predict(&c->mvi, i, j, tile->mv); @@ -608,14 +612,14 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data, cmv.x /= 2; cmv.y /= 2; av_freep(&tile); - tile = decode_tile_info(&c->gb, &c->lev[4], 0); // U + tile = decode_tile_info(&c->gb, &lev[4], 0); // U if (!tile) return AVERROR(ENOMEM); ret = restore_tree(avctx, c->pic, c->prev, 1, x, y, size, tile, cmv); if (ret < 0) mb_ret = ret; av_freep(&tile); - tile = decode_tile_info(&c->gb, &c->lev[7], 0); // V + tile = decode_tile_info(&c->gb, &lev[7], 0); // V if (!tile) return AVERROR(ENOMEM); ret = restore_tree(avctx, c->pic, c->prev, 2, x, y, size, tile, cmv); @@ -645,12 +649,11 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data, return mb_ret < 0 ? mb_ret : buf_size; } -static av_cold int build_vlc(VLC *vlc, const uint8_t counts[16], - const uint16_t **syms) +static av_cold void build_vlc(VLC *vlc, const uint8_t counts[16], + const uint16_t **syms, unsigned *offset) { uint8_t lens[MAX_VLC_ENTRIES]; unsigned num = 0; - int ret; for (int i = 0; i < 16; i++) { unsigned count = counts[i]; @@ -659,18 +662,51 @@ static av_cold int build_vlc(VLC *vlc, const uint8_t counts[16], for (count += num; num < count; num++) lens[num] = i + 1; } - ret = ff_init_vlc_from_lengths(vlc, CLV_VLC_BITS, num, lens, 1, - *syms, 2, 2, 0, 0, NULL); - if (ret < 0) - return ret; + vlc->table = &vlc_buf[*offset]; + vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; + ff_init_vlc_from_lengths(vlc, CLV_VLC_BITS, num, lens, 1, + *syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); *syms += num; - return 0; + *offset += vlc->table_size; +} + +static av_cold void clv_init_static(void) +{ + const uint16_t *mv_syms = clv_mv_syms, *bias_syms = clv_bias_syms; + + INIT_VLC_STATIC_FROM_LENGTHS(&dc_vlc, CLV_VLC_BITS, NUM_DC_CODES, + clv_dc_lens, 1, + clv_dc_syms, 1, 1, -63, 0, 1104); + INIT_VLC_STATIC_FROM_LENGTHS(&ac_vlc, CLV_VLC_BITS, NUM_AC_CODES, + clv_ac_bits, 1, + clv_ac_syms, 2, 2, 0, 0, 554); + for (unsigned i = 0, j = 0, k = 0, offset = 0;; i++) { + if (0x36F & (1 << i)) { + build_vlc(&lev[i].mv_cb, clv_mv_len_counts[k], &mv_syms, &offset); + k++; + } + if (i == FF_ARRAY_ELEMS(lev) - 1) + break; + if (0x1B7 & (1 << i)) { + lev[i].flags_cb.table = &vlc_buf[offset]; + lev[i].flags_cb.table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; + ff_init_vlc_from_lengths(&lev[i].flags_cb, CLV_VLC_BITS, 16, + clv_flags_bits[j], 1, + clv_flags_syms[j], 1, 1, + 0, INIT_VLC_STATIC_OVERLONG, NULL); + offset += lev[i].flags_cb.table_size; + + build_vlc(&lev[i + 1].bias_cb, clv_bias_len_counts[j], + &bias_syms, &offset); + j++; + } + } } static av_cold int clv_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; CLVContext *const c = avctx->priv_data; - const uint16_t *mv_syms = clv_mv_syms, *bias_syms = clv_bias_syms; int ret, w, h; if (avctx->extradata_size == 110) { @@ -711,44 +747,9 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); ff_idctdsp_init(&c->idsp, avctx); - ret = ff_init_vlc_from_lengths(&c->dc_vlc, CLV_VLC_BITS, NUM_DC_CODES, - clv_dc_lens, 1, - clv_dc_syms, 1, 1, -63, 0, avctx); - if (ret) { - av_log(avctx, AV_LOG_ERROR, "Error initialising DC VLC\n"); - return ret; - } - ret = ff_init_vlc_from_lengths(&c->ac_vlc, CLV_VLC_BITS, NUM_AC_CODES, - clv_ac_bits, 1, - clv_ac_syms, 2, 2, 0, 0, avctx); - if (ret) { - av_log(avctx, AV_LOG_ERROR, "Error initialising AC VLC\n"); - return ret; - } - for (int i = 0, j = 0, k = 0;; i++) { - if (0x36F & (1 << i)) { - ret = build_vlc(&c->lev[i].mv_cb, clv_mv_len_counts[k], &mv_syms); - if (ret < 0) - return ret; - k++; - } - if (i == FF_ARRAY_ELEMS(c->lev) - 1) - break; - if (0x1B7 & (1 << i)) { - ret = ff_init_vlc_from_lengths(&c->lev[i].flags_cb, CLV_VLC_BITS, 16, - clv_flags_bits[j], 1, - clv_flags_syms[j], 1, 1, 0, 0, avctx); - if (ret < 0) - return ret; - - ret = build_vlc(&c->lev[i + 1].bias_cb, - clv_bias_len_counts[j], &bias_syms); - if (ret < 0) - return ret; - j++; - } - } + ff_thread_once(&init_static_once, clv_init_static); + return 0; } @@ -761,14 +762,6 @@ static av_cold int clv_decode_end(AVCodecContext *avctx) av_freep(&c->mvi.mv); - ff_free_vlc(&c->dc_vlc); - ff_free_vlc(&c->ac_vlc); - for (int i = 0; i < FF_ARRAY_ELEMS(c->lev); i++) { - ff_free_vlc(&c->lev[i].mv_cb); - ff_free_vlc(&c->lev[i].flags_cb); - ff_free_vlc(&c->lev[i].bias_cb); - } - return 0; } From patchwork Fri Nov 20 07:18:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23772 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 76FE9449F1B for ; Fri, 20 Nov 2020 09:28:26 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A114A68BA41; Fri, 20 Nov 2020 09:24:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4120168B9B8 for ; Fri, 20 Nov 2020 09:24:33 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id lv15so5640555ejb.12 for ; Thu, 19 Nov 2020 23:24:33 -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=WDceH3BvzNWQRv6j0OzYBfD5y7uy3TDo/v+9lN2Nfc8=; b=GFue9nN3f23tbSqpr8981HE1eRVsmoRzlRRtXZ9OfWak35OF1lck5xg0LIyPUhU4nW D2eRT0EXkTBRdWQWgrWHu4NSSAeaRehnF2REdCol65JmVlI+8FlRQJnO8oifK0e6kz3C ilNUcOf/wg4VjS/Grh5YvHJt8qvbZnI6hDxuTr9Qa8UEAs4l8b568+LUx9BADdv+eEft nN7N76ME2gfM/flHfkCgVgeEin8AiRUABoNmSZ2v3Wwpj+4hIewyWKgrCko1LHtCboAU v8vhQm7bKpY5ufF3GzkjE+Q1wE+0auCF1VrZB5W4V6Fu6mSItF76pgYRsTtV8GJjaY09 qvpA== 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=WDceH3BvzNWQRv6j0OzYBfD5y7uy3TDo/v+9lN2Nfc8=; b=fUpjhomqYYHO7W3W9SRHeVVezIkELBLFpc1eRiOY4B/W/PVXXIFADoRTHgPZD+JNOp Y4iBWG+DAjCwj0WjLOplYyoQCydbRH/nrPx9sLtGTgP0ct6Oi5ORzBjQ9BEj5lBrMlQh tSfUJ5KuN61EK6PU6rroM7tzY3f0mQWWcp++tjsOu8MUa6dFBQHQFfsPbVau2bHONCwz F5ZNcd0QK1+j/iotruD7VcbHdSIOWkQgWpqPhAiNLq4x7Wg8cRwsvs+IcSDUYWHt0A/k NRMl/3bKej25S+HNWlmoLq7c1T/IH/khsrqcMLZ6hSjmqJNK96Z6M8A6L0g4wWCHISbY e6WQ== X-Gm-Message-State: AOAM532GXjjIF+76jKD/1vVhFTKwDXEFm/SUiRv+lzUUFvu12vyGI4dl s5BApy49AKhDAv8jPWmoT037nRrnrN555g== X-Google-Smtp-Source: ABdhPJwD07sWts8iQOwHPt8+enhVtqaYVgYld1xeDlAhfbTIvplMcU4+6m4i4yr2TPWjTqS3zAippQ== X-Received: by 2002:a17:907:11d9:: with SMTP id va25mr13254138ejb.431.1605857072398; Thu, 19 Nov 2020 23:24:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:31 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:56 +0100 Message-Id: <20201120072116.818090-24-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 023/162] avcodec/wnv1: Make array for initializing 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" This is possible by switching to ff_init_vlc_from_lengths() which allows to replace the table for the codes (which need an uint16_t) by a table of symbols which fit into an uint8_t. Also switch to an ordinary INIT_VLC macro while just at it. Signed-off-by: Andreas Rheinhardt --- libavcodec/wnv1.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index b5cd0f0f0c..f8a9b94746 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -29,11 +29,10 @@ #include "get_bits.h" #include "internal.h" - -static const uint16_t code_tab[16][2] = { - { 0x17F, 9 }, { 0xBF, 8 }, { 0x5F, 7 }, { 0x2F, 6 }, { 0x17, 5 }, { 0x0B, 4 }, { 0x005, 3 }, - { 0x000, 1 }, - { 0x01, 3 }, { 0x03, 4 }, { 0x07, 5 }, { 0x0F, 6 }, { 0x1F, 7 }, { 0x3F, 8 }, { 0x07F, 9 }, { 0xFF, 8 } +static const uint8_t code_tab[16][2] = { + { 7, 1 }, { 8, 3 }, { 6, 3 }, { 9, 4 }, { 5, 4 }, { 10, 5 }, { 4, 5 }, + { 11, 6 }, { 3, 6 }, { 12, 7 }, { 2, 7 }, { 13, 8 }, { 1, 8 }, { 14, 9 }, + { 0, 9 }, { 15, 8 } }; #define CODE_VLC_BITS 9 @@ -115,16 +114,12 @@ static int decode_frame(AVCodecContext *avctx, static av_cold int decode_init(AVCodecContext *avctx) { - static VLC_TYPE code_table[1 << CODE_VLC_BITS][2]; - avctx->pix_fmt = AV_PIX_FMT_YUV422P; - code_vlc.table = code_table; - code_vlc.table_allocated = 1 << CODE_VLC_BITS; - init_vlc(&code_vlc, CODE_VLC_BITS, 16, - &code_tab[0][1], 4, 2, - &code_tab[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); - + 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); return 0; } From patchwork Fri Nov 20 07:18:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23773 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 D8059449F1B for ; Fri, 20 Nov 2020 09:28:37 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 45D5268BA1D; Fri, 20 Nov 2020 09:24:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A35E168B9C1 for ; Fri, 20 Nov 2020 09:24:34 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id f20so11490588ejz.4 for ; Thu, 19 Nov 2020 23:24:34 -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=gwSf2byWZjg4uJsdrh0QZhxV9l2gzdjFveT59d7z/Sl9kPADCSBsM82jJ0w2WX5WXE zoyp2tcJ+91iwZVRRmdt46K68wBE82qze46+Lqjht6O9c/sZm6raQzTVi2WMWZjvgH1n 2mrCgyJrDVxPiYWnhUON6I6Ten9b90SOESlK0fMoYSdnaX3TTFkpTRL5hdSN8kVIQ1iL lRIBINDjOTpRRNZgqpKtMLMcvb6d5FVQXAi8JKRQPsJjdxAlcG2H69EN/TvXGzL9Vd/H /QP4YUKCAPIie8gTxGi8CoqMmRwvsldkHsBO5ktyvvhHNL4Kua4v+DTfkil1vDPSpNrC JaQg== 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=HeTS3zB/6n3RlcEjGDZERJcAuirUFzMTYsJ4QceTXrDAZJOhhEOSo5r1ePV8rrZwRw tPpm7QvPdqy83w0v024CtAAwBjOm6qSXdJKJl1efB5CDLKj26a9Dp0IwSyliKHyy3gSN GjsM2JCq2WPNWKiBsn4Ayt3kDJh1Ffi+26/ZekmXmQljmADAEEtbgSyUwj+ItopGRUH+ WhKBF/LpRjS8IOxbOitx4I8cLCLyHJuoAYgG0NYemz7fBXgBc+JNjKLVRL4+WFF83J+Z XXdKl0lE5qLQBMgwIfYwJLAPRCb7hAOLSjtNpnrgM5j64ILuCrkYi1feN3YBCbnZIS7O AeiQ== X-Gm-Message-State: AOAM530yHaRV08TGDZdYO3qp8OK+LAzKWOpPJL2/TaUl+/8AgOJAAWfC gnmKV9AioAdLr9EcJRG+DHYEL4muye5SSw== X-Google-Smtp-Source: ABdhPJzs6fp2ySuyCXmUiY8NIMzYJSVAm8eCg/BlWFvqvX6xT3pJv6Eo5I4CjZ9O4FtR9io0imRlSg== X-Received: by 2002:a17:906:7d1:: with SMTP id m17mr31860164ejc.98.1605857073808; Thu, 19 Nov 2020 23:24:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:33 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:57 +0100 Message-Id: <20201120072116.818090-25-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 024/162] 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; } From patchwork Fri Nov 20 07:18:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23774 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 86368449F1B for ; Fri, 20 Nov 2020 09:28:49 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0DDDB68BA3C; Fri, 20 Nov 2020 09:24:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BD7B168BA04 for ; Fri, 20 Nov 2020 09:24:35 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id f23so11520008ejk.2 for ; Thu, 19 Nov 2020 23:24:35 -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=siPJDSm4OoIE+xXL8C/6KqQZhqDHgBUW/oCAucP5LPo=; b=kYZ/4VfG5ydiNqhCFzEN6jtJPs8nZ7zaKUZ7F+hNv+EfNR0H6txkeJZymbmyGBv7ui BzE76si42OPPGHSwXlPoWieOAtTuI9LGbUlPKJbhjmisMmUBGpt1oEG1cZjdbYzGfsFA ywLnHiWqlWo0DjJq+36FDA/pjvzjPHF013sVL45UakPWNQqB2mOdscH7QsbGiezP+jtZ L6LN+3HcBVzaKMAGZ6owVLr9XMVA5cJmVArxH3/1Oam9sCJQfvd+xINSWlqcs6N0OiX5 SATXEW0Z/66UgH0y05o3c6VVii2HGGxXNQbM/IhhZyYaVg3iDJd/bKmkQh9QeYYRe4Ll FCEA== 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=siPJDSm4OoIE+xXL8C/6KqQZhqDHgBUW/oCAucP5LPo=; b=opjZtmpfLPchCx7MM/AsoI+H/XrCU3790/S1q5snD62B3At2CPNBIUNGSItKUjudYW eMbr/PbDKRvLqU3VrkK6N6R0xyMhUYRfABeCrB0YahH6+28aTWhi3Q7r9AkZyecZRyXx +DGHJcX4E0W63weTuDKNHNWlyGoJJ5GQWlbv1TSnYJeVQ9C40I7wrzhACypsOmnRT8O2 KFWQoPfsU+QLJg6LpMtvSe+EgscIksobAvVsQQd24SAze9jSEWDNGS88xNbHiwSZCTYQ mNB5Vy/uJn4QHvuFiHNcTDtUT5NqT1dJtVKJ8+V2bzGqHOkKfqvFIJPKdwljxuj9YL1P sDvw== X-Gm-Message-State: AOAM531ty/1Q/sD4N19FIk0tlVpxKNqKulqWEXo7MKYXiIFmKMMv2H6q naCvPcErsxgqqTDxgaznM8QzwHW0Ud95lQ== X-Google-Smtp-Source: ABdhPJw0xNlUh4vM2KoYcOwkCUwvlgV0YfSYFwN8YOX8lvBgBnqC+chaeRbbckcmg4G9VNKXVznkEg== X-Received: by 2002:a17:907:1008:: with SMTP id ox8mr30987543ejb.189.1605857074918; Thu, 19 Nov 2020 23:24:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:34 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:58 +0100 Message-Id: <20201120072116.818090-26-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 025/162] avcodec/wnv1: Make decoder init-threadsafe 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 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index 7dd0e72596..a17a2bc3b6 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -24,6 +24,8 @@ * Winnov WNV1 codec. */ +#include "libavutil/thread.h" + #define BITSTREAM_READER_LE #include "avcodec.h" #include "get_bits.h" @@ -112,14 +114,22 @@ static int decode_frame(AVCodecContext *avctx, return buf_size; } -static av_cold int decode_init(AVCodecContext *avctx) +static av_cold void wnv1_init_static(void) { - avctx->pix_fmt = AV_PIX_FMT_YUV422P; - INIT_VLC_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16, &code_tab[0][1], 2, &code_tab[0][0], 2, 1, -7, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); +} + +static av_cold int decode_init(AVCodecContext *avctx) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + + avctx->pix_fmt = AV_PIX_FMT_YUV422P; + + ff_thread_once(&init_static_once, wnv1_init_static); + return 0; } @@ -131,4 +141,5 @@ AVCodec ff_wnv1_decoder = { .init = decode_init, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Fri Nov 20 07:18:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23776 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 1380744AB58 for ; Fri, 20 Nov 2020 09:29:13 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3A89A68BA5F; Fri, 20 Nov 2020 09:24:46 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9284168B97B for ; Fri, 20 Nov 2020 09:24:38 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id o21so11493796ejb.3 for ; Thu, 19 Nov 2020 23:24:38 -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=JAjvMUR49E6lZMw/VQPa2tL1+KbBSrIeI6ACQw1N5nE=; b=eOroPFoJbKEt4eWbLJkvewWida7Nxks5AsnfMc8TB/LtOvE7Cj6dWpZsP7Q1B6NLUe LavYCorGhnhesu19YBJd+HlOqmFBcRpN5COwKviOZcQuPbDo6NVEdcrv63HYATbOQmqx vMHcSjhJs19X5E4v+q4NjBNbhnWxR+ZuOhQbmuXccjhDYue9QRVthTbLIpixSn50td3y cssNNc4EDYJt71KKl31HRR9o3fLLJVqNQq8pmRq8mj8WoLMa1JANyzTZ+jIqu1KcJXI4 fV4IZ9fQtjfQOWcVaEq9ocWsulF55uCYaXw5n7mlPn2LnExFnVlkoolGxdc1lV51CZGd IY/g== 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=JAjvMUR49E6lZMw/VQPa2tL1+KbBSrIeI6ACQw1N5nE=; b=q0cpYtlARmMk6ShODrN+viJUhoC+jmmkc0V30YPb32UCCPVWreEs6ewZjqx1IyoSxu D+RQmjGsbCiWe5o3NLYihCUogrDRiDdgCuq0sjN0SS/sZb7OVcv0w2U1B1NrXIJ/UowS /Xc64PqcF2JJOJUY8nLJ0i9eKdr/WY1Lg1XxjBR5p2U82THUfS0kpBb9rSphFkQm+vsg KGkeetysM17qAJnGo85wLkxLyo3GCcOpxO0EPKbb5fVDPgW5gkjzyJY1bNNs9pUHT0eg wRew3iyjUuO1Vy7U1Cmu8PlEgCPRoDfYtkDpr4jjBKIVqyPJKuQyC866eB0ShZdtRShv ncSQ== X-Gm-Message-State: AOAM5330LxxwQr/3NHygNUktjDECdPo4TDR8R5+gCAIwI99IGB0z04+9 yTI67I8VlIpDI+/U/7khEOUDwNAyqlJGwA== X-Google-Smtp-Source: ABdhPJwqos1waWc9HQWWW8pMrrNXLhuGBqebha8HP6P6cd/QYuHdd0BA7biYfDV7/HIVMv+7TxdauA== X-Received: by 2002:a17:906:8496:: with SMTP id m22mr29783856ejx.298.1605857076458; Thu, 19 Nov 2020 23:24:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:35 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:18:59 +0100 Message-Id: <20201120072116.818090-27-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 026/162] avcodec/cook: Make tables to initialize VLCs 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" Up until now, the Cook decoder used tables for the lengths of codes and tables of the codes itself to initialize VLCs; the tables for the codes were of type uint16_t because the codes were so long. It did not use explicit symbol tables. This commit instead reorders the tables so that the code tables are sorted from left to right in the tree. Then the codes can be easily derived from the lengths and therefore be omitted. This comes at the price of explicitly coding the symbols, but this is nevertheless a net win because most of the symbols tables can be coded on one byte. Furthermore, Cook actually does not use a contiguous range of symbols for its main VLC tables and the old code compensated for that by adding holes (codes of length zero) to the tables (that are skipped by ff_init_vlc_sparse()). This is no longer necessary with the new approach. All in all, this saves about 1.7KB. Signed-off-by: Andreas Rheinhardt --- libavcodec/cook.c | 24 +- libavcodec/cookdata.h | 643 ++++++++++++++++++------------------------ 2 files changed, 290 insertions(+), 377 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 9582495442..f22fd02209 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -197,23 +197,27 @@ static av_cold int init_cook_vlc_tables(COOKContext *q) result = 0; for (i = 0; i < 13; i++) { - result |= init_vlc(&q->envelope_quant_index[i], 9, 24, - envelope_quant_index_huffbits[i], 1, 1, - envelope_quant_index_huffcodes[i], 2, 2, 0); + result |= ff_init_vlc_from_lengths(&q->envelope_quant_index[i], 9, 24, + envelope_quant_index_huffbits[i], 1, + envelope_quant_index_huffsyms[i], 1, 1, + 0, 0, q->avctx); } av_log(q->avctx, AV_LOG_DEBUG, "sqvh VLC init\n"); for (i = 0; i < 7; i++) { - result |= init_vlc(&q->sqvh[i], vhvlcsize_tab[i], vhsize_tab[i], - cvh_huffbits[i], 1, 1, - cvh_huffcodes[i], 2, 2, 0); + int sym_size = 1 + (i == 3); + result |= ff_init_vlc_from_lengths(&q->sqvh[i], vhvlcsize_tab[i], vhsize_tab[i], + cvh_huffbits[i], 1, + cvh_huffsyms[i], sym_size, sym_size, + 0, 0, q->avctx); } for (i = 0; i < q->num_subpackets; i++) { if (q->subpacket[i].joint_stereo == 1) { - result |= init_vlc(&q->subpacket[i].channel_coupling, 6, - (1 << q->subpacket[i].js_vlc_bits) - 1, - ccpl_huffbits[q->subpacket[i].js_vlc_bits - 2], 1, 1, - ccpl_huffcodes[q->subpacket[i].js_vlc_bits - 2], 2, 2, 0); + result |= ff_init_vlc_from_lengths(&q->subpacket[i].channel_coupling, 6, + (1 << q->subpacket[i].js_vlc_bits) - 1, + ccpl_huffbits[q->subpacket[i].js_vlc_bits - 2], 1, + ccpl_huffsyms[q->subpacket[i].js_vlc_bits - 2], 1, 1, + 0, 0, q->avctx); av_log(q->avctx, AV_LOG_DEBUG, "subpacket %i Joint-stereo VLC used.\n", i); } } diff --git a/libavcodec/cookdata.h b/libavcodec/cookdata.h index efb8a53942..05d1eef23b 100644 --- a/libavcodec/cookdata.h +++ b/libavcodec/cookdata.h @@ -71,7 +71,7 @@ static const int vpr_tab[7] = { /* VLC data */ static const int vhsize_tab[7] = { - 191, 97, 48, 607, 246, 230, 32, + 181, 94, 48, 520, 209, 192, 32, }; static const int vhvlcsize_tab[7] = { @@ -79,352 +79,269 @@ static const int vhvlcsize_tab[7] = { }; static const uint8_t envelope_quant_index_huffbits[13][24] = { - { 4, 6, 5, 5, 4, 4, 4, 4, 4, 4, 3, 3, 3, 4, 5, 7, 8, 9, 11, 11, 12, 12, 12, 12 }, - { 10, 8, 6, 5, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 7, 9, 11, 12, 13, 15, 15, 15, 16, 16 }, - { 12, 10, 8, 6, 5, 4, 4, 4, 4, 4, 4, 3, 3, 3, 4, 4, 5, 5, 7, 9, 11, 13, 14, 14 }, - { 13, 10, 9, 9, 7, 7, 5, 5, 4, 3, 3, 3, 3, 3, 4, 4, 4, 5, 7, 9, 11, 13, 13, 13 }, - { 12, 13, 10, 8, 6, 6, 5, 5, 4, 4, 3, 3, 3, 3, 3, 4, 5, 5, 6, 7, 9, 11, 14, 14 }, - { 12, 11, 9, 8, 8, 7, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4, 5, 5, 7, 8, 10, 13, 14, 14 }, - { 15, 16, 15, 12, 10, 8, 6, 5, 4, 3, 3, 3, 2, 3, 4, 5, 5, 7, 9, 11, 13, 16, 16, 16 }, - { 14, 14, 11, 10, 9, 7, 7, 5, 5, 4, 3, 3, 2, 3, 3, 4, 5, 7, 9, 9, 12, 14, 15, 15 }, - { 9, 9, 9, 8, 7, 6, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 13 }, - { 14, 12, 10, 8, 6, 6, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 6, 8, 8, 9, 11, 14, 14, 14 }, - { 13, 10, 9, 8, 6, 6, 5, 4, 4, 4, 3, 3, 2, 3, 4, 5, 6, 8, 9, 9, 11, 12, 14, 14 }, - { 16, 13, 12, 11, 9, 6, 5, 5, 4, 4, 4, 3, 2, 3, 3, 4, 5, 7, 8, 10, 14, 16, 16, 16 }, - { 13, 14, 14, 14, 10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9, 11, 14, 14, 14 }, -}; - -static const uint16_t envelope_quant_index_huffcodes[13][24] = { - {0x0006, 0x003e, 0x001c, 0x001d, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x0000, 0x0001, - 0x0002, 0x000d, 0x001e, 0x007e, 0x00fe, 0x01fe, 0x07fc, 0x07fd, 0x0ffc, 0x0ffd, 0x0ffe, 0x0fff}, - {0x03fe, 0x00fe, 0x003e, 0x001c, 0x001d, 0x000c, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x000d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x0ffe, 0x1ffe, 0x7ffc, 0x7ffd, 0x7ffe, 0xfffe, 0xffff}, - {0x0ffe, 0x03fe, 0x00fe, 0x003e, 0x001c, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x0000, - 0x0001, 0x0002, 0x000c, 0x000d, 0x001d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x1ffe, 0x3ffe, 0x3fff}, - {0x1ffc, 0x03fe, 0x01fc, 0x01fd, 0x007c, 0x007d, 0x001c, 0x001d, 0x000a, 0x0000, 0x0001, 0x0002, - 0x0003, 0x0004, 0x000b, 0x000c, 0x000d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x1ffd, 0x1ffe, 0x1fff}, - {0x0ffe, 0x1ffe, 0x03fe, 0x00fe, 0x003c, 0x003d, 0x001a, 0x001b, 0x000a, 0x000b, 0x0000, 0x0001, - 0x0002, 0x0003, 0x0004, 0x000c, 0x001c, 0x001d, 0x003e, 0x007e, 0x01fe, 0x07fe, 0x3ffe, 0x3fff}, - {0x0ffe, 0x07fe, 0x01fe, 0x00fc, 0x00fd, 0x007c, 0x001c, 0x000a, 0x000b, 0x0000, 0x0001, 0x0002, - 0x0003, 0x0004, 0x000c, 0x000d, 0x001d, 0x001e, 0x007d, 0x00fe, 0x03fe, 0x1ffe, 0x3ffe, 0x3fff}, - {0x7ffc, 0xfffc, 0x7ffd, 0x0ffe, 0x03fe, 0x00fe, 0x003e, 0x001c, 0x000c, 0x0002, 0x0003, 0x0004, - 0x0000, 0x0005, 0x000d, 0x001d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x1ffe, 0xfffd, 0xfffe, 0xffff}, - {0x3ffc, 0x3ffd, 0x07fe, 0x03fe, 0x01fc, 0x007c, 0x007d, 0x001c, 0x001d, 0x000c, 0x0002, 0x0003, - 0x0000, 0x0004, 0x0005, 0x000d, 0x001e, 0x007e, 0x01fd, 0x01fe, 0x0ffe, 0x3ffe, 0x7ffe, 0x7fff}, - {0x01fc, 0x01fd, 0x01fe, 0x00fc, 0x007c, 0x003c, 0x001c, 0x000c, 0x0000, 0x0001, 0x0002, 0x0003, - 0x0004, 0x0005, 0x000d, 0x001d, 0x003d, 0x007d, 0x00fd, 0x03fe, 0x07fe, 0x0ffe, 0x1ffe, 0x1fff}, - {0x3ffc, 0x0ffe, 0x03fe, 0x00fc, 0x003c, 0x003d, 0x001c, 0x000c, 0x0000, 0x0001, 0x0002, 0x0003, - 0x0004, 0x0005, 0x000d, 0x001d, 0x003e, 0x00fd, 0x00fe, 0x01fe, 0x07fe, 0x3ffd, 0x3ffe, 0x3fff}, - {0x1ffe, 0x03fe, 0x01fc, 0x00fc, 0x003c, 0x003d, 0x001c, 0x000a, 0x000b, 0x000c, 0x0002, 0x0003, - 0x0000, 0x0004, 0x000d, 0x001d, 0x003e, 0x00fd, 0x01fd, 0x01fe, 0x07fe, 0x0ffe, 0x3ffe, 0x3fff}, - {0xfffc, 0x1ffe, 0x0ffe, 0x07fe, 0x01fe, 0x003e, 0x001c, 0x001d, 0x000a, 0x000b, 0x000c, 0x0002, - 0x0000, 0x0003, 0x0004, 0x000d, 0x001e, 0x007e, 0x00fe, 0x03fe, 0x3ffe, 0xfffd, 0xfffe, 0xffff}, - {0x1ffc, 0x3ffa, 0x3ffb, 0x3ffc, 0x03fe, 0x00fe, 0x007c, 0x007d, 0x001c, 0x000c, 0x0002, 0x0003, - 0x0000, 0x0004, 0x0005, 0x000d, 0x001d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x3ffd, 0x3ffe, 0x3fff}, -}; - - -static const uint8_t cvh_huffbits0[191] = { - 1, 4, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, - 11, 11, 4, 5, 6, 7, 7, 8, 8, 9, 9, 9, - 9, 10, 11, 11, 5, 6, 7, 8, 8, 9, 9, 9, - 9, 10, 10, 10, 11, 12, 6, 7, 8, 9, 9, 9, - 9, 10, 10, 10, 10, 11, 12, 13, 7, 7, 8, 9, - 9, 9, 10, 10, 10, 10, 11, 11, 12, 13, 8, 8, - 9, 9, 9, 10, 10, 10, 10, 11, 11, 12, 13, 14, - 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, - 13, 15, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, - 12, 13, 14, 15, 9, 9, 9, 10, 10, 10, 11, 11, - 12, 13, 12, 14, 15, 16, 9, 9, 10, 10, 10, 10, - 11, 12, 12, 14, 14, 16, 16, 0, 9, 9, 10, 10, - 11, 11, 12, 13, 13, 14, 14, 15, 0, 0, 10, 10, - 10, 11, 11, 12, 12, 13, 15, 15, 16, 0, 0, 0, - 11, 11, 11, 12, 13, 13, 13, 15, 16, 16, 0, 0, - 0, 0, 11, 11, 12, 13, 13, 14, 15, 16, 16, -}; - -static const uint16_t cvh_huffcodes0[191] = { - 0x0000,0x0008,0x002c,0x002d,0x0062,0x0063,0x00d4,0x00d5,0x00d6,0x01c6,0x01c7,0x03ca, - 0x07d6,0x07d7,0x0009,0x0014,0x002e,0x0064,0x0065,0x00d7,0x00d8,0x01c8,0x01c9,0x01ca, - 0x01cb,0x03cb,0x07d8,0x07d9,0x0015,0x002f,0x0066,0x00d9,0x00da,0x01cc,0x01cd,0x01ce, - 0x01cf,0x03cc,0x03cd,0x03ce,0x07da,0x0fe4,0x0030,0x0067,0x00db,0x01d0,0x01d1,0x01d2, - 0x01d3,0x03cf,0x03d0,0x03d1,0x03d2,0x07db,0x0fe5,0x1fea,0x0068,0x0069,0x00dc,0x01d4, - 0x01d5,0x01d6,0x03d3,0x03d4,0x03d5,0x03d6,0x07dc,0x07dd,0x0fe6,0x1feb,0x00dd,0x00de, - 0x01d7,0x01d8,0x01d9,0x03d7,0x03d8,0x03d9,0x03da,0x07de,0x07df,0x0fe7,0x1fec,0x3ff2, - 0x00df,0x00e0,0x01da,0x01db,0x03db,0x03dc,0x07e0,0x07e1,0x07e2,0x0fe8,0x0fe9,0x1fed, - 0x1fee,0x7ff4,0x00e1,0x00e2,0x01dc,0x01dd,0x03dd,0x03de,0x07e3,0x07e4,0x07e5,0x0fea, - 0x0feb,0x1fef,0x3ff3,0x7ff5,0x01de,0x01df,0x01e0,0x03df,0x03e0,0x03e1,0x07e6,0x07e7, - 0x0fec,0x1ff0,0x0fed,0x3ff4,0x7ff6,0xfff8,0x01e1,0x01e2,0x03e2,0x03e3,0x03e4,0x03e5, - 0x07e8,0x0fee,0x0fef,0x3ff5,0x3ff6,0xfff9,0xfffa,0xfffa,0x01e3,0x01e4,0x03e6,0x03e7, - 0x07e9,0x07ea,0x0ff0,0x1ff1,0x1ff2,0x3ff7,0x3ff8,0x7ff7,0x7ff7,0xfffa,0x03e8,0x03e9, - 0x03ea,0x07eb,0x07ec,0x0ff1,0x0ff2,0x1ff3,0x7ff8,0x7ff9,0xfffb,0x3ff8,0x7ff7,0x7ff7, - 0x07ed,0x07ee,0x07ef,0x0ff3,0x1ff4,0x1ff5,0x1ff6,0x7ffa,0xfffc,0xfffd,0xfffb,0xfffb, - 0x3ff8,0x7ff7,0x07f0,0x07f1,0x0ff4,0x1ff7,0x1ff8,0x3ff9,0x7ffb,0xfffe,0xffff, -}; - - -static const uint8_t cvh_huffbits1[97] = { - 1, 4, 5, 6, 7, 8, 8, 9, 10, 10, 4, 5, - 6, 7, 7, 8, 8, 9, 9, 11, 5, 5, 6, 7, - 8, 8, 9, 9, 10, 11, 6, 6, 7, 8, 8, 9, - 9, 10, 11, 12, 7, 7, 8, 8, 9, 9, 10, 11, - 11, 13, 8, 8, 8, 9, 9, 10, 10, 11, 12, 14, - 8, 8, 8, 9, 10, 11, 11, 12, 13, 15, 9, 9, - 9, 10, 11, 12, 12, 14, 14, 0, 9, 9, 9, 10, - 11, 12, 14, 16, 0, 0, 10, 10, 11, 12, 13, 14, + { 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, + 5, 5, 6, 7, 8, 9, 11, 11, 12, 12, 12, 12 }, + { 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 15, 15, 15, 16, 16 }, + { 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, + 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14 }, + { 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, + 7, 7, 7, 9, 9, 9, 10, 11, 13, 13, 13, 13 }, + { 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, + 6, 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14 }, + { 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, + 7, 7, 8, 8, 8, 9, 10, 11, 12, 13, 14, 14 }, + { 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 15, 15, 16, 16, 16, 16 }, + { 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 7, 7, + 7, 9, 9, 9, 10, 11, 12, 14, 14, 14, 15, 15 }, + { 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 9, 10, 11, 12, 13, 13 }, + { 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, + 6, 8, 8, 8, 9, 10, 11, 12, 14, 14, 14, 14 }, + { 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, + 6, 8, 8, 9, 9, 9, 10, 11, 12, 13, 14, 14 }, + { 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 16, 16, 16, 16 }, + { 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 7, 7, + 7, 8, 9, 10, 11, 13, 14, 14, 14, 14, 14, 14 }, +}; + +static const uint8_t envelope_quant_index_huffsyms[13][24] = { + { 10, 11, 12, 0, 4, 5, 6, 7, 8, 9, 13, 2, + 3, 14, 1, 15, 16, 17, 18, 19, 20, 21, 22, 23 }, + { 6, 7, 8, 9, 10, 11, 5, 12, 3, 4, 13, 2, + 14, 1, 15, 0, 16, 17, 18, 19, 20, 21, 22, 23 }, + { 11, 12, 13, 5, 6, 7, 8, 9, 10, 14, 15, 4, + 16, 17, 3, 18, 2, 19, 1, 20, 0, 21, 22, 23 }, + { 9, 10, 11, 12, 13, 8, 14, 15, 16, 6, 7, 17, + 4, 5, 18, 2, 3, 19, 1, 20, 0, 21, 22, 23 }, + { 10, 11, 12, 13, 14, 8, 9, 15, 6, 7, 16, 17, + 4, 5, 18, 19, 3, 20, 2, 21, 0, 1, 22, 23 }, + { 9, 10, 11, 12, 13, 7, 8, 14, 15, 6, 16, 17, + 5, 18, 3, 4, 19, 2, 20, 1, 0, 21, 22, 23 }, + { 12, 9, 10, 11, 13, 8, 14, 7, 15, 16, 6, 17, + 5, 18, 4, 19, 3, 20, 0, 2, 1, 21, 22, 23 }, + { 12, 10, 11, 13, 14, 9, 15, 7, 8, 16, 5, 6, + 17, 4, 18, 19, 3, 2, 20, 0, 1, 21, 22, 23 }, + { 8, 9, 10, 11, 12, 13, 7, 14, 6, 15, 5, 16, + 4, 17, 3, 18, 0, 1, 2, 19, 20, 21, 22, 23 }, + { 8, 9, 10, 11, 12, 13, 7, 14, 6, 15, 4, 5, + 16, 3, 17, 18, 19, 2, 20, 1, 0, 21, 22, 23 }, + { 12, 10, 11, 13, 7, 8, 9, 14, 6, 15, 4, 5, + 16, 3, 17, 2, 18, 19, 1, 20, 21, 0, 22, 23 }, + { 12, 11, 13, 14, 8, 9, 10, 15, 6, 7, 16, 5, + 17, 18, 4, 19, 3, 2, 1, 20, 0, 21, 22, 23 }, + { 12, 10, 11, 13, 14, 9, 15, 8, 16, 17, 6, 7, + 18, 5, 19, 4, 20, 0, 1, 2, 3, 21, 22, 23 }, +}; + + +static const uint8_t cvh_huffbits0[181] = { + 1, 4, 4, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, + 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, }; +static const uint8_t cvh_huffsyms0[181] = { + 0, 1, 14, 15, 28, 2, 3, 16, 29, 42, 4, 5, 17, 18, 30, + 43, 56, 57, 6, 7, 8, 19, 20, 31, 32, 44, 58, 70, 71, 84, + 85, 98, 99, 9, 10, 21, 22, 23, 24, 33, 34, 35, 36, 45, 46, + 47, 48, 59, 60, 61, 72, 73, 74, 86, 87, 100, 101, 112, 113, 114, + 126, 127, 140, 141, 11, 25, 37, 38, 39, 49, 50, 51, 52, 62, 63, + 64, 65, 75, 76, 77, 78, 88, 89, 102, 103, 115, 116, 117, 128, 129, + 130, 131, 142, 143, 154, 155, 156, 12, 13, 26, 27, 40, 53, 66, 67, + 79, 80, 90, 91, 92, 104, 105, 106, 118, 119, 132, 144, 145, 157, 158, + 168, 169, 170, 182, 183, 41, 54, 68, 81, 93, 94, 107, 108, 120, 122, + 133, 134, 146, 159, 160, 171, 184, 55, 69, 82, 95, 96, 109, 121, 147, + 148, 161, 172, 173, 174, 185, 186, 83, 110, 123, 135, 136, 149, 150, 187, + 97, 111, 124, 151, 162, 163, 175, 188, 125, 137, 138, 164, 176, 177, 189, + 190, +}; -static const uint16_t cvh_huffcodes1[97] = { - 0x0000,0x0008,0x0014,0x0030,0x006a,0x00e2,0x00e3,0x01e4,0x03ec,0x03ed,0x0009,0x0015, - 0x0031,0x006b,0x006c,0x00e4,0x00e5,0x01e5,0x01e6,0x07f0,0x0016,0x0017,0x0032,0x006d, - 0x00e6,0x00e7,0x01e7,0x01e8,0x03ee,0x07f1,0x0033,0x0034,0x006e,0x00e8,0x00e9,0x01e9, - 0x01ea,0x03ef,0x07f2,0x0ff6,0x006f,0x0070,0x00ea,0x00eb,0x01eb,0x01ec,0x03f0,0x07f3, - 0x07f4,0x1ffa,0x00ec,0x00ed,0x00ee,0x01ed,0x01ee,0x03f1,0x03f2,0x07f5,0x0ff7,0x3ffa, - 0x00ef,0x00f0,0x00f1,0x01ef,0x03f3,0x07f6,0x07f7,0x0ff8,0x1ffb,0x7ffe,0x01f0,0x01f1, - 0x01f2,0x03f4,0x07f8,0x0ff9,0x0ffa,0x3ffb,0x3ffc,0x0000,0x01f3,0x01f4,0x01f5,0x03f5, - 0x07f9,0x0ffb,0x3ffd,0xfffe,0x0000,0x0000,0x03f6,0x03f7,0x07fa,0x0ffc,0x1ffc,0x3ffe, - 0xffff, +static const uint8_t cvh_huffbits1[94] = { + 1, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, + 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, + 14, 15, 16, 16, }; -static const uint8_t cvh_huffbits2[48] = { - 1, 4, 5, 7, 8, 9, 10, 3, 4, 5, 7, 8, - 9, 10, 5, 5, 6, 7, 8, 10, 10, 7, 6, 7, - 8, 9, 10, 12, 8, 8, 8, 9, 10, 12, 14, 8, - 9, 9, 10, 11, 15, 16, 9, 10, 11, 12, 13, 16, -}; - -static const uint16_t cvh_huffcodes2[48] = { - 0x0000,0x000a,0x0018,0x0074,0x00f2,0x01f4,0x03f6,0x0004,0x000b,0x0019,0x0075,0x00f3, - 0x01f5,0x03f7,0x001a,0x001b,0x0038,0x0076,0x00f4,0x03f8,0x03f9,0x0077,0x0039,0x0078, - 0x00f5,0x01f6,0x03fa,0x0ffc,0x00f6,0x00f7,0x00f8,0x01f7,0x03fb,0x0ffd,0x3ffe,0x00f9, - 0x01f8,0x01f9,0x03fc,0x07fc,0x7ffe,0xfffe,0x01fa,0x03fd,0x07fd,0x0ffe,0x1ffe,0xffff, -}; - -static const uint8_t cvh_huffbits3[607] = { - 2, 4, 6, 8, 10, 5, 5, 6, 8, 10, 7, 8, - 8, 10, 12, 9, 9, 10, 12, 15, 10, 11, 13, 16, - 16, 5, 6, 8, 10, 11, 5, 6, 8, 10, 12, 7, - 7, 8, 10, 13, 9, 9, 10, 12, 15, 12, 11, 13, - 16, 16, 7, 9, 10, 12, 15, 7, 8, 10, 12, 13, - 9, 9, 11, 13, 16, 11, 11, 12, 14, 16, 12, 12, - 14, 16, 0, 9, 11, 12, 16, 16, 9, 10, 13, 15, - 16, 10, 11, 12, 16, 16, 13, 13, 16, 16, 16, 16, - 16, 15, 16, 0, 11, 13, 16, 16, 15, 11, 13, 15, - 16, 16, 13, 13, 16, 16, 0, 14, 16, 16, 16, 0, - 16, 16, 0, 0, 0, 4, 6, 8, 10, 13, 6, 6, - 8, 10, 13, 9, 8, 10, 12, 16, 10, 10, 11, 15, - 16, 13, 12, 14, 16, 16, 5, 6, 8, 11, 13, 6, - 6, 8, 10, 13, 8, 8, 9, 11, 14, 10, 10, 12, - 12, 16, 13, 12, 13, 15, 16, 7, 8, 9, 12, 16, - 7, 8, 10, 12, 14, 9, 9, 10, 13, 16, 11, 10, - 12, 15, 16, 13, 13, 16, 16, 0, 9, 11, 13, 16, - 16, 9, 10, 12, 15, 16, 10, 11, 13, 16, 16, 13, - 12, 16, 16, 16, 16, 16, 16, 16, 0, 11, 13, 16, - 16, 16, 11, 13, 16, 16, 16, 12, 13, 15, 16, 0, - 16, 16, 16, 16, 0, 16, 16, 0, 0, 0, 6, 8, - 11, 13, 16, 8, 8, 10, 12, 16, 11, 10, 11, 13, - 16, 12, 13, 13, 15, 16, 16, 16, 14, 16, 0, 6, - 8, 10, 13, 16, 8, 8, 10, 12, 16, 10, 10, 11, - 13, 16, 13, 12, 13, 16, 16, 14, 14, 14, 16, 0, - 8, 9, 11, 13, 16, 8, 9, 11, 16, 14, 10, 10, - 12, 15, 16, 12, 12, 13, 16, 16, 15, 16, 16, 16, - 0, 10, 12, 15, 16, 16, 10, 12, 12, 14, 16, 12, - 12, 13, 16, 16, 14, 15, 16, 16, 0, 16, 16, 16, - 0, 0, 12, 15, 15, 16, 0, 13, 13, 16, 16, 0, - 14, 16, 16, 16, 0, 16, 16, 16, 0, 0, 0, 0, - 0, 0, 0, 8, 10, 13, 15, 16, 10, 11, 13, 16, - 16, 13, 13, 14, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 0, 8, 10, 11, 15, 16, 9, 10, 12, - 16, 16, 12, 12, 15, 16, 16, 16, 14, 16, 16, 16, - 16, 16, 16, 16, 0, 9, 11, 14, 16, 16, 10, 11, - 13, 16, 16, 14, 13, 14, 16, 16, 16, 15, 15, 16, - 0, 16, 16, 16, 0, 0, 11, 13, 16, 16, 16, 11, - 13, 15, 16, 16, 13, 16, 16, 16, 0, 16, 16, 16, - 16, 0, 16, 16, 0, 0, 0, 15, 16, 16, 16, 0, - 14, 16, 16, 16, 0, 16, 16, 16, 0, 0, 16, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 9, 13, 16, 16, - 16, 11, 13, 16, 16, 16, 14, 15, 16, 16, 0, 15, - 16, 16, 16, 0, 16, 16, 0, 0, 0, 9, 13, 15, - 15, 16, 12, 13, 14, 16, 16, 16, 15, 16, 16, 0, - 16, 16, 16, 16, 0, 16, 16, 0, 0, 0, 11, 13, - 15, 16, 0, 12, 14, 16, 16, 0, 16, 16, 16, 16, - 0, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 16, - 16, 16, 16, 0, 16, 16, 16, 16, 0, 16, 16, 16, - 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 16, 0, 0, 0, 16, 16, -}; - - -static const uint16_t cvh_huffcodes3[607] = { - 0x0000,0x0004,0x0022,0x00c6,0x03b0,0x000c,0x000d,0x0023,0x00c7,0x03b1,0x005c,0x00c8, - 0x00c9,0x03b2,0x0fa4,0x01c2,0x01c3,0x03b3,0x0fa5,0x7f72,0x03b4,0x07b2,0x1f9a,0xff24, - 0xff25,0x000e,0x0024,0x00ca,0x03b5,0x07b3,0x000f,0x0025,0x00cb,0x03b6,0x0fa6,0x005d, - 0x005e,0x00cc,0x03b7,0x1f9b,0x01c4,0x01c5,0x03b8,0x0fa7,0x7f73,0x0fa8,0x07b4,0x1f9c, - 0xff26,0xff27,0x005f,0x01c6,0x03b9,0x0fa9,0x7f74,0x0060,0x00cd,0x03ba,0x0faa,0x1f9d, - 0x01c7,0x01c8,0x07b5,0x1f9e,0xff28,0x07b6,0x07b7,0x0fab,0x3fa2,0xff29,0x0fac,0x0fad, - 0x3fa3,0xff2a,0x3fa2,0x01c9,0x07b8,0x0fae,0xff2b,0xff2c,0x01ca,0x03bb,0x1f9f,0x7f75, - 0xff2d,0x03bc,0x07b9,0x0faf,0xff2e,0xff2f,0x1fa0,0x1fa1,0xff30,0xff31,0xff32,0xff33, - 0xff34,0x7f76,0xff35,0xff31,0x07ba,0x1fa2,0xff36,0xff37,0x7f77,0x07bb,0x1fa3,0x7f78, - 0xff38,0xff39,0x1fa4,0x1fa5,0xff3a,0xff3b,0xff2e,0x3fa4,0xff3c,0xff3d,0xff3e,0xff31, - 0xff3f,0xff40,0xff30,0xff31,0xff31,0x0005,0x0026,0x00ce,0x03bd,0x1fa6,0x0027,0x0028, - 0x00cf,0x03be,0x1fa7,0x01cb,0x00d0,0x03bf,0x0fb0,0xff41,0x03c0,0x03c1,0x07bc,0x7f79, - 0xff42,0x1fa8,0x0fb1,0x3fa5,0xff43,0xff44,0x0010,0x0029,0x00d1,0x07bd,0x1fa9,0x002a, - 0x002b,0x00d2,0x03c2,0x1faa,0x00d3,0x00d4,0x01cc,0x07be,0x3fa6,0x03c3,0x03c4,0x0fb2, - 0x0fb3,0xff45,0x1fab,0x0fb4,0x1fac,0x7f7a,0xff46,0x0061,0x00d5,0x01cd,0x0fb5,0xff47, - 0x0062,0x00d6,0x03c5,0x0fb6,0x3fa7,0x01ce,0x01cf,0x03c6,0x1fad,0xff48,0x07bf,0x03c7, - 0x0fb7,0x7f7b,0xff49,0x1fae,0x1faf,0xff4a,0xff4b,0x7f7b,0x01d0,0x07c0,0x1fb0,0xff4c, - 0xff4d,0x01d1,0x03c8,0x0fb8,0x7f7c,0xff4e,0x03c9,0x07c1,0x1fb1,0xff4f,0xff50,0x1fb2, - 0x0fb9,0xff51,0xff52,0xff53,0xff54,0xff55,0xff56,0xff57,0xff52,0x07c2,0x1fb3,0xff58, - 0xff59,0xff5a,0x07c3,0x1fb4,0xff5b,0xff5c,0xff5d,0x0fba,0x1fb5,0x7f7d,0xff5e,0xff4f, - 0xff5f,0xff60,0xff61,0xff62,0xff52,0xff63,0xff64,0xff51,0xff52,0xff52,0x002c,0x00d7, - 0x07c4,0x1fb6,0xff65,0x00d8,0x00d9,0x03ca,0x0fbb,0xff66,0x07c5,0x03cb,0x07c6,0x1fb7, - 0xff67,0x0fbc,0x1fb8,0x1fb9,0x7f7e,0xff68,0xff69,0xff6a,0x3fa8,0xff6b,0x7f7e,0x002d, - 0x00da,0x03cc,0x1fba,0xff6c,0x00db,0x00dc,0x03cd,0x0fbd,0xff6d,0x03ce,0x03cf,0x07c7, - 0x1fbb,0xff6e,0x1fbc,0x0fbe,0x1fbd,0xff6f,0xff70,0x3fa9,0x3faa,0x3fab,0xff71,0xff6f, - 0x00dd,0x01d2,0x07c8,0x1fbe,0xff72,0x00de,0x01d3,0x07c9,0xff73,0x3fac,0x03d0,0x03d1, - 0x0fbf,0x7f7f,0xff74,0x0fc0,0x0fc1,0x1fbf,0xff75,0xff76,0x7f80,0xff77,0xff78,0xff79, - 0xff75,0x03d2,0x0fc2,0x7f81,0xff7a,0xff7b,0x03d3,0x0fc3,0x0fc4,0x3fad,0xff7c,0x0fc5, - 0x0fc6,0x1fc0,0xff7d,0xff7e,0x3fae,0x7f82,0xff7f,0xff80,0xff80,0xff81,0xff82,0xff83, - 0xff80,0xff80,0x0fc7,0x7f83,0x7f84,0xff84,0xff7a,0x1fc1,0x1fc2,0xff85,0xff86,0x3fad, - 0x3faf,0xff87,0xff88,0xff89,0xff7d,0xff8a,0xff8b,0xff8c,0xff80,0xff80,0x3fae,0x7f82, - 0xff7f,0xff80,0xff80,0x00df,0x03d4,0x1fc3,0x7f85,0xff8d,0x03d5,0x07ca,0x1fc4,0xff8e, - 0xff8f,0x1fc5,0x1fc6,0x3fb0,0xff90,0xff91,0xff92,0xff93,0xff94,0xff95,0xff96,0xff97, - 0xff98,0xff99,0xff9a,0xff95,0x00e0,0x03d6,0x07cb,0x7f86,0xff9b,0x01d4,0x03d7,0x0fc8, - 0xff9c,0xff9d,0x0fc9,0x0fca,0x7f87,0xff9e,0xff9f,0xffa0,0x3fb1,0xffa1,0xffa2,0xffa3, - 0xffa4,0xffa5,0xffa6,0xffa7,0xffa2,0x01d5,0x07cc,0x3fb2,0xffa8,0xffa9,0x03d8,0x07cd, - 0x1fc7,0xffaa,0xffab,0x3fb3,0x1fc8,0x3fb4,0xffac,0xffad,0xffae,0x7f88,0x7f89,0xffaf, - 0xffaf,0xffb0,0xffb1,0xffb2,0xffaf,0xffaf,0x07ce,0x1fc9,0xffb3,0xffb4,0xffb5,0x07cf, - 0x1fca,0x7f8a,0xffb6,0xffb7,0x1fcb,0xffb8,0xffb9,0xffba,0xffba,0xffbb,0xffbc,0xffbd, - 0xffbe,0xffbe,0xffbf,0xffc0,0xffbd,0xffbe,0xffbe,0x7f8b,0xffc1,0xffc2,0xffc3,0xffb4, - 0x3fb5,0xffc4,0xffc5,0xffc6,0xffb6,0xffc7,0xffc8,0xffc9,0xffba,0xffba,0xffca,0xffcb, - 0xffbd,0xffbe,0xffbe,0xffbb,0xffbc,0xffbd,0xffbe,0xffbe,0x01d6,0x1fcc,0xffcc,0xffcd, - 0xffce,0x07d0,0x1fcd,0xffcf,0xffd0,0xffd1,0x3fb6,0x7f8c,0xffd2,0xffd3,0xff90,0x7f8d, - 0xffd4,0xffd5,0xffd6,0xff95,0xffd7,0xffd8,0xff94,0xff95,0xff95,0x01d7,0x1fce,0x7f8e, - 0x7f8f,0xffd9,0x0fcb,0x1fcf,0x3fb7,0xffda,0xffdb,0xffdc,0x7f90,0xffdd,0xffde,0xff9e, - 0xffdf,0xffe0,0xffe1,0xffe2,0xffa2,0xffe3,0xffe4,0xffa1,0xffa2,0xffa2,0x07d1,0x1fd0, - 0x7f91,0xffe5,0xffa8,0x0fcc,0x3fb8,0xffe6,0xffe7,0xffaa,0xffe8,0xffe9,0xffea,0xffeb, - 0xffac,0xffec,0xffed,0xffee,0xffaf,0xffaf,0xffae,0x7f88,0x7f89,0xffaf,0xffaf,0xffef, - 0xfff0,0xfff1,0xfff2,0xffb4,0xfff3,0xfff4,0xfff5,0xfff6,0xffb6,0xfff7,0xfff8,0xfff9, - 0xffba,0xffba,0xfffa,0xfffb,0xffbd,0xffbe,0xffbe,0xffbb,0xffbc,0xffbd,0xffbe,0xffbe, - 0xfffc,0xfffd,0xffb3,0xffb4,0xffb4,0xfffe,0xffff, -}; - -static const uint8_t cvh_huffbits4[246] = { - 2, 4, 7, 10, 4, 5, 7, 10, 7, 8, 10, 14, - 11, 11, 15, 15, 4, 5, 9, 12, 5, 5, 8, 12, - 8, 7, 10, 15, 11, 11, 15, 15, 7, 9, 12, 15, - 8, 8, 12, 15, 10, 10, 13, 15, 14, 14, 15, 0, - 11, 13, 15, 15, 11, 13, 15, 15, 14, 15, 15, 0, - 15, 15, 0, 0, 4, 5, 9, 13, 5, 6, 9, 13, - 9, 9, 11, 15, 14, 13, 15, 15, 4, 6, 9, 12, - 5, 6, 9, 13, 9, 8, 11, 15, 13, 12, 15, 15, - 7, 9, 12, 15, 7, 8, 11, 15, 10, 10, 14, 15, - 14, 15, 15, 0, 10, 12, 15, 15, 11, 13, 15, 15, - 15, 15, 15, 0, 15, 15, 0, 0, 6, 9, 13, 14, - 8, 9, 12, 15, 12, 12, 15, 15, 15, 15, 15, 0, - 7, 9, 13, 15, 8, 9, 12, 15, 11, 12, 15, 15, - 15, 15, 15, 0, 9, 11, 15, 15, 9, 11, 15, 15, - 14, 14, 15, 0, 15, 15, 0, 0, 14, 15, 15, 0, - 14, 15, 15, 0, 15, 15, 0, 0, 0, 0, 0, 0, - 9, 12, 15, 15, 12, 13, 15, 15, 15, 15, 15, 0, - 15, 15, 0, 0, 10, 12, 15, 15, 12, 14, 15, 15, - 15, 15, 15, 0, 15, 15, 0, 0, 14, 15, 15, 0, - 15, 15, 15, 0, 15, 15, 0, 0, 0, 0, 0, 0, - 15, 15, 0, 0, 15, 15, -}; - - -static const uint16_t cvh_huffcodes4[246] = { - 0x0000,0x0004,0x006c,0x03e6,0x0005,0x0012,0x006d,0x03e7,0x006e,0x00e8,0x03e8,0x3fc4, - 0x07e0,0x07e1,0x7fa4,0x7fa5,0x0006,0x0013,0x01e2,0x0fda,0x0014,0x0015,0x00e9,0x0fdb, - 0x00ea,0x006f,0x03e9,0x7fa6,0x07e2,0x07e3,0x7fa7,0x7fa8,0x0070,0x01e3,0x0fdc,0x7fa9, - 0x00eb,0x00ec,0x0fdd,0x7faa,0x03ea,0x03eb,0x1fd6,0x7fab,0x3fc5,0x3fc6,0x7fac,0x1fd6, - 0x07e4,0x1fd7,0x7fad,0x7fae,0x07e5,0x1fd8,0x7faf,0x7fb0,0x3fc7,0x7fb1,0x7fb2,0x1fd6, - 0x7fb3,0x7fb4,0x1fd6,0x1fd6,0x0007,0x0016,0x01e4,0x1fd9,0x0017,0x0032,0x01e5,0x1fda, - 0x01e6,0x01e7,0x07e6,0x7fb5,0x3fc8,0x1fdb,0x7fb6,0x7fb7,0x0008,0x0033,0x01e8,0x0fde, - 0x0018,0x0034,0x01e9,0x1fdc,0x01ea,0x00ed,0x07e7,0x7fb8,0x1fdd,0x0fdf,0x7fb9,0x7fba, - 0x0071,0x01eb,0x0fe0,0x7fbb,0x0072,0x00ee,0x07e8,0x7fbc,0x03ec,0x03ed,0x3fc9,0x7fbd, - 0x3fca,0x7fbe,0x7fbf,0x3fc9,0x03ee,0x0fe1,0x7fc0,0x7fc1,0x07e9,0x1fde,0x7fc2,0x7fc3, - 0x7fc4,0x7fc5,0x7fc6,0x3fc9,0x7fc7,0x7fc8,0x3fc9,0x3fc9,0x0035,0x01ec,0x1fdf,0x3fcb, - 0x00ef,0x01ed,0x0fe2,0x7fc9,0x0fe3,0x0fe4,0x7fca,0x7fcb,0x7fcc,0x7fcd,0x7fce,0x7fca, - 0x0073,0x01ee,0x1fe0,0x7fcf,0x00f0,0x01ef,0x0fe5,0x7fd0,0x07ea,0x0fe6,0x7fd1,0x7fd2, - 0x7fd3,0x7fd4,0x7fd5,0x7fd1,0x01f0,0x07eb,0x7fd6,0x7fd7,0x01f1,0x07ec,0x7fd8,0x7fd9, - 0x3fcc,0x3fcd,0x7fda,0x7fda,0x7fdb,0x7fdc,0x7fda,0x7fda,0x3fce,0x7fdd,0x7fde,0x7fd6, - 0x3fcf,0x7fdf,0x7fe0,0x7fd8,0x7fe1,0x7fe2,0x7fda,0x7fda,0x3fcc,0x3fcd,0x7fda,0x7fda, - 0x01f2,0x0fe7,0x7fe3,0x7fe4,0x0fe8,0x1fe1,0x7fe5,0x7fe6,0x7fe7,0x7fe8,0x7fe9,0x7fca, - 0x7fea,0x7feb,0x7fca,0x7fca,0x03ef,0x0fe9,0x7fec,0x7fed,0x0fea,0x3fd0,0x7fee,0x7fef, - 0x7ff0,0x7ff1,0x7ff2,0x7fd1,0x7ff3,0x7ff4,0x7fd1,0x7fd1,0x3fd1,0x7ff5,0x7ff6,0x7fd6, - 0x7ff7,0x7ff8,0x7ff9,0x7fd8,0x7ffa,0x7ffb,0x7fda,0x7fda,0x3fcc,0x3fcd,0x7fda,0x7fda, - 0x7ffc,0x7ffd,0x7fd6,0x7fd6,0x7ffe,0x7fff, -}; - - -static const uint8_t cvh_huffbits5[230] = { - 2, 4, 8, 4, 5, 9, 9, 10, 14, 4, 6, 11, - 5, 6, 12, 10, 11, 15, 9, 11, 15, 10, 13, 15, - 14, 15, 0, 4, 6, 12, 6, 7, 12, 12, 12, 15, - 5, 7, 13, 6, 7, 13, 12, 13, 15, 10, 12, 15, - 11, 13, 15, 15, 15, 0, 8, 13, 15, 11, 12, 15, - 15, 15, 0, 10, 13, 15, 12, 15, 15, 15, 15, 0, - 15, 15, 0, 15, 15, 0, 0, 0, 0, 4, 5, 11, - 5, 7, 12, 11, 12, 15, 6, 7, 13, 7, 8, 14, - 12, 14, 15, 11, 13, 15, 12, 13, 15, 15, 15, 0, - 5, 6, 13, 7, 8, 15, 12, 14, 15, 6, 8, 14, - 7, 8, 15, 14, 15, 15, 12, 12, 15, 12, 13, 15, - 15, 15, 0, 9, 13, 15, 12, 13, 15, 15, 15, 0, - 11, 13, 15, 13, 13, 15, 15, 15, 0, 14, 15, 0, - 15, 15, 0, 0, 0, 0, 8, 10, 15, 11, 12, 15, - 15, 15, 0, 10, 12, 15, 12, 13, 15, 15, 15, 0, - 14, 15, 0, 15, 15, 0, 0, 0, 0, 8, 12, 15, - 12, 13, 15, 15, 15, 0, 11, 13, 15, 13, 15, 15, - 15, 15, 0, 15, 15, 0, 15, 15, 0, 0, 0, 0, - 14, 15, 0, 15, 15, 0, 0, 0, 0, 15, 15, 0, - 15, 15, -}; - - - -static const uint16_t cvh_huffcodes5[230] = { - 0x0000,0x0004,0x00f0,0x0005,0x0012,0x01f0,0x01f1,0x03e8,0x3fce,0x0006,0x0030,0x07de, - 0x0013,0x0031,0x0fd2,0x03e9,0x07df,0x7fb0,0x01f2,0x07e0,0x7fb1,0x03ea,0x1fd2,0x7fb2, - 0x3fcf,0x7fb3,0x0031,0x0007,0x0032,0x0fd3,0x0033,0x0070,0x0fd4,0x0fd5,0x0fd6,0x7fb4, - 0x0014,0x0071,0x1fd3,0x0034,0x0072,0x1fd4,0x0fd7,0x1fd5,0x7fb5,0x03eb,0x0fd8,0x7fb6, - 0x07e1,0x1fd6,0x7fb7,0x7fb8,0x7fb9,0x0072,0x00f1,0x1fd7,0x7fba,0x07e2,0x0fd9,0x7fbb, - 0x7fbc,0x7fbd,0x0070,0x03ec,0x1fd8,0x7fbe,0x0fda,0x7fbf,0x7fc0,0x7fc1,0x7fc2,0x0072, - 0x7fc3,0x7fc4,0x0071,0x7fc5,0x7fc6,0x0072,0x0034,0x0072,0x0072,0x0008,0x0015,0x07e3, - 0x0016,0x0073,0x0fdb,0x07e4,0x0fdc,0x7fc7,0x0035,0x0074,0x1fd9,0x0075,0x00f2,0x3fd0, - 0x0fdd,0x3fd1,0x7fc8,0x07e5,0x1fda,0x7fc9,0x0fde,0x1fdb,0x7fca,0x7fcb,0x7fcc,0x00f2, - 0x0017,0x0036,0x1fdc,0x0076,0x00f3,0x7fcd,0x0fdf,0x3fd2,0x7fce,0x0037,0x00f4,0x3fd3, - 0x0077,0x00f5,0x7fcf,0x3fd4,0x7fd0,0x7fd1,0x0fe0,0x0fe1,0x7fd2,0x0fe2,0x1fdd,0x7fd3, - 0x7fd4,0x7fd5,0x00f5,0x01f3,0x1fde,0x7fd6,0x0fe3,0x1fdf,0x7fd7,0x7fd8,0x7fd9,0x00f3, - 0x07e6,0x1fe0,0x7fda,0x1fe1,0x1fe2,0x7fdb,0x7fdc,0x7fdd,0x00f5,0x3fd5,0x7fde,0x00f4, - 0x7fdf,0x7fe0,0x00f5,0x0077,0x00f5,0x00f5,0x00f6,0x03ed,0x7fe1,0x07e7,0x0fe4,0x7fe2, - 0x7fe3,0x7fe4,0x0073,0x03ee,0x0fe5,0x7fe5,0x0fe6,0x1fe3,0x7fe6,0x7fe7,0x7fe8,0x00f2, - 0x3fd6,0x7fe9,0x0074,0x7fea,0x7feb,0x00f2,0x0075,0x00f2,0x00f2,0x00f7,0x0fe7,0x7fec, - 0x0fe8,0x1fe4,0x7fed,0x7fee,0x7fef,0x00f3,0x07e8,0x1fe5,0x7ff0,0x1fe6,0x7ff1,0x7ff2, - 0x7ff3,0x7ff4,0x00f5,0x7ff5,0x7ff6,0x00f4,0x7ff7,0x7ff8,0x00f5,0x0077,0x00f5,0x00f5, - 0x3fd7,0x7ff9,0x0036,0x7ffa,0x7ffb,0x00f3,0x0076,0x00f3,0x00f3,0x7ffc,0x7ffd,0x0000, - 0x7ffe,0x7fff, + +static const uint8_t cvh_huffsyms1[94] = { + 0, 1, 10, 2, 11, 20, 21, 3, 12, 22, 30, 31, 4, 13, 14, 23, 32, 40, 41, + 5, 6, 15, 16, 24, 25, 33, 34, 42, 43, 50, 51, 52, 60, 61, 62, 7, 17, 18, + 26, 27, 35, 36, 44, 45, 53, 54, 63, 70, 71, 72, 80, 81, 82, 8, 9, 28, 37, + 46, 55, 56, 64, 73, 83, 90, 91, 19, 29, 38, 47, 48, 57, 65, 66, 74, 84, 92, + 39, 58, 67, 75, 76, 85, 93, 49, 68, 94, 59, 77, 78, 86, 95, 69, 87, 96, }; +static const uint8_t cvh_huffbits2[48] = { + 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, + 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, + 10, 10, 11, 11, 12, 12, 12, 13, 14, 15, 16, 16, +}; + +static const uint8_t cvh_huffsyms2[48] = { + 0, 7, 1, 8, 2, 9, 14, 15, 16, 22, 3, 10, 17, 21, 23, 4, 11, 18, 24, + 28, 29, 30, 35, 5, 12, 25, 31, 36, 37, 42, 6, 13, 19, 20, 26, 32, 38, 43, + 39, 44, 27, 33, 45, 46, 34, 40, 41, 47, +}; + +static const uint8_t cvh_huffbits3[520] = { + 2, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, +}; + +static const uint16_t cvh_huffsyms3[520] = { + 0, 1, 125, 5, 6, 25, 30, 150, 2, 7, 26, 31, 126, 130, 131, + 151, 155, 156, 250, 275, 10, 35, 36, 50, 55, 175, 180, 3, 8, 11, + 12, 27, 32, 37, 56, 127, 132, 136, 152, 157, 160, 161, 176, 181, 251, + 255, 256, 276, 280, 281, 300, 305, 375, 400, 15, 16, 40, 41, 51, 60, + 61, 75, 80, 135, 162, 177, 185, 186, 200, 205, 301, 306, 405, 425, 500, + 525, 4, 9, 13, 17, 20, 28, 33, 38, 42, 52, 57, 81, 85, 128, + 133, 137, 140, 141, 158, 165, 166, 182, 187, 191, 206, 210, 257, 261, 277, + 282, 285, 286, 310, 311, 325, 330, 376, 380, 401, 406, 430, 21, 29, 46, + 62, 65, 66, 76, 86, 100, 105, 142, 153, 163, 190, 201, 211, 225, 230, + 252, 260, 262, 287, 302, 307, 381, 402, 426, 431, 450, 455, 505, 550, 14, + 18, 34, 43, 45, 53, 58, 67, 70, 71, 77, 87, 138, 146, 167, 168, + 171, 178, 183, 192, 207, 216, 235, 258, 265, 283, 291, 312, 315, 316, 326, + 331, 332, 335, 336, 350, 407, 410, 411, 530, 555, 22, 39, 47, 59, 63, + 82, 90, 91, 101, 106, 110, 111, 129, 134, 145, 154, 159, 170, 172, 188, + 195, 196, 202, 212, 215, 226, 231, 236, 253, 263, 266, 267, 278, 288, 290, + 292, 303, 317, 337, 355, 356, 377, 382, 385, 386, 432, 436, 451, 456, 460, + 501, 506, 526, 531, 551, 68, 72, 115, 147, 164, 184, 272, 295, 296, 297, + 309, 333, 340, 360, 387, 416, 427, 435, 437, 480, 510, 532, 556, 19, 44, + 54, 83, 97, 104, 107, 143, 173, 193, 208, 237, 268, 313, 320, 327, 341, + 351, 352, 378, 403, 412, 441, 442, 457, 475, 511, 515, 527, 528, 536, 552, + 23, 24, 48, 49, 64, 69, 73, 78, 79, 84, 88, 89, 92, 93, 94, + 95, 96, 98, 102, 103, 108, 109, 112, 113, 116, 117, 118, 120, 121, 139, + 144, 148, 149, 169, 174, 179, 189, 194, 197, 198, 203, 204, 209, 213, 214, + 217, 218, 219, 220, 221, 222, 223, 227, 228, 229, 232, 233, 234, 238, 240, + 241, 242, 243, 245, 246, 254, 259, 264, 269, 270, 271, 273, 279, 284, 289, + 293, 294, 298, 304, 308, 314, 318, 319, 321, 322, 323, 328, 329, 334, 338, + 339, 342, 343, 345, 346, 347, 353, 357, 358, 361, 362, 363, 365, 366, 367, + 379, 383, 384, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 404, + 408, 409, 413, 414, 415, 417, 418, 419, 420, 421, 422, 423, 428, 429, 433, + 434, 438, 439, 440, 443, 445, 446, 447, 452, 453, 454, 458, 459, 461, 462, + 463, 465, 466, 467, 468, 470, 471, 476, 477, 478, 481, 482, 483, 485, 486, + 487, 490, 491, 502, 503, 504, 507, 508, 509, 512, 513, 516, 517, 518, 520, + 521, 529, 533, 534, 535, 537, 538, 540, 541, 542, 543, 545, 546, 553, 557, + 558, 560, 561, 562, 563, 565, 566, 567, 575, 576, 577, 578, 580, 581, 582, + 583, 585, 586, 587, 590, 591, 600, 601, 605, 606, +}; + +static const uint8_t cvh_huffbits4[209] = { + 2, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, + 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +}; + +static const uint8_t cvh_huffsyms4[209] = { + 0, 1, 4, 16, 64, 80, 5, 17, 20, 21, 65, 68, 84, 69, 81, + 85, 128, 2, 6, 8, 25, 32, 96, 100, 144, 9, 22, 24, 36, 37, + 89, 101, 132, 148, 18, 33, 66, 70, 72, 73, 82, 86, 88, 97, 129, + 133, 145, 149, 160, 164, 192, 3, 7, 10, 26, 40, 41, 104, 105, 112, + 208, 12, 13, 28, 29, 48, 52, 74, 90, 102, 116, 152, 161, 165, 19, + 23, 34, 38, 83, 93, 98, 113, 134, 136, 137, 150, 153, 193, 196, 209, + 212, 42, 49, 53, 67, 71, 77, 87, 92, 117, 130, 146, 197, 11, 44, + 45, 56, 76, 106, 108, 131, 168, 169, 176, 180, 213, 224, 14, 15, 27, + 30, 31, 35, 39, 43, 46, 50, 51, 54, 55, 57, 58, 60, 61, 75, + 78, 79, 91, 94, 95, 99, 103, 107, 109, 110, 114, 115, 118, 119, 120, + 121, 122, 124, 125, 135, 138, 139, 140, 141, 142, 147, 151, 154, 155, 156, + 157, 158, 162, 163, 166, 167, 170, 172, 173, 177, 178, 181, 182, 184, 185, + 194, 195, 198, 199, 200, 201, 202, 204, 205, 210, 211, 214, 215, 216, 217, + 218, 220, 221, 225, 226, 228, 229, 230, 232, 233, 240, 241, 244, 245, +}; + +static const uint8_t cvh_huffbits5[192] = { + 2, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, + 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, + 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +}; + +static const uint8_t cvh_huffsyms5[192] = { + 0, 1, 3, 9, 27, 81, 4, 12, 36, 82, 84, 108, 10, 13, 28, + 30, 39, 90, 109, 117, 31, 37, 40, 85, 91, 93, 111, 120, 2, 54, + 94, 112, 118, 121, 162, 189, 5, 6, 18, 135, 7, 15, 21, 45, 63, + 163, 171, 11, 16, 19, 48, 57, 83, 87, 99, 144, 165, 198, 14, 29, + 32, 33, 34, 42, 46, 58, 66, 86, 88, 96, 102, 114, 126, 127, 129, + 138, 166, 172, 174, 190, 192, 22, 38, 41, 43, 49, 55, 64, 92, 100, + 103, 110, 130, 136, 139, 145, 147, 148, 175, 193, 199, 201, 8, 24, 95, + 97, 115, 119, 123, 153, 180, 216, 17, 20, 23, 25, 35, 44, 47, 50, + 51, 52, 56, 59, 60, 61, 65, 67, 68, 69, 70, 72, 73, 75, 76, + 89, 98, 101, 104, 105, 106, 113, 116, 122, 124, 125, 128, 131, 132, 133, + 137, 140, 141, 142, 146, 149, 150, 151, 154, 156, 157, 164, 167, 168, 169, + 173, 176, 177, 178, 181, 183, 184, 191, 194, 195, 196, 200, 202, 203, 204, + 205, 207, 208, 210, 211, 217, 219, 220, 225, 226, 228, 229, +}; static const uint8_t cvh_huffbits6[32] = { - 1, 4, 4, 6, 4, 6, 6, 8, 4, 6, 6, 8, - 6, 9, 8, 10, 4, 6, 7, 8, 6, 9, 8, 11, - 6, 9, 8, 10, 8, 10, 9, 11, + 1, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 8, 8, + 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, }; -static const uint16_t cvh_huffcodes6[32] = { - 0x0000,0x0008,0x0009,0x0034,0x000a,0x0035,0x0036,0x00f6,0x000b,0x0037,0x0038,0x00f7, - 0x0039,0x01fa,0x00f8,0x03fc,0x000c,0x003a,0x007a,0x00f9,0x003b,0x01fb,0x00fa,0x07fe, - 0x003c,0x01fc,0x00fb,0x03fd,0x00fc,0x03fe,0x01fd,0x07ff, +static const uint8_t cvh_huffsyms6[32] = { + 0, 1, 2, 4, 8, 16, 3, 5, 6, 9, 10, 12, 17, 20, 24, 18, 7, 11, 14, + 19, 22, 26, 28, 13, 21, 25, 30, 15, 27, 29, 23, 31, }; -static const uint16_t* const cvh_huffcodes[7] = { - cvh_huffcodes0, cvh_huffcodes1, cvh_huffcodes2, cvh_huffcodes3, - cvh_huffcodes4, cvh_huffcodes5, cvh_huffcodes6, +static const void* const cvh_huffsyms[7] = { + cvh_huffsyms0, cvh_huffsyms1, cvh_huffsyms2, cvh_huffsyms3, + cvh_huffsyms4, cvh_huffsyms5, cvh_huffsyms6, }; static const uint8_t* const cvh_huffbits[7] = { @@ -433,65 +350,57 @@ static const uint8_t* const cvh_huffbits[7] = { }; -static const uint16_t ccpl_huffcodes2[3] = { - 0x02,0x00,0x03, +static const uint8_t ccpl_huffsyms2[3] = { + 1, 0, 2, }; -static const uint16_t ccpl_huffcodes3[7] = { - 0x3e,0x1e,0x02,0x00,0x06,0x0e,0x3f, +static const uint8_t ccpl_huffsyms3[7] = { + 3, 2, 4, 5, 1, 0, 6, }; -static const uint16_t ccpl_huffcodes4[15] = { - 0xfc,0xfd,0x7c,0x3c,0x1c,0x0c,0x04,0x00,0x05,0x0d,0x1d,0x3d, - 0x7d,0xfe,0xff, +static const uint8_t ccpl_huffsyms4[15] = { + 7, 6, 8, 5, 9, 4, 10, 3, 11, 2, 12, 0, 1, 13, 14, }; -static const uint16_t ccpl_huffcodes5[31] = { - 0x03f8,0x03f9,0x03fa,0x03fb,0x01f8,0x01f9,0x00f8,0x00f9,0x0078,0x0079,0x0038,0x0039, - 0x0018,0x0019,0x0004,0x0000,0x0005,0x001a,0x001b,0x003a,0x003b,0x007a,0x007b,0x00fa, - 0x00fb,0x01fa,0x01fb,0x03fc,0x03fd,0x03fe,0x03ff, +static const uint8_t ccpl_huffsyms5[31] = { + 15, 14, 16, 12, 13, 17, 18, 10, 11, 19, 20, 8, 9, 21, 22, 6, 7, 23, 24, + 4, 5, 25, 26, 0, 1, 2, 3, 27, 28, 29, 30, }; -static const uint16_t ccpl_huffcodes6[63] = { - 0xfffe, 0x7ffe, 0x3ffc, 0x1ffc, 0x0ffc, 0x07f6, 0x07f7, 0x07f8, 0x07f9, - 0x03f2, 0x03f3, 0x03f4, 0x03f5, 0x01f0, 0x01f1, 0x01f2, 0x01f3, 0x01f4, - 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x0070, 0x0071, 0x0072, 0x0073, 0x0034, - 0x0035, 0x0016, 0x0017, 0x0004, 0x0000, 0x000a, 0x0018, 0x0019, 0x0036, - 0x0037, 0x0074, 0x0075, 0x0076, 0x0077, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x01f5, 0x01f6, 0x01f7, 0x01f8, 0x03f6, 0x03f7, 0x03f8, 0x03f9, 0x03fa, - 0x07fa, 0x07fb, 0x07fc, 0x07fd, 0x0ffd, 0x1ffd, 0x3ffd, 0x3ffe, 0xffff +static const uint8_t ccpl_huffsyms6[63] = { + 31, 30, 32, 28, 29, 33, 34, 26, 27, 35, 36, 22, 23, 24, 25, 37, 38, 39, 40, + 18, 19, 20, 21, 41, 42, 43, 44, 13, 14, 15, 16, 17, 45, 46, 47, 48, 9, 10, + 11, 12, 49, 50, 51, 52, 53, 5, 6, 7, 8, 54, 55, 56, 57, 4, 58, 3, 59, + 2, 60, 61, 1, 0, 62, }; static const uint8_t ccpl_huffbits2[3] = { - 2,1,2, + 1, 2, 2, }; static const uint8_t ccpl_huffbits3[7] = { - 6,5,2,1,3,4,6, + 1, 2, 3, 4, 5, 6, 6, }; static const uint8_t ccpl_huffbits4[15] = { - 8,8,7,6,5,4,3,1,3,4,5,6,7,8,8, + 1, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8, }; static const uint8_t ccpl_huffbits5[31] = { - 10,10,10,10,9,9,8,8,7,7,6,6, - 5,5,3,1,3,5,5,6,6,7,7,8, - 8,9,9,10,10,10,10, + 1, 3, 3, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, + 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, }; static const uint8_t ccpl_huffbits6[63] = { - 16,15,14,13,12,11,11,11,11,10,10,10, - 10,9,9,9,9,9,8,8,8,8,7,7, - 7,7,6,6,5,5,3,1,4,5,5,6, - 6,7,7,7,7,8,8,8,8,9,9,9, - 9,10,10,10,10,10,11,11,11,11,12,13, - 14,14,16, + 1, 3, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, + 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12, + 12, 13, 13, 14, 14, 14, 15, 16, 16, }; -static const uint16_t* const ccpl_huffcodes[5] = { - ccpl_huffcodes2,ccpl_huffcodes3, - ccpl_huffcodes4,ccpl_huffcodes5,ccpl_huffcodes6 +static const uint8_t *const ccpl_huffsyms[5] = { + ccpl_huffsyms2, ccpl_huffsyms3, + ccpl_huffsyms4, ccpl_huffsyms5, ccpl_huffsyms6 }; static const uint8_t* const ccpl_huffbits[5] = { From patchwork Fri Nov 20 07:19:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23775 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 98425449F1B for ; Fri, 20 Nov 2020 09:29:01 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D965468BA19; Fri, 20 Nov 2020 09:24:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3B42768BA11 for ; Fri, 20 Nov 2020 09:24:38 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id gj5so11498113ejb.8 for ; Thu, 19 Nov 2020 23:24:38 -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=yL1GJc3DBEpZVjRsloBwR1+wsXSQKilFx3GbcKMyGYc=; b=J3nYTYBtRgqQSk1GglvmQO9EK/9WTTPYBfAxmMgMHBqj9BJ3Um8Qb0LpJuE1vYsBLQ OreDF6rQjDYN5fww7PnMYxC3wO117MPASWolczpz9mOqhKgidwEz7t7McQFKF6IFjQnx 2yz+dt/PgK+B2WwF7Wacj/m3tC+1Q+HKTXS8tKgz1kg2TPVy/Apc3CyPxg5F3leTGfku JmhTTUyeFK0Q5ziEQVNdNLxjbBrycbxTQsVFvEvDw9jTOTp9lKZ3jfeVeRxVxIiq0TrS 0o6V14OKDwmm/viMbL9FVrffDCa6h5vB3NypxpbNYD529m6zE3Pc2w9o/YOv/bKGEVWp k1sA== 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=yL1GJc3DBEpZVjRsloBwR1+wsXSQKilFx3GbcKMyGYc=; b=WMcqNSMi/IrJ0xFYip90N4zwnLdMLkkd0e9fBls7SsuejCkQWmxSlSQe0TFr8s5/GI ci5Nix4cdEDkjQ/FpWYSA9KnGGIKW1J9Y0PR+ZNf5QV2zVQX4XORVGU5wZsGcldQ87aO uVO+VHnxQaLR+moE5AelzeEvKu/VvKfbNOTKK52d8sk2bvDS6Nut8nI2Xf6EMAl3ibdT NKyMWiQMuLnXa45rm+IYfCtO8hg+uVV9hp8JAv9Ze3M89vLSZ0XnIhm+LftszClBod3+ Ws7VIBjaiwEj8A48+ynHSVMkBHWqlpiwjuhwhdJCcApSjZOpa7mqN6rmF+OFTJfvLlZr 8xqQ== X-Gm-Message-State: AOAM530e6Z+PEsxNVi0gvEjWGriFKVh4Kfyo6tfXzaT2Jcf/CvWzk0WP TvTN2l9jqG2uKVJhHbtOnNgtyfnOFzyIrQ== X-Google-Smtp-Source: ABdhPJzZwoiTiFSkWYjBN7RZYpxC3v+6JKkHHV2i3ZRV+Xx7KKAtnyxPf9FleN4lr+Kig82cR7ZCMw== X-Received: by 2002:a17:906:af47:: with SMTP id ly7mr33407629ejb.532.1605857077413; Thu, 19 Nov 2020 23:24:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:36 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:00 +0100 Message-Id: <20201120072116.818090-28-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 027/162] avcodec/cook: Apply offset when initializing VLC 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/cook.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index f22fd02209..7756098d97 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -200,7 +200,7 @@ static av_cold int init_cook_vlc_tables(COOKContext *q) result |= ff_init_vlc_from_lengths(&q->envelope_quant_index[i], 9, 24, envelope_quant_index_huffbits[i], 1, envelope_quant_index_huffsyms[i], 1, 1, - 0, 0, q->avctx); + -12, 0, q->avctx); } av_log(q->avctx, AV_LOG_DEBUG, "sqvh VLC init\n"); for (i = 0; i < 7; i++) { @@ -385,7 +385,7 @@ static int decode_envelope(COOKContext *q, COOKSubpacket *p, j = get_vlc2(&q->gb, q->envelope_quant_index[vlc_index - 1].table, q->envelope_quant_index[vlc_index - 1].bits, 2); - quant_index_table[i] = quant_index_table[i - 1] + j - 12; // differential encoding + quant_index_table[i] = quant_index_table[i - 1] + j; // differential encoding if (quant_index_table[i] > 63 || quant_index_table[i] < -63) { av_log(q->avctx, AV_LOG_ERROR, "Invalid quantizer %d at position %d, outside [-63, 63] range\n", From patchwork Fri Nov 20 07:19:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23777 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 1755544AB58 for ; Fri, 20 Nov 2020 09:29:26 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B144B68BA6E; Fri, 20 Nov 2020 09:24:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2E4FB68B9FC for ; Fri, 20 Nov 2020 09:24:40 +0200 (EET) Received: by mail-ed1-f67.google.com with SMTP id d18so8468736edt.7 for ; Thu, 19 Nov 2020 23:24:40 -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=TcJwNkZNi876MShid0EZts+eTCyUF8vK8pd9ulu+2Y4=; b=nIRO7qHh7qVPjCabPByJk9NzxCZmMRnAkSxRQOO6ikei1qfvDIGFlmQTIHe6MAp8dm mxBQ4+HxqdHOfpj+O/ThD6dSlna8QAG3AXotKUaS95ZaHDOamU+NC/t8ry2gnBqLXMe/ SVAUd4G040fDPbMp9EW+52RIqC476bPCBdNNJazPUEXNcJXANITti1rvFeq+mearPpz1 DL62+OjG/GXMvGKfxN0/WLsFqWZ7W80IoNgbaW88OdsI7F2A3IQ06uLZbUCKNZWHmGZl tbD+y757NmlZhz9TTFG3lcc0c8RVfPNE1hgqE8brMCyLxJDV+E2jJE2cL1WqRV/1qAZu l5oQ== 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=TcJwNkZNi876MShid0EZts+eTCyUF8vK8pd9ulu+2Y4=; b=ik/1aXXuX2Sf95XC7aCYXHXFMlFB4kY54vV4o4dEu2KmRnIbEFyZnxtaXrNNfQEA87 WqCVy1y1Dy3YM+st/gKeD0mL7jeGfUr0/0L9ewOxv0m6ijW6lvQa7k9+T684uAdluSZ1 QmfuGA8TKV5Gie45l7CiiIaazwQd80oF4ppkYzij8fEH6hmkNUpolxXE0kJWno4CYsdF 355ViWOaRTQXosVilrprd2HV15FrYxtgW5DQa3A0YFFrPgvy/v0AiaVnxuJf7suErkdP zRH2SPL8nmObhXNf8yFHIxsnlr8uNxNH5qjYhBcMGQLXtxOCXEpQMhuxRIVatxdrDj4y d68Q== X-Gm-Message-State: AOAM532Z2xcSp1M/ATqY6X51ZOj8i901i5K0/3UIYN43K2rnl+qBvluf kysWAbTSqBwzXwdsyk+g3oxc7gK9dpzfBA== X-Google-Smtp-Source: ABdhPJxwmRAZwm0Y17TBMQZLuVWPPUtSUI6b9DsHzmFtzjQem8nV5HuqtPHdsQ4XEkpmTsJmZxzCKA== X-Received: by 2002:aa7:ce8d:: with SMTP id y13mr21589079edv.65.1605857078717; Thu, 19 Nov 2020 23:24:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:37 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:01 +0100 Message-Id: <20201120072116.818090-29-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 028/162] avcodec/cook: Avoid big length tables for VLC initialization 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" Permuting the tables used to initialize the Cook VLCs so that the code tables are ordered from left to right in the tree revealed that the length of the codes are ascending from left to right. Therefore one can run-length encode them to avoid the big length tables; this saves a bit more than 1KB. Signed-off-by: Andreas Rheinhardt --- libavcodec/cook.c | 38 ++++++--- libavcodec/cookdata.h | 187 +++++++----------------------------------- 2 files changed, 54 insertions(+), 171 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 7756098d97..4d06488c10 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -190,6 +190,21 @@ static av_cold void init_gain_table(COOKContext *q) (1.0 / (double) q->gain_size_factor)); } +static av_cold int build_vlc(VLC *vlc, int nb_bits, const uint8_t counts[16], + const void *syms, int symbol_size, int offset, + void *logctx) +{ + uint8_t lens[MAX_COOK_VLC_ENTRIES]; + unsigned num = 0; + + for (int i = 0; i < 16; i++) + for (unsigned count = num + counts[i]; num < count; num++) + lens[num] = i + 1; + + return ff_init_vlc_from_lengths(vlc, nb_bits, num, lens, 1, + syms, symbol_size, symbol_size, + offset, 0, logctx); +} static av_cold int init_cook_vlc_tables(COOKContext *q) { @@ -197,27 +212,24 @@ static av_cold int init_cook_vlc_tables(COOKContext *q) result = 0; for (i = 0; i < 13; i++) { - result |= ff_init_vlc_from_lengths(&q->envelope_quant_index[i], 9, 24, - envelope_quant_index_huffbits[i], 1, - envelope_quant_index_huffsyms[i], 1, 1, - -12, 0, q->avctx); + result |= build_vlc(&q->envelope_quant_index[i], 9, + envelope_quant_index_huffcounts[i], + envelope_quant_index_huffsyms[i], 1, -12, q->avctx); } av_log(q->avctx, AV_LOG_DEBUG, "sqvh VLC init\n"); for (i = 0; i < 7; i++) { int sym_size = 1 + (i == 3); - result |= ff_init_vlc_from_lengths(&q->sqvh[i], vhvlcsize_tab[i], vhsize_tab[i], - cvh_huffbits[i], 1, - cvh_huffsyms[i], sym_size, sym_size, - 0, 0, q->avctx); + result |= build_vlc(&q->sqvh[i], vhvlcsize_tab[i], + cvh_huffcounts[i], + cvh_huffsyms[i], sym_size, 0, q->avctx); } for (i = 0; i < q->num_subpackets; i++) { if (q->subpacket[i].joint_stereo == 1) { - result |= ff_init_vlc_from_lengths(&q->subpacket[i].channel_coupling, 6, - (1 << q->subpacket[i].js_vlc_bits) - 1, - ccpl_huffbits[q->subpacket[i].js_vlc_bits - 2], 1, - ccpl_huffsyms[q->subpacket[i].js_vlc_bits - 2], 1, 1, - 0, 0, q->avctx); + result |= build_vlc(&q->subpacket[i].channel_coupling, 6, + ccpl_huffcounts[q->subpacket[i].js_vlc_bits - 2], + ccpl_huffsyms[q->subpacket[i].js_vlc_bits - 2], 1, + 0, q->avctx); av_log(q->avctx, AV_LOG_DEBUG, "subpacket %i Joint-stereo VLC used.\n", i); } } diff --git a/libavcodec/cookdata.h b/libavcodec/cookdata.h index 05d1eef23b..a4ca1201bf 100644 --- a/libavcodec/cookdata.h +++ b/libavcodec/cookdata.h @@ -70,41 +70,26 @@ static const int vpr_tab[7] = { /* VLC data */ -static const int vhsize_tab[7] = { - 181, 94, 48, 520, 209, 192, 32, -}; +#define MAX_COOK_VLC_ENTRIES 520 static const int vhvlcsize_tab[7] = { 8, 7, 7, 10, 9, 9, 6, }; -static const uint8_t envelope_quant_index_huffbits[13][24] = { - { 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, - 5, 5, 6, 7, 8, 9, 11, 11, 12, 12, 12, 12 }, - { 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 15, 15, 15, 16, 16 }, - { 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, - 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14 }, - { 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, - 7, 7, 7, 9, 9, 9, 10, 11, 13, 13, 13, 13 }, - { 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, - 6, 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14 }, - { 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, - 7, 7, 8, 8, 8, 9, 10, 11, 12, 13, 14, 14 }, - { 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 15, 15, 16, 16, 16, 16 }, - { 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 7, 7, - 7, 9, 9, 9, 10, 11, 12, 14, 14, 14, 15, 15 }, - { 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 9, 10, 11, 12, 13, 13 }, - { 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, - 6, 8, 8, 8, 9, 10, 11, 12, 14, 14, 14, 14 }, - { 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, - 6, 8, 8, 9, 9, 9, 10, 11, 12, 13, 14, 14 }, - { 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 16, 16, 16, 16 }, - { 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 7, 7, - 7, 8, 9, 10, 11, 13, 14, 14, 14, 14, 14, 14 }, +static const uint8_t envelope_quant_index_huffcounts[13][16] = { + { 0, 0, 3, 8, 3, 1, 1, 1, 1, 0, 2, 4, 0, 0, 0, 0 }, + { 0, 0, 6, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 2 }, + { 0, 0, 3, 8, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0 }, + { 0, 0, 5, 4, 3, 0, 3, 0, 3, 1, 1, 0, 4, 0, 0, 0 }, + { 0, 0, 5, 3, 4, 3, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0 }, + { 0, 0, 5, 4, 3, 0, 2, 3, 1, 1, 1, 1, 1, 2, 0, 0 }, + { 0, 1, 4, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 4 }, + { 0, 1, 4, 2, 3, 0, 3, 0, 3, 1, 1, 1, 0, 3, 2, 0 }, + { 0, 0, 6, 2, 2, 2, 2, 2, 3, 1, 1, 1, 2, 0, 0, 0 }, + { 0, 0, 6, 2, 2, 3, 0, 3, 1, 1, 1, 1, 0, 4, 0, 0 }, + { 0, 1, 3, 4, 2, 3, 0, 2, 3, 1, 1, 1, 1, 2, 0, 0 }, + { 0, 1, 3, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 4 }, + { 0, 1, 4, 2, 3, 0, 3, 1, 1, 1, 1, 0, 1, 6, 0, 0 }, }; static const uint8_t envelope_quant_index_huffsyms[13][24] = { @@ -137,18 +122,14 @@ static const uint8_t envelope_quant_index_huffsyms[13][24] = { }; -static const uint8_t cvh_huffbits0[181] = { - 1, 4, 4, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, - 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, - 16, +static const uint8_t cvh_huffcounts[7][16] = { + { 1, 0, 0, 2, 2, 5, 8, 15, 31, 33, 28, 17, 15, 8, 8, 8 }, + { 1, 0, 0, 2, 4, 5, 7, 16, 18, 12, 11, 7, 3, 5, 1, 2 }, + { 1, 0, 1, 2, 4, 2, 5, 8, 7, 8, 2, 3, 1, 1, 1, 2 }, + { 0, 1, 0, 2, 5, 12, 7, 27, 22, 41, 32, 41, 55, 23, 32, 220 }, + { 0, 1, 0, 5, 7, 4, 8, 9, 17, 10, 13, 17, 12, 14, 92, 0 }, + { 0, 1, 0, 5, 6, 8, 8, 8, 4, 7, 11, 23, 21, 10, 80, 0 }, + { 1, 0, 0, 5, 0, 9, 1, 7, 4, 3, 2, 0, 0, 0, 0, 0 }, }; static const uint8_t cvh_huffsyms0[181] = { @@ -167,16 +148,6 @@ static const uint8_t cvh_huffsyms0[181] = { 190, }; -static const uint8_t cvh_huffbits1[94] = { - 1, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, - 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, - 14, 15, 16, 16, -}; - - static const uint8_t cvh_huffsyms1[94] = { 0, 1, 10, 2, 11, 20, 21, 3, 12, 22, 30, 31, 4, 13, 14, 23, 32, 40, 41, 5, 6, 15, 16, 24, 25, 33, 34, 42, 43, 50, 51, 52, 60, 61, 62, 7, 17, 18, @@ -185,50 +156,12 @@ static const uint8_t cvh_huffsyms1[94] = { 39, 58, 67, 75, 76, 85, 93, 49, 68, 94, 59, 77, 78, 86, 95, 69, 87, 96, }; -static const uint8_t cvh_huffbits2[48] = { - 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, - 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 11, 12, 12, 12, 13, 14, 15, 16, 16, -}; - static const uint8_t cvh_huffsyms2[48] = { 0, 7, 1, 8, 2, 9, 14, 15, 16, 22, 3, 10, 17, 21, 23, 4, 11, 18, 24, 28, 29, 30, 35, 5, 12, 25, 31, 36, 37, 42, 6, 13, 19, 20, 26, 32, 38, 43, 39, 44, 27, 33, 45, 46, 34, 40, 41, 47, }; -static const uint8_t cvh_huffbits3[520] = { - 2, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, -}; - static const uint16_t cvh_huffsyms3[520] = { 0, 1, 125, 5, 6, 25, 30, 150, 2, 7, 26, 31, 126, 130, 131, 151, 155, 156, 250, 275, 10, 35, 36, 50, 55, 175, 180, 3, 8, 11, @@ -267,21 +200,6 @@ static const uint16_t cvh_huffsyms3[520] = { 583, 585, 586, 587, 590, 591, 600, 601, 605, 606, }; -static const uint8_t cvh_huffbits4[209] = { - 2, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, - 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -}; - static const uint8_t cvh_huffsyms4[209] = { 0, 1, 4, 16, 64, 80, 5, 17, 20, 21, 65, 68, 84, 69, 81, 85, 128, 2, 6, 8, 25, 32, 96, 100, 144, 9, 22, 24, 36, 37, @@ -299,20 +217,6 @@ static const uint8_t cvh_huffsyms4[209] = { 218, 220, 221, 225, 226, 228, 229, 230, 232, 233, 240, 241, 244, 245, }; -static const uint8_t cvh_huffbits5[192] = { - 2, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, - 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, - 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -}; - static const uint8_t cvh_huffsyms5[192] = { 0, 1, 3, 9, 27, 81, 4, 12, 36, 82, 84, 108, 10, 13, 28, 30, 39, 90, 109, 117, 31, 37, 40, 85, 91, 93, 111, 120, 2, 54, @@ -329,11 +233,6 @@ static const uint8_t cvh_huffsyms5[192] = { 205, 207, 208, 210, 211, 217, 219, 220, 225, 226, 228, 229, }; -static const uint8_t cvh_huffbits6[32] = { - 1, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 8, 8, - 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, -}; - static const uint8_t cvh_huffsyms6[32] = { 0, 1, 2, 4, 8, 16, 3, 5, 6, 9, 10, 12, 17, 20, 24, 18, 7, 11, 14, 19, 22, 26, 28, 13, 21, 25, 30, 15, 27, 29, 23, 31, @@ -344,12 +243,6 @@ static const void* const cvh_huffsyms[7] = { cvh_huffsyms4, cvh_huffsyms5, cvh_huffsyms6, }; -static const uint8_t* const cvh_huffbits[7] = { - cvh_huffbits0, cvh_huffbits1, cvh_huffbits2, cvh_huffbits3, - cvh_huffbits4, cvh_huffbits5, cvh_huffbits6, -}; - - static const uint8_t ccpl_huffsyms2[3] = { 1, 0, 2, }; @@ -374,28 +267,12 @@ static const uint8_t ccpl_huffsyms6[63] = { 2, 60, 61, 1, 0, 62, }; -static const uint8_t ccpl_huffbits2[3] = { - 1, 2, 2, -}; - -static const uint8_t ccpl_huffbits3[7] = { - 1, 2, 3, 4, 5, 6, 6, -}; - -static const uint8_t ccpl_huffbits4[15] = { - 1, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8, -}; - -static const uint8_t ccpl_huffbits5[31] = { - 1, 3, 3, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, - 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, -}; - -static const uint8_t ccpl_huffbits6[63] = { - 1, 3, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, - 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12, - 12, 13, 13, 14, 14, 14, 15, 16, 16, +static const uint8_t ccpl_huffcounts[5][16] = { + { 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 2, 2, 2, 2, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 2, 0, 4, 4, 4, 4, 4, 8, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 1, 1, 4, 4, 8, 8, 9, 9, 8, 2, 2, 3, 1, 2 }, }; static const uint8_t *const ccpl_huffsyms[5] = { @@ -403,12 +280,6 @@ static const uint8_t *const ccpl_huffsyms[5] = { ccpl_huffsyms4, ccpl_huffsyms5, ccpl_huffsyms6 }; -static const uint8_t* const ccpl_huffbits[5] = { - ccpl_huffbits2,ccpl_huffbits3, - ccpl_huffbits4,ccpl_huffbits5,ccpl_huffbits6 -}; - - //Coupling tables static const int cplband[51] = { From patchwork Fri Nov 20 07:19:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23761 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 5B1AA44A644 for ; Fri, 20 Nov 2020 09:24:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3E94B68BA6B; Fri, 20 Nov 2020 09:24:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C8C3E68BA30 for ; Fri, 20 Nov 2020 09:24:40 +0200 (EET) Received: by mail-ed1-f67.google.com with SMTP id k4so8505268edl.0 for ; Thu, 19 Nov 2020 23:24:40 -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=o0HqSF1w3Faqea4lvh0Wq8DIQluc0FvT+3j5jehxnsw=; b=KkoQNOYNHD7NkP6eM+WoK9ffPy10oTj9Zix/pwErFQ+U0fV/qNgkzYBrUYG72UpiPT SfST62RyawVPn21gwHQOQi+BF8IStT58KtPJYm0juIKBdsl0FztkwDbKW4m+zwOxO/np GVY7tN2azW7kkMqRoZjzXmnTr4e1wSd6RK60BB7H6GfNYMM89ks8PHItT5BrJtYpCQpe u7uYHkkyeZg1P9AkCgTtgK9lud0XTLxFh7SLAlUrmO7jLn+pV4ZNLLq7HlwTIWbLE5zn Q8kT9EytRPO0QZ08Ws6X/5ndX65OxfrUW/TtdaRvM/5STEhL3YlP9loJQzZnEXYq2nax TdlA== 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=o0HqSF1w3Faqea4lvh0Wq8DIQluc0FvT+3j5jehxnsw=; b=M8S+tVzydtQ4zg8jswDs9v0H9bppACtDD9B2v1W4FUo5OZY2o3vtXfZ1HVjfuRoyzW Xx+S46/60uiQhq5tCY88HULaU6RyDPrbteDPpPr4gE3MbXil2PU33aeXklaIGaJuP/tn 8Es0i5Q2B203svOXJw+1dPAKyyd0S2o2QHmGKS12zDJFN/+1RISvUpfAT0z2xIFDOixD P+ZoV69lIS2jNwJRzjgWW+/rk9mYju5HpbByvsE0NzAOdDadzZL1Rp2ad9USKYDwYY8d gG1IsQkO3e5S2eiPKUM3XrZZD9kts0GSF2iK+lGpO+4CCEw2yMaEUoHlRRS8zgz3cJeR rjcA== X-Gm-Message-State: AOAM531Mg99vw+AFwDHuzn9wZ+fRG0R6ZvlTAh0ycZiIY4X3t3rXNnih 74w60xOESmFdbIQ1IvWM0KLwdnE/9SS5Bw== X-Google-Smtp-Source: ABdhPJwjK5SnI2o5NeuSWrvTQo3EtGthwmCTe5b6UulE6aVeq7JOCL2x1vKyTklhJaRa5EbYrFpUCw== X-Received: by 2002:aa7:c2d7:: with SMTP id m23mr33984042edp.230.1605857080098; Thu, 19 Nov 2020 23:24:40 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:39 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:02 +0100 Message-Id: <20201120072116.818090-30-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 029/162] avcodec/cook: Inline constants 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/cook.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 4d06488c10..1968f2f896 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -65,6 +65,9 @@ #define SUBBAND_SIZE 20 #define MAX_SUBPACKETS 5 +#define QUANT_VLC_BITS 9 +#define COUPLING_VLC_BITS 6 + typedef struct cook_gains { int *now; int *previous; @@ -212,7 +215,7 @@ static av_cold int init_cook_vlc_tables(COOKContext *q) result = 0; for (i = 0; i < 13; i++) { - result |= build_vlc(&q->envelope_quant_index[i], 9, + result |= build_vlc(&q->envelope_quant_index[i], QUANT_VLC_BITS, envelope_quant_index_huffcounts[i], envelope_quant_index_huffsyms[i], 1, -12, q->avctx); } @@ -226,7 +229,7 @@ static av_cold int init_cook_vlc_tables(COOKContext *q) for (i = 0; i < q->num_subpackets; i++) { if (q->subpacket[i].joint_stereo == 1) { - result |= build_vlc(&q->subpacket[i].channel_coupling, 6, + result |= build_vlc(&q->subpacket[i].channel_coupling, COUPLING_VLC_BITS, ccpl_huffcounts[q->subpacket[i].js_vlc_bits - 2], ccpl_huffsyms[q->subpacket[i].js_vlc_bits - 2], 1, 0, q->avctx); @@ -396,7 +399,7 @@ static int decode_envelope(COOKContext *q, COOKSubpacket *p, vlc_index = 13; // the VLC tables >13 are identical to No. 13 j = get_vlc2(&q->gb, q->envelope_quant_index[vlc_index - 1].table, - q->envelope_quant_index[vlc_index - 1].bits, 2); + QUANT_VLC_BITS, 2); quant_index_table[i] = quant_index_table[i - 1] + j; // differential encoding if (quant_index_table[i] > 63 || quant_index_table[i] < -63) { av_log(q->avctx, AV_LOG_ERROR, @@ -775,7 +778,7 @@ static int decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab) for (i = 0; i < length; i++) decouple_tab[start + i] = get_vlc2(&q->gb, p->channel_coupling.table, - p->channel_coupling.bits, 3); + COUPLING_VLC_BITS, 3); else for (i = 0; i < length; i++) { int v = get_bits(&q->gb, p->js_vlc_bits); From patchwork Fri Nov 20 07:19:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23781 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 01B6B44AB58 for ; Fri, 20 Nov 2020 09:29:49 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4599168BA9E; Fri, 20 Nov 2020 09:24:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B39EB68BA30 for ; Fri, 20 Nov 2020 09:24:41 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id q16so8459940edv.10 for ; Thu, 19 Nov 2020 23:24: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=zwPyVyTo5M8vh2oK0w3AiMGcK+Cj7UdvYm17Uf+Q88A=; b=szfDhY1vNW9WzpBQ9sRDVdXqKy/FM+8g0bCFkAaMLfT6Cx+Enz6XisfNx7SOhEqKol ln5okFWs49mx/JQh6A16hvimCbZdeonoNWFwchsiACCzXaSFBQckrRI76cNudtWVwAvP qAjJGNrAG5BPqVYO+0+5J4+R0ABiI7a3AA1L2hcAAvlCyowVdq/9xKaaRFoDEMP0O9VV +c6Cxq5n6241RtK4XU5l531n7OjvzG3dYILjs+zn4hpfSR0p2iRAFY3pjM2cwovKlkCY GIAtg8g+Z3E3l4nDlu6u9tmuGdJ5rAb5BX+i7ptTQOeyu3YA2eheATAIDQaFeFjJdm7J BvTw== 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=zwPyVyTo5M8vh2oK0w3AiMGcK+Cj7UdvYm17Uf+Q88A=; b=EtZjFl4GW0g+O5bUTJbCMWyimPVEPL77MweFE891JeluT4fpxDBujrHJYAN8//CCSL SdBeWwtwuKqqSfaDsxcjG78fY3vq5CkGvlDW6kFcIgWs7wFFv9+A06XW5NQISnZu33vp J1l76neczbY74HMEu0qO9r6A7odtN8egYr1EQBGuEgqTRQZVrEwfCtR5/zlRWXhba+B4 tKfRMXAC77pSoA91+jY3Gg146xhYeJtj5kqZzIp4lLD3KysrIkY15hM1K6F8UBAOkaIW t6X8frla4tfy++qjqzH93Hj6oqsae8xU9RZmTypwXA38YKmlM/TW22vUZVKuvEEDxYAU F7lg== X-Gm-Message-State: AOAM531VRxUxmliEv+pO7FWhoMvVDABeydZ1GmX0w1R/DXJ/pD84i8Sf +k4VM2dRUZKI9/XsWSF2xG1VBg6m2eNscg== X-Google-Smtp-Source: ABdhPJyALkSFXU90vXUnlWBf96bfy/K6SyIflyZD1OKKPcQXMTYf2Mt3j2n/PlBYAOYtgzn4tFFKFQ== X-Received: by 2002:a05:6402:100e:: with SMTP id c14mr32743198edu.243.1605857080989; Thu, 19 Nov 2020 23:24:40 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:40 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:03 +0100 Message-Id: <20201120072116.818090-31-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 030/162] avcodec/rv10: Make initializing static RV10 VLCs thread-safe 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/rv10.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index e594160fea..3a487a6b3e 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -28,6 +28,7 @@ #include #include "libavutil/imgutils.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "error_resilience.h" @@ -463,11 +464,22 @@ static int rv20_decode_picture_header(RVDecContext *rv) return s->mb_width * s->mb_height - mb_pos; } +static av_cold void rv10_init_static(void) +{ + INIT_VLC_STATIC(&rv_dc_lum, DC_VLC_BITS, 256, + rv_lum_bits, 1, 1, + rv_lum_code, 2, 2, 16384); + INIT_VLC_STATIC(&rv_dc_chrom, DC_VLC_BITS, 256, + rv_chrom_bits, 1, 1, + rv_chrom_code, 2, 2, 16388); + ff_h263_decode_init_vlc(); +} + static av_cold int rv10_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; RVDecContext *rv = avctx->priv_data; MpegEncContext *s = &rv->m; - static int done = 0; int major_ver, minor_ver, micro_ver, ret; if (avctx->extradata_size < 8) { @@ -525,18 +537,9 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) return ret; ff_h263dsp_init(&s->h263dsp); - ff_h263_decode_init_vlc(); - /* init rv vlc */ - if (!done) { - INIT_VLC_STATIC(&rv_dc_lum, DC_VLC_BITS, 256, - rv_lum_bits, 1, 1, - rv_lum_code, 2, 2, 16384); - INIT_VLC_STATIC(&rv_dc_chrom, DC_VLC_BITS, 256, - rv_chrom_bits, 1, 1, - rv_chrom_code, 2, 2, 16388); - done = 1; - } + /* init static VLCs */ + ff_thread_once(&init_static_once, rv10_init_static); return 0; } From patchwork Fri Nov 20 07:19:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23782 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 BB05C44AB58 for ; Fri, 20 Nov 2020 09:29:58 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3DC7268BAA3; Fri, 20 Nov 2020 09:24:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 27A2F68B9B5 for ; Fri, 20 Nov 2020 09:24:43 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id q3so8443433edr.12 for ; Thu, 19 Nov 2020 23:24:43 -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=qA07nudlPxeeukZ4iRPJc5jpdKJK2TTmt2fdASywyVY=; b=W04NY5xPAiQYVs0Mhv8VaK5FxKI8+AV2XvpCy7iR3vJf+PU7mCQ5tElmEOUzvgoMgO P5GFv86E8PUaZ6rMBFpL4Pj+sBC7GA8EOq0RGMvFCQ4rNx7nB+U1TYqRktq6530euXFp uIvJBAngd91WuObaMHdNpZKrZIq/XkfPZReW5SCmG2eYOd7NOh7gPMlSYs2YM6Tu6w2i cC1UPrfebRevsLCkNyd75HCh4E2qutOZJX1nABDgslPkqwfAFfuOqXpzDlbIi8NYKZTU je4IT8BEXUNNn/dCexHgZ6QyuddD5Zx7oppxJNYuaDoN9kKZPP0WFTrlPgeh96qZ7fxk 2WwQ== 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=qA07nudlPxeeukZ4iRPJc5jpdKJK2TTmt2fdASywyVY=; b=fDnm5+caYtNSHrOK06a/iYPuVuP4hYljTq4fYlu8LfDd4lab8MqFY03wY78LSOYUWo jC6QpH1nftwzhQFUD+wEJqE86nRJ29mSLknM5g8VKdapHbJCNnu8qnRmTDfkdS07EfUP f20DEY9XhItNYQCMWkYD0ugROt/Tp8jiWFAtVKeMxaMOmW47MzK4LzNmWS0rT7kXXiV9 kP+BfklTjqeN58j5VYJZA5IhcI4HM5BiwatOm/sl/ocmTGjHYxU5gVBcjzg6TbqpDg0M BA2e57ILagzZyD4KACTA2mzJG1lGlHnoKukBGm5U6dcMbYvHr87AXwE+R+6o1ylM1qld ipBA== X-Gm-Message-State: AOAM5300abKuAWo28+mTJeQu0g+5O1A2a/S0pxVJ9IMMKVnyD99FAQB2 Q8Lj/6cCksPsnBVnHC+M2JPJw6HmCRCQuw== X-Google-Smtp-Source: ABdhPJzMO73uJwkU+tCHxQcuQ14bHtiaYOmkqziFeH2VYzu4sJ+9fklqxPh68N/wfoNJwdf8dmBOuA== X-Received: by 2002:a50:dac9:: with SMTP id s9mr32714408edj.75.1605857081948; Thu, 19 Nov 2020 23:24:41 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:41 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:04 +0100 Message-Id: <20201120072116.818090-32-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 031/162] avcodec/rv10: Reduce the size of the tables used to initialize 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" This can be achieved by switching to ff_init_vlc_from_lengths() which allows to replace two uint16_t tables for codes with uint8_t tables for the symbols by permuting the tables so that the codes are ordered from left to right in the tree in which case they can be easily computed from the lengths at runtime. And after doing so, it became apparent that the tables for the symbols are actually the same for luma and chroma, so that one can even omit one of them. Signed-off-by: Andreas Rheinhardt --- libavcodec/rv10.c | 199 ++++++++++++++-------------------------------- 1 file changed, 59 insertions(+), 140 deletions(-) diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 3a487a6b3e..d1a02d9578 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -54,144 +54,63 @@ typedef struct RVDecContext { int orig_width, orig_height; } RVDecContext; -static const uint16_t rv_lum_code[256] = { - 0x3e7f, 0x0f00, 0x0f01, 0x0f02, 0x0f03, 0x0f04, 0x0f05, 0x0f06, - 0x0f07, 0x0f08, 0x0f09, 0x0f0a, 0x0f0b, 0x0f0c, 0x0f0d, 0x0f0e, - 0x0f0f, 0x0f10, 0x0f11, 0x0f12, 0x0f13, 0x0f14, 0x0f15, 0x0f16, - 0x0f17, 0x0f18, 0x0f19, 0x0f1a, 0x0f1b, 0x0f1c, 0x0f1d, 0x0f1e, - 0x0f1f, 0x0f20, 0x0f21, 0x0f22, 0x0f23, 0x0f24, 0x0f25, 0x0f26, - 0x0f27, 0x0f28, 0x0f29, 0x0f2a, 0x0f2b, 0x0f2c, 0x0f2d, 0x0f2e, - 0x0f2f, 0x0f30, 0x0f31, 0x0f32, 0x0f33, 0x0f34, 0x0f35, 0x0f36, - 0x0f37, 0x0f38, 0x0f39, 0x0f3a, 0x0f3b, 0x0f3c, 0x0f3d, 0x0f3e, - 0x0f3f, 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x0386, - 0x0387, 0x0388, 0x0389, 0x038a, 0x038b, 0x038c, 0x038d, 0x038e, - 0x038f, 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, - 0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, - 0x039f, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, - 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, - 0x00cf, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, - 0x0057, 0x0020, 0x0021, 0x0022, 0x0023, 0x000c, 0x000d, 0x0004, - 0x0000, 0x0005, 0x000e, 0x000f, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, - 0x03a0, 0x03a1, 0x03a2, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, - 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, - 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, - 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, - 0x0f40, 0x0f41, 0x0f42, 0x0f43, 0x0f44, 0x0f45, 0x0f46, 0x0f47, - 0x0f48, 0x0f49, 0x0f4a, 0x0f4b, 0x0f4c, 0x0f4d, 0x0f4e, 0x0f4f, - 0x0f50, 0x0f51, 0x0f52, 0x0f53, 0x0f54, 0x0f55, 0x0f56, 0x0f57, - 0x0f58, 0x0f59, 0x0f5a, 0x0f5b, 0x0f5c, 0x0f5d, 0x0f5e, 0x0f5f, - 0x0f60, 0x0f61, 0x0f62, 0x0f63, 0x0f64, 0x0f65, 0x0f66, 0x0f67, - 0x0f68, 0x0f69, 0x0f6a, 0x0f6b, 0x0f6c, 0x0f6d, 0x0f6e, 0x0f6f, - 0x0f70, 0x0f71, 0x0f72, 0x0f73, 0x0f74, 0x0f75, 0x0f76, 0x0f77, - 0x0f78, 0x0f79, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f7e, 0x0f7f, +/* The elements with negative length in the bits table correspond to + * open ends in the respective Huffman tree. */ +static const uint8_t rv_sym[] = { + 128, 127, 129, 125, 126, 130, 131, 121, 122, 123, 124, 132, 133, 134, 135, + 113, 114, 115, 116, 117, 118, 119, 120, 136, 137, 138, 139, 140, 141, 142, + 143, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 0, 0, 0, 0, 0, 0, 0, 0, }; -static const uint8_t rv_lum_bits[256] = { - 14, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 7, 7, 7, 7, 7, 7, 7, - 7, 6, 6, 6, 6, 5, 5, 4, - 2, 4, 5, 5, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, +static const uint8_t rv_lum_len[] = { + 2, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, -8, -9,-10,-11,-12,-13,-14, 14, }; -static const uint16_t rv_chrom_code[256] = { - 0xfe7f, 0x3f00, 0x3f01, 0x3f02, 0x3f03, 0x3f04, 0x3f05, 0x3f06, - 0x3f07, 0x3f08, 0x3f09, 0x3f0a, 0x3f0b, 0x3f0c, 0x3f0d, 0x3f0e, - 0x3f0f, 0x3f10, 0x3f11, 0x3f12, 0x3f13, 0x3f14, 0x3f15, 0x3f16, - 0x3f17, 0x3f18, 0x3f19, 0x3f1a, 0x3f1b, 0x3f1c, 0x3f1d, 0x3f1e, - 0x3f1f, 0x3f20, 0x3f21, 0x3f22, 0x3f23, 0x3f24, 0x3f25, 0x3f26, - 0x3f27, 0x3f28, 0x3f29, 0x3f2a, 0x3f2b, 0x3f2c, 0x3f2d, 0x3f2e, - 0x3f2f, 0x3f30, 0x3f31, 0x3f32, 0x3f33, 0x3f34, 0x3f35, 0x3f36, - 0x3f37, 0x3f38, 0x3f39, 0x3f3a, 0x3f3b, 0x3f3c, 0x3f3d, 0x3f3e, - 0x3f3f, 0x0f80, 0x0f81, 0x0f82, 0x0f83, 0x0f84, 0x0f85, 0x0f86, - 0x0f87, 0x0f88, 0x0f89, 0x0f8a, 0x0f8b, 0x0f8c, 0x0f8d, 0x0f8e, - 0x0f8f, 0x0f90, 0x0f91, 0x0f92, 0x0f93, 0x0f94, 0x0f95, 0x0f96, - 0x0f97, 0x0f98, 0x0f99, 0x0f9a, 0x0f9b, 0x0f9c, 0x0f9d, 0x0f9e, - 0x0f9f, 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, - 0x03c7, 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, - 0x03cf, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, - 0x00e7, 0x0030, 0x0031, 0x0032, 0x0033, 0x0008, 0x0009, 0x0002, - 0x0000, 0x0003, 0x000a, 0x000b, 0x0034, 0x0035, 0x0036, 0x0037, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x03d0, 0x03d1, 0x03d2, 0x03d3, 0x03d4, 0x03d5, 0x03d6, 0x03d7, - 0x03d8, 0x03d9, 0x03da, 0x03db, 0x03dc, 0x03dd, 0x03de, 0x03df, - 0x0fa0, 0x0fa1, 0x0fa2, 0x0fa3, 0x0fa4, 0x0fa5, 0x0fa6, 0x0fa7, - 0x0fa8, 0x0fa9, 0x0faa, 0x0fab, 0x0fac, 0x0fad, 0x0fae, 0x0faf, - 0x0fb0, 0x0fb1, 0x0fb2, 0x0fb3, 0x0fb4, 0x0fb5, 0x0fb6, 0x0fb7, - 0x0fb8, 0x0fb9, 0x0fba, 0x0fbb, 0x0fbc, 0x0fbd, 0x0fbe, 0x0fbf, - 0x3f40, 0x3f41, 0x3f42, 0x3f43, 0x3f44, 0x3f45, 0x3f46, 0x3f47, - 0x3f48, 0x3f49, 0x3f4a, 0x3f4b, 0x3f4c, 0x3f4d, 0x3f4e, 0x3f4f, - 0x3f50, 0x3f51, 0x3f52, 0x3f53, 0x3f54, 0x3f55, 0x3f56, 0x3f57, - 0x3f58, 0x3f59, 0x3f5a, 0x3f5b, 0x3f5c, 0x3f5d, 0x3f5e, 0x3f5f, - 0x3f60, 0x3f61, 0x3f62, 0x3f63, 0x3f64, 0x3f65, 0x3f66, 0x3f67, - 0x3f68, 0x3f69, 0x3f6a, 0x3f6b, 0x3f6c, 0x3f6d, 0x3f6e, 0x3f6f, - 0x3f70, 0x3f71, 0x3f72, 0x3f73, 0x3f74, 0x3f75, 0x3f76, 0x3f77, - 0x3f78, 0x3f79, 0x3f7a, 0x3f7b, 0x3f7c, 0x3f7d, 0x3f7e, 0x3f7f, -}; - -static const uint8_t rv_chrom_bits[256] = { - 16, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 8, 8, 8, 8, 8, 8, 8, - 8, 6, 6, 6, 6, 4, 4, 3, - 2, 3, 4, 4, 6, 6, 6, 6, - 8, 8, 8, 8, 8, 8, 8, 8, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, +static const uint8_t rv_chrom_len[] = { + 2, 3, 3, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14,-10,-11,-12,-13,-14,-15,-16, 16, }; static VLC rv_dc_lum, rv_dc_chrom; @@ -466,12 +385,12 @@ static int rv20_decode_picture_header(RVDecContext *rv) static av_cold void rv10_init_static(void) { - INIT_VLC_STATIC(&rv_dc_lum, DC_VLC_BITS, 256, - rv_lum_bits, 1, 1, - rv_lum_code, 2, 2, 16384); - INIT_VLC_STATIC(&rv_dc_chrom, DC_VLC_BITS, 256, - rv_chrom_bits, 1, 1, - rv_chrom_code, 2, 2, 16388); + INIT_VLC_STATIC_FROM_LENGTHS(&rv_dc_lum, DC_VLC_BITS, 263, + rv_lum_len, 1, + rv_sym, 1, 1, 0, 0, 16384); + INIT_VLC_STATIC_FROM_LENGTHS(&rv_dc_chrom, DC_VLC_BITS, 263, + rv_chrom_len, 1, + rv_sym, 1, 1, 0, 0, 16388); ff_h263_decode_init_vlc(); } From patchwork Fri Nov 20 07:19:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23783 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 B8B6E44AD2C for ; Fri, 20 Nov 2020 09:30:09 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 04F4468BA80; Fri, 20 Nov 2020 09:24:54 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ED0B468BA3B for ; Fri, 20 Nov 2020 09:24:43 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id cf17so4914430edb.2 for ; Thu, 19 Nov 2020 23:24:43 -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=Os4bjlAqnM/5vs2UMVsa7g9kpzZ0SeOqgaQh+xNNzpM=; b=uP2sUSx0Ec2PYI2y5IeUNEDcKcnxoKu9VsQ2+0N7jmb+CYx6MAXcBaQpvgPq9d/2UG Qg+w/r7w1kRk8ILngMQPyCs+tyS5SJaWFLe0IzsHU9MVwG1qNOg1N4k+BU5+vPh8I+nP Rm3tSCMFgiw2Ye2p5jP79eP/j3F0DAb4Rr6TGp6OIpt7BfJZv9LJsyRVTadCmeSpQufE PMhzdDk4s9/kVexZwkfMkHqe0hvV3BU5HvDyecRayk4K3xXbJkgbnsLfn59ORX/21dSk YVt/o98YB6JXkYVTWy40b4DS+tqji/hxfnY32pbhykrkI+Cp9yp6xqR7Q5GiJjpI/0ci 7vpg== 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=Os4bjlAqnM/5vs2UMVsa7g9kpzZ0SeOqgaQh+xNNzpM=; b=DUmFG6oYRt7MN5nOWqBQCw63Cs6lRkON4sAn4TRCh1mmKjWPPzWtGFor7ccBiCMtXB B753ZLouvc8C/7g/2cFFPwHY/XczqwhRInrif7C3GLBz6PcmGCs60pVxGdd4uSP7xks4 Jv5CYrVPlq0ORG0WBBTPCabaG2hV1xhaUklvRo2AjoW+2Pq4zESZiZ4byH2h5fHv7W61 Ne5XheluNeY4o0WsZtleyvA9j0LCVSEFSgHdYRfLmtNBt8+rgA9a5MUzEA5KawZpfFfn 9zHKOR1RKMxi9XWK2U9Vco6x0JqdamR5CLjmhEbnEAHBhju5Y7QJznom1HGXAYSJJ0oJ ysNQ== X-Gm-Message-State: AOAM532Nx5WftDj8yh6xfVaFyCJB6nO82fCHgjgIrdFrM4PAyGcmJ4ih oqE+JvLKTtJhpEHsr4C42i4TPHNYVrDeWg== X-Google-Smtp-Source: ABdhPJyhwxpL10pfC50i8fqUMtkwHn4SV2Jfsy28PMYgHZnuRKZJynYh6inn+YPqEZZEZY9hIWDg7g== X-Received: by 2002:a05:6402:1358:: with SMTP id y24mr23333962edw.291.1605857082852; Thu, 19 Nov 2020 23:24:42 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:42 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:05 +0100 Message-Id: <20201120072116.818090-33-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 032/162] avcodec/rv10: Reduce number of exceptions when reading VLC value 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" RealVideo 1.0 uses an insane way to encode DC coefficients: There are several symbols that (for no good reason whatsoever) have multiple encodings, leading to longer codes than necessary. More specifically, the tree for the 256 luma symbols contains 255 codes belonging to 255 different symbols on the left; going further right, the tree consists of two blocks of 128 codes each of length 14 encoding consecutive numbers (including two encodings for the symbol missing among the 255 codes on the left); this is followed by two blocks of codes of length 16 each containing 256 elements with consecutive symbols (i.e. each of the blocks allows to encode all symbols). The rest of the tree consists of 2^11 codes that all encode the same symbol. The tree for the 256 chroma symbols is similar, but is missing the blocks of length 256 and there are only 2^9 consecutive codes that encode the same symbol; furthermore, the chroma tree is incomplete: The right-most node has no right child. All of this caused problems when parsing these codes; the reason is that the code for this predates commit b613bacca9c256f1483c46847f713e47a0e9a5f6 which added support for explicit symbol tables and thereby removed the requirement that different codes have different symbols. In order to address this, the trees used for parsing were incomplete: They contained the 255 codes on the left and one code for the remaining symbol. Whenever a code not in these trees was encountered, it was dealt with in special cases (one for each of the blocks mentioned above). This commit reduces the number of special cases: Using a symbols table allows to treat the blocks of consecutive symbols like ordinary codes; only the blocks encoding a single symbol are still treated specially (in order not to waste memory on tables for them). In order to not increment the size of the tables used to initialize the VLCs both the symbols as well as the lengths are now run-length encoded. Signed-off-by: Andreas Rheinhardt --- libavcodec/rv10.c | 137 ++++++++++++++++++---------------------------- 1 file changed, 53 insertions(+), 84 deletions(-) diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index d1a02d9578..eaabb99e69 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -46,6 +46,7 @@ #define RV_GET_MINOR_VER(x) (((x) >> 20) & 0xFF) #define RV_GET_MICRO_VER(x) (((x) >> 12) & 0xFF) +#define MAX_VLC_ENTRIES 1023 // Note: Does not include the skip entries. #define DC_VLC_BITS 14 // FIXME find a better solution typedef struct RVDecContext { @@ -54,63 +55,25 @@ typedef struct RVDecContext { int orig_width, orig_height; } RVDecContext; -/* The elements with negative length in the bits table correspond to - * open ends in the respective Huffman tree. */ -static const uint8_t rv_sym[] = { - 128, 127, 129, 125, 126, 130, 131, 121, 122, 123, 124, 132, 133, 134, 135, - 113, 114, 115, 116, 117, 118, 119, 120, 136, 137, 138, 139, 140, 141, 142, - 143, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 0, 0, 0, 0, 0, 0, 0, 0, +/* (run, length) encoded value for the symbols table. The actual symbols + * are run..run + length (mod 256). + * The last two entries in the following table apply to luma only. + * The skip values are not included in this list. */ +static const uint8_t rv_sym_run_len[][2] = { + { 128, 0 }, { 127, 0 }, { 129, 0 }, { 125, 1 }, { 130, 1 }, + { 121, 3 }, { 132, 3 }, { 113, 7 }, { 136, 7 }, { 97, 15 }, + { 144, 15 }, { 65, 31 }, { 160, 31 }, { 1, 63 }, { 192, 63 }, + { 129, 127 }, { 0, 127 }, { 1, 255 }, { 0, 255 }, }; -static const uint8_t rv_lum_len[] = { - 2, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, -8, -9,-10,-11,-12,-13,-14, 14, +/* entry[i] of the following tables gives + * the number of VLC codes of length i + 2. */ +static const uint16_t rv_lum_len_count[15] = { + 1, 0, 2, 4, 8, 16, 32, 0, 64, 0, 128, 0, 256, 0, 512, }; -static const uint8_t rv_chrom_len[] = { - 2, 3, 3, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14,-10,-11,-12,-13,-14,-15,-16, 16, +static const uint16_t rv_chrom_len_count[15] = { + 1, 2, 4, 0, 8, 0, 16, 0, 32, 0, 64, 0, 128, 0, 256, }; static VLC rv_dc_lum, rv_dc_chrom; @@ -122,37 +85,18 @@ int ff_rv_decode_dc(MpegEncContext *s, int n) if (n < 4) { code = get_vlc2(&s->gb, rv_dc_lum.table, DC_VLC_BITS, 2); if (code < 0) { - /* XXX: I don't understand why they use LONGER codes than - * necessary. The following code would be completely useless - * if they had thought about it !!! */ - code = get_bits(&s->gb, 7); - if (code == 0x7c) { - code = (int8_t) (get_bits(&s->gb, 7) + 1); - } else if (code == 0x7d) { - code = -128 + get_bits(&s->gb, 7); - } else if (code == 0x7e) { - if (get_bits1(&s->gb) == 0) - code = (int8_t) (get_bits(&s->gb, 8) + 1); - else - code = (int8_t) (get_bits(&s->gb, 8)); - } else if (code == 0x7f) { - skip_bits(&s->gb, 11); - code = 1; - } + /* Skip entry - no error. */ + skip_bits(&s->gb, 18); + code = 1; } else { code -= 128; } } else { code = get_vlc2(&s->gb, rv_dc_chrom.table, DC_VLC_BITS, 2); - /* same remark */ if (code < 0) { - code = get_bits(&s->gb, 9); - if (code == 0x1fc) { - code = (int8_t) (get_bits(&s->gb, 7) + 1); - } else if (code == 0x1fd) { - code = -128 + get_bits(&s->gb, 7); - } else if (code == 0x1fe) { - skip_bits(&s->gb, 9); + if (show_bits(&s->gb, 9) == 0x1FE) { + /* Skip entry - no error. */ + skip_bits(&s->gb, 18); code = 1; } else { av_log(s->avctx, AV_LOG_ERROR, "chroma dc error\n"); @@ -383,14 +327,39 @@ static int rv20_decode_picture_header(RVDecContext *rv) return s->mb_width * s->mb_height - mb_pos; } +static av_cold void rv10_build_vlc(VLC *vlc, const uint16_t len_count[15], + const uint8_t sym_rl[][2], int sym_rl_elems) +{ + uint16_t syms[MAX_VLC_ENTRIES]; + uint8_t lens[MAX_VLC_ENTRIES]; + unsigned nb_syms = 0, nb_lens = 0; + + for (unsigned i = 0; i < sym_rl_elems; i++) { + unsigned cur_sym = sym_rl[i][0]; + for (unsigned tmp = nb_syms + sym_rl[i][1]; nb_syms <= tmp; nb_syms++) + syms[nb_syms] = 0xFF & cur_sym++; + } + + for (unsigned i = 0; i < 15; i++) + for (unsigned tmp = nb_lens + len_count[i]; nb_lens < tmp; nb_lens++) + lens[nb_lens] = i + 2; + av_assert1(nb_lens == nb_syms); + ff_init_vlc_from_lengths(vlc, DC_VLC_BITS, nb_lens, lens, 1, + syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); +} + static av_cold void rv10_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&rv_dc_lum, DC_VLC_BITS, 263, - rv_lum_len, 1, - rv_sym, 1, 1, 0, 0, 16384); - INIT_VLC_STATIC_FROM_LENGTHS(&rv_dc_chrom, DC_VLC_BITS, 263, - rv_chrom_len, 1, - rv_sym, 1, 1, 0, 0, 16388); + static VLC_TYPE table[16896 + 16640][2]; + + rv_dc_lum.table = table; + rv_dc_lum.table_allocated = 16896; + rv10_build_vlc(&rv_dc_lum, rv_lum_len_count, + rv_sym_run_len, FF_ARRAY_ELEMS(rv_sym_run_len)); + rv_dc_chrom.table = &table[16896]; + rv_dc_chrom.table_allocated = 16640; + rv10_build_vlc(&rv_dc_chrom, rv_chrom_len_count, + rv_sym_run_len, FF_ARRAY_ELEMS(rv_sym_run_len) - 2); ff_h263_decode_init_vlc(); } From patchwork Fri Nov 20 07:19:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23784 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 5F5BE44AF11 for ; Fri, 20 Nov 2020 09:30:20 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0FBAD68BAB4; Fri, 20 Nov 2020 09:24:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 82E2E68BA51 for ; Fri, 20 Nov 2020 09:24:44 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id v22so8463416edt.9 for ; Thu, 19 Nov 2020 23:24:44 -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=26/AMtD+E3oH9sxGhNSLM/kb5pTpREeSUzZ4RgWKk2o=; b=JztTtDFWCol6Gm7K9jwVHTvfx0ZJIsM5GEBf/eYYdPkfDgwioE6DrOoS6tGdYhJK40 VxcwWoPCb4kzEa/CF1O9D1OgU5ZyPsE9hxPVTLNMKY+EOWaKErdka2sIICFfcZnh4k4E BdqZq+AYuw2gUk9SrJpVwPA4iCXOhYLMn9BljfHFMzaY9pGnOZefV9gqOKORgZ6Ao8Dr +OhsoT9rDoCHSS2juiKJOVSfKqpgI21gtw+KX/54zJCKTRQtxRm4kM8vzeFehlHK79HZ 5LHK3mTQ10EOu1vDljaARl5aVnIBqOG4fb4u9IUkrHfKWO15KDRupqTIsXGS+MZmmT1D oC9Q== 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=26/AMtD+E3oH9sxGhNSLM/kb5pTpREeSUzZ4RgWKk2o=; b=a6+44efoRG76OXt5fQ4ayqyTXVsjiypGfsZQzFtmqPm30hPRcCeSbjvDw6qWzJnGcx PYm7VP0TZxm1HRdHEaiToUIYoeTlmEL7iVCPc05+dsTt2wLYDdtphgjGW6XIv9uBSv8W /wk55GSJZVmzseSfkIyurIM4Vi+QFZf6mMZuJGHvHrj2RR044gPANGrb8p0Lmd8mCKQi 0giA50ALd19BN0QkLViYeLOlzsAb4r0yLWNc/ZLsIIIk6SqPwtnVRx2QTzRRuAQjRyhH C4S2c/Sc2GCfMn7ZmEOYJ6/paw87seE4GfJVi8BdoWOCoHWeca8DOJWWBP8k9YZ8LQH3 L3ug== X-Gm-Message-State: AOAM533lI8hAgezu11qVJhZ4wkrNNYOl3G01qZo9FnLqGT8N3cAeSEZb yDwXHWdWtNZxVcpjD6xBiCGEHi24Kwq5/Q== X-Google-Smtp-Source: ABdhPJzFDP+W9GT/kgVMFRchhYscVRGBMRfTElYRTCDdSRtDSwDropaBx2YKgGzEohXsAbATa85uTg== X-Received: by 2002:a05:6402:1245:: with SMTP id l5mr34093220edw.68.1605857083691; Thu, 19 Nov 2020 23:24:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:43 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:06 +0100 Message-Id: <20201120072116.818090-34-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 033/162] avcodec/rv10: Use symbol table more effectively 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 RealVideo 1.0 decoder uses VLCs to parse DC coefficients. But the values returned from get_vlc2() are not directly used; instead -(val - 128) (which is in the range -127..128) is. This transformation is unnecessary as it can effectively be done when initializing the VLC by modifying the symbols table used. There is just one minor complication: The chroma table is incomplete and in order to distinguish an error from get_vlc2() (due to an invalid code) the ordinary return range is modified to 0..255. This is possible because the only caller of this function is (on success) only interested in the return value modulo 256. Signed-off-by: Andreas Rheinhardt --- libavcodec/ituh263dec.c | 2 +- libavcodec/rv10.c | 24 ++++++++++-------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index c1005b0994..ced7fa52ee 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -467,7 +467,7 @@ static int h263_decode_block(MpegEncContext * s, int16_t * block, level = s->last_dc[component]; if (s->rv10_first_dc_coded[component]) { diff = ff_rv_decode_dc(s, n); - if (diff == 0xffff) + if (diff < 0) return -1; level += diff; level = level & 0xff; /* handle wrap round */ diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index eaabb99e69..4d4c2b0f2e 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -56,14 +56,14 @@ typedef struct RVDecContext { } RVDecContext; /* (run, length) encoded value for the symbols table. The actual symbols - * are run..run + length (mod 256). + * are run..run - length (mod 256). * The last two entries in the following table apply to luma only. * The skip values are not included in this list. */ static const uint8_t rv_sym_run_len[][2] = { - { 128, 0 }, { 127, 0 }, { 129, 0 }, { 125, 1 }, { 130, 1 }, - { 121, 3 }, { 132, 3 }, { 113, 7 }, { 136, 7 }, { 97, 15 }, - { 144, 15 }, { 65, 31 }, { 160, 31 }, { 1, 63 }, { 192, 63 }, - { 129, 127 }, { 0, 127 }, { 1, 255 }, { 0, 255 }, + { 0, 0 }, { 1, 0 }, { 255, 0 }, { 3, 1 }, { 254, 1 }, + { 7, 3 }, { 252, 3 }, { 15, 7 }, { 248, 7 }, { 31, 15 }, + { 240, 15 }, { 63, 31 }, { 224, 31 }, { 127, 63 }, { 192, 63 }, + { 255, 127 }, { 128, 127 }, { 127, 255 }, { 128, 255 }, }; /* entry[i] of the following tables gives @@ -87,9 +87,7 @@ int ff_rv_decode_dc(MpegEncContext *s, int n) if (code < 0) { /* Skip entry - no error. */ skip_bits(&s->gb, 18); - code = 1; - } else { - code -= 128; + code = 255; } } else { code = get_vlc2(&s->gb, rv_dc_chrom.table, DC_VLC_BITS, 2); @@ -97,16 +95,14 @@ int ff_rv_decode_dc(MpegEncContext *s, int n) if (show_bits(&s->gb, 9) == 0x1FE) { /* Skip entry - no error. */ skip_bits(&s->gb, 18); - code = 1; + code = 255; } else { av_log(s->avctx, AV_LOG_ERROR, "chroma dc error\n"); - return 0xffff; + return -1; } - } else { - code -= 128; } } - return -code; + return code; } /* read RV 1.0 compatible frame header */ @@ -337,7 +333,7 @@ static av_cold void rv10_build_vlc(VLC *vlc, const uint16_t len_count[15], for (unsigned i = 0; i < sym_rl_elems; i++) { unsigned cur_sym = sym_rl[i][0]; for (unsigned tmp = nb_syms + sym_rl[i][1]; nb_syms <= tmp; nb_syms++) - syms[nb_syms] = 0xFF & cur_sym++; + syms[nb_syms] = 0xFF & cur_sym--; } for (unsigned i = 0; i < 15; i++) From patchwork Fri Nov 20 07:19:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23785 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 1316544AF11 for ; Fri, 20 Nov 2020 09:30:31 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1357868BA85; Fri, 20 Nov 2020 09:24:56 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5076D68BA5F for ; Fri, 20 Nov 2020 09:24:45 +0200 (EET) Received: by mail-ed1-f67.google.com with SMTP id q16so8460087edv.10 for ; Thu, 19 Nov 2020 23:24:45 -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=4AmEe6B/QE4lfl6Oz6JAU3ipfHRxnyv2Dy7a7cjxjhM=; b=KijITyR7gyiLaJcXn0+oTD2k1yqfW8EvzM05YkX6K2i2IDKJrKcdy47xqngt9zKAFV jpri5EPQSlaWrs3Q+lWDXyzhNFFVD9y60pd/vxUWJ6pE9KV2+7Jj6xZv/L4zv8Fwco6w Pgo6DoGUZ2ffkKSYnkbsrlWy5Odq32jagl3UmqoaXGCL0Q/3sfHoYhlqkbGmeY3EddwX MYhg2D+5vhcPp4wyfD9lOWanvc5uWY1XbLGD9+MxMZJFxrrqWz3qGzRXYrZ/apyrf995 g5X9oQ8ylBUe/qv9mWNl4dLBgljjBNauFf1m9UFZjO1QKxO+8+oNaNnEsBrJI34ZHHA+ Qw3Q== 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=4AmEe6B/QE4lfl6Oz6JAU3ipfHRxnyv2Dy7a7cjxjhM=; b=kfBIBFZJxKynGf4uh/jwn0bjzdIuE50dbC+4UNDql2geEHZTA2TlNOR3FvWgIFFHWC 6V321oyhwLblrNxWYfBVQz6kiSvxh0TlkHJDW+pCfvBOElvHyRy+yrr/7ZWh2gK9xQ4e YKtdqZnOhMEx3MEQHl+i3WGU6AcbSmwKgGiaq+cdJHqIFg2v1lqFSMAuoHapXNH7GUPF Ty5D6MDNAlZXWOpkWtgdPw9DMZ5C1RHT6OQvy96hZhzl/OsHZY6D8VFS5WAdYiONYZVX 6zX0XmHfe648tCvWOQ7n5Xgb1eU2Hi0Ya42a6Sd4jEh18aH2d+b/N0UK8r8s9CLXdM/a vDlw== X-Gm-Message-State: AOAM5330N1Gg+zrANfkFUy8qHaG/bSwjwPh1w25/sl43v83Cz1IjHsGw Xlw9UKtiQzZe0AXLhlLpYbdGSwxT4v9lZw== X-Google-Smtp-Source: ABdhPJwbKxVVKA6N4ps/XIjAZ46E8X+bCaXuREhr2pZA22kW4iHP2fWRXm9Nh2PN0rRp9WeHcnuuqw== X-Received: by 2002:a50:eb96:: with SMTP id y22mr35054864edr.116.1605857084613; Thu, 19 Nov 2020 23:24:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:44 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:07 +0100 Message-Id: <20201120072116.818090-35-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 034/162] avcodec/rv10: Make VLC tables 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" These tables were huge (14 bits) because one needed 14 bits in order to find out whether a code is valid and in the VLC table or a valid code that required hacky workarounds due to RealVideo 1.0 using multiple codes for the same symbol and the code predating the introduction of symbols tables for VLCs. Signed-off-by: Andreas Rheinhardt --- libavcodec/rv10.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 4d4c2b0f2e..0727899337 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -47,7 +47,7 @@ #define RV_GET_MICRO_VER(x) (((x) >> 12) & 0xFF) #define MAX_VLC_ENTRIES 1023 // Note: Does not include the skip entries. -#define DC_VLC_BITS 14 // FIXME find a better solution +#define DC_VLC_BITS 9 typedef struct RVDecContext { MpegEncContext m; @@ -346,14 +346,14 @@ static av_cold void rv10_build_vlc(VLC *vlc, const uint16_t len_count[15], static av_cold void rv10_init_static(void) { - static VLC_TYPE table[16896 + 16640][2]; + static VLC_TYPE table[1472 + 992][2]; rv_dc_lum.table = table; - rv_dc_lum.table_allocated = 16896; + rv_dc_lum.table_allocated = 1472; rv10_build_vlc(&rv_dc_lum, rv_lum_len_count, rv_sym_run_len, FF_ARRAY_ELEMS(rv_sym_run_len)); - rv_dc_chrom.table = &table[16896]; - rv_dc_chrom.table_allocated = 16640; + rv_dc_chrom.table = &table[1472]; + rv_dc_chrom.table_allocated = 992; rv10_build_vlc(&rv_dc_chrom, rv_chrom_len_count, rv_sym_run_len, FF_ARRAY_ELEMS(rv_sym_run_len) - 2); ff_h263_decode_init_vlc(); From patchwork Fri Nov 20 07:19:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23786 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 40A2944AF11 for ; Fri, 20 Nov 2020 09:30:41 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C2C3868BAB9; Fri, 20 Nov 2020 09:24:56 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 539D468BA66 for ; Fri, 20 Nov 2020 09:24:46 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id oq3so11473090ejb.7 for ; Thu, 19 Nov 2020 23:24:46 -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=eqNa9Wh/gCNFDpvPb6UQIBhKQtTk99WAwB63GZU3M3E=; b=vPhUnSBAwum5m3eKsO0cB9xlmTCrfQf6wp0T9BBfewPif6j3MOffVB4tH/91vXmmXd /7zdMKP2pUI6PaNxdNcEwaZ68TT32RaaivLHwrak52yGEsjPqIqE42nO9O8MjV36ZVlP WbV8pXjbZjzzT3gim0s+8KT5AGS+m079QPeAjwpc6MxVzw3JjPzt/kvaxVMDisBQt7Xi MSqahXg+RuV/Kdg5CdkLXpaZW1fUoJjwy+xqC7we534WVcwpdkK/pIICCYCiwpfjh4Rx Yyf+4GDXP7eirk54OW7DSpY4qvh/i11ipoenWhIS4sTL3c9Hv0GbFQoab8zus43JLsjh TcEw== 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=eqNa9Wh/gCNFDpvPb6UQIBhKQtTk99WAwB63GZU3M3E=; b=Gtc6TB4IU8XiG35U516+VxWe7I7mVL9HIMdPQpWAaOG/DpDRFBDXVvNPIePymxnD+Q MXizCjmO72u0B7L83k2WQiaeR0oZyVE4oGaw1sKhluIHFx9NRTWtH1PmQeDrROJRp/V3 K/eSZGag8iG1M+K/9diuzXd8h5Tvmlebw5xNyd1FeTRwrQ4Be/UI86UmQhjXgLdSBt6u G+wL/YaUgigxFAWuhu9QeA8jGm6q6TUGWOXjHneNtSSaHGJO8PN0mmdnVhTIl5I9ME1B jeALnXb2v1KpN8n4TCnkb7SlJ0gXeEzcLLGUl3MFbdsDXd+KCgmeACJokTr1ZrG6SVnL R7hA== X-Gm-Message-State: AOAM531nCuOy6EDkekiQ2koEoJoeFu0xDXBomdhuwzfQAA8dPV8hPEsE Y/rrjDRkUgOsfqn8yALF+uOBDJwm0yzxQQ== X-Google-Smtp-Source: ABdhPJxTtCMeXTEGuFnl5zL4YgVGtN5yNXxe1ro9sRsMNbB28PxeNiwFKl68FUTOKRu4K1Ygy1Ge+w== X-Received: by 2002:a17:907:9d0:: with SMTP id bx16mr32734236ejc.426.1605857085519; Thu, 19 Nov 2020 23:24:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:44 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:08 +0100 Message-Id: <20201120072116.818090-36-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 035/162] avcodec/rv10: Simplify handling of skip VLC entries 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 tables to be used for parsing RealVideo 1.0 DC coefficients are weird: The luma table contains a block of 2^11 codes beginning with the same prefix and length that all have the same symbol (i.e. value only depends upon the prefix); the same goes for the chroma block (except it's only 2^9 codes). Up until now, these entries (which generally could be parsed like ordinary entries with subtables) have been treated specially: They have been treated like open ends of the tree, so that get_vlc2() returned a value < 0 upon encountering them; afterwards it was checked whether the right prefix was used and if so, the appropriate number of bytes was skipped. But there is actually an easy albeit slightly hacky way to support them directly without pointless subtables: Just modify the VLC table so that all the entries sharing the right prefix have a length that equals the length of the whole entry. Signed-off-by: Andreas Rheinhardt --- libavcodec/rv10.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 0727899337..d118515c3b 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -84,22 +84,11 @@ int ff_rv_decode_dc(MpegEncContext *s, int n) if (n < 4) { code = get_vlc2(&s->gb, rv_dc_lum.table, DC_VLC_BITS, 2); - if (code < 0) { - /* Skip entry - no error. */ - skip_bits(&s->gb, 18); - code = 255; - } } else { code = get_vlc2(&s->gb, rv_dc_chrom.table, DC_VLC_BITS, 2); if (code < 0) { - if (show_bits(&s->gb, 9) == 0x1FE) { - /* Skip entry - no error. */ - skip_bits(&s->gb, 18); - code = 255; - } else { - av_log(s->avctx, AV_LOG_ERROR, "chroma dc error\n"); - return -1; - } + av_log(s->avctx, AV_LOG_ERROR, "chroma dc error\n"); + return -1; } } return code; @@ -352,10 +341,21 @@ static av_cold void rv10_init_static(void) rv_dc_lum.table_allocated = 1472; rv10_build_vlc(&rv_dc_lum, rv_lum_len_count, rv_sym_run_len, FF_ARRAY_ELEMS(rv_sym_run_len)); + for (int i = 0; i < 1 << (DC_VLC_BITS - 7 /* Length of skip prefix */); i++) { + /* All codes beginning with 0x7F have the same length and value. + * Modifying the table directly saves us the useless subtables. */ + rv_dc_lum.table[(0x7F << (DC_VLC_BITS - 7)) + i][0] = 255; + rv_dc_lum.table[(0x7F << (DC_VLC_BITS - 7)) + i][1] = 18; + } rv_dc_chrom.table = &table[1472]; rv_dc_chrom.table_allocated = 992; rv10_build_vlc(&rv_dc_chrom, rv_chrom_len_count, rv_sym_run_len, FF_ARRAY_ELEMS(rv_sym_run_len) - 2); + for (int i = 0; i < 1 << (DC_VLC_BITS - 9 /* Length of skip prefix */); i++) { + /* Same as above. */ + rv_dc_chrom.table[(0x1FE << (DC_VLC_BITS - 9)) + i][0] = 255; + rv_dc_chrom.table[(0x1FE << (DC_VLC_BITS - 9)) + i][1] = 18; + } ff_h263_decode_init_vlc(); } From patchwork Fri Nov 20 07:19:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23787 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 E52E044AF11 for ; Fri, 20 Nov 2020 09:30:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AECD668BA8B; Fri, 20 Nov 2020 09:24:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5861E68BA6C for ; Fri, 20 Nov 2020 09:24:47 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id f20so11491174ejz.4 for ; Thu, 19 Nov 2020 23:24:47 -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=Ap2+12C/N6FyXSWWkUzDt1y7978WCwEi2YLY9OVOeOk=; b=ehDaJkTiGX7f0rWXsFvBmvrif4Gc3ovc5FF+Ze8c72i1nQ2BoP9wEyFExb7nkA2pPw r5qltzbxeiXmz2/bE/oLZClrhTEc5zT03XBTJrvxtmGK35sA3trpw9ZeyIWmY4uWAbnn EoAcFBHQyo0jX2BxrdHLTntd152ocBeqLbyoOgCoHDPezWY8qaH+PhgR+mpdOMwZJ2Pb Io/1RPX5ZAzzBGYfX8pqOfIvvvw6aiNKgr4Ges69YeoDzqClqPqeSFbrqrCS8Y70Mdso dUncEto1E8oR9Op4vv0o6jLvfwiRs8T+OG/3CfFo8IUd0urSvqTAZzdPWDji5TU94VrE Ltew== 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=Ap2+12C/N6FyXSWWkUzDt1y7978WCwEi2YLY9OVOeOk=; b=H7HM9c7/Sb5IfdeD60fPmeV5qFlg6ibkretuVCfoexCFTnjxL3vNZtZxWFswW/cai8 DDlCENNtZc0j2JE1r4C+1/aEctiyzJHzvppKisQEW8wOdmzvIX2mvngrX3pcUS9eIYw4 1zoMdOXvDst5lgIIQIbh191yv2lKESTAxwyHkECvChjOeQnkYemzEbXhmKlkwVjCLaCw z6Zo8lb9gRYQjYyQsuZncjmWM5+DCteAGAShON6e1j8YcJCHY4tZ2ovDv8Ffgx5m4glR o2U26wqMMzMufX0mb5/vM8W22UAkqnBeLs1+xd49QQONkVq6pF2q3lBHhpVQqG/XRcNi JM6w== X-Gm-Message-State: AOAM533r5wHo0RyR4c/hNx/NKfD/rnNbDazDBnYXGDRwXuroVRVfVZ8z H4sDN/GFvYy+LBfFf/cZiEVmxDG27DjApw== X-Google-Smtp-Source: ABdhPJy5SvOR0reQBid+LhOI+u9A/yvBE0eDFSKslhlVNgso9Jg2dGyjf5/U4bKPrxiLXYVMjaW5ug== X-Received: by 2002:a17:906:2f87:: with SMTP id w7mr34147319eji.83.1605857086440; Thu, 19 Nov 2020 23:24:46 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:45 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:09 +0100 Message-Id: <20201120072116.818090-37-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 036/162] avcodec/mimic: Reduce size of tables used to initialize 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" By switching to ff_init_vlc_from_lengths() one can replace a table of codes of type uint32_t with a table of symbols of type uint8_t saving space. The old tables also had holes in it (because of the symbols) which are now superfluous, saving ever more space. Signed-off-by: Andreas Rheinhardt --- libavcodec/mimic.c | 55 ++++++++++++++++------------------------------ 1 file changed, 19 insertions(+), 36 deletions(-) diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 0f8103ef85..7a74b99086 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -65,43 +65,25 @@ typedef struct MimicContext { int next_prev_index; } MimicContext; -static const uint32_t huffcodes[] = { - 0x0000000a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000b, - 0x0000001b, 0x00000038, 0x00000078, 0x00000079, 0x0000007a, 0x000000f9, - 0x000000fa, 0x000003fb, 0x000007f8, 0x000007f9, 0x000007fa, 0x000007fb, - 0x00000ff8, 0x00000ff9, 0x00000001, 0x00000039, 0x0000007b, 0x000000fb, - 0x000001f8, 0x000001f9, 0x00000ffa, 0x00000ffb, 0x00001ff8, 0x00001ff9, - 0x00001ffa, 0x00001ffb, 0x00003ff8, 0x00003ff9, 0x00003ffa, 0x00000000, - 0x00000004, 0x0000003a, 0x000001fa, 0x00003ffb, 0x00007ff8, 0x00007ff9, - 0x00007ffa, 0x00007ffb, 0x0000fff8, 0x0000fff9, 0x0000fffa, 0x0000fffb, - 0x0001fff8, 0x0001fff9, 0x0001fffa, 0x00000000, 0x0000000c, 0x000000f8, - 0x000001fb, 0x0001fffb, 0x0003fff8, 0x0003fff9, 0x0003fffa, 0x0003fffb, - 0x0007fff8, 0x0007fff9, 0x0007fffa, 0x0007fffb, 0x000ffff8, 0x000ffff9, - 0x000ffffa, 0x00000000, 0x0000001a, 0x000003f8, 0x000ffffb, 0x001ffff8, - 0x001ffff9, 0x001ffffa, 0x001ffffb, 0x003ffff8, 0x003ffff9, 0x003ffffa, - 0x003ffffb, 0x007ffff8, 0x007ffff9, 0x007ffffa, 0x007ffffb, 0x00000000, - 0x0000003b, 0x000003f9, 0x00fffff8, 0x00fffff9, 0x00fffffa, 0x00fffffb, - 0x01fffff8, 0x01fffff9, 0x01fffffa, 0x01fffffb, 0x03fffff8, 0x03fffff9, - 0x03fffffa, 0x03fffffb, 0x07fffff8, 0x00000000, 0x000003fa, 0x07fffff9, - 0x07fffffa, 0x07fffffb, 0x0ffffff8, 0x0ffffff9, 0x0ffffffa, 0x0ffffffb, - 0x1ffffff8, 0x1ffffff9, 0x1ffffffa, 0x1ffffffb, 0x3ffffff8, 0x3ffffff9, - 0x3ffffffa, +static const uint8_t huffsyms[] = { + 0x10, 0x20, 0x30, 0x00, 0x11, 0x40, 0x50, 0x12, 0x13, 0x21, 0x31, 0x60, + 0x14, 0x15, 0x16, 0x22, 0x41, 0x17, 0x18, 0x23, 0x24, 0x25, 0x32, 0x42, + 0x51, 0x61, 0x70, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x26, 0x27, + 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x52, 0x53, 0x54, 0x55, 0x56, + 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x62, 0x63, 0x64, 0x65, + 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x71, 0x72, 0x73, + 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, }; static const uint8_t huffbits[] = { - 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 2, 4, 5, 6, 7, 7, 7, 8, - 8, 10, 11, 11, 11, 11, 12, 12, 2, 6, 7, 8, - 9, 9, 12, 12, 13, 13, 13, 13, 14, 14, 14, 0, - 3, 6, 9, 14, 15, 15, 15, 15, 16, 16, 16, 16, - 17, 17, 17, 0, 4, 8, 9, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 0, 5, 10, 20, 21, - 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 0, - 6, 10, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, - 26, 26, 27, 0, 10, 27, 27, 27, 28, 28, 28, 28, - 29, 29, 29, 29, 30, 30, 30, + 2, 2, 3, 4, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, + 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, + 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, + 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, + 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, + 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, }; static const uint8_t col_zag[64] = { @@ -142,8 +124,9 @@ static av_cold int mimic_decode_init(AVCodecContext *avctx) ctx->prev_index = 0; ctx->cur_index = 15; - if ((ret = init_vlc(&ctx->vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits), - huffbits, 1, 1, huffcodes, 4, 4, 0)) < 0) { + ret = ff_init_vlc_from_lengths(&ctx->vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits), + huffbits, 1, huffsyms, 1, 1, 0, 0, avctx); + if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "error initializing vlc table\n"); return ret; } From patchwork Fri Nov 20 07:19:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23788 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 AC79B44AF11 for ; Fri, 20 Nov 2020 09:31:02 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BBA9F68BACB; Fri, 20 Nov 2020 09:24:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3F42168BA73 for ; Fri, 20 Nov 2020 09:24:48 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id cf17so4914644edb.2 for ; Thu, 19 Nov 2020 23:24:48 -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=YQLtcaX2wO0688ZcJd37wdCX99OgTLLdasAm0eIRnbk=; b=RQnJf/ItAuS2yXqFwOPkAI1echmqvz7tzvxoo9lIZz5Cx6bfXIuzgIYSYKEcPzcd2b xH2LTCmRPu8Ihc/EZxuYeJrTDWcYt2RXd0q3bVlCEdNAzNsHLy1anGtB36qWi/9XBW6D ruS934jIaOYIYdSs8+WNxANywXtVLjWXsehOSaYr4pZNMGOaP/qKaLuv4f7tgE2oxNms dBYK6T1WebMIyL4/6DFu2R9cagD8p8hch7njWrB4bo/+wcJnUQ3vf1OIl4gxCH6o0itW fSZGLbDDT7uIezsKJGSV4gbvBnndOpuMwh6LuMs72unpJSEpaloMXzD2SURzvWxbyRSB 7eRw== 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=YQLtcaX2wO0688ZcJd37wdCX99OgTLLdasAm0eIRnbk=; b=kiLiYKLsxU6cghHvcgg8JQbdvnhQBWLwxyyPiu3cFhd+C0b9tvwI0192hxfxq00Zkj R9Wtu36V1pNmD/0l6oGjSzTNJo3qJz5jw9ZDXpMTtPgmwgeYNHjMzj9J5GCFhQwMGtaw TyjM6DzyOaSQn69Se0OcXJBf/2p0E2K69/JBTvB8PGRYbW7szFIsxZChSL50F0SoA7gt t+K+9K3hBbEwZVM4g8BMfzFyX1vGvuVQdg27OfOYVgtcnO5YFGLGoctDAcxkkMVa59Zr meBnGKSQ38ojJN4QOcAAszLcEx8yserXMRw1flVTkNQXlrUuJT8nR5tU1xN1Qi5Y70sd cDYQ== X-Gm-Message-State: AOAM531iRIYM1ap3yylKJhyTZwZuQtBz0T/0MZTvL28zNQeE7yjJY6kM Ge36SfdRxPX3LnXXwo8jxhA5D8C0/bsjdQ== X-Google-Smtp-Source: ABdhPJzVRKTOFueegT2fB2hw6j5zivdJ3WyA2xOzdNEWVGzxf58P8PbLfW1cMbhB+NqvAIRsWeU01Q== X-Received: by 2002:aa7:d34e:: with SMTP id m14mr33178933edr.42.1605857087272; Thu, 19 Nov 2020 23:24:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:46 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:10 +0100 Message-Id: <20201120072116.818090-38-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 037/162] avcodec/mimic: Cleanup generically upon init failure 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/mimic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 7a74b99086..6ceb5c9ae3 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -138,10 +138,8 @@ static av_cold int mimic_decode_init(AVCodecContext *avctx) for (i = 0; i < FF_ARRAY_ELEMS(ctx->frames); i++) { ctx->frames[i].f = av_frame_alloc(); - if (!ctx->frames[i].f) { - mimic_decode_end(avctx); + if (!ctx->frames[i].f) return AVERROR(ENOMEM); - } } return 0; @@ -443,5 +441,5 @@ AVCodec ff_mimic_decoder = { .decode = mimic_decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .update_thread_context = ONLY_IF_THREADS_ENABLED(mimic_decode_update_thread_context), - .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS, + .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP, }; From patchwork Fri Nov 20 07:19:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23789 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 9373C44B17A for ; Fri, 20 Nov 2020 09:31:13 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5148968BACF; Fri, 20 Nov 2020 09:25:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 283B068BA66 for ; Fri, 20 Nov 2020 09:24:49 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id gj5so11498615ejb.8 for ; Thu, 19 Nov 2020 23:24:48 -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=ZzoJ1Glna5sXCwK+emwSt5rQAiXC7zeQ1hVggiwg+SI=; b=T5d+WMa4ybv4iqZlgVonsTtJVoYUymttPCl4D+IfKLlynRrJyyPGkHPKcem23AmLcn 2cRAgh03nT9upHXNJTmtu9Mitls7ILf22I6OixRCaAT6AKG9ojSFYPzPWy9X+OoVo/PQ FJd/7H0GgQ8pSwOtkDlV1w5az1KHXK0pKkU2hA3xWsX4BMYz6lMYxg0T2qpZWwlDOteU 0Kx/a3K91LGMPxWevns+TtJUKW81itWbSBzU+VH5Mdc2ELfT+K2Y4KEquicAqSU1u1gy Gd3MFwUB/phhb0zH3l9mDtSOyh6vFQLx2HduteRqLwJgMvq2yj6PZcNwk2qjVccyB7cr dkhw== 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=ZzoJ1Glna5sXCwK+emwSt5rQAiXC7zeQ1hVggiwg+SI=; b=mlyOC3yvw5HpqPiTOPcfWK7Xv69tytKuj4PgaNDSc2Q+119GeCM5XSPxLfk9TA5Lm9 WdgA/yIRbWNHS8oCxndkrRMv0u/RlOq2Zg6yAJQdq5AqdqVImMlX3ZjpSamIYknmBZpm mNrx6qpnQdFNz9rBw8bzjjZ82qIpiBWUCQdbwrwqLpe28dK7GLxExiA5SP2axV71IrCX /ImaiV4frRjBrTBgeA0kjpWiPGEw3syAweFZlusggs1V2ynWj8XnqICso2697zD6chkA q6Sg/stCaqLTkmDuOlXmXICtqDQS1f7mCkW9XorlmMinfoR/POQokHht+GnTkd2p0cec 5jQw== X-Gm-Message-State: AOAM531GbqmUjCkQwIH0voi93+Ox0iS2j0+U4Eb+b3sdi9qzF8wWYSjv S3aXxUm9QUKZeF6H5Ups8MMgh1bmCcdPLg== X-Google-Smtp-Source: ABdhPJxYjTltpJ1b0Tq2ns8BKXt/PzZ6Y0wpDihocp0bY/kJjUsBBfn8LsR/7bT1gb4mK/TFcN0NCQ== X-Received: by 2002:a17:906:4698:: with SMTP id a24mr33246206ejr.90.1605857088285; Thu, 19 Nov 2020 23:24:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:47 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:11 +0100 Message-Id: <20201120072116.818090-39-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 038/162] avcodec/mimic: Mark decoder as init-threadsafe 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/mimic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 6ceb5c9ae3..60c612003a 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -441,5 +441,6 @@ AVCodec ff_mimic_decoder = { .decode = mimic_decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .update_thread_context = ONLY_IF_THREADS_ENABLED(mimic_decode_update_thread_context), - .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS | + FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Fri Nov 20 07:19:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23779 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 CA1D444AB58 for ; Fri, 20 Nov 2020 09:29:28 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A29FE68BAD8; Fri, 20 Nov 2020 09:25:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5C7B068B98E for ; Fri, 20 Nov 2020 09:24:50 +0200 (EET) Received: by mail-ed1-f66.google.com with SMTP id a15so8502105edy.1 for ; Thu, 19 Nov 2020 23:24:50 -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=RszryPX6U0VBcyesq+m//gnR+m6YgIbOyg2Smq7g/lQ=; b=BttgOQhvROx/IlA98UKrSZImFtX7mX/6xFKIOUBD14J/BLSlKVlg/j6QWSS15FIlsu qpH4MfGuKV/XecPAA3x6IHcvh1SHRbSQVomcR3yWluFpIKzjwRNR34D442fRDD4hupTg poyB6nA2Dkh7sXrmB5Y+c/6i7G23E1axJhtGQHi51od7AgCVXjEie2iK+Y3YzRyX9OR9 p2GlzHCo0pjo31B36ZaKrvP9E/1izaQpvpcQ0XAdFa+YaSsicDDhgB5/RIuPN4QAjOKy pf8oaGKLNiaBeGhKo+BsAZReLu2mKaXPvLrJA5AX0uFRS8CI4NZAhY4/NvEDkMYNkwnb ohMw== 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=RszryPX6U0VBcyesq+m//gnR+m6YgIbOyg2Smq7g/lQ=; b=WLKPQtQAoXhpLG7C3+zkjOwXqX3HJFT60dYcW86qD6RjL56dF5OnWXR/a2j5SCkbHC u01/bEy3f+SLWrlK3atlGQNv067pFfBolZT18tgnvFGwmTiwYHdmRK773rSwx/Behyto /1+4NA9E06ulB2GuNpv5oSe89BM2qkw1Znx1K4DPgl+HXb3f6ZRmRSyAYhfhIeVAE5Ya 2tmN0jeytmfezIRAtZ/jRuUk9KwVjjDacp/+iITnjsxYPoQ0MoYb+IIUxjL7zNpFFc1w uKghSTwuqy8kvKSv6X+2yekgKGSLzc4xvl/xcHhNNX1mXXtwx6EJy+K8YApYGIVusfQK No/A== X-Gm-Message-State: AOAM530IHVJyKrSCeweFMfBblJ/bglFmzlwuPn6F7vvuMGZD12l0qOrc qLUMlJ/3vhek/Qpo1Jrx4PhJOdUo7bvGhQ== X-Google-Smtp-Source: ABdhPJyaVzFodwMJ+BwVWwD3/ZHSMvLyA8fArDNEExvuiA1Nr1gG0PWp7MHc6/fTgKTG4G7GFQPe5A== X-Received: by 2002:aa7:d54b:: with SMTP id u11mr35304678edr.341.1605857089311; Thu, 19 Nov 2020 23:24:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:48 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:12 +0100 Message-Id: <20201120072116.818090-40-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 039/162] avcodec/mimic: Make VLC static 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/mimic.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 60c612003a..ea6a7efe93 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -23,6 +23,8 @@ #include #include +#include "libavutil/thread.h" + #include "avcodec.h" #include "blockdsp.h" #include "internal.h" @@ -58,13 +60,14 @@ typedef struct MimicContext { BswapDSPContext bbdsp; HpelDSPContext hdsp; IDCTDSPContext idsp; - VLC vlc; /* Kept in the context so multithreading can have a constant to read from */ int next_cur_index; int next_prev_index; } MimicContext; +static VLC block_vlc; + static const uint8_t huffsyms[] = { 0x10, 0x20, 0x30, 0x00, 0x11, 0x40, 0x50, 0x12, 0x13, 0x21, 0x31, 0x60, 0x14, 0x15, 0x16, 0x22, 0x41, 0x17, 0x18, 0x23, 0x24, 0x25, 0x32, 0x42, @@ -111,25 +114,24 @@ static av_cold int mimic_decode_end(AVCodecContext *avctx) av_frame_free(&ctx->frames[i].f); } - ff_free_vlc(&ctx->vlc); - return 0; } +static av_cold void mimic_init_static(void) +{ + INIT_VLC_STATIC_FROM_LENGTHS(&block_vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits), + huffbits, 1, huffsyms, 1, 1, 0, 0, 4368); +} + static av_cold int mimic_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; MimicContext *ctx = avctx->priv_data; - int ret, i; + int i; ctx->prev_index = 0; ctx->cur_index = 15; - ret = ff_init_vlc_from_lengths(&ctx->vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits), - huffbits, 1, huffsyms, 1, 1, 0, 0, avctx); - if (ret < 0) { - av_log(avctx, AV_LOG_ERROR, "error initializing vlc table\n"); - return ret; - } ff_blockdsp_init(&ctx->bdsp, avctx); ff_bswapdsp_init(&ctx->bbdsp); ff_hpeldsp_init(&ctx->hdsp, avctx->flags); @@ -142,6 +144,8 @@ static av_cold int mimic_decode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } + ff_thread_once(&init_static_once, mimic_init_static); + return 0; } @@ -221,7 +225,7 @@ static int vlc_decode_block(MimicContext *ctx, int num_coeffs, int qscale) int value; int coeff; - vlc = get_vlc2(&ctx->gb, ctx->vlc.table, MIMIC_VLC_BITS, 3); + vlc = get_vlc2(&ctx->gb, block_vlc.table, MIMIC_VLC_BITS, 3); if (!vlc) /* end-of-block code */ return 0; if (vlc == -1) From patchwork Fri Nov 20 07:19:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23790 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 67ABC44B17A for ; Fri, 20 Nov 2020 09:31:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C43F768BA9C; Fri, 20 Nov 2020 09:25:02 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4ED9468BA7B for ; Fri, 20 Nov 2020 09:24:51 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id s25so11496100ejy.6 for ; Thu, 19 Nov 2020 23:24:51 -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=bpvjtuL0904bHagDoLTOGnC3g0rjuC8b7GCnYbcjLBA=; b=X22EoSDO7UNQq8X/ujZGCODPQs7Rpp1SUhZqxWZU5wSVYAjEttE0hBK93B+XXYFiUp /KQneIwGY4SIkU4SMMqVlAylP8KtU4LWtvrCu2c0OQYuAm2XRmd96Z1yF/DAHEUI4L1A Ka386Mp4ufPn7FnHLqMlhzCj2Kuk/+n82TqjHPpHhh+zl/oqLKPMCLF8FbU9Fqg5syQA YXqAMUu1xR0We+wIajKYGJ++2otlut8uqnKrsWACKcrErqA1fOO7ZtYOXYnEOfJbNiJR TBrFQF2yECn3Rxty/1/Uc5uQxDM9HyckvfmmY9/pNecPM43Km6QC3kwa/MxZd+iltIX5 0CsA== 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=bpvjtuL0904bHagDoLTOGnC3g0rjuC8b7GCnYbcjLBA=; b=kV7WbB7mYeagVA8ID06QguMVt1XSGACccAwv3wRFC1JVwi8bjde/Mxk8t7uPOyZIM+ oHUwPuCl4xbeNavjoCCefkqSg/82cnPUoEq42HALXWxUcMzNtGwHPXZZG4D6OBM6YiBP X4NgBi4HpdBRkL0X0Rgy/Ff/rE3HaFbKTd1QuUs91c5m/mLGj9RG+yHvjf3j9mqXxm86 JPrpONgXVj134SCInxWJrCXxBdYTR4m4xp8RSX9S6e8QC/WYqq6eSw1JKXjPvW9a6bhh 56QLAoYC1FT4uuSbUNjJUuS5Vucx6d5OjkwDm84/p1ErrgCLS7c4YmMFPM6+U65Gwbsn +dQA== X-Gm-Message-State: AOAM5323KAg3Lws+JWOO+Hyl83tYiqxCdqNjunocwMzpe/FhtVfpH4Sd SjqMrnNCVwynXOLGQJaB8uH2GzwnKPdTxA== X-Google-Smtp-Source: ABdhPJwC+Ep1vUUMC7MfMSkIkK0+5TXAP6oeklGWYOW5YJNi8GNJvunLz4ybIQbya/3s+W4GVyCMPg== X-Received: by 2002:a17:906:79c4:: with SMTP id m4mr30647821ejo.26.1605857090431; Thu, 19 Nov 2020 23:24:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:49 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:13 +0100 Message-Id: <20201120072116.818090-41-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 040/162] avcodec/motionpixels: Only create VLC iff it is going to be used 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" If the Huffman tree consists of only one entry (which has length zero), no tree is used at all for parsing as the VLC API currently can't handle this. So it makes no sense to create a VLC in this case. Commit 41b7389cade702383e59343561776f83bb26e17f added a check for whether creating the VLC should be skipped, but it also skipped decoding the packet and it used the wrong check: It checked max_codes_bits, the maximum length of code; but this value is only updated iff there is more than one Huffman entry. So if there is only one Huffman entry, and there was a previous frame with more than one entry, then a VLC was created unnecessarily; yet if there was no previous frame with more than one entry, then this frame will be skipped which is probably spec-incompliant. I have no sample for the latter. This commit improves the check to create a VLC iff it is going to be used. Signed-off-by: Andreas Rheinhardt --- libavcodec/motionpixels.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index b48200b017..0bf153f883 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -324,8 +324,7 @@ static int mp_decode_frame(AVCodecContext *avctx, if (sz == 0) goto end; - if (mp->max_codes_bits <= 0) - goto end; + if (mp->codes_count > 1) if (init_vlc(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[0].size, sizeof(HuffCode), 1, &mp->codes[0].code, sizeof(HuffCode), 4, 0)) goto end; mp_decode_frame_helper(mp, &gb); From patchwork Fri Nov 20 07:19:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23951 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp952581ybf; Thu, 19 Nov 2020 23:31:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwm9ty2woRUD+ZW5IehnGDJLgZ2sYZnVkHVy4P4oB7BS+FhBILvezNQO5JzOuFTQ/DCuDSu X-Received: by 2002:adf:8521:: with SMTP id 30mr14428985wrh.265.1605857512052; Thu, 19 Nov 2020 23:31:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605857512; cv=none; d=google.com; s=arc-20160816; b=0xpbR0/vmhmG7yehHIHBa62d1C0tN+NDVmerkxlLGf0NT2ibyGVprpsGC87L/gbpkH j0hEZTH0JjWEUgMe2UM+jRi9gNvWc4T3N+98N+LEchGa38GdKNElYoOtQ5V04/4YAWoh CVXWOVLfv11EhdQGI2V+l7LVlimd5bBA0VxyU8gmqIrj27yyW3er28liefou4V7oX/1C ZBzlbE5DDEj4pcSxz9CErSuy+M/cswWxHKElMkqwZEs0x7/xSjVDzUuwdKkSXKvSuSg4 emNaD9sYKcmrU4Qxa/L13Abrw+XGDiV0xC9qOjbHXMVyJ2dp95AoizXXbA8aO5XK8zU2 AzXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=oNZhG91+a9w6HMlPecdD4xwyuC3o2CTlWdV1U+IAu/E=; b=HXq28Hh9oAqcF899yMhTL2UeKUsu8MTi9oscyAXMt9jKTLWWYPpOqRyh13rAmkKmAi +F3Tg7HyzCJIsaQnZt2u0pmnTZ8dA0WjfH3O6bMcYIpqe+40t3fUkUDgwY1y8WPyAo1/ vzkWvyvaUpyET03hnKU9jy/aC5SOPVc20+xYn678blYtxbyi7wAlJGcXl6qj3+D16rzE OZP8k7Ye2Bhjgq0vWuFk9q1s96kTn0CzPv61kGbUa52IS4mQhrOEX1be/PIE+34QXGcP MTSIENbH6q0sFV74Ga3ius4mN7k3Fw2tgdZdv1XUSUQPFWgA3BH+Bkx5UVbVYNUAKXXD zCzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=jSjScmJo; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n13si1893610wrq.468.2020.11.19.23.31.51; Thu, 19 Nov 2020 23:31:52 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=jSjScmJo; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2438968B9CE; Fri, 20 Nov 2020 09:25:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 33AAB68BA74 for ; Fri, 20 Nov 2020 09:24:52 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id f20so11491393ejz.4 for ; Thu, 19 Nov 2020 23:24:52 -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=uhY475YTarCSb7i4v9IBQ1qRt7Xat6ivhYCZpmqev1Y=; b=jSjScmJoyDYc7XxVYAdf8pPhWmtSmx1mDY3Ui4bqxhwMJnvqJffFkZW9i6VQnS5Z9w pWfplQA5L7Vc2Ab0kbExcd3Ze7UzFxbBMnE1lLRMyHpSimao8hwy+XLPYlJzO9r/L1um Egl6GRuiDq62KmjmNY2jadvWGtNIuIw5RKNU/rCvPT7wl2rQe3HmQ1DQEixMzNCi17LX ciEJR3EcaDHTgDUxQcyYZ803EY68XVgbnngvLEqmbdLp/OkXqU9TYhZDO8EVw5TDwCbl SsZI8GEB/2i3CZHfdG04mbzhi3xZSZb8175DFZmjNzH9u1HjSOonOFyZh3JPzN8+YwDL GYRQ== 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=uhY475YTarCSb7i4v9IBQ1qRt7Xat6ivhYCZpmqev1Y=; b=dWDEMmk9WhQyEzGdRYBnpU9I1cK0mQRAziUP1M9vGV7d1KHHR/6DsSrjhN62Re16Im 2807dzV7XoLzbhlPqxckOrOL7MQlr66I6LkdydjdshdEBVX/wl3OhyfXj6Lj/0fQRT0S Lv1x0I0NkAQ2CTCM8I6GSDTdd1haYQL8Ju5CLx8peHqSsrtBoxt3P8F75Z9Pk24qCJff SphmNAU673imB9s1u+KL8JSEQnmMkgVKDbvY/heB4tXHypMzeCePeijwWaMRVGxQ9CVq IjF9Jp5dQFVLId6OdIGGjD2beIMuOwxz9IZJ+VH7rjttYuS/5/GfUZ0M6BjRoOTojWZF 2Lvg== X-Gm-Message-State: AOAM533G+hLEUG50bfOcpntuhB9qCucX4l67HhhvlHxmAFc6tngJUbiN MnT2xHeDftQm5YTTOD6yisgTKwA4jIQ5XA== X-Received: by 2002:a17:907:94c6:: with SMTP id dn6mr30639093ejc.13.1605857091381; Thu, 19 Nov 2020 23:24:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:50 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:14 +0100 Message-Id: <20201120072116.818090-42-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 041/162] avcodec/motionpixels: Be more strict when parsing Huffman trees 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" X-TUID: Kruu7lgPe73D Content-Length: 1694 This ensures that the number of leafs in the Huffman tree equals the number it is supposed to be and therefore ensures that the VLC tree is complete, allowing us to remove checks. Signed-off-by: Andreas Rheinhardt --- An alternative would be to use current_codes_count to initialize the VLC. libavcodec/motionpixels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 0bf153f883..4b9830fbed 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -133,7 +133,7 @@ static int mp_get_code(MotionPixelsContext *mp, GetBitContext *gb, int size, int if (mp_get_code(mp, gb, size, code + 1) < 0) return AVERROR_INVALIDDATA; } - if (mp->current_codes_count >= MAX_HUFF_CODES) { + if (mp->current_codes_count >= mp->codes_count) { av_log(mp->avctx, AV_LOG_ERROR, "too many codes\n"); return AVERROR_INVALIDDATA; } From patchwork Fri Nov 20 07:19:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23956 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp952636ybf; Thu, 19 Nov 2020 23:31:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwymIHOBrtrRA0IvxkMwuUTugbols8P2+bgHnVloC7zexoAfn50SYr20kT7U3KGcTE69gvG X-Received: by 2002:a5d:6692:: with SMTP id l18mr13542701wru.44.1605857519375; Thu, 19 Nov 2020 23:31:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605857519; cv=none; d=google.com; s=arc-20160816; b=YuUXEk6O9hLds4mxVXZ2fX6NRKe0Po+V/SyPPLLi7f0Fz4o4vGTXVr5nELlJAvSiKl JDDv32UMnO5lOksJcok9X+3W3682X9Kqa6cpk8qujUC+aNG9A15DQFY0V0bSzpS4g/XX miYUO28tzddoHXIjApDeL/7xE9Pm1T01CcZTVtfGWmuKRYQAYAahzAZlUm7GMomdadlW Dz+IeUVtLAqMa+CkYPkXhZ7CjLJJlurFvgcxQAu4SGtLEqnU+y/kWeAQT4STU0nluqwo 478pUNGQnXGlR8MkwH/Aosl1MWW6Sg2n+sa+O10vY1mp8J/K4pjhKXWZgIQqbcINofT8 2kcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=D1LCTU64CpVYUTrNO5UXqn3mqW1HSh4SjOynWtqVW7o=; b=xtKExW628ZcoormTuLXqv4WqagIYCBXhqJzDPptibLlSXTV9siIhEJR/5wDcRoL2Q5 Aw9ofvS+RXiLxjmvI+l/sUiz8B1Mvzd7GImSLcJbXUFnbqVEmlMq7MuhMShtqEtvRjBZ MFipABd9q07GG+x7w/iOfhK1mm3CgY+PM3LlIBmEucEzufG1yWXnp2e6KNH4Av7/h6Ul VC29jmWc2Sx+SvqQ5fxVkOzxVNHTTYgG3/2Kk322HSDe392mmkRY08uWAdUbeFEFa++N h6NzORE7lpOsIJIMydGK0XQk1BUGMtmRTeD923mKHTeHsKFwluqC2NJXkET2q9Kr+Dca jXng== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=PjteFTTc; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j127si2221983wmj.74.2020.11.19.23.31.58; Thu, 19 Nov 2020 23:31:59 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=PjteFTTc; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D7E7168BA6A; Fri, 20 Nov 2020 09:25:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 784B768B9E9 for ; Fri, 20 Nov 2020 09:24:53 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id k27so11454067ejs.10 for ; Thu, 19 Nov 2020 23:24:53 -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=2/IFLCyEeWmbl8ycvYjex9zNCQEceBHcvIRlS5YSCgU=; b=PjteFTTcW19FLfttkv+gPzvvCdzb1dgS18w/jEth1Z0lbDd9rqEzoJxIIbZtWlqnH+ 01xDuHGrZUK52Dg+fo4Mh56gFdel9gqf0qHbXrBKdke9SkIU3Gar2l2decPbHyGC1kan SECAc9fUhMysNZIuDTIzzmpEh845nEdC4mSizQFR5B4F7LPx5Dps/Lh1V5X5qJwe0eXt 7iyZ2Hs1pNFEjzdF3v4lAYlF1A+iXblxuAUkscTk609fndKbb1W+Nb0qp4qPPOaimqbY 0RqRmKvg+a9TtMCJdf5pQE/XdZiXUhibITAxhDwedkRCRqBeU4gOOuTpivEIRpht1Xlg SmwA== 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=2/IFLCyEeWmbl8ycvYjex9zNCQEceBHcvIRlS5YSCgU=; b=TcStEkPW5VDHM+ZAiPrSmXBfpJj5LNjrJ4PKSktgnW5Bn7IZok+2I/mZuToMBhvSSA Tzu4oW12RrjAdmJxHVNw/8FzQx1tUYZ84zAgUELixu5LRnstIjmbbWH+f34FswPqgRBq xjnThZbQeZYPI2/x7bqYx1zqbXxXi/1i6wotc9RAuAY0HpUsD3B3ad1AsSyDzM2Zx7Nl +/pPLoO/sTc3dq33fpPCH+oR+reeokQ6XJCAwdYqn5VzC3C9OZjPwj4tNojQibcsfb5+ yt4SgJbXUya804NEbGjs9NJUGA2bOIln/c+/M5dxqyC2ZRyXORw6JNKduKsmeGQ6V6vB jkKg== X-Gm-Message-State: AOAM530U1g9uZ0ODoZeJcgwEoCBIxTtYUxg9MFxy/x59yU8jpkdewyWr mynJHmZHHoxh5CYlxkL97GLN6AfFFKBw6A== X-Received: by 2002:a17:906:b14e:: with SMTP id bt14mr743068ejb.226.1605857092734; Thu, 19 Nov 2020 23:24:52 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:52 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:15 +0100 Message-Id: <20201120072116.818090-43-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 042/162] avcodec/motionpixels: Don't check for complete 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" X-TUID: 83qCGK1GVNrS Content-Length: 1273 The algorithm used here always creates a complete VLC, so it is unnecessary to check this again. Signed-off-by: Andreas Rheinhardt --- libavcodec/motionpixels.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 4b9830fbed..a65250efe5 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -195,8 +195,6 @@ static av_always_inline int mp_get_vlc(MotionPixelsContext *mp, GetBitContext *g int i; i = (mp->codes_count == 1) ? 0 : get_vlc2(gb, mp->vlc.table, mp->max_codes_bits, 1); - if (i < 0) - return i; return mp->codes[i].delta; } From patchwork Fri Nov 20 07:19:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23947 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp952794ybf; Thu, 19 Nov 2020 23:32:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrNzDWoFk3baV9TjU6extzmJg+HQlNgQ6cqS2wGfAd2HC/yno4hYGGDpNIzg2esoxOYFpW X-Received: by 2002:adf:c3c8:: with SMTP id d8mr14246879wrg.366.1605857539500; Thu, 19 Nov 2020 23:32:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605857539; cv=none; d=google.com; s=arc-20160816; b=qkFoSm0O3WXVN33K3B7zTwF0ob6kZp91/b/OPg1lfg6fOjHpx8WNBk2NkEQqDJJcSA 0EYfEZ8LYFyns3oTJoovrVtm1bVoI3bK6ylrQBsPHvsGUGhM+GzyNJQvCziW77U15q4N 3iEkRiW1ZlJnzireJuPW2p4JMppxGvbL6OL/VJT4Hc3kdrE3LDx94rrKmCqok+I5/UR3 lo+jtCJVkggBZ16+IeHyYXnYYBbp9GUXopj5c6I55d4RLShLQab9Unkv2ZEgrbfN72bV YWQsD+EYxw4dy47dK++qv4V1fqTyeqqs8FbOET/2I+2FvmMvYb6DZoGnItO4X/+TD8e+ jkvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=SHNTlb7uR8zzLd17qvNyn6s2IXzYoJF+Or2n6dB7z14=; b=Bg01tMDQXUu3ceaFU24vI6gpq/7w8V4t2Dp0u/jb2hiT2998h2MzJsBF0MXdHGyTri TEg+BqXFB5vAvP/WRfScQ7Aa3H2fzrVzEU+TpbF6PizTBotywnd2IUbssU9TahUYlrA+ g9/v/JVLc+BAbZUiKMblEMyebL8zJ65gSzbVoQ8vHeeBKkCMzAN7rdODz7PVe8a9VCb7 90gZxAJrsll4zMsUxEJDqVTGMWJEe+sbznX3b2MCtNfUr04XQ2pw+oe6q0wZtLdIHP7C ZnlYNyCbDiEseemK2CfS4fw+Ki6JP723Z5a5Bs8MZCmCi4tp3AEl7AzVYg8TxTARubCR xN1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=cngTFlKI; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 22si213507wmo.200.2020.11.19.23.32.19; Thu, 19 Nov 2020 23:32:19 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=cngTFlKI; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 94FB468BAD0; Fri, 20 Nov 2020 09:25:07 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6B12B68BACF for ; Fri, 20 Nov 2020 09:24:54 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id k4so8505770edl.0 for ; Thu, 19 Nov 2020 23:24:54 -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=UeqgSPKZskcNQGrngNAXnbSNdEWUtcJxlHQ9bDFmTLI=; b=cngTFlKIvJ7ke291WKzdJcHr9G3gAoVL3o4nCVNWUq0MrdJQez0VJJYdljpbnNenCv CcB/K0bXb3ePxgQ4+tQ9/x6ePVREPRcf77EBOUNwFGomA7hWLy6svOvs3V9t9GRfRdxh 5nVd6iPj/dCdNX+3zXebXmjoJT8KLZSUHgABzJ40wkzhxodLOH9ZxpcxAApP1BZfP9y5 FWDTEUe0BShs1UKj0oo+er6apDVeOF4/foU8swRJxRPhhxDvNIZRbaa/0q9I7locvQVo F3B5ar9tdUPHjhefa/up9+bgRCNwJDNZbQQCZGDqnBlCPMVLTqWwAYPqYaJkalHtO3k0 qt4g== 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=UeqgSPKZskcNQGrngNAXnbSNdEWUtcJxlHQ9bDFmTLI=; b=iqeZ6UJ16rEaJWvLlMTJ2FpANKWbX+by7rBOsD26ItGRWTAhQ0oc42hQgIxzkL2Tvs euB9UzN7+7YPp3hrZd+23jh/UdaHgRA4m/yAPArx0lcILTrH89cH0uf4rznIPUs4K/EK SufDXjp1hmD1R4dU5FF6LfF8KGoO3uOpjOC4lX6dwIqsTlXwKLgSqUf1qrJl0FpEjkgG wps4+Ar+EVSG+doQ1JsfpzUa/M+Lcyt6tXVpzWUxOsQghcXUdgiXJ75OGNiCvW08Z+P1 8YQmUvdzeNEs12XH8aGSUNmrYYn4aQvIh3gNvvqQv91ZJo1hDdG6SACNjKaNAc4/2XWb yDKw== X-Gm-Message-State: AOAM530Jwozsz+j0h9ICulH78R3HBWUlyaBSEK/C9bzgdHMto44s74wJ TmayE1W1SUb5Rj1TLVxyDi4wjt8rgIOAHg== X-Received: by 2002:a05:6402:1284:: with SMTP id w4mr9831530edv.324.1605857093657; Thu, 19 Nov 2020 23:24:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:53 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:16 +0100 Message-Id: <20201120072116.818090-44-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 043/162] avcodec/motionpixels: Use symbols 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" X-TUID: c4hVGNIA0U6h Content-Length: 2728 If allows us to directly store the deltas in the VLC table and therefore avoids a level of indirection. Signed-off-by: Andreas Rheinhardt --- libavcodec/motionpixels.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index a65250efe5..927f9fdc14 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -192,10 +192,8 @@ static void mp_set_rgb_from_yuv(MotionPixelsContext *mp, int x, int y, const Yuv static av_always_inline int mp_get_vlc(MotionPixelsContext *mp, GetBitContext *gb) { - int i; - - i = (mp->codes_count == 1) ? 0 : get_vlc2(gb, mp->vlc.table, mp->max_codes_bits, 1); - return mp->codes[i].delta; + return mp->vlc.table ? get_vlc2(gb, mp->vlc.table, mp->max_codes_bits, 1) + : mp->codes[0].delta; } static void mp_decode_line(MotionPixelsContext *mp, GetBitContext *gb, int y) @@ -322,9 +320,14 @@ static int mp_decode_frame(AVCodecContext *avctx, if (sz == 0) goto end; - if (mp->codes_count > 1) - if (init_vlc(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[0].size, sizeof(HuffCode), 1, &mp->codes[0].code, sizeof(HuffCode), 4, 0)) - goto end; + if (mp->codes_count > 1) { + ret = ff_init_vlc_sparse(&mp->vlc, mp->max_codes_bits, mp->codes_count, + &mp->codes[0].size, sizeof(HuffCode), 1, + &mp->codes[0].code, sizeof(HuffCode), 4, + &mp->codes[0].delta, sizeof(HuffCode), 1, 0); + if (ret < 0) + goto end; + } mp_decode_frame_helper(mp, &gb); ff_free_vlc(&mp->vlc); From patchwork Fri Nov 20 07:19:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23952 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp952943ybf; Thu, 19 Nov 2020 23:32:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2cm9VV0upNdhDOj/QbTxVjRMGG+GXvRjFoRy+/pyP7Yoph6i0QIVT9zL7Je3runZENl4T X-Received: by 2002:a7b:cf26:: with SMTP id m6mr8857732wmg.121.1605857560346; Thu, 19 Nov 2020 23:32:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605857560; cv=none; d=google.com; s=arc-20160816; b=OwYBX+QO4tEU5qbBe7T/gTAzaMD7tkPycXlaLK4xTRb2sJtU5xQgDe9FhrSCHSm2/g wyvovM9jI85z61Fj4nivfeTSyRxKEMZKyMAA5Emg+7qubX8EbPrDtPAAEWZvrqfaaZEc TltxvIUQXuCjVd+Gpcwgck9nxBL1dN8i2hZevdrP/ItwKZ7a/QSYqp7yE030Un9zU3ld 66p7O9WPPwy/p9X5E6S8U8x6W4fIx5PHgnsk9gNu8xKt8luByk6TlIb5gwdYVTwWsbDF Pdt1c5Ql4xt0ViB9F6KDWQXKh9JiLHV3cu45oZjIh/n84Q3yQdjw3eh0lTOVHmN3wEUC Is+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=YdNFJwfGgTduXpg0F8BYTX/BvyS15mjevyu5+AJ/few=; b=os7sIT251B06WCK6532jAeLbreE7mS51yKNOUSPe+Iejz8ou+Tg5HsYwCZC1Hr5oNP AAoK/ZXn08KO7o8ILplDZaEnHLs+GLFKr4QxUTCIO4ytz9lSOQwYwshxLRTv4iai7l0p djYxWv/DuhtCDBnCn92b6VnNRGChcwg9m04CmE0V7LX5WolvhGQuIlg9CAmDayOQTxBI T+pAi8LtW1uWAmCGRYnsTwWjFXtHZ6hVI/MWFEgYIUp+gEg1rbj258DBL7vY7t0hgpWZ cWJ0lkpa6MuU2Iob8p7r4sFqmNl0fB3Azg6T7bLx6zp9CdTJp+W4Wl/sphuRKkjwucjf 94WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=MquHuiIy; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id s8si2149913wmc.213.2020.11.19.23.32.40; Thu, 19 Nov 2020 23:32:40 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=MquHuiIy; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 450BC68BB17; Fri, 20 Nov 2020 09:25:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4B68D68BA96 for ; Fri, 20 Nov 2020 09:24:55 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id 7so11519479ejm.0 for ; Thu, 19 Nov 2020 23:24:55 -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=KAu7ZH95vEHq3HJduB9zKBPyiJykdWsMBpt7LGL8qII=; b=MquHuiIyWJ3tgMn1vwvDNkoUbyFvpYO5hCTHhYIycKte0Qzfgj4rUyRuRcCM+hodEq GNguDoV9ez4F0aAz8aCV1lqAZgu3GkQQrA/EW3SDvmd9e2OIiYyUxQMq60D4549eF4vj hpaFhVOQP4jvR8fdqym40vWfeV3z4rRtZHV0o/mYBj9Gk1XLAzWgpa7q4E43yFW1DteF 9CeEbBzASaSxX+7YDCUkviA/NbP6nF6JjDiKEzO+idhBA4b/qXgV51OJQzas9pxRTMhq viv3G3RhkY3uW5qZYZt8eYPPOqQqegCTkRvsq37rUG+v1zgVTIcK8ciGU3wcPz4PtTqu 2uNQ== 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=KAu7ZH95vEHq3HJduB9zKBPyiJykdWsMBpt7LGL8qII=; b=aEfzzr452OtKYUGEbMN+oYXjm3mDZD8+CHUVUgVW9vPkp+QPyoX6H5mazVCSbK0edZ 4g4uxNDGlRqkOsMe12Sf4Wv4JZ3urmjpMXkDw7n8yuZTMJmQumQU0ts87TCB5I9ZtgKg pSvMIR7eVWQaOnBdA6JCwWe23IyeC6OProLLNsoWF6btu3lFOPq92ZA/gDp4hmWoz8xz z7uvBBirK+J9p5xAvk6qJ3Bstm+R7iN5rIVxu4jN3WyGLlyKs4cxp0y2oHv1wQoVho5O +OhlLFrDR6ARgiyevbthGlrXIFP8GB6hSSDD1gChggrvlnbJ73NkGBbWwKCV2X9Eb0KP X+dg== X-Gm-Message-State: AOAM533++bIMUa5jWVwAIE0FfRQ6EIsIvMdPceyi8WELfX9yVmdfDlf8 nfhn36eUlAAqZAp4ZKwATGe3LgWtpnxnPg== X-Received: by 2002:a17:906:b0c5:: with SMTP id bk5mr14493577ejb.217.1605857094586; Thu, 19 Nov 2020 23:24:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:54 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:17 +0100 Message-Id: <20201120072116.818090-45-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 044/162] avcodec/motionpixels: Simplify creating VLC tables 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" X-TUID: wofgvZroBseE Content-Length: 4746 By using ff_init_vlc_from_lengths(), we do not have to keep track of the codes themselves, but can offload this to ff_init_vlc_from_lengths(). Furthermore, the old code presumed sizeof(int) == 4; this is no longer so. Signed-off-by: Andreas Rheinhardt --- libavcodec/motionpixels.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 927f9fdc14..22deb9d1bd 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -29,7 +29,6 @@ #include "motionpixels_tablegen.h" typedef struct HuffCode { - int code; uint8_t size; uint8_t delta; } HuffCode; @@ -121,7 +120,7 @@ static void mp_read_changes_map(MotionPixelsContext *mp, GetBitContext *gb, int } } -static int mp_get_code(MotionPixelsContext *mp, GetBitContext *gb, int size, int code) +static int mp_get_code(MotionPixelsContext *mp, GetBitContext *gb, int size) { while (get_bits1(gb)) { ++size; @@ -129,8 +128,7 @@ static int mp_get_code(MotionPixelsContext *mp, GetBitContext *gb, int size, int av_log(mp->avctx, AV_LOG_ERROR, "invalid code size %d/%d\n", size, mp->max_codes_bits); return AVERROR_INVALIDDATA; } - code <<= 1; - if (mp_get_code(mp, gb, size, code + 1) < 0) + if (mp_get_code(mp, gb, size) < 0) return AVERROR_INVALIDDATA; } if (mp->current_codes_count >= mp->codes_count) { @@ -138,7 +136,6 @@ static int mp_get_code(MotionPixelsContext *mp, GetBitContext *gb, int size, int return AVERROR_INVALIDDATA; } - mp->codes[mp->current_codes_count ].code = code; mp->codes[mp->current_codes_count++].size = size; return 0; } @@ -155,7 +152,7 @@ static int mp_read_codes_table(MotionPixelsContext *mp, GetBitContext *gb) for (i = 0; i < mp->codes_count; ++i) mp->codes[i].delta = get_bits(gb, 4); mp->current_codes_count = 0; - if ((ret = mp_get_code(mp, gb, 0, 0)) < 0) + if ((ret = mp_get_code(mp, gb, 0)) < 0) return ret; if (mp->current_codes_count < mp->codes_count) { av_log(mp->avctx, AV_LOG_ERROR, "too few codes\n"); @@ -321,10 +318,12 @@ static int mp_decode_frame(AVCodecContext *avctx, goto end; if (mp->codes_count > 1) { - ret = ff_init_vlc_sparse(&mp->vlc, mp->max_codes_bits, mp->codes_count, - &mp->codes[0].size, sizeof(HuffCode), 1, - &mp->codes[0].code, sizeof(HuffCode), 4, - &mp->codes[0].delta, sizeof(HuffCode), 1, 0); + /* The entries of the mp->codes array are sorted from right to left + * in the Huffman tree, hence -(int)sizeof(HuffCode). */ + ret = ff_init_vlc_from_lengths(&mp->vlc, mp->max_codes_bits, mp->codes_count, + &mp->codes[mp->codes_count - 1].size, -(int)sizeof(HuffCode), + &mp->codes[mp->codes_count - 1].delta, -(int)sizeof(HuffCode), 1, + 0, 0, avctx); if (ret < 0) goto end; } From patchwork Fri Nov 20 07:19: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: 23955 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp953054ybf; Thu, 19 Nov 2020 23:32:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLP3rYMDHEdpVwP25RSexCimqRvGpF+9MU31xJmaxLkQ4qdwbm0i/t5L2t5ud9ErFEHd/m X-Received: by 2002:a1c:7213:: with SMTP id n19mr8169930wmc.36.1605857573736; Thu, 19 Nov 2020 23:32:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605857573; cv=none; d=google.com; s=arc-20160816; b=qDvawZHBgZxp/TOcgixfunWpwBEIs4M4LfBbz+MKnf5VT6a0oDVEzh0ra0ux8BHKsb 6wwWTjxtQIwTMscoS6Z57DtxJ0B6Tf44uXJ72fFFx6dbo0ZG04KmF8E215A4tHBMmUBt ycEPUkCphtmFoDau9Sy6vSnHsYZlgAbiWmEPXZY/lJ968HjLg1f12JwnVPKgjCMYZxUa jXwi+pIiRpCxZeThP02asoNuZqC/FD8GSwOxjz2heeKv4oCgyjV5nVO9bg3Uz3Hplux3 0gA3f4PlKM843BVhlmb91T1XQCbwf1YHRl+AfZgso2ldNE/3wJS0qohjqHQ0eVl/X2z2 5GfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=Igc6sugHLmKZpJKjFWgYFXgkZRWvuwBUkLDbd5Fh1bE=; b=cNpfKQWLgfhnGrWUu9bq8A1oR1JDgczIlKm1qkVrME86Gk5Q9ZHSbW6UWnqOlTToGW qV+YCFzztIZ80r+Jem4DoNWHHPyUJ6ehHRdYHQ/KwBD1fPJcvoGaWXfxiRulQYmgnDQH zx2i2ZEUvfag1HdmkpiYo/iXjNY9Uda7w/8VXAWC1zUP4zbZHaYgeLDq0XTyr2IwLFzL Xkx70RefsBRaHQMIqdhRS8tMoqKxtX0zbFHcXZx8qisKeUtCnU4krUyntCY0V5dbjrxa +SQg7pPLsQN7w7q6oDOW6Sbxh0jzNoKsC0vssME9rIy2PYMAOsQvd36wkkMnbLyGQPuF 39uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=iyphQvKv; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r15si1988112wrc.73.2020.11.19.23.32.53; Thu, 19 Nov 2020 23:32:53 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=iyphQvKv; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D458668BB18; Fri, 20 Nov 2020 09:25:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3BBE568BA96 for ; Fri, 20 Nov 2020 09:24:56 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id t11so8444576edj.13 for ; Thu, 19 Nov 2020 23:24:56 -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=HIzgKoQZ3nYbCFBYOione7jDywAp9ctLnoCwEsqQMb8=; b=iyphQvKvn2UdZcPyzcnvbCkdnL+BH6ffAEeeljbsof4Ag20wa4SiTswB+9d6wPRxD4 +qMsz/jFc85AiUfXLprYq/57PdruLJxTgSlmX9v6MXkRvH1ChjaxPUnAiDz08XTCGds/ KAlk83g8ZO1DN2l+81GgGe6PruXpM4/XTZw39HljeNLkbaC6gpD8d7muzOs6bTeKb53H yUvPCRwCjtvBmPtYSg1q/RgiWhdT0RIAQPRaRalwsKo0z2YXDqGjPIDoN8Kjs0dJrfOJ NNKBm/J9a2aww0sYZ8R8koPBPziYfR5ZE7PmAJdyoQym5SHyF5ZTjl/rHWp6Qk04eewl 7cHw== 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=HIzgKoQZ3nYbCFBYOione7jDywAp9ctLnoCwEsqQMb8=; b=GctSml1aWw08kT30rDlQAr9HOke8AyKhwQasZfDwc7rMJO8G222Z/B6cEZJl5Qdx6L bDnC9CSGH+FH3pIFY/ndoqv690a+c7gf/1h0UnhZTGTUs2AqcUQ9o5SZP+fqLKw3upPj MoF/MbViRyyEB4XrWCw3exmaYffMIAd/0Wtu3I2TW7Ad7W+uYvEDF9PnOg49NsS9RADF h682QVnGLRwWKRacz9LpHSrnJvhfWcZdBpVt9xtUE0vSu2Lh/ilQIUUlww8QESeCBVBs oL1kI5R+bjJ/n8veV9D6DpFyVQkq89hw+lMfPZK5tBt26UfnrglNB+Aak42+mtIYcp7G 2CKQ== X-Gm-Message-State: AOAM531cUm2NHiIJYRx9fgx2taUPgUvSGq665+SGNqDSXGDouVccrqqr N3en/3tYXrNYvocwEDnkJHaex20ByxXqHw== X-Received: by 2002:a50:99d6:: with SMTP id n22mr35160291edb.261.1605857095489; Thu, 19 Nov 2020 23:24:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:54 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:18 +0100 Message-Id: <20201120072116.818090-46-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 045/162] avcodec/motionpixels: Make decoder init-threadsafe 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" X-TUID: XhMNFqnKoKmc Content-Length: 3445 Signed-off-by: Andreas Rheinhardt --- libavcodec/motionpixels.c | 12 ++++++++++-- libavcodec/motionpixels_tablegen.h | 3 +-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 22deb9d1bd..b08a2f624b 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/thread.h" + +#include "config.h" + #include "avcodec.h" #include "get_bits.h" #include "bswapdsp.h" @@ -64,6 +68,7 @@ static av_cold int mp_decode_end(AVCodecContext *avctx) static av_cold int mp_decode_init(AVCodecContext *avctx) { + av_unused static AVOnce init_static_once = AV_ONCE_INIT; MotionPixelsContext *mp = avctx->priv_data; int w4 = (avctx->width + 3) & ~3; int h4 = (avctx->height + 3) & ~3; @@ -73,7 +78,6 @@ static av_cold int mp_decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } - motionpixels_tableinit(); mp->avctx = avctx; ff_bswapdsp_init(&mp->bdsp); mp->changes_map = av_mallocz_array(avctx->width, h4); @@ -88,6 +92,10 @@ static av_cold int mp_decode_init(AVCodecContext *avctx) if (!mp->frame) return AVERROR(ENOMEM); +#if !CONFIG_HARDCODED_TABLES + ff_thread_once(&init_static_once, motionpixels_tableinit); +#endif + return 0; } @@ -347,5 +355,5 @@ AVCodec ff_motionpixels_decoder = { .close = mp_decode_end, .decode = mp_decode_frame, .capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/motionpixels_tablegen.h b/libavcodec/motionpixels_tablegen.h index 9239b6a667..fd10c80cba 100644 --- a/libavcodec/motionpixels_tablegen.h +++ b/libavcodec/motionpixels_tablegen.h @@ -84,8 +84,7 @@ static av_cold void mp_build_rgb_yuv_table(YuvPixel *p) static av_cold void motionpixels_tableinit(void) { - if (!mp_rgb_yuv_table[0].u) - mp_build_rgb_yuv_table(mp_rgb_yuv_table); + mp_build_rgb_yuv_table(mp_rgb_yuv_table); } #endif /* CONFIG_HARDCODED_TABLES */ From patchwork Fri Nov 20 07:19:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23953 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp953332ybf; Thu, 19 Nov 2020 23:33:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnE8Cwz/4Oe2fqBkjEA06P5BwWdMN3V2yYy86wbz3MWV8bNhD1gYh2eVLUdtZ4E/xpirV8 X-Received: by 2002:a1c:e245:: with SMTP id z66mr6358617wmg.9.1605857604871; Thu, 19 Nov 2020 23:33:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605857604; cv=none; d=google.com; s=arc-20160816; b=GxPFbTuQWf+6YaRkRIOoc6XkdBzVnnmoEHUH5iTa+IFg/gudY/FAZednHdinXJc+RI 21Uz1zp1wIF0Ksx5w1PB6R49g36NFB5LqTrWDkhXzzasDBPvOULRQfde7os819KLU3F4 swAaQRJV9aUVvFqINd/1ZIXD38dqhk+inXLBrY9O/zAOIt4MCNM2VZ+J3okNua9zsja+ EkPNns6697HTGH/wl8JlMDRtAqzshp/iC+kh4zjIf9Lo7lLNWVAD9ovexIxkEMmwrWyb CuHsbzIDFiVXRL+hFi5u5Yvt3Q5ZpFQnDHebIlcZqX/I7kwmzwPzg7+PeSg6WssGLHd6 /UsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=0MszhmyASiitpjIXsjZq3OFHscSJ/nLm/Ro9cXigS0o=; b=fJ3S9khZIfl7640e8/d2xRgiFHod4NeHmVIKl4jdwmAxrVCDZmIuAZv9HW52i4o9R4 dhyp3Pv2ztOFY5aexVgVbfN7AZV0bx2OMffFT2G+BLjvtBX6TQvr+o4EHzNhZsPtXwc3 8qBcwYHexZgxCH+/On083M0Hr5udShnhAXmNFR7aR1kYHzNdXgyjjgqCO9Fniezx8nnO eKN2PNts68FpR5slq0yg/A2PtaE78S4H9BsQ2ILOU1kO9tEIQ3WN81I4Ea+fEl7YY2QB AlsWDe3eDaEAFSm6wnSh6MAZ/lv0acHsSr4hutV/qsbu6FOpCS3xCMV4OGiDp5/t44IL WvPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=IpSgS3+v; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v20si1920701wrc.501.2020.11.19.23.33.24; Thu, 19 Nov 2020 23:33:24 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=IpSgS3+v; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BC08D68BAB6; Fri, 20 Nov 2020 09:25:13 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9AA2C68BAE0 for ; Fri, 20 Nov 2020 09:24:57 +0200 (EET) Received: by mail-ed1-f54.google.com with SMTP id t11so8444658edj.13 for ; Thu, 19 Nov 2020 23:24:57 -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=ZB4GHS5vbX2vrEo7hV+qrGL6/BkWeK86nPLYCMnR1r4=; b=IpSgS3+vEslum8zLpGaOGdJz6rhl+OpUN5f0BhtuBHsq3A8i3CELTV+37wlsxLjwR+ +ZuznzGw2tKV6m0hYgdKPy7yq+OWKciIzmm7COTPRs7vAGH9gQN320lGywTGmFRj2+59 8G5F1QWZgeUZLzRfXABeVdlJWbeihGDijTOmXCJJKlmMPriH1UIcjH9BVf2KfiCCOQ2S FCzS02WDpVgDN7SfGvpvtYXeJI3WaqIVqiAzwXxZqnfm2EMyeLzeIetpwHEpdq1/UedM SKqsBUBaYHrbZdP0BxxcprhtNmsh1ZU3awJLzwgoVYRFiTHpWV6Km00Vp63CzWJAnBa2 NBoQ== 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=ZB4GHS5vbX2vrEo7hV+qrGL6/BkWeK86nPLYCMnR1r4=; b=eySLSZEFIKdZnGPsL8IFsD2zKH6rE0VL5muj/u/hlJZSpiRobtvL8WOMWNqIg1dZ2j qV10ikSn3qfhTFpUdGfX8Zxu1Vl/9OraVIx5zI+VMfdDXHznmaC/TwHy7FMeyPMI7jlX FHLYC54HIEflkJxDs/SPIPXHa35sqpj8wawOSvGshpJRTR03MRRhskew1ZXuUaXTs1Jv GNJAjKKuRCoz2UYLUx7rIbO2UoLnhjXsIsiXF8IuxEwt+j9Hk3eJL52RF6I5+FDVVzi6 Oebk1jgm7bbGSVtcFQtiOktaKru0VilwZFDP3rsOchyaYD5ctJtmdtPb+6CCO1EiqM76 K/Kw== X-Gm-Message-State: AOAM533C+oG7y86tMm7Nf3bRoWet1Al18IhF2yXxr+zuIxSNz6pd7+h0 gWu7IlUNr2dVJ2DDPhlC4MZoBbSLA9yBXA== X-Received: by 2002:a05:6402:1019:: with SMTP id c25mr6534296edu.297.1605857096481; Thu, 19 Nov 2020 23:24:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:55 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:19 +0100 Message-Id: <20201120072116.818090-47-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 046/162] avcodec/mpc7: Reduce size of tables used to initialize 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" X-TUID: 1YPp5e9oUEqq Content-Length: 18878 By switching to ff_init_vlc_from_lengths() one can replace tables of codes of type uint16_t with tables of symbols of type uint8_t, saving space. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc7.c | 27 ++++---- libavcodec/mpc7data.h | 156 ++++++++++++++++++++---------------------- 2 files changed, 90 insertions(+), 93 deletions(-) diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 6482029efc..28c066d055 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -54,7 +54,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) static VLC_TYPE quant_tables[7224][2]; VLC_TYPE (*quant_table)[2] = quant_tables; - const uint16_t *raw_quant_table = mpc7_quant_vlcs; + const uint8_t *raw_quant_table = mpc7_quant_vlcs; /* Musepack SV7 is always stereo */ if (avctx->channels != 2) { @@ -93,23 +93,24 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) if(vlc_initialized) return 0; av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n"); - INIT_VLC_STATIC(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE, - &mpc7_scfi[1], 2, 1, - &mpc7_scfi[0], 2, 1, 1 << MPC7_SCFI_BITS); - INIT_VLC_STATIC(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE, - &mpc7_dscf[1], 2, 1, - &mpc7_dscf[0], 2, 1, 1 << MPC7_DSCF_BITS); - INIT_VLC_STATIC(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, - &mpc7_hdr[1], 2, 1, - &mpc7_hdr[0], 2, 1, 1 << MPC7_HDR_BITS); + INIT_VLC_STATIC_FROM_LENGTHS(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE, + &mpc7_scfi[1], 2, + &mpc7_scfi[0], 2, 1, 0, 0, 1 << MPC7_SCFI_BITS); + INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE, + &mpc7_dscf[1], 2, + &mpc7_dscf[0], 2, 1, 0, 0, 1 << MPC7_DSCF_BITS); + INIT_VLC_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, + &mpc7_hdr[1], 2, + &mpc7_hdr[0], 2, 1, 0, 0, 1 << MPC7_HDR_BITS); for(i = 0; i < MPC7_QUANT_VLC_TABLES; i++){ for(j = 0; j < 2; j++){ quant_vlc[i][j].table = quant_table; quant_vlc[i][j].table_allocated = quant_sizes[i * 2 + j]; quant_table += quant_sizes[i * 2 + j]; - init_vlc(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], - raw_quant_table + 1, 4, 2, - raw_quant_table, 4, 2, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], + &raw_quant_table[1], 2, + &raw_quant_table[0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); raw_quant_table += 2 * mpc7_quant_vlc_sizes[i]; } } diff --git a/libavcodec/mpc7data.h b/libavcodec/mpc7data.h index b9c5f208a4..b578cbdb27 100644 --- a/libavcodec/mpc7data.h +++ b/libavcodec/mpc7data.h @@ -33,21 +33,21 @@ static const int8_t mpc7_idx51[] = { -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, #define MPC7_SCFI_SIZE 4 #define MPC7_SCFI_BITS 3 static const uint8_t mpc7_scfi[MPC7_SCFI_SIZE * 2] = { - 0x2, 3, 0x1, 1, 0x3, 3, 0x0, 2 + 0x03, 2, 0x00, 3, 0x02, 3, 0x01, 1, }; #define MPC7_DSCF_SIZE 16 #define MPC7_DSCF_BITS 6 static const uint8_t mpc7_dscf[MPC7_DSCF_SIZE * 2] = { - 0x20, 6, 0x04, 5, 0x11, 5, 0x1E, 5, 0x0D, 4, 0x00, 3, 0x03, 3, 0x09, 4, - 0x05, 3, 0x02, 3, 0x0E, 4, 0x03, 4, 0x1F, 5, 0x05, 5, 0x21, 6, 0x0C, 4 + 0x05, 3, 0x01, 5, 0x0D, 5, 0x0B, 4, 0x09, 3, 0x06, 3, 0x00, 6, 0x0E, 6, + 0x02, 5, 0x07, 4, 0x08, 3, 0x0F, 4, 0x04, 4, 0x0A, 4, 0x03, 5, 0x0C, 5, }; #define MPC7_HDR_SIZE 10 #define MPC7_HDR_BITS 9 static const uint8_t mpc7_hdr[MPC7_HDR_SIZE * 2] = { - 0x5C, 8, 0x2F, 7, 0x0A, 5, 0x04, 4, 0x00, 2, - 0x01, 1, 0x03, 3, 0x16, 6, 0xBB, 9, 0xBA, 9 + 0x04, 2, 0x03, 4, 0x02, 5, 0x07, 6, 0x00, 8, + 0x09, 9, 0x08, 9, 0x01, 7, 0x06, 3, 0x05, 1, }; #define MPC7_QUANT_VLC_TABLES 7 @@ -59,81 +59,77 @@ static const uint8_t mpc7_quant_vlc_off[MPC7_QUANT_VLC_TABLES] = { 0, 0, 3, 4, 7, 15, 31 }; -static const uint16_t mpc7_quant_vlcs[177 * 2 * 2] = { - 0x0036, 6, 0x0009, 5, 0x0020, 6, 0x0005, 5, 0x000A, 4, 0x0007, 5, - 0x0034, 6, 0x0000, 5, 0x0023, 6, 0x000A, 5, 0x0006, 4, 0x0004, 5, - 0x000B, 4, 0x0007, 3, 0x000C, 4, 0x0003, 5, 0x0007, 4, 0x000B, 5, - 0x0022, 6, 0x0001, 5, 0x0035, 6, 0x0006, 5, 0x0009, 4, 0x0002, 5, - 0x0021, 6, 0x0008, 5, 0x0037, 6, - 0x0067, 8, 0x003E, 7, 0x00E1, 9, 0x0037, 7, 0x0003, 4, 0x0034, 7, - 0x0065, 8, 0x003C, 7, 0x00E3, 9, 0x0018, 6, 0x0000, 4, 0x003D, 7, - 0x0004, 4, 0x0001, 1, 0x0005, 4, 0x003F, 7, 0x0001, 4, 0x003B, 7, - 0x00E2, 9, 0x0039, 7, 0x0064, 8, 0x0035, 7, 0x0002, 4, 0x0036, 7, - 0x00E0, 9, 0x003A, 7, 0x0066, 8, - - 0x0059, 7, 0x002F, 6, 0x000F, 5, 0x0000, 5, 0x005B, 7, 0x0004, 5, - 0x0006, 4, 0x000D, 4, 0x0004, 4, 0x0005, 5, 0x0014, 5, 0x000C, 4, - 0x0004, 3, 0x000F, 4, 0x000E, 5, 0x0003, 5, 0x0003, 4, 0x000E, 4, - 0x0005, 4, 0x0001, 5, 0x005A, 7, 0x0002, 5, 0x0015, 5, 0x002E, 6, - 0x0058, 7, - 0x0399, 10, 0x0071, 7, 0x0033, 6, 0x00E7, 8, 0x039A, 10, 0x0068, 7, - 0x001E, 5, 0x0000, 3, 0x001D, 5, 0x0069, 7, 0x0032, 6, 0x0001, 3, - 0x0002, 2, 0x0003, 3, 0x0031, 6, 0x006B, 7, 0x001B, 5, 0x0002, 3, - 0x001F, 5, 0x0070, 7, 0x0398, 10, 0x006A, 7, 0x0030, 6, 0x0072, 7, - 0x039B, 10, - - 0x000C, 4, 0x0004, 3, 0x0000, 2, 0x0001, 2, 0x0007, 3, 0x0005, 3, - 0x000D, 4, - 0x0004, 5, 0x0003, 4, 0x0002, 2, 0x0003, 2, 0x0001, 2, 0x0000, 3, - 0x0005, 5, - - 0x0005, 4, 0x0000, 3, 0x0004, 3, 0x0006, 3, 0x0007, 3, 0x0005, 3, - 0x0003, 3, 0x0001, 3, 0x0004, 4, - 0x0009, 5, 0x000C, 4, 0x0003, 3, 0x0000, 2, 0x0002, 2, 0x0007, 3, - 0x000D, 4, 0x0005, 4, 0x0008, 5, - - 0x0039, 6, 0x0017, 5, 0x0008, 4, 0x000A, 4, 0x000D, 4, 0x0000, 3, - 0x0002, 3, 0x0003, 3, 0x0001, 3, 0x000F, 4, 0x000C, 4, 0x0009, 4, - 0x001D, 5, 0x0016, 5, 0x0038, 6, - 0x00E5, 8, 0x0038, 6, 0x0007, 5, 0x0002, 4, 0x0000, 3, 0x0003, 3, - 0x0005, 3, 0x0006, 3, 0x0004, 3, 0x0002, 3, 0x000F, 4, 0x001D, 5, - 0x0006, 5, 0x0073, 7, 0x00E4, 8, - - 0x0041, 7, 0x0006, 6, 0x002C, 6, 0x002D, 6, 0x003B, 6, 0x000D, 5, - 0x0011, 5, 0x0013, 5, 0x0017, 5, 0x0015, 5, 0x001A, 5, 0x001E, 5, - 0x0000, 4, 0x0002, 4, 0x0005, 4, 0x0007, 4, 0x0003, 4, 0x0004, 4, - 0x001F, 5, 0x001C, 5, 0x0019, 5, 0x001B, 5, 0x0018, 5, 0x0014, 5, - 0x0012, 5, 0x000C, 5, 0x0002, 5, 0x003A, 6, 0x0021, 6, 0x0007, 6, - 0x0040, 7, - 0x1948, 13, 0x194A, 13, 0x0328, 10, 0x0195, 9, 0x00CB, 8, 0x0066, 7, - 0x0031, 6, 0x0009, 5, 0x000F, 5, 0x001F, 5, 0x0002, 4, 0x0006, 4, - 0x0008, 4, 0x000B, 4, 0x000D, 4, 0x0000, 3, 0x000E, 4, 0x000A, 4, - 0x0009, 4, 0x0005, 4, 0x0003, 4, 0x001E, 5, 0x000E, 5, 0x0008, 5, - 0x0030, 6, 0x0067, 7, 0x00C9, 8, 0x00C8, 8, 0x0653, 11, 0x1949, 13, - 0x194B, 13, - - 0x0067, 8, 0x0099, 8, 0x00B5, 8, 0x00E9, 8, 0x0040, 7, 0x0041, 7, - 0x004D, 7, 0x0051, 7, 0x005B, 7, 0x0071, 7, 0x0070, 7, 0x0018, 6, - 0x001D, 6, 0x0023, 6, 0x0025, 6, 0x0029, 6, 0x002C, 6, 0x002E, 6, - 0x0033, 6, 0x0031, 6, 0x0036, 6, 0x0037, 6, 0x0039, 6, 0x003C, 6, - 0x0000, 5, 0x0002, 5, 0x000A, 5, 0x0005, 5, 0x0009, 5, 0x0006, 5, - 0x000D, 5, 0x0007, 5, 0x000B, 5, 0x000F, 5, 0x0008, 5, 0x0004, 5, - 0x0003, 5, 0x0001, 5, 0x003F, 6, 0x003E, 6, 0x003D, 6, 0x0035, 6, - 0x003B, 6, 0x0034, 6, 0x0030, 6, 0x002F, 6, 0x002B, 6, 0x002A, 6, - 0x0027, 6, 0x0024, 6, 0x0021, 6, 0x001C, 6, 0x0075, 7, 0x0065, 7, - 0x0064, 7, 0x0050, 7, 0x0045, 7, 0x0044, 7, 0x0032, 7, 0x00E8, 8, - 0x00B4, 8, 0x0098, 8, 0x0066, 8, - 0x37A4, 14, 0x37AD, 14, 0x37A6, 14, 0x37AE, 14, 0x0DEA, 12, 0x02F0, 10, - 0x02F1, 10, 0x00A0, 9, 0x00A2, 9, 0x01BC, 9, 0x007A, 8, 0x00DF, 8, - 0x003C, 7, 0x0049, 7, 0x006E, 7, 0x000E, 6, 0x0018, 6, 0x0019, 6, - 0x0022, 6, 0x0025, 6, 0x0036, 6, 0x0003, 5, 0x0009, 5, 0x000B, 5, - 0x0010, 5, 0x0013, 5, 0x0015, 5, 0x0018, 5, 0x001A, 5, 0x001D, 5, - 0x001F, 5, 0x0002, 4, 0x0000, 4, 0x001E, 5, 0x001C, 5, 0x0019, 5, - 0x0016, 5, 0x0014, 5, 0x000E, 5, 0x000D, 5, 0x0008, 5, 0x0006, 5, - 0x0002, 5, 0x002E, 6, 0x0023, 6, 0x001F, 6, 0x0015, 6, 0x000F, 6, - 0x005F, 7, 0x0048, 7, 0x0029, 7, 0x00BD, 8, 0x007B, 8, 0x0179, 9, - 0x00A1, 9, 0x037B, 10, 0x0147, 10, 0x0146, 10, 0x0DE8, 12, 0x37AF, 14, - 0x37A7, 14, 0x37AC, 14, 0x37A5, 14 +static const uint8_t mpc7_quant_vlcs[177 * 2 * 2] = { + /* quant_vlc[0][0] - 27 entries */ + 0x07, 5, 0x13, 5, 0x17, 5, 0x0F, 5, 0x0B, 5, 0x03, 5, 0x15, 5, + 0x05, 5, 0x19, 5, 0x01, 5, 0x09, 5, 0x11, 5, 0x0A, 4, 0x10, 4, + 0x02, 6, 0x18, 6, 0x12, 6, 0x08, 6, 0x16, 4, 0x04, 4, 0x0C, 4, + 0x0E, 4, 0x06, 6, 0x14, 6, 0x00, 6, 0x1A, 6, 0x0D, 3, + /* quant_vlc[0][1] - 27 entries */ + 0x0A, 4, 0x10, 4, 0x16, 4, 0x04, 4, 0x0C, 4, 0x0E, 4, 0x09, 6, + 0x14, 8, 0x06, 8, 0x1A, 8, 0x00, 8, 0x05, 7, 0x15, 7, 0x17, 7, + 0x03, 7, 0x18, 9, 0x02, 9, 0x12, 9, 0x08, 9, 0x13, 7, 0x19, 7, + 0x11, 7, 0x07, 7, 0x0B, 7, 0x01, 7, 0x0F, 7, 0x0D, 1, + /* quant_vlc[1][0] - 25 entries */ + 0x03, 5, 0x13, 5, 0x15, 5, 0x0F, 5, 0x05, 5, 0x09, 5, 0x10, 4, + 0x08, 4, 0x12, 4, 0x06, 4, 0x0E, 5, 0x02, 5, 0x0C, 3, 0x0A, 5, + 0x16, 5, 0x18, 7, 0x00, 7, 0x14, 7, 0x04, 7, 0x17, 6, 0x01, 6, + 0x0B, 4, 0x07, 4, 0x11, 4, 0x0D, 4, + /* quant_vlc[1][1] - 25 entries */ + 0x07, 3, 0x0B, 3, 0x11, 3, 0x0D, 3, 0x0C, 2, 0x16, 6, 0x0E, 6, + 0x0A, 6, 0x02, 6, 0x05, 7, 0x09, 7, 0x15, 7, 0x0F, 7, 0x10, 5, + 0x13, 7, 0x01, 7, 0x17, 7, 0x14, 10, 0x00, 10, 0x04, 10, 0x18, 10, + 0x03, 8, 0x08, 5, 0x06, 5, 0x12, 5, + /* quant_vlc[2][0] - 7 entries */ + 0x02, 2, 0x03, 2, 0x01, 3, 0x05, 3, 0x00, 4, 0x06, 4, 0x04, 3, + /* quant_vlc[2][1] - 7 entries */ + 0x05, 3, 0x00, 5, 0x06, 5, 0x01, 4, 0x04, 2, 0x02, 2, 0x03, 2, + /* quant_vlc[3][0] - 9 entries */ + 0x01, 3, 0x07, 3, 0x08, 4, 0x00, 4, 0x06, 3, 0x02, 3, 0x05, 3, + 0x03, 3, 0x04, 3, + /* quant_vlc[3][1] - 9 entries */ + 0x03, 2, 0x08, 5, 0x00, 5, 0x07, 4, 0x02, 3, 0x04, 2, 0x01, 4, + 0x06, 4, 0x05, 3, + /* quant_vlc[4][0] - 15 entries */ + 0x05, 3, 0x08, 3, 0x06, 3, 0x07, 3, 0x02, 4, 0x0B, 4, 0x03, 4, + 0x0D, 5, 0x01, 5, 0x0A, 4, 0x04, 4, 0x0E, 6, 0x00, 6, 0x0C, 5, + 0x09, 4, + /* quant_vlc[4][1] - 15 entries */ + 0x04, 3, 0x03, 4, 0x0C, 5, 0x02, 5, 0x09, 3, 0x05, 3, 0x08, 3, + 0x06, 3, 0x07, 3, 0x01, 6, 0x0E, 8, 0x00, 8, 0x0D, 7, 0x0B, 5, + 0x0A, 4, + /* quant_vlc[5][0] - 31 entries */ + 0x0C, 4, 0x1A, 5, 0x01, 6, 0x1D, 6, 0x0D, 4, 0x10, 4, 0x11, 4, + 0x0E, 4, 0x19, 5, 0x05, 5, 0x0F, 4, 0x1E, 7, 0x00, 7, 0x1C, 6, + 0x06, 5, 0x18, 5, 0x07, 5, 0x17, 5, 0x09, 5, 0x02, 6, 0x03, 6, + 0x08, 5, 0x16, 5, 0x14, 5, 0x0A, 5, 0x15, 5, 0x13, 5, 0x1B, 6, + 0x04, 6, 0x0B, 5, 0x12, 5, + /* quant_vlc[5][1] - 31 entries */ + 0x0F, 3, 0x0A, 4, 0x14, 4, 0x17, 5, 0x07, 5, 0x13, 4, 0x0B, 4, + 0x16, 5, 0x08, 5, 0x0C, 4, 0x12, 4, 0x11, 4, 0x0D, 4, 0x18, 6, + 0x06, 6, 0x1B, 8, 0x1A, 8, 0x02, 10, 0x00, 13, 0x1D, 13, 0x01, 13, + 0x1E, 13, 0x1C, 11, 0x03, 9, 0x04, 8, 0x05, 7, 0x19, 7, 0x0E, 4, + 0x10, 4, 0x15, 5, 0x09, 5, + /* quant_vlc[6][0] - 63 entries */ + 0x18, 5, 0x25, 5, 0x19, 5, 0x24, 5, 0x23, 5, 0x1B, 5, 0x1D, 5, + 0x1F, 5, 0x22, 5, 0x1C, 5, 0x1A, 5, 0x20, 5, 0x0B, 6, 0x3A, 7, + 0x3E, 8, 0x00, 8, 0x1E, 5, 0x33, 6, 0x0C, 6, 0x21, 5, 0x04, 7, + 0x05, 7, 0x32, 6, 0x39, 7, 0x38, 7, 0x0D, 6, 0x31, 6, 0x0E, 6, + 0x3D, 8, 0x01, 8, 0x06, 7, 0x30, 6, 0x37, 7, 0x07, 7, 0x0F, 6, + 0x2F, 6, 0x2E, 6, 0x10, 6, 0x3C, 8, 0x02, 8, 0x08, 7, 0x11, 6, + 0x2D, 6, 0x2C, 6, 0x13, 6, 0x36, 7, 0x35, 7, 0x12, 6, 0x2B, 6, + 0x29, 6, 0x14, 6, 0x15, 6, 0x0A, 7, 0x09, 7, 0x16, 6, 0x3B, 8, + 0x03, 8, 0x34, 7, 0x2A, 6, 0x17, 6, 0x28, 6, 0x27, 6, 0x26, 6, + /* quant_vlc[6][1] - 63 entries */ + 0x20, 4, 0x2A, 5, 0x15, 5, 0x1F, 4, 0x29, 5, 0x0F, 6, 0x2F, 6, + 0x28, 5, 0x16, 5, 0x07, 9, 0x36, 9, 0x08, 9, 0x39, 10, 0x38, 10, + 0x32, 7, 0x2E, 6, 0x17, 5, 0x10, 6, 0x11, 6, 0x27, 5, 0x26, 5, + 0x0C, 7, 0x0A, 8, 0x34, 8, 0x2D, 6, 0x18, 5, 0x12, 6, 0x2C, 6, + 0x31, 7, 0x0D, 7, 0x13, 6, 0x19, 5, 0x25, 5, 0x1A, 5, 0x24, 5, + 0x2B, 6, 0x05, 10, 0x06, 10, 0x35, 9, 0x33, 8, 0x30, 7, 0x1B, 5, + 0x23, 5, 0x1C, 5, 0x14, 6, 0x0E, 7, 0x09, 9, 0x3A, 12, 0x00, 14, + 0x3E, 14, 0x02, 14, 0x3C, 14, 0x04, 12, 0x3D, 14, 0x01, 14, 0x03, 14, + 0x3B, 14, 0x37, 10, 0x0B, 8, 0x22, 5, 0x1D, 5, 0x21, 5, 0x1E, 5, }; #endif /* AVCODEC_MPC7DATA_H */ From patchwork Fri Nov 20 07:19:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23954 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp952740ybf; Thu, 19 Nov 2020 23:32:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJx89bwUmh6/YIBLBcxAMPg0lOew54Tt227DjILvvYiE4okCf/k/AuleyufHdVQxlg0B/INt X-Received: by 2002:a5d:6046:: with SMTP id j6mr14418054wrt.317.1605857532184; Thu, 19 Nov 2020 23:32:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605857532; cv=none; d=google.com; s=arc-20160816; b=H/yrcONTR9YYuHXBkMVqlAubxUO5j1VT49JGGNsmzy9KuB7Lu3/Ni5tYzLyTU1w/+y 0odKWDDjw8r2yG3O/2qxT8wjd7+rWWJq2U8s8CbYCA5IgOgxH/RnDQbNHr2522/2f+0m 22qDF7QV5DO5rQvNsMG8Wy/BMgmHmtQmYk9S2ZILvQHN5MzsvtKoJxHmHC/4jFozu/jV xWbkxhXBycJme/JcsJGj0yshUSukWG7aByMJU/Jhr9+n4r9NJpaUF/ugp7w8uJrjBKCY Fam3Eyf3BNDtxnnykG2QNFNjuxqJQ8RfoqToOCZ58UbUxpPN6wqeadzDzWzbqbybxkkh m59w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=+A1+Uw53rAgSZNTklWNErdTFbcTECC8FlKBZVZAISlk=; b=JuSSoYjonea624ECpYaQI3pG02UoD+RkEbqqk8DW6clC2bfV3ddbI4Th7F4JZ2L8LJ Zvx5MoIv+KMzsy8OTsJi9DDtLg3VLkU7lVM3t9+FIOl35isDfiFM37AYJHETyqvsUnI3 bZ3WAgBww3prTHTiqwDihORYfT5KVzDDgpmW/rTLAbtGLcaxArIXR4Vr/AvWo+Azbw3K 8eZm3Ubpw3OeNIjgfmHeTBC85+qYXCi60nvcfRhSo47+gRi1wIfl51FjRVck93EFa3sF Z2iL13a12fJKe2Ou2yxSD2dV24Kue6vXdn2ht2IKS/C0k5m41aTkDlIU9F/uFcRKufpk wW7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=IpvZ5STD; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q8si1803982wrm.137.2020.11.19.23.32.11; Thu, 19 Nov 2020 23:32:12 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=IpvZ5STD; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3710968BAA5; Fri, 20 Nov 2020 09:25:07 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 529F468BAC7 for ; Fri, 20 Nov 2020 09:24:58 +0200 (EET) Received: by mail-ej1-f46.google.com with SMTP id i19so11471904ejx.9 for ; Thu, 19 Nov 2020 23:24:58 -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=YauTU2eUk493iHfUsY+lAlwOp/MkqDAxkfkm5OHG+H4=; b=IpvZ5STDvYx3ET2repLyDDhBFGKKAZHPpvXnfNGsgmdiQS/vR12RkkDH+qIDnWD4q7 MduWHKDXELFLOZbzJwSAzlQ6qQdoW2PDlGfRRlPpJlGLVBzpwfuNLBINdmT7MQAYkq6k hl36x9FBc5r/ZQ8lNcoE61XAfvXKAVqVwnncjnBIQR0Z5SAEEkUxItDbEWp2WilbtxQf Roujj3j6qGYcc9AcrLphE9BSTodAuXKvSSSPSjNhIoMqlZex+pjoByhjB9r5H3+ZAgoy Jc9rOHeeRE4YysZFSKtRxpd4xzqFjhz3tO4Xc7Xr05z4ofoQ2ibcaa5twXIJdruguTxc 5mFw== 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=YauTU2eUk493iHfUsY+lAlwOp/MkqDAxkfkm5OHG+H4=; b=rbCjRYkrWm/ETaNBFNrfeK3Nt48zxWneO1W829Ra/clPlge362+83vG0Im77AwRBt8 JUAogh1pRyLjQgB5ZcxQEYStDqloVtVkwT4B1OSo55i4AZ8wVcy2SVlFQrpwI6DqpKGv GqbDEPdk9udftCnTWe6PXDjP6oj5PVDEI6N7B1MAyP0N1A31g1iyPBC6tEN75j2ZoN6W TUWIXDs+CaUEWoW47Q+RhsGpuQbIO39Urvor0/VLhfdhNssKe+zOV9O3kyZZVrOysOd+ o6OvMP1oDD2FDO4yja6ajPqxE0+EQUcQjTIMj6cyRCMlog7TnCpHuj9JqamT33kvK9bH t51g== X-Gm-Message-State: AOAM5307ICHWnJvtqzFhJCelI6TJhZcMTrYKEGPI5mlBxYgc+U4lZnb1 4Rz5Ada4MEm0S5tCzJYaLEE2hvDQppCw3Q== X-Received: by 2002:a17:906:3a55:: with SMTP id a21mr30914356ejf.357.1605857097517; Thu, 19 Nov 2020 23:24:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:56 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:20 +0100 Message-Id: <20201120072116.818090-48-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 047/162] avcodec/mpc7: Apply offsets when creating 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" X-TUID: vu05nybDcYtb Content-Length: 5411 Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc7.c | 14 +++++++------- libavcodec/mpc7data.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 28c066d055..ad0fc6dbbc 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -98,10 +98,10 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) &mpc7_scfi[0], 2, 1, 0, 0, 1 << MPC7_SCFI_BITS); INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE, &mpc7_dscf[1], 2, - &mpc7_dscf[0], 2, 1, 0, 0, 1 << MPC7_DSCF_BITS); + &mpc7_dscf[0], 2, 1, -7, 0, 1 << MPC7_DSCF_BITS); INIT_VLC_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, &mpc7_hdr[1], 2, - &mpc7_hdr[0], 2, 1, 0, 0, 1 << MPC7_HDR_BITS); + &mpc7_hdr[0], 2, 1, -5, 0, 1 << MPC7_HDR_BITS); for(i = 0; i < MPC7_QUANT_VLC_TABLES; i++){ for(j = 0; j < 2; j++){ quant_vlc[i][j].table = quant_table; @@ -110,7 +110,8 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) ff_init_vlc_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], &raw_quant_table[1], 2, &raw_quant_table[0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + mpc7_quant_vlc_off[i], + INIT_VLC_USE_NEW_STATIC, NULL); raw_quant_table += 2 * mpc7_quant_vlc_sizes[i]; } } @@ -151,7 +152,7 @@ static inline void idx_to_quant(MPCContext *c, GetBitContext *gb, int idx, int * case 3: case 4: case 5: case 6: case 7: i1 = get_bits1(gb); for(i = 0; i < SAMPLES_PER_BAND; i++) - *dst++ = get_vlc2(gb, quant_vlc[idx-1][i1].table, 9, 2) - mpc7_quant_vlc_off[idx-1]; + *dst++ = get_vlc2(gb, quant_vlc[idx-1][i1].table, 9, 2); break; case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: @@ -166,7 +167,7 @@ static inline void idx_to_quant(MPCContext *c, GetBitContext *gb, int idx, int * static int get_scale_idx(GetBitContext *gb, int ref) { - int t = get_vlc2(gb, dscf_vlc.table, MPC7_DSCF_BITS, 1) - 7; + int t = get_vlc2(gb, dscf_vlc.table, MPC7_DSCF_BITS, 1); if (t == 8) return get_bits(gb, 6); return ref + t; @@ -221,8 +222,7 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data, /* read subband indexes */ for(i = 0; i <= c->maxbands; i++){ for(ch = 0; ch < 2; ch++){ - int t = 4; - if(i) t = get_vlc2(&gb, hdr_vlc.table, MPC7_HDR_BITS, 1) - 5; + int t = i ? get_vlc2(&gb, hdr_vlc.table, MPC7_HDR_BITS, 1) : 4; if(t == 4) bands[i].res[ch] = get_bits(&gb, 4); else bands[i].res[ch] = bands[i-1].res[ch] + t; if (bands[i].res[ch] < -1 || bands[i].res[ch] > 17) { diff --git a/libavcodec/mpc7data.h b/libavcodec/mpc7data.h index b578cbdb27..ee77393fce 100644 --- a/libavcodec/mpc7data.h +++ b/libavcodec/mpc7data.h @@ -55,8 +55,8 @@ static const uint8_t mpc7_quant_vlc_sizes[MPC7_QUANT_VLC_TABLES] = { 27, 25, 7, 9, 15, 31, 63 }; -static const uint8_t mpc7_quant_vlc_off[MPC7_QUANT_VLC_TABLES] = { - 0, 0, 3, 4, 7, 15, 31 +static const int8_t mpc7_quant_vlc_off[MPC7_QUANT_VLC_TABLES] = { + 0, 0, -3, -4, -7, -15, -31 }; static const uint8_t mpc7_quant_vlcs[177 * 2 * 2] = { From patchwork Fri Nov 20 07:19:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23950 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp952891ybf; Thu, 19 Nov 2020 23:32:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtxZxyHUsQ44422p3DBNHm0bdVkgc6SkL7/HfqA2ym16O3FCIAo730pCY+1FUA7LuZAs0i X-Received: by 2002:a1c:7202:: with SMTP id n2mr8007384wmc.38.1605857553849; Thu, 19 Nov 2020 23:32:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605857553; cv=none; d=google.com; s=arc-20160816; b=rfmo03qxT9EIll3FNb7mGQI6Gd01N7sk67eavSXXWp0c0iByLKdLsL3RNSoZw0lITi V9dei23ZmvkrjpnqjDwBIhnwPrL8WcSO6UYFAbWMAKh6+RBDnIRO6wzvpmgDsBUAT2Cv ZRJrHo6iP3paSI94QAt7//c1sJg37Hdm/QY/z9zclv/63fLEtW+YW1p/1HECbJy191as /JTMUZoLqIKSMcsrQQhuKkHSjBG9m2XbWC0xUW8sNzRfZGKtZC30uQDqFwmQmlLnHAj1 L0NjHGXYtp8LiDGgRtkxY0UYItPQWhhAODUQlbvcUNPArUh8b6/zMzqMceeYdvI68pSK dxeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=88zL/PdOzv+bEi1XJ09MKNMyM1M54A2qBQ6nRJBQAhE=; b=Png3kbTVi4WSIWW2LHMYdEzGDNeSzpm1ZjLgZppcSH3VdBrv9rrntNOqGpP4wUZ1PB iPZPcLs8asxwshvTIXPLe1t56VbfQ9otCjriDiNTNQxITem0VCulUB9RI+KNYVekEKMI T6269AhRSDjsxuYmI+UtRUQY7YDgPnU7fuN+17vIMVd0cKS6JtfE5UDuN3ZQaatv9DmS Xn7CfY7eVEC55ny/jEg3rRgUPBenQzJinQ6egGXCTy3bFX6wIOwQR3ATWj1a0P8mFYpy HbgimjlfbiiNkFQurzaGvI3EUkTMnesv7lUgSn/orIrYBzOL2mXWQ3BlsuSoKzNxlfSd RvBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=YtW6h12H; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i3si1860669wri.144.2020.11.19.23.32.33; Thu, 19 Nov 2020 23:32:33 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=YtW6h12H; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D38CC68BB14; Fri, 20 Nov 2020 09:25:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 02CCB68BACF for ; Fri, 20 Nov 2020 09:24:59 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id gj5so11499126ejb.8 for ; Thu, 19 Nov 2020 23:24:59 -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=dDF1pF3kIPIUhgN+IABdQc5A/fUTVFuorTg9cgIWRMM=; b=YtW6h12Hnv9gfI2vJuP11llPhZSHAzutUXWYewzTc7Ca8nO/3KNRaEDSK9CPYvXCxe 9ZLaebCIwWUS5JL1QX46atEEH9OugctnuRVt2REzfN5fl2wA92eg8HDiTio+kdI8p8DM ntGFJ1vdrkM7LCax7ZRr41vh+DVN2wH8psBxl957Wd8Ld2KFhxOS9ORmbeozPfvvlFI7 NokhgFqL/HUAbkvXFrd3YjD+iigLCruTqPPpGcY3CT/kiFq4cm3Tazn9NT/J9CigQyxs mfbQ2c7LUwdTpm7xNDljLhjktEWLrU4Hbg8BfNGw++M0andDuqBAMcIs280LiKCIZWPE 11hA== 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=dDF1pF3kIPIUhgN+IABdQc5A/fUTVFuorTg9cgIWRMM=; b=kTn4fdMr3gbcvDhB9uICfVU2yxETSuniHH6xAyY3dOQ1UIi6cDwGXPdey6Zl5SL0Uu uZaDc78V9RBkBVQHbtZK7O9WUAloiwyQaSPI/BUqwtU3YMF6xK5xxTWepxC/2eEizrw+ SGTS4SuIf+C8gcPpZVBuSjMOgQdRG6aE6No5rs4ysu1AbSaIDno3kYxOy1MbtK/GZqyy PeS1eQSTw1FFG8djQX+yFv6Rv44JzP7DFEO8J7hM0lqo5ZBTRD/qpuBrk+/fIDbSrOZt 2DZO+/ZYrG9ZIkL6TktdKv4td/bycco/aMjsb0eLW+fo4xeWV6d/UWXmkNFDn5tFdAbM mrFA== X-Gm-Message-State: AOAM530LuMWtOHumZPiahGffc/pEnH8n2X9JBsHH896z8MfNPp0ws0fq R9aysD5AHPuzwSRswzOpW0jrv1MQ4l0/sw== X-Received: by 2002:a17:906:2581:: with SMTP id m1mr30983667ejb.28.1605857099191; Thu, 19 Nov 2020 23:24:59 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:58 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:21 +0100 Message-Id: <20201120072116.818090-49-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 048/162] avcodec/mpc7: Avoid offsets table when creating 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" X-TUID: pcEVHdTyhk71 Content-Length: 3490 Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc7.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index ad0fc6dbbc..0b9e6f0088 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -38,22 +38,15 @@ static VLC scfi_vlc, dscf_vlc, hdr_vlc, quant_vlc[MPC7_QUANT_VLC_TABLES][2]; -static const uint16_t quant_sizes[MPC7_QUANT_VLC_TABLES*2] = -{ - 512, 512, 512, 516, 512, 512, 512, 512, 512, 512, 512, 528, 512, 548 -}; - - static av_cold int mpc7_decode_init(AVCodecContext * avctx) { - int i, j; + int j; MPCContext *c = avctx->priv_data; GetBitContext gb; LOCAL_ALIGNED_16(uint8_t, buf, [16]); static int vlc_initialized = 0; static VLC_TYPE quant_tables[7224][2]; - VLC_TYPE (*quant_table)[2] = quant_tables; const uint8_t *raw_quant_table = mpc7_quant_vlcs; /* Musepack SV7 is always stereo */ @@ -102,17 +95,17 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) INIT_VLC_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, &mpc7_hdr[1], 2, &mpc7_hdr[0], 2, 1, -5, 0, 1 << MPC7_HDR_BITS); - for(i = 0; i < MPC7_QUANT_VLC_TABLES; i++){ + for (unsigned i = 0, offset = 0; i < MPC7_QUANT_VLC_TABLES; i++){ for(j = 0; j < 2; j++){ - quant_vlc[i][j].table = quant_table; - quant_vlc[i][j].table_allocated = quant_sizes[i * 2 + j]; - quant_table += quant_sizes[i * 2 + j]; + quant_vlc[i][j].table = &quant_tables[offset]; + quant_vlc[i][j].table_allocated = FF_ARRAY_ELEMS(quant_tables) - offset; ff_init_vlc_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], &raw_quant_table[1], 2, &raw_quant_table[0], 2, 1, mpc7_quant_vlc_off[i], - INIT_VLC_USE_NEW_STATIC, NULL); + INIT_VLC_STATIC_OVERLONG, NULL); raw_quant_table += 2 * mpc7_quant_vlc_sizes[i]; + offset += quant_vlc[i][j].table_size; } } vlc_initialized = 1; From patchwork Fri Nov 20 07:19:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23949 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp953278ybf; Thu, 19 Nov 2020 23:33:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUrWHevXAdU3yOcQn5pqdgR/WojsYWn9WxFbBsPtXT6w5hBIwuAcAjwoaOVv6hKy+lpnAW X-Received: by 2002:a5d:4690:: with SMTP id u16mr14894868wrq.263.1605857596327; Thu, 19 Nov 2020 23:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605857596; cv=none; d=google.com; s=arc-20160816; b=XWIW7yFuk3DQ0nFuDffc0jvk6ptOH0UkxvKgHi067umlfyK4a36XztUA1447qD00ld x8ocZUYuLOrbUl/HjhXzBneTcKN5d+wKPcrcR7Wf8VLHKhEQpO+HEBY11rSLlIO4X5Ne 1WhDMmAztj0O9TcSxFFO5pLX8pSMa8ogl205pc9WLG/hx6+mElioQnHOmzSaZHnoSe9O yyEaukbov07mMNkRiwCZUmiFj6byO/EMcpxUzvWHcMm+sdol/y0HCcF1sf7oKwwoWRZB 4oAmPyOQYRNPd+ClD452ySX6pQmkAmhDrXYoLmJ/7ZjurNQt9c1u999M73CBjmkDzFd1 gekA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=bcnoXRTXY178e2KxtGpLMVQqfeQxHGhoKZSsLlbJsLo=; b=Pwfj3OlahB3iSC3eOWLjH5Psy3+JagyjJMobHDYMrTmJU977pO6ev7E0/7Um1F6VNG WAfDkDce4NFtGursXNK9V2as6VBeDjYHG3mmJi8yrnstK5AG2e8Ls2qjI3fcWJduYcPG GZuPvmQNgBKv07vZIqhauU4hKgBCYegcnVfaf23k1MexSOACwlnFFKQ9UK4pgbpqY2Lw xOs67fjmrX+h/Km1Pi2jNZE3po9dXy74bWCvF/8IfMMw/g/ENwN1uD3XgNvR8AMgBGyU zrEGCABjSnCv4ksCl6bhPtXSqIEBzuWIMUTyjQAHdqe8VlzSIMl26qlvnUjQpiPoPWF9 r3Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=QKpoPP3y; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i9si1799932wru.105.2020.11.19.23.33.15; Thu, 19 Nov 2020 23:33:16 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=QKpoPP3y; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EF6F968BA88; Fri, 20 Nov 2020 09:25:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 50A3068BAD6 for ; Fri, 20 Nov 2020 09:25:02 +0200 (EET) Received: by mail-ej1-f43.google.com with SMTP id 7so11519764ejm.0 for ; Thu, 19 Nov 2020 23:25:02 -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=DVEqiRX+cj3CegSTfCWoifv0idgdbuSc/xgFoArgDis=; b=QKpoPP3y6igyB4jtFfQmjVhyp43C0dJHgTylumNLFLZQ/eo/vbB9v//qA+uE+4WThg YO/7y2ZUiWrDdGItnvILVEvPlJgf0cT5b5wSW5tiiFaZc++nel+SuPxR/KJWCNTKTaDZ ykqejSn4iBBl3qCAY0HPV/R/UOIgElHS5OeTDepjS8cPDhrmKwqSd+2/ElgrWEbZM3e+ 50IC8kLJbk+wJhyxWs/CEmP587AFFfl2KcBAqWYpJCzCMIoWJCvhIUdeGa3QcjJJJxp/ JhYsJb6p45HNZBi6vToAcPk6676TcTeqScZOqtcZIZ+AXFTv/7eoWQvoyyOeVvjs89Dq AKOw== 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=DVEqiRX+cj3CegSTfCWoifv0idgdbuSc/xgFoArgDis=; b=feocX4PPQ2jC4OmajnATaA8K+B+q1GkWeoJw4Vh0psVtW+N24ORqZbaXlzbTIp3/Ct hNxrmhZJv0pawvegcupe7pezcSMO6xG0VNsOaBKs2TmGDx0dj7ZgjX6nCgs/2HDc2o42 SCQSiBkxqkg6hwTBhGqaOkEUHrLPRjCYla7nhoutYV1o93/89wVo/nCs8mGvDufuibff ZJXrZ89wJe3FKn2CHXHH3GMKKtY8dcaJ+xvRU9r5eFBNEr8WGjZcS2fBw2PYTGZYsYcX CrPmrJeMqjeJ02orzUXGqLm317gJzSS8+FHbD8qdryfnfitQHk0fgtXgOaZvcwVhtYIF qMuQ== X-Gm-Message-State: AOAM533j/1/OUvd5CBWPyKDQYxl7VCzT9cZ/b0+HfiLLu9eSEOsFnQ4M 6+3dwohmextnczdsxDFPxCg2imsCskl7Eg== X-Received: by 2002:a17:906:3644:: with SMTP id r4mr31566728ejb.517.1605857100308; Thu, 19 Nov 2020 23:25:00 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:59 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:22 +0100 Message-Id: <20201120072116.818090-50-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 049/162] avcodec/mpc8: Reduce size of tables used to initialize 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" X-TUID: kWxs70+rYsMj Content-Length: 55732 By switching to ff_init_vlc_from_lengths() one can make a table of codes of type uint8_t superfluous, saving space. Other VLCs (those without dedicated symbols table and with codes of type uint8_t) have been made to use ff_init_vlc_from_lengths(), too, because it reduces codesize (ff_init_vlc_from_lengths() has two parameters less than ff_init_vlc_sparse()) and because it allows to use the offset parameter in future commits. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc8.c | 133 ++++------ libavcodec/mpc8huff.h | 575 ++++++++++++++---------------------------- 2 files changed, 240 insertions(+), 468 deletions(-) diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index 631bac2753..920180e92d 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -101,15 +101,6 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) static int vlc_initialized = 0; int channels; - static VLC_TYPE band_table[542][2]; - static VLC_TYPE q1_table[520][2]; - static VLC_TYPE q9up_table[524][2]; - static VLC_TYPE scfi0_table[1 << MPC8_SCFI0_BITS][2]; - static VLC_TYPE scfi1_table[1 << MPC8_SCFI1_BITS][2]; - static VLC_TYPE dscf0_table[560][2]; - static VLC_TYPE dscf1_table[598][2]; - static VLC_TYPE q3_0_table[512][2]; - static VLC_TYPE q3_1_table[516][2]; static VLC_TYPE codes_table[5708][2]; if(avctx->extradata_size < 2){ @@ -145,91 +136,77 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) if(vlc_initialized) return 0; av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n"); - band_vlc.table = band_table; - band_vlc.table_allocated = 542; - init_vlc(&band_vlc, MPC8_BANDS_BITS, MPC8_BANDS_SIZE, - mpc8_bands_bits, 1, 1, - mpc8_bands_codes, 1, 1, INIT_VLC_USE_NEW_STATIC); - - q1_vlc.table = q1_table; - q1_vlc.table_allocated = 520; - init_vlc(&q1_vlc, MPC8_Q1_BITS, MPC8_Q1_SIZE, - mpc8_q1_bits, 1, 1, - mpc8_q1_codes, 1, 1, INIT_VLC_USE_NEW_STATIC); - q9up_vlc.table = q9up_table; - q9up_vlc.table_allocated = 524; - init_vlc(&q9up_vlc, MPC8_Q9UP_BITS, MPC8_Q9UP_SIZE, - mpc8_q9up_bits, 1, 1, - mpc8_q9up_codes, 1, 1, INIT_VLC_USE_NEW_STATIC); - - scfi_vlc[0].table = scfi0_table; - scfi_vlc[0].table_allocated = 1 << MPC8_SCFI0_BITS; - init_vlc(&scfi_vlc[0], MPC8_SCFI0_BITS, MPC8_SCFI0_SIZE, - mpc8_scfi0_bits, 1, 1, - mpc8_scfi0_codes, 1, 1, INIT_VLC_USE_NEW_STATIC); - scfi_vlc[1].table = scfi1_table; - scfi_vlc[1].table_allocated = 1 << MPC8_SCFI1_BITS; - init_vlc(&scfi_vlc[1], MPC8_SCFI1_BITS, MPC8_SCFI1_SIZE, - mpc8_scfi1_bits, 1, 1, - mpc8_scfi1_codes, 1, 1, INIT_VLC_USE_NEW_STATIC); - - dscf_vlc[0].table = dscf0_table; - dscf_vlc[0].table_allocated = 560; - init_vlc(&dscf_vlc[0], MPC8_DSCF0_BITS, MPC8_DSCF0_SIZE, - mpc8_dscf0_bits, 1, 1, - mpc8_dscf0_codes, 1, 1, INIT_VLC_USE_NEW_STATIC); - dscf_vlc[1].table = dscf1_table; - dscf_vlc[1].table_allocated = 598; - init_vlc(&dscf_vlc[1], MPC8_DSCF1_BITS, MPC8_DSCF1_SIZE, - mpc8_dscf1_bits, 1, 1, - mpc8_dscf1_codes, 1, 1, INIT_VLC_USE_NEW_STATIC); - - q3_vlc[0].table = q3_0_table; - q3_vlc[0].table_allocated = 512; - ff_init_vlc_sparse(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE, - mpc8_q3_bits, 1, 1, - mpc8_q3_codes, 1, 1, - mpc8_q3_syms, 1, 1, INIT_VLC_USE_NEW_STATIC); - q3_vlc[1].table = q3_1_table; - q3_vlc[1].table_allocated = 516; - ff_init_vlc_sparse(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE, - mpc8_q4_bits, 1, 1, - mpc8_q4_codes, 1, 1, - mpc8_q4_syms, 1, 1, INIT_VLC_USE_NEW_STATIC); + INIT_VLC_STATIC_FROM_LENGTHS(&band_vlc, MPC8_BANDS_BITS, MPC8_BANDS_SIZE, + mpc8_bands_bits, 1, + mpc8_bands_syms, 1, 1, 0, 0, 542); + + INIT_VLC_STATIC_FROM_LENGTHS(&q1_vlc, MPC8_Q1_BITS, MPC8_Q1_SIZE, + mpc8_q1_bits, 1, + mpc8_q1_syms, 1, 1, 0, 0, 520); + INIT_VLC_STATIC_FROM_LENGTHS(&q9up_vlc, MPC8_Q9UP_BITS, MPC8_Q9UP_SIZE, + mpc8_q9up_bits, 1, + mpc8_q9up_syms, 1, 1, 0, 0, 524); + + INIT_VLC_STATIC_FROM_LENGTHS(&scfi_vlc[0], MPC8_SCFI0_BITS, MPC8_SCFI0_SIZE, + mpc8_scfi0_bits, 1, + mpc8_scfi0_syms, 1, 1, 0, 0, 1 << MPC8_SCFI0_BITS); + INIT_VLC_STATIC_FROM_LENGTHS(&scfi_vlc[1], MPC8_SCFI1_BITS, MPC8_SCFI1_SIZE, + mpc8_scfi1_bits, 1, + mpc8_scfi1_syms, 1, 1, 0, 0, 1 << MPC8_SCFI1_BITS); + + INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc[0], MPC8_DSCF0_BITS, MPC8_DSCF0_SIZE, + mpc8_dscf0_bits, 1, + mpc8_dscf0_syms, 1, 1, 0, 0, 560); + INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc[1], MPC8_DSCF1_BITS, MPC8_DSCF1_SIZE, + mpc8_dscf1_bits, 1, + mpc8_dscf1_syms, 1, 1, 0, 0, 598); + + INIT_VLC_STATIC_FROM_LENGTHS(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE, + mpc8_q3_bits, 1, + mpc8_q3_syms, 1, 1, 0, 0, 512); + INIT_VLC_STATIC_FROM_LENGTHS(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE, + mpc8_q4_bits, 1, + mpc8_q4_syms, 1, 1, 0, 0, 516); for(i = 0; i < 2; i++){ res_vlc[i].table = &codes_table[vlc_offsets[0+i]]; res_vlc[i].table_allocated = vlc_offsets[1+i] - vlc_offsets[0+i]; - init_vlc(&res_vlc[i], MPC8_RES_BITS, MPC8_RES_SIZE, - &mpc8_res_bits[i], 1, 1, - &mpc8_res_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&res_vlc[i], MPC8_RES_BITS, MPC8_RES_SIZE, + mpc8_res_bits[i], 1, + mpc8_res_syms[i], 1, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); q2_vlc[i].table = &codes_table[vlc_offsets[2+i]]; q2_vlc[i].table_allocated = vlc_offsets[3+i] - vlc_offsets[2+i]; - init_vlc(&q2_vlc[i], MPC8_Q2_BITS, MPC8_Q2_SIZE, - &mpc8_q2_bits[i], 1, 1, - &mpc8_q2_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&q2_vlc[i], MPC8_Q2_BITS, MPC8_Q2_SIZE, + mpc8_q2_bits[i], 1, + mpc8_q2_syms[i], 1, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); quant_vlc[0][i].table = &codes_table[vlc_offsets[4+i]]; quant_vlc[0][i].table_allocated = vlc_offsets[5+i] - vlc_offsets[4+i]; - init_vlc(&quant_vlc[0][i], MPC8_Q5_BITS, MPC8_Q5_SIZE, - &mpc8_q5_bits[i], 1, 1, - &mpc8_q5_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&quant_vlc[0][i], MPC8_Q5_BITS, MPC8_Q5_SIZE, + mpc8_q5_bits[i], 1, + mpc8_q5_syms[i], 1, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); quant_vlc[1][i].table = &codes_table[vlc_offsets[6+i]]; quant_vlc[1][i].table_allocated = vlc_offsets[7+i] - vlc_offsets[6+i]; - init_vlc(&quant_vlc[1][i], MPC8_Q6_BITS, MPC8_Q6_SIZE, - &mpc8_q6_bits[i], 1, 1, - &mpc8_q6_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&quant_vlc[1][i], MPC8_Q6_BITS, MPC8_Q6_SIZE, + mpc8_q6_bits[i], 1, + mpc8_q6_syms[i], 1, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); quant_vlc[2][i].table = &codes_table[vlc_offsets[8+i]]; quant_vlc[2][i].table_allocated = vlc_offsets[9+i] - vlc_offsets[8+i]; - init_vlc(&quant_vlc[2][i], MPC8_Q7_BITS, MPC8_Q7_SIZE, - &mpc8_q7_bits[i], 1, 1, - &mpc8_q7_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&quant_vlc[2][i], MPC8_Q7_BITS, MPC8_Q7_SIZE, + mpc8_q7_bits[i], 1, + mpc8_q7_syms[i], 1, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); quant_vlc[3][i].table = &codes_table[vlc_offsets[10+i]]; quant_vlc[3][i].table_allocated = vlc_offsets[11+i] - vlc_offsets[10+i]; - init_vlc(&quant_vlc[3][i], MPC8_Q8_BITS, MPC8_Q8_SIZE, - &mpc8_q8_bits[i], 1, 1, - &mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&quant_vlc[3][i], MPC8_Q8_BITS, MPC8_Q8_SIZE, + mpc8_q8_bits[i], 1, + mpc8_q8_syms[i], 1, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); } vlc_initialized = 1; diff --git a/libavcodec/mpc8huff.h b/libavcodec/mpc8huff.h index 0566c910ca..687c9f7e98 100644 --- a/libavcodec/mpc8huff.h +++ b/libavcodec/mpc8huff.h @@ -27,287 +27,182 @@ #define MPC8_BANDS_SIZE 33 #define MPC8_BANDS_BITS 9 -static const uint8_t mpc8_bands_codes[MPC8_BANDS_SIZE] = { - 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, - 0x05, 0x06, 0x01, 0x02, 0x03, 0x00, 0x04, 0x05, - 0x06, 0x07, 0x08, 0x01, 0x09, 0x0A, 0x0B, 0x07, - 0x08, 0x09, 0x06, 0x07, 0x05, 0x05, 0x03, 0x03, - 0x01, +static const uint8_t mpc8_bands_syms[MPC8_BANDS_SIZE] = { + 13, 19, 10, 11, 12, 14, 15, 16, 17, 18, 20, 21, 22, 9, 23, 24, 25, 8, 26, + 27, 7, 28, 5, 6, 29, 4, 3, 30, 2, 31, 1, 32, 0 }; static const uint8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = { - 1, 3, 5, 6, 7, 8, 8, 9, - 10, 11, 12, 12, 12, 13, 12, 12, - 12, 12, 12, 13, 12, 12, 12, 11, - 11, 11, 10, 10, 9, 8, 6, 5, - 2, + 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, + 10, 9, 9, 8, 8, 8, 7, 6, 6, 5, 5, 3, 2, 1 }; #define MPC8_SCFI0_SIZE 4 #define MPC8_SCFI0_BITS 3 -static const uint8_t mpc8_scfi0_codes[MPC8_SCFI0_SIZE] = { - 0x00, 0x01, 0x01, 0x01, +static const uint8_t mpc8_scfi0_syms[MPC8_SCFI0_SIZE] = { + 0, 1, 3, 2 }; static const uint8_t mpc8_scfi0_bits[MPC8_SCFI0_SIZE] = { - 3, 3, 1, 2, + 3, 3, 2, 1 }; #define MPC8_SCFI1_SIZE 16 #define MPC8_SCFI1_BITS 7 -static const uint8_t mpc8_scfi1_codes[MPC8_SCFI1_SIZE] = { - 0x01, 0x00, 0x02, 0x03, 0x01, 0x03, 0x04, 0x05, - 0x04, 0x06, 0x02, 0x02, 0x05, 0x07, 0x03, 0x03, - +static const uint8_t mpc8_scfi1_syms[MPC8_SCFI1_SIZE] = { + 1, 4, 0, 2, 3, 8, 12, 5, 6, 7, 9, 13, 11, 14, 10, 15 }; static const uint8_t mpc8_scfi1_bits[MPC8_SCFI1_SIZE] = { - 6, 7, 6, 6, 7, 5, 5, 5, - 6, 5, 2, 3, 6, 5, 3, 2, - + 7, 7, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 3, 3, 2, 2 }; #define MPC8_DSCF0_SIZE 64 #define MPC8_DSCF0_BITS 9 -static const uint8_t mpc8_dscf0_codes[MPC8_DSCF0_SIZE] = { - 0x03, 0x04, 0x05, 0x04, 0x05, 0x06, 0x05, 0x06, - 0x07, 0x08, 0x09, 0x07, 0x08, 0x09, 0x0A, 0x07, - 0x08, 0x09, 0x0A, 0x07, 0x08, 0x09, 0x0A, 0x06, - 0x07, 0x05, 0x04, 0x05, 0x06, 0x06, 0x07, 0x0A, - 0x08, 0x05, 0x06, 0x07, 0x09, 0x07, 0x08, 0x09, - 0x0B, 0x0B, 0x0C, 0x0D, 0x0B, 0x0C, 0x0D, 0x0B, - 0x0C, 0x0D, 0x07, 0x08, 0x09, 0x06, 0x07, 0x03, - 0x04, 0x05, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, +static const uint8_t mpc8_dscf0_syms[MPC8_DSCF0_SIZE] = { + 58, 59, 60, 61, 62, 63, 55, 56, 57, 0, 1, 2, 53, 54, 3, 4, 5, 50, 51, + 52, 6, 7, 8, 9, 10, 31, 47, 48, 49, 11, 12, 13, 14, 44, 45, 46, 15, 16, + 17, 18, 41, 42, 43, 19, 20, 21, 22, 40, 23, 24, 38, 39, 25, 28, 37, 26, 27, + 29, 30, 32, 36, 33, 34, 35, }; static const uint8_t mpc8_dscf0_bits[MPC8_DSCF0_SIZE] = { - 12, 12, 12, 11, 11, 11, 10, 10, - 10, 10, 10, 9, 9, 9, 9, 8, - 8, 8, 8, 7, 7, 7, 7, 6, - 6, 5, 4, 4, 5, 4, 4, 10, - 4, 3, 3, 3, 4, 5, 6, 6, - 7, 8, 8, 8, 9, 9, 9, 10, - 10, 10, 11, 11, 11, 12, 12, 13, - 13, 13, 14, 14, 14, 14, 14, 14, - + 14, 14, 14, 14, 14, 14, 13, 13, 13, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, + 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 8, 8, + 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 4, 4, + 4, 4, 4, 4, 3, 3, 3 }; #define MPC8_DSCF1_SIZE 65 #define MPC8_DSCF1_BITS 9 -static const uint8_t mpc8_dscf1_codes[MPC8_DSCF1_SIZE] = { - 0x00, 0x03, 0x04, 0x04, 0x05, 0x06, 0x05, 0x06, - 0x07, 0x08, 0x07, 0x08, 0x09, 0x0A, 0x07, 0x08, - 0x09, 0x0A, 0x07, 0x08, 0x09, 0x06, 0x07, 0x05, - 0x06, 0x04, 0x03, 0x03, 0x04, 0x03, 0x04, 0x05, - 0x06, 0x07, 0x05, 0x04, 0x05, 0x05, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x0B, 0x0C, 0x0D, 0x0B, 0x0C, - 0x0D, 0x09, 0x0A, 0x0B, 0x0C, 0x07, 0x08, 0x09, - 0x05, 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, - 0x0D, +static const uint8_t mpc8_dscf1_syms[MPC8_DSCF1_SIZE] = { + 0, 59, 60, 61, 62, 63, 1, 2, 56, 57, 58, 3, 4, 5, 53, 54, 55, 6, 7, + 8, 9, 49, 50, 51, 52, 64, 10, 11, 12, 13, 46, 47, 48, 14, 15, 16, 17, 43, + 44, 45, 18, 19, 20, 41, 42, 21, 22, 39, 40, 23, 24, 38, 25, 37, 26, 35, 36, + 27, 28, 34, 29, 30, 31, 32, 33, }; static const uint8_t mpc8_dscf1_bits[MPC8_DSCF1_SIZE] = { - 15, 14, 14, 13, 13, 13, 12, 12, - 12, 12, 11, 11, 11, 11, 10, 10, - 10, 10, 9, 9, 9, 8, 8, 7, - 7, 6, 5, 4, 4, 3, 3, 3, - 3, 3, 4, 5, 5, 6, 7, 8, - 8, 9, 9, 10, 10, 10, 11, 11, - 11, 12, 12, 12, 12, 13, 13, 13, - 14, 14, 14, 15, 15, 15, 15, 15, - 12, + 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, + 10, 10, 9, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 6, 6, 5, 5, 5, + 4, 4, 4, 3, 3, 3, 3, 3 }; #define MPC8_RES_SIZE 17 #define MPC8_RES_BITS 9 -static const uint8_t mpc8_res_codes[2][MPC8_RES_SIZE] = { +static const uint8_t mpc8_res_syms[2][MPC8_RES_SIZE] = { { - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, - 0x01, + 13, 14, 12, 11, 10, 9, 8, 7, 6, 15, 5, 4, 3, 2, 16, 1, 0, }, { - 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x00, 0x01, 0x02, 0x03, 0x01, 0x01, 0x01, 0x01, - 0x03, + 8, 9, 10, 11, 7, 12, 6, 13, 5, 4, 14, 3, 15, 2, 0, 1, 16, } }; static const uint8_t mpc8_res_bits[2][MPC8_RES_SIZE] = { { - 1, 2, 4, 5, 6, 7, 9, 10, - 11, 12, 13, 14, 15, 16, 16, 8, - 3, + 16, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }, { - 2, 2, 3, 5, 7, 8, 10, 12, - 14, 14, 14, 14, 11, 9, 6, 4, - 2, + 14, 14, 14, 14, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 2, 2 } }; #define MPC8_Q1_SIZE 19 #define MPC8_Q1_BITS 9 -static const uint8_t mpc8_q1_codes[MPC8_Q1_SIZE] = { - 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x03, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x00, 0x01, +static const uint8_t mpc8_q1_syms[MPC8_Q1_SIZE] = { + 17, 18, 16, 15, 14, 13, 12, 0, 11, 1, 2, 8, 9, 10, 3, 4, 5, 6, 7, }; static const uint8_t mpc8_q1_bits[MPC8_Q1_SIZE] = { - 6, 4, 4, 3, 3, 3, 3, 3, - 4, 4, 4, 5, 7, 8, 9, 10, - 11, 12, 12, + 12, 12, 11, 10, 9, 8, 7, 6, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3 }; #define MPC8_Q9UP_SIZE 256 #define MPC8_Q9UP_BITS 9 -static const uint8_t mpc8_q9up_codes[MPC8_Q9UP_SIZE] = { - 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x26, 0x27, 0x13, 0x14, 0x15, - 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, - 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, - 0x28, 0x26, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, - 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, - 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, - 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, - 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, - 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, - 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, - 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, - 0x67, 0x68, 0x69, 0x6A, 0x56, 0x57, 0x58, 0x59, - 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, - 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x3E, - 0x3F, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7A, 0x6B, 0x7B, 0x6C, 0x6D, 0x6E, - 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, - 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, - 0x7F, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, - 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, - 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, - 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, - 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0x27, 0x28, 0x29, - 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, - 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, - 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, - 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, - 0x4A, 0x4B, 0x06, 0x07, 0x08, 0x09, 0x00, 0x01, +static const uint8_t mpc8_q9up_syms[MPC8_Q9UP_SIZE] = { + 254, 255, 0, 1, 2, 3, 4, 250, 251, 252, 253, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 19, 20, 40, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 147, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 127, + 128, }; static const uint8_t mpc8_q9up_bits[MPC8_Q9UP_SIZE] = { - 10, 10, 10, 10, 10, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 8, 8, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 8, 9, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 6, - 6, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 8, 7, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 10, 10, 10, 10, 11, 11, + 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 6, 6 }; #define MPC8_Q2_SIZE 125 #define MPC8_Q2_BITS 9 -static const uint8_t mpc8_q2_codes[2][MPC8_Q2_SIZE] = { +static const uint8_t mpc8_q2_syms[2][MPC8_Q2_SIZE] = { { - 0x02, 0x03, 0x0F, 0x04, 0x00, 0x05, 0x0C, 0x12, - 0x0D, 0x06, 0x07, 0x13, 0x15, 0x14, 0x08, 0x09, - 0x0E, 0x15, 0x0F, 0x0A, 0x03, 0x0B, 0x10, 0x0C, - 0x01, 0x0D, 0x10, 0x16, 0x11, 0x0E, 0x12, 0x0F, - 0x10, 0x16, 0x13, 0x17, 0x11, 0x08, 0x12, 0x18, - 0x14, 0x13, 0x14, 0x17, 0x15, 0x0F, 0x16, 0x19, - 0x17, 0x10, 0x11, 0x1A, 0x18, 0x1B, 0x12, 0x1C, - 0x15, 0x09, 0x16, 0x1D, 0x19, 0x0A, 0x07, 0x0B, - 0x1A, 0x1E, 0x17, 0x0C, 0x18, 0x1F, 0x13, 0x20, - 0x1B, 0x21, 0x14, 0x11, 0x18, 0x22, 0x19, 0x12, - 0x1A, 0x19, 0x1A, 0x1B, 0x1B, 0x23, 0x1C, 0x0D, - 0x1D, 0x24, 0x1C, 0x1C, 0x1E, 0x1F, 0x1D, 0x13, - 0x1E, 0x25, 0x1F, 0x14, 0x02, 0x15, 0x15, 0x16, - 0x04, 0x17, 0x20, 0x26, 0x21, 0x18, 0x16, 0x27, - 0x1D, 0x28, 0x19, 0x1A, 0x22, 0x29, 0x23, 0x1B, - 0x03, 0x1C, 0x17, 0x1D, 0x05, + 4, 24, 100, 120, 0, 20, 104, 124, 1, 3, 5, 9, 10, 14, 15, + 19, 21, 23, 25, 29, 45, 49, 75, 79, 95, 99, 101, 103, 105, 109, + 114, 115, 119, 121, 123, 2, 22, 50, 54, 70, 74, 102, 110, 122, 6, + 8, 16, 18, 26, 28, 30, 34, 40, 44, 46, 48, 76, 78, 80, 84, + 90, 94, 96, 98, 106, 108, 116, 118, 7, 11, 13, 17, 27, 35, 39, + 47, 51, 53, 55, 59, 65, 69, 71, 73, 77, 85, 89, 97, 107, 111, + 113, 117, 12, 33, 43, 52, 60, 64, 72, 91, 112, 31, 32, 36, 38, + 41, 42, 56, 58, 66, 68, 81, 82, 83, 86, 88, 92, 93, 37, 57, + 61, 63, 67, 87, 62, }, { - 0x02, 0x03, 0x0F, 0x04, 0x00, 0x05, 0x0C, 0x0D, - 0x0E, 0x06, 0x07, 0x0F, 0x1E, 0x10, 0x10, 0x08, - 0x11, 0x12, 0x13, 0x09, 0x03, 0x0A, 0x11, 0x0B, - 0x01, 0x0C, 0x14, 0x15, 0x16, 0x0D, 0x17, 0x12, - 0x0E, 0x13, 0x18, 0x19, 0x14, 0x0F, 0x10, 0x1A, - 0x1B, 0x15, 0x11, 0x16, 0x1C, 0x0E, 0x1D, 0x1E, - 0x1F, 0x0F, 0x12, 0x20, 0x1F, 0x21, 0x13, 0x22, - 0x12, 0x13, 0x14, 0x23, 0x20, 0x15, 0x0F, 0x16, - 0x21, 0x24, 0x17, 0x18, 0x19, 0x25, 0x14, 0x26, - 0x22, 0x27, 0x15, 0x10, 0x28, 0x29, 0x2A, 0x11, - 0x2B, 0x17, 0x1A, 0x18, 0x2C, 0x2D, 0x1B, 0x1C, - 0x19, 0x2E, 0x2F, 0x1A, 0x1D, 0x1B, 0x30, 0x12, - 0x31, 0x32, 0x33, 0x13, 0x02, 0x14, 0x15, 0x16, - 0x04, 0x17, 0x34, 0x35, 0x36, 0x18, 0x16, 0x37, - 0x23, 0x38, 0x19, 0x1A, 0x39, 0x3A, 0x3B, 0x1B, - 0x03, 0x1C, 0x17, 0x1D, 0x05, + 4, 24, 100, 120, 0, 20, 104, 124, 1, 3, 5, 9, 10, 15, 19, + 21, 23, 25, 29, 45, 49, 75, 79, 95, 99, 101, 102, 103, 105, 109, + 114, 115, 119, 121, 123, 2, 14, 22, 50, 54, 70, 74, 110, 122, 6, + 7, 8, 11, 13, 16, 17, 18, 26, 27, 28, 30, 34, 35, 39, 40, + 44, 46, 47, 48, 51, 53, 55, 59, 65, 69, 71, 73, 76, 77, 78, + 80, 84, 85, 89, 90, 94, 96, 97, 98, 106, 107, 108, 111, 113, 116, + 117, 118, 12, 52, 60, 64, 72, 112, 31, 33, 36, 41, 43, 81, 83, + 88, 91, 93, 32, 37, 38, 42, 56, 57, 58, 61, 63, 66, 67, 68, + 82, 86, 87, 92, 62, } }; static const uint8_t mpc8_q2_bits[2][MPC8_Q2_SIZE] = { { - 12, 11, 10, 11, 13, 11, 9, 8, - 9, 11, 11, 8, 7, 8, 11, 11, - 9, 8, 9, 11, 12, 11, 10, 11, - 13, 11, 9, 8, 9, 11, 9, 6, - 6, 7, 9, 8, 6, 4, 6, 8, - 9, 6, 6, 7, 9, 11, 9, 8, - 9, 11, 10, 8, 7, 8, 10, 8, - 6, 4, 6, 8, 7, 4, 3, 4, - 7, 8, 6, 4, 6, 8, 10, 8, - 7, 8, 10, 11, 9, 8, 9, 11, - 9, 6, 6, 6, 9, 8, 6, 4, - 6, 8, 9, 7, 6, 6, 9, 11, - 9, 8, 9, 11, 13, 11, 10, 11, - 12, 11, 9, 8, 9, 11, 10, 8, - 7, 8, 11, 11, 9, 8, 9, 11, - 13, 11, 10, 11, 12, + 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 3 }, { - 11, 10, 9, 10, 12, 10, 8, 8, - 8, 10, 10, 8, 7, 8, 9, 10, - 8, 8, 8, 10, 11, 10, 9, 10, - 12, 10, 8, 8, 8, 10, 8, 6, - 5, 6, 8, 8, 6, 5, 5, 8, - 8, 6, 5, 6, 8, 10, 8, 8, - 8, 10, 9, 8, 7, 8, 9, 8, - 5, 5, 5, 8, 7, 5, 4, 5, - 7, 8, 5, 5, 5, 8, 9, 8, - 7, 8, 9, 10, 8, 8, 8, 10, - 8, 6, 5, 6, 8, 8, 5, 5, - 6, 8, 8, 6, 5, 6, 8, 10, - 8, 8, 8, 10, 12, 10, 10, 10, - 11, 10, 8, 8, 8, 10, 9, 8, - 7, 8, 10, 10, 8, 8, 8, 10, - 12, 10, 9, 10, 11, + 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, + 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4 } }; @@ -315,100 +210,56 @@ static const uint8_t mpc8_q2_bits[2][MPC8_Q2_SIZE] = { #define MPC8_Q3_BITS 9 #define MPC8_Q3_OFFSET -48 -static const uint8_t mpc8_q3_codes[MPC8_Q3_SIZE] = { - 0x07, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x0F, - 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x13, 0x12, 0x11, - 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, - 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, - 0x09, 0x08, 0x07, 0x06, 0x05, 0x09, 0x08, 0x07, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01, - 0x00, -}; static const uint8_t mpc8_q3_bits[MPC8_Q3_SIZE] = { - 3, 4, 4, 4, 4, 4, 4, 5, - 5, 5, 5, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 8, 8, 8, - 8, 8, 8, 8, 8, 9, 9, 9, - 9, + 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, + 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 3, }; static const uint8_t mpc8_q3_syms[MPC8_Q3_SIZE] = { - 48, 65, 64, 49, 63, 32, 47, 80, - 79, 50, 62, 33, 16, 82, 81, 95, - 94, 66, 78, 34, 46, 17, 31, 30, - 97, 96, 111, 67, 77, 51, 61, 35, - 45, 18, 1, 0, 15, 98, 110, 83, - 93, 19, 29, 2, 14, 99, 109, 3, - 13, + 13, 3, 109, 99, 14, 2, 29, 19, 93, 83, 110, 98, 15, 0, 1, + 18, 45, 35, 61, 51, 77, 67, 111, 96, 97, 30, 31, 17, 46, 34, + 78, 66, 94, 95, 81, 82, 16, 33, 62, 50, 79, 80, 47, 32, 63, + 49, 64, 65, 48, }; #define MPC8_Q4_SIZE 81 #define MPC8_Q4_BITS 9 #define MPC8_Q4_OFFSET -64 -static const uint8_t mpc8_q4_codes[MPC8_Q4_SIZE] = { - 0x0F, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, - 0x16, 0x15, 0x14, 0x13, 0x12, 0x23, 0x22, 0x21, - 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, - 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, - 0x10, 0x0F, 0x0E, 0x0D, 0x19, 0x18, 0x17, 0x16, - 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, - 0x0D, 0x0C, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, - 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, - 0x09, 0x08, 0x07, 0x06, 0x05, 0x09, 0x08, 0x07, - 0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01, - 0x00, -}; static const uint8_t mpc8_q4_bits[MPC8_Q4_SIZE] = { - 4, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 9, 9, 9, - 9, 9, 9, 9, 9, 10, 10, 10, - 10, + 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 4, }; static const uint8_t mpc8_q4_syms[MPC8_Q4_SIZE] = { - 64, 96, 81, 80, 95, 66, 65, 79, - 78, 49, 48, 63, 32, 113, 112, 98, - 97, 111, 110, 83, 82, 94, 93, 67, - 77, 51, 50, 62, 61, 34, 33, 47, - 46, 17, 16, 31, 128, 114, 127, 126, - 99, 109, 68, 76, 35, 45, 18, 30, - 0, 15, 130, 129, 143, 142, 115, 125, - 100, 108, 84, 92, 52, 60, 36, 44, - 19, 29, 2, 1, 14, 131, 141, 116, - 124, 20, 28, 3, 13, 132, 140, 4, - 12, + 12, 4, 140, 132, 13, 3, 28, 20, 124, 116, 141, 131, 14, 1, 2, + 29, 19, 44, 36, 60, 52, 92, 84, 108, 100, 125, 115, 142, 143, 129, + 130, 15, 0, 30, 18, 45, 35, 76, 68, 109, 99, 126, 127, 114, 128, + 31, 16, 17, 46, 47, 33, 34, 61, 62, 50, 51, 77, 67, 93, 94, + 82, 83, 110, 111, 97, 98, 112, 113, 32, 63, 48, 49, 78, 79, 65, + 66, 95, 80, 81, 96, 64, }; #define MPC8_Q5_SIZE 15 #define MPC8_Q5_BITS 7 #define MPC8_Q5_OFFSET -7 -static const uint8_t mpc8_q5_codes[2][MPC8_Q5_SIZE] = { +static const uint8_t mpc8_q5_syms[2][MPC8_Q5_SIZE] = { { - 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x05, 0x03, 0x03, 0x03, 0x02, 0x03, + 0, 1, 13, 14, 2, 12, 3, 11, 4, 10, 5, 6, 8, 9, 7, }, { - 0x00, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x05, - 0x06, 0x07, 0x04, 0x05, 0x03, 0x02, 0x03, + 0, 1, 13, 14, 2, 12, 3, 4, 10, 11, 5, 6, 7, 8, 9, } }; static const uint8_t mpc8_q5_bits[2][MPC8_Q5_SIZE] = { { - 7, 7, 6, 5, 4, 3, 3, 2, - 3, 3, 4, 5, 6, 7, 7, + 7, 7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 3, 3, 2 }, { - 6, 6, 5, 4, 4, 3, 3, 3, - 3, 3, 4, 4, 5, 6, 6, + 6, 6, 6, 6, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 3 } }; @@ -416,32 +267,24 @@ static const uint8_t mpc8_q5_bits[2][MPC8_Q5_SIZE] = { #define MPC8_Q6_BITS 9 #define MPC8_Q6_OFFSET -15 -static const uint8_t mpc8_q6_codes[2][MPC8_Q6_SIZE] = { +static const uint8_t mpc8_q6_syms[2][MPC8_Q6_SIZE] = { { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x04, 0x03, - 0x04, 0x05, 0x05, 0x06, 0x04, 0x05, 0x04, 0x03, - 0x05, 0x06, 0x07, 0x07, 0x06, 0x07, 0x08, 0x09, - 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, + 0, 1, 2, 3, 27, 28, 29, 30, 4, 5, 25, 26, 6, 24, 7, 8, 9, 20, 21, + 22, 23, 10, 11, 19, 12, 13, 17, 18, 14, 16, 15, }, { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x04, - 0x05, 0x06, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, - 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x07, 0x08, 0x09, - 0x06, 0x07, 0x05, 0x06, 0x07, 0x02, 0x03, + 0, 1, 29, 30, 2, 3, 4, 26, 27, 28, 5, 6, 24, 25, 7, 8, 9, 21, 22, + 23, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, } }; static const uint8_t mpc8_q6_bits[2][MPC8_Q6_SIZE] = { { - 9, 9, 9, 9, 8, 8, 7, 6, - 6, 6, 5, 5, 4, 4, 3, 2, - 3, 4, 4, 5, 6, 6, 6, 6, - 7, 8, 8, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 6, 6, 6, 6, 6, + 6, 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 2 }, { - 8, 8, 7, 7, 7, 6, 6, 5, - 5, 5, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 5, 5, 5, - 6, 6, 7, 7, 7, 8, 8, + 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 5, + 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 } }; @@ -449,48 +292,32 @@ static const uint8_t mpc8_q6_bits[2][MPC8_Q6_SIZE] = { #define MPC8_Q7_BITS 9 #define MPC8_Q7_OFFSET -31 -static const uint8_t mpc8_q7_codes[2][MPC8_Q7_SIZE] = { +static const uint8_t mpc8_q7_syms[2][MPC8_Q7_SIZE] = { { - 0x00, 0x01, 0x02, 0x08, 0x09, 0x03, 0x04, 0x05, - 0x06, 0x07, 0x0A, 0x0B, 0x0C, 0x0D, 0x0A, 0x0B, - 0x0C, 0x0D, 0x0E, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0A, 0x0B, 0x0C, 0x08, 0x09, 0x06, 0x04, 0x03, - 0x05, 0x07, 0x0A, 0x0B, 0x0D, 0x0E, 0x0F, 0x0F, - 0x10, 0x11, 0x12, 0x0F, 0x13, 0x10, 0x11, 0x12, - 0x13, 0x0E, 0x0F, 0x10, 0x11, 0x08, 0x09, 0x0A, - 0x0B, 0x0C, 0x12, 0x13, 0x0D, 0x0E, 0x0F, + 0, 1, 2, 5, 6, 7, 8, 9, 53, 54, 55, 56, 57, 60, 61, 62, 3, 4, 10, + 11, 12, 13, 49, 50, 51, 52, 58, 59, 14, 15, 16, 17, 18, 43, 45, 46, 47, 48, + 19, 20, 21, 22, 23, 39, 40, 41, 42, 44, 24, 25, 26, 36, 37, 38, 27, 28, 34, + 35, 29, 33, 30, 32, 31, }, { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x09, 0x0A, - 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x0C, 0x0D, - 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, - 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, - 0x1E, 0x1F, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, - 0x17, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x09, 0x0A, - 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x02, 0x03, + 0, 1, 61, 62, 2, 3, 4, 5, 6, 7, 8, 54, 55, 56, 57, 58, 59, 60, 9, + 10, 11, 12, 13, 49, 50, 51, 52, 53, 14, 15, 16, 17, 18, 19, 20, 21, 42, 43, + 44, 45, 46, 47, 48, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, } }; static const uint8_t mpc8_q7_bits[2][MPC8_Q7_SIZE] = { { - 10, 10, 10, 9, 9, 10, 10, 10, - 10, 10, 9, 9, 9, 9, 8, 8, - 8, 8, 8, 7, 7, 7, 7, 7, - 6, 6, 6, 5, 5, 4, 3, 2, - 3, 4, 5, 5, 6, 6, 6, 7, - 7, 7, 7, 8, 7, 8, 8, 8, - 8, 9, 9, 9, 9, 10, 10, 10, - 10, 10, 9, 9, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, + 5, 4, 4, 3, 3, 2 }, { - 9, 9, 8, 8, 8, 8, 8, 8, - 8, 7, 7, 7, 7, 7, 6, 6, - 6, 6, 6, 6, 6, 6, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 6, 6, 6, 6, 6, 6, - 6, 7, 7, 7, 7, 7, 8, 8, - 8, 8, 8, 8, 8, 9, 9, + 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5 } }; @@ -498,80 +325,48 @@ static const uint8_t mpc8_q7_bits[2][MPC8_Q7_SIZE] = { #define MPC8_Q8_BITS 9 #define MPC8_Q8_OFFSET -63 -static const uint8_t mpc8_q8_codes[2][MPC8_Q8_SIZE] = { +static const uint8_t mpc8_q8_syms[2][MPC8_Q8_SIZE] = { { - 0x03, 0x04, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x1A, - 0x0F, 0x1B, 0x10, 0x00, 0x01, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x11, 0x0C, 0x12, 0x13, - 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1C, 0x1A, - 0x1B, 0x1C, 0x1D, 0x1E, 0x1D, 0x1E, 0x1F, 0x20, - 0x21, 0x22, 0x23, 0x24, 0x19, 0x25, 0x1A, 0x1B, - 0x1C, 0x1D, 0x1E, 0x1F, 0x14, 0x15, 0x16, 0x17, - 0x0E, 0x0F, 0x10, 0x11, 0x0B, 0x07, 0x04, 0x03, - 0x05, 0x0C, 0x0D, 0x12, 0x13, 0x14, 0x15, 0x18, - 0x19, 0x1A, 0x1B, 0x20, 0x21, 0x22, 0x23, 0x24, - 0x25, 0x26, 0x27, 0x26, 0x27, 0x28, 0x29, 0x2A, - 0x2B, 0x2C, 0x2D, 0x2E, 0x1F, 0x20, 0x2F, 0x21, - 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, - 0x0D, 0x0E, 0x2A, 0x0F, 0x10, 0x11, 0x12, 0x02, - 0x13, 0x03, 0x04, 0x05, 0x2B, 0x2C, 0x30, 0x31, - 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, + 11, 12, 111, 113, 114, 115, 0, 1, 13, 14, 15, 16, 17, 18, 19, + 21, 104, 105, 107, 108, 109, 110, 112, 2, 3, 4, 5, 6, 8, 10, + 20, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 92, + 93, 95, 96, 97, 98, 99, 100, 101, 102, 103, 106, 116, 117, 120, 121, + 122, 123, 124, 125, 126, 7, 9, 30, 36, 37, 38, 39, 40, 41, 42, + 43, 45, 83, 84, 85, 86, 87, 88, 89, 90, 91, 94, 118, 119, 44, + 46, 47, 48, 49, 50, 51, 75, 76, 77, 78, 79, 80, 81, 82, 52, + 53, 54, 55, 71, 72, 73, 74, 56, 57, 58, 59, 67, 68, 69, 70, + 60, 65, 66, 61, 62, 64, 63, }, { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x15, 0x16, - 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, - 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, - 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, - 0x2F, 0x30, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, - 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, - 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, - 0x3C, 0x3D, 0x3E, 0x31, 0x3F, 0x32, 0x33, 0x34, - 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, - 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, - 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x16, - 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, - 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, - 0x27, 0x28, 0x29, 0x04, 0x05, 0x06, 0x07, + 0, 1, 2, 3, 123, 124, 125, 126, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 75, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 76, } }; static const uint8_t mpc8_q8_bits[2][MPC8_Q8_SIZE] = { { - 11, 11, 10, 10, 10, 10, 10, 9, - 10, 9, 10, 12, 12, 11, 11, 11, - 11, 11, 11, 11, 10, 11, 10, 10, - 10, 10, 10, 10, 10, 10, 9, 10, - 10, 10, 10, 10, 9, 9, 9, 9, - 9, 9, 9, 9, 8, 9, 8, 8, - 8, 8, 8, 8, 7, 7, 7, 7, - 6, 6, 6, 6, 5, 4, 3, 2, - 3, 5, 5, 6, 6, 6, 6, 7, - 7, 7, 7, 8, 8, 8, 8, 8, - 8, 8, 8, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 10, 10, 9, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 11, 11, 10, 11, 11, 11, 11, 12, - 11, 12, 12, 12, 10, 10, 9, 9, - 10, 10, 10, 10, 10, 10, 10, + 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, + 6, 6, 6, 6, 6, 6, 5, 5, 5, 4, 3, 3, 2 }, { - 9, 9, 9, 9, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 7, 6, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 } }; From patchwork Fri Nov 20 07:19:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23946 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp953118ybf; Thu, 19 Nov 2020 23:33:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHcGhrwyzMVBMJSXwu50OFWvAgmyXEBx4pKU0k0e8+28pZAHeZeYq+LtaV43S93Tb+GcxD X-Received: by 2002:adf:8284:: with SMTP id 4mr14727935wrc.386.1605857581067; Thu, 19 Nov 2020 23:33:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605857581; cv=none; d=google.com; s=arc-20160816; b=FJXqZ5U8yjIvpDwjffrexFprGHPmz2+XE78xax/giKhu5uoLSad67FjgqUgJC1hKH8 XX14myebDEI+C8vc/lzEhTANG72+AFC0LPElnyr2Nu7cuT32tbXeCYWiVvaU2cJ3RPVa L6xxjAA1QVv7drVt9x0DgeafNvD0aZQ5lAmlcUxOQUPXgYcd8jokxaTNJHUilth2o+kX qBnur2sDzkU6qB0BBxRoTWB+f6ys5KG/JNyK/djTceuKYdsTAf22L4oTcYLQCZZxsAsB cxQVEfDTFlhbPhrl8ruvmvjkRl0rKu4wk6JKmm1eA+2XF+cUFB1LPIMANMIBqNz87XeD 0rdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=sAxTL77oRFz3u35lveuqqPL7XhcckOo41n+RYJuRLyk=; b=pMeDcuM5808hFQA3eH6ncLFw+baBYKYo8QKjqrKM0PDTTsgU1jjg5gPDYvEDNx/K0h EYlRsHLwskrxpXL6osNsNLsnXgrynQi4pdjchjHFhzwgTfYRHxGicTAy/pW+G7uma26/ s/plVOKnB6P+Gt3Im8oGHrrmzbEj+2wWlfWl8PkP1dQQn7SU/18I6jUp7BAnHqN+mvve gA6A3mNhpInGtv1CABgdFzdEu7leQ5QRxV+iG3HwF1B0trYn77KScJqCsfW9SK/dtpZ1 hhSnN12HcmdZTyJcirFrtVjhshECmwVSZzvyG8Ysp78hXY31Ccm7DXiUeY/jtvFFpluH 8JkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="hBmF/8GG"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i81si2103842wma.190.2020.11.19.23.33.00; Thu, 19 Nov 2020 23:33:01 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="hBmF/8GG"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6847968BB0F; Fri, 20 Nov 2020 09:25:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0338168BA8C for ; Fri, 20 Nov 2020 09:25:01 +0200 (EET) Received: by mail-ed1-f67.google.com with SMTP id d18so8469631edt.7 for ; Thu, 19 Nov 2020 23:25:01 -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=gifL3XzHolExl39r/lMMME2GcIGJ7TCUD7k8259OhPI=; b=hBmF/8GGdXwPItCHPX8weltGiaNa7CDVrIoKuOkKat++058WeplSi30sFEDaP9OvmK nC/2zB935FTahU0dcUNUXeNDTeD6lm86hu7VjvUCZikK4eIcwIK8sbGErUfjcFiIMjmo 5af6w2fwXHEWatxKrqptYi78W7aFwUgB935uHE1r0hQrJ0jsHp8JtJfVPS6Us7V0rCW7 SClUFoiInwTp95qkxHE5bi+RrSZONg8X5Vm7Oolkt8BEZD0SsgdUPx3Y0rpasX/vqEE+ svPXYsjYrixcYadTzNTkRX+t5Uw/B8o1FBX0NeKpHOOFpnEMD72LtFYwrS0fqxBwKVAC +8IA== 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=gifL3XzHolExl39r/lMMME2GcIGJ7TCUD7k8259OhPI=; b=ReOFzGl/NnDNI6E/XClWoTQT0Ox3WbnK2mNPiy9lIctzlTN0jdUOimOoI/2ZjPhpWY 7mbObOtagubkEK7bB5JPPqCwcyBwXEzOU/7kgT4cfe3UPwTYj39/0yl/cbcGMrguc3Ap +TJSugpHAQ+x32IgttC4EN91lmPrPO2PX+nZ5ThN+cPiOUFCX5drw1jsvO1VBWTFJgav VUVfKAg9frvWBqAlkA6ib5HGbTd8SmncTUjUoDJhVeWzeYuozvujq75veF3qtjfSUpuJ K1m197/oSKcYCGRpih8BgnWYXRaaBAvb0upeQZ5lOa9vcY8YgP58ueC3mMCcJoEKLbvM jnoQ== X-Gm-Message-State: AOAM532+vsBfsD/e5q/v831UmQ2cviC9r1Oqm2MBUbJ0BT2GziQNLAzX 7IaZ9eFmRsjR0E4no8AXRVnEusg7MKsGmw== X-Received: by 2002:a05:6402:3098:: with SMTP id de24mr33471246edb.155.1605857101150; Thu, 19 Nov 2020 23:25:01 -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.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:00 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:23 +0100 Message-Id: <20201120072116.818090-51-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 050/162] avcodec/mpc8: Apply offsets 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" X-TUID: G9u48Ru72wkr Content-Length: 6521 Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc8.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index 920180e92d..b5f89c845b 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -39,9 +39,6 @@ static VLC band_vlc, scfi_vlc[2], dscf_vlc[2], res_vlc[2]; static VLC q1_vlc, q2_vlc[2], q3_vlc[2], quant_vlc[4][2], q9up_vlc; -static const int q3_offsets[2] = { MPC8_Q3_OFFSET, MPC8_Q4_OFFSET }; -static const int quant_offsets[6] = { MPC8_Q5_OFFSET, MPC8_Q6_OFFSET, MPC8_Q7_OFFSET, MPC8_Q8_OFFSET }; - static inline int mpc8_dec_base(GetBitContext *gb, int k, int n) { int len = mpc8_cnk_len[k-1][n-1] - 1; @@ -163,10 +160,10 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) INIT_VLC_STATIC_FROM_LENGTHS(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE, mpc8_q3_bits, 1, - mpc8_q3_syms, 1, 1, 0, 0, 512); + mpc8_q3_syms, 1, 1, MPC8_Q3_OFFSET, 0, 512); INIT_VLC_STATIC_FROM_LENGTHS(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE, mpc8_q4_bits, 1, - mpc8_q4_syms, 1, 1, 0, 0, 516); + mpc8_q4_syms, 1, 1, MPC8_Q4_OFFSET, 0, 516); for(i = 0; i < 2; i++){ res_vlc[i].table = &codes_table[vlc_offsets[0+i]]; @@ -188,25 +185,25 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) ff_init_vlc_from_lengths(&quant_vlc[0][i], MPC8_Q5_BITS, MPC8_Q5_SIZE, mpc8_q5_bits[i], 1, mpc8_q5_syms[i], 1, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + MPC8_Q5_OFFSET, INIT_VLC_USE_NEW_STATIC, NULL); quant_vlc[1][i].table = &codes_table[vlc_offsets[6+i]]; quant_vlc[1][i].table_allocated = vlc_offsets[7+i] - vlc_offsets[6+i]; ff_init_vlc_from_lengths(&quant_vlc[1][i], MPC8_Q6_BITS, MPC8_Q6_SIZE, mpc8_q6_bits[i], 1, mpc8_q6_syms[i], 1, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + MPC8_Q6_OFFSET, INIT_VLC_USE_NEW_STATIC, NULL); quant_vlc[2][i].table = &codes_table[vlc_offsets[8+i]]; quant_vlc[2][i].table_allocated = vlc_offsets[9+i] - vlc_offsets[8+i]; ff_init_vlc_from_lengths(&quant_vlc[2][i], MPC8_Q7_BITS, MPC8_Q7_SIZE, mpc8_q7_bits[i], 1, mpc8_q7_syms[i], 1, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + MPC8_Q7_OFFSET, INIT_VLC_USE_NEW_STATIC, NULL); quant_vlc[3][i].table = &codes_table[vlc_offsets[10+i]]; quant_vlc[3][i].table_allocated = vlc_offsets[11+i] - vlc_offsets[10+i]; ff_init_vlc_from_lengths(&quant_vlc[3][i], MPC8_Q8_BITS, MPC8_Q8_SIZE, mpc8_q8_bits[i], 1, mpc8_q8_syms[i], 1, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + MPC8_Q8_OFFSET, INIT_VLC_USE_NEW_STATIC, NULL); } vlc_initialized = 1; @@ -359,7 +356,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data, case 3: case 4: for(j = 0; j < SAMPLES_PER_BAND; j += 2){ - t = get_vlc2(gb, q3_vlc[res - 3].table, MPC8_Q3_BITS, 2) + q3_offsets[res - 3]; + t = get_vlc2(gb, q3_vlc[res - 3].table, MPC8_Q3_BITS, 2); c->Q[ch][off + j + 1] = t >> 4; c->Q[ch][off + j + 0] = sign_extend(t, 4); } @@ -370,8 +367,8 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data, case 8: cnt = 2 * mpc8_thres[res]; for(j = 0; j < SAMPLES_PER_BAND; j++){ - t = get_vlc2(gb, quant_vlc[res - 5][cnt > mpc8_thres[res]].table, quant_vlc[res - 5][cnt > mpc8_thres[res]].bits, 2) + quant_offsets[res - 5]; - c->Q[ch][off + j] = t; + const VLC *vlc = &quant_vlc[res - 5][cnt > mpc8_thres[res]]; + c->Q[ch][off + j] = get_vlc2(gb, vlc->table, vlc->bits, 2); cnt = (cnt >> 1) + FFABS(c->Q[ch][off + j]); } break; From patchwork Fri Nov 20 07:19:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23948 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp953450ybf; Thu, 19 Nov 2020 23:33:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkt2j9U+c0iBb6JQzDrfURyyBr6TbtP5sUYV+MRlH6xaewv2CaC4xQxlT9sNX5xuyIrJ1x X-Received: by 2002:a5d:4d86:: with SMTP id b6mr14048537wru.369.1605857620036; Thu, 19 Nov 2020 23:33:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605857620; cv=none; d=google.com; s=arc-20160816; b=FCQSW0+rxJRqEKoxlE6fFAJuNnOevN+g+75ku92j7b5X73ceXdA6AVFmJHCHgUSFaa LktBubi1VblUF9brqGiy1q8WnBEF11yDHPziJt/1m7l7G6gZISim+htimSWdzsEAaz+A q2HAegZXfnEqsbrcspfIPE0isYpT3Cih06etMsaMXxsJybAEzCI2rdVAXMEGLdKMtPoG UVUpi1wWSUZGbcnnXOr0cO6arzljT/QImvYcez8UKtvjcd5tmCU7FTCa5Jwue6UsH7wC tzDRC3JVXVIimgAslxopFptc+bthszqiBv89ovoyMp/fxP54j0dRjdruL3b20nshFWB3 eUvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=JAaE/VEFjC89KdTi4nq5GHExu5RK62L1RmS+dT+2ibI=; b=myL2ubDCx5eEynvt5IIW28sJOdtu8jR5UxGvG3neJddJuJPvb0dsR6FVMjWWrZ9FC/ hV0J3h2gEijOKJOrHMQnAOuz9ojf0M2hIm1GIZ07IQq3cxR0vALWOq34hTd5dsfEs7Ny 9YyiNlgrWtWzTzb9sowIbTqAl7dL0T2iD8IArObQkSYbGaGPEd5UO44hRiWW7AUkRH0h jpPs12kFRNHLCDgbtRm+JqX9qgSbn6Grc6BHlOcNUEvoYAJxK6F//EQXxsf+NEInVd8A m9+FxfldlblBiZn908OlAE51Z8RMDGf9zc6pR1nOj13snOGpdvtMnUfxeY9UL7lbrr5H S7jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=OaIc9wYF; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 10si2205894wmo.126.2020.11.19.23.33.39; Thu, 19 Nov 2020 23:33:40 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=OaIc9wYF; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A7C5068BB54; Fri, 20 Nov 2020 09:25:15 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6FBDB68BA26 for ; Fri, 20 Nov 2020 09:25:03 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id f23so11521222ejk.2 for ; Thu, 19 Nov 2020 23:25:03 -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=qfbOuO/Vp9fOQYEE+AAXbscEqj7xAnkyo1tPtyDdPqo=; b=OaIc9wYFKPjK3TN/5gf/Xt+SzQIYa8URU/2Bmr+YLukgrvmdyDyUjwfC4CYRfCKXEE 35m5SItFUYa6p3AQC5GpiPnfNJY2i5FGu8esIdRgEads/8SrjeUrcHDNVkSLxl3UavIn 0tnbP5pJqxmb/GPGP13+7OTt5My5DawGPVVn6feVTw3QA9Wdr8lx4AwBIjUos/s1XY1p 8z0XwXJEpJogO+S6HnzSJnC8BA/+d7yk4pA1oW3zUeqhk1vdQCxRarOj10UwQWzKXHtz N/Qy6J28jpSyITIPOzFj8SRfXdA3LM+CYwdnaWk/u7em1ujbvm4n9riELVCTPQ4roHWi 9BLg== 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=qfbOuO/Vp9fOQYEE+AAXbscEqj7xAnkyo1tPtyDdPqo=; b=FxWI4X2dvD4nys7nqliaM63jJiZa568JTmteFUWlvYncSHTW02hRVwwH0f81B/XlgA Y5IqPeClyMoYjzZfrRMiUJqE5uxUw0mgeAzWG8x70Llq8vnQUHi1MQBZ8t97wovM4K4I Pm664BwHCzJk0mM7R18Bv6bgk8dZGx/MW85xisvl2K26Ka7nfKIxJZXoZ4OQS7WcSZVS l1LtOlP83S+c+uTmKn3YVPG+0Ww/mryduV0IlfLtJ0aW0ztHZASXG59H0ygVQTuKEeKV 4WpCFaYhTEAg7Gxs1Wjpu72nnMbACvuyXQzPG3/czvfqXfedrcDl6bKVqNQuA59wdzPI +NVA== X-Gm-Message-State: AOAM532wSJLvNZ2Wy98SkfO1rZbIeUnH0cEXTjMZRHxRtHK4vkh/t39p VAtPa6TRDasb0sAHNHZzBReBcup4zOjUCg== X-Received: by 2002:a17:907:10d9:: with SMTP id rv25mr32402955ejb.437.1605857102243; Thu, 19 Nov 2020 23:25:02 -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.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:01 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:24 +0100 Message-Id: <20201120072116.818090-52-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 051/162] avcodec/mpc8: Reduce the size of the length tables to initialize 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" X-TUID: kS9yda7nrzaT Content-Length: 28353 After permuting both length, code as well as symbol tables so that the codes are ordered from left to right in the tree, it became apparent that the length of the codes decreases from left to right. Therefore one can run-length encode the lengths to save space. This commit implements this. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc8.c | 114 +++++++++++++++-------------- libavcodec/mpc8huff.h | 166 ++++++++++++------------------------------ 2 files changed, 104 insertions(+), 176 deletions(-) diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index b5f89c845b..64b1967d8d 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -90,6 +90,21 @@ static const uint16_t vlc_offsets[13] = { 0, 640, 1184, 1748, 2298, 2426, 2554, 3066, 3578, 4106, 4618, 5196, 5708 }; +static av_cold void build_vlc(VLC *vlc, int nb_bits, + const uint8_t codes_counts[16], + const uint8_t syms[], int offset) +{ + uint8_t len[MPC8_MAX_VLC_SIZE]; + unsigned num = 0; + + for (int i = 16; i > 0; i--) + for (unsigned tmp = num + codes_counts[i - 1]; num < tmp; num++) + len[num] = i; + + ff_init_vlc_from_lengths(vlc, nb_bits, num, len, 1, + syms, 1, 1, offset, INIT_VLC_USE_NEW_STATIC, NULL); +} + static av_cold int mpc8_decode_init(AVCodecContext * avctx) { int i; @@ -97,7 +112,6 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) GetBitContext gb; static int vlc_initialized = 0; int channels; - static VLC_TYPE codes_table[5708][2]; if(avctx->extradata_size < 2){ @@ -133,77 +147,65 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) if(vlc_initialized) return 0; av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n"); - INIT_VLC_STATIC_FROM_LENGTHS(&band_vlc, MPC8_BANDS_BITS, MPC8_BANDS_SIZE, - mpc8_bands_bits, 1, - mpc8_bands_syms, 1, 1, 0, 0, 542); - - INIT_VLC_STATIC_FROM_LENGTHS(&q1_vlc, MPC8_Q1_BITS, MPC8_Q1_SIZE, - mpc8_q1_bits, 1, - mpc8_q1_syms, 1, 1, 0, 0, 520); - INIT_VLC_STATIC_FROM_LENGTHS(&q9up_vlc, MPC8_Q9UP_BITS, MPC8_Q9UP_SIZE, - mpc8_q9up_bits, 1, - mpc8_q9up_syms, 1, 1, 0, 0, 524); - - INIT_VLC_STATIC_FROM_LENGTHS(&scfi_vlc[0], MPC8_SCFI0_BITS, MPC8_SCFI0_SIZE, - mpc8_scfi0_bits, 1, - mpc8_scfi0_syms, 1, 1, 0, 0, 1 << MPC8_SCFI0_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&scfi_vlc[1], MPC8_SCFI1_BITS, MPC8_SCFI1_SIZE, - mpc8_scfi1_bits, 1, - mpc8_scfi1_syms, 1, 1, 0, 0, 1 << MPC8_SCFI1_BITS); - - INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc[0], MPC8_DSCF0_BITS, MPC8_DSCF0_SIZE, - mpc8_dscf0_bits, 1, - mpc8_dscf0_syms, 1, 1, 0, 0, 560); - INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc[1], MPC8_DSCF1_BITS, MPC8_DSCF1_SIZE, - mpc8_dscf1_bits, 1, - mpc8_dscf1_syms, 1, 1, 0, 0, 598); - - INIT_VLC_STATIC_FROM_LENGTHS(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE, - mpc8_q3_bits, 1, - mpc8_q3_syms, 1, 1, MPC8_Q3_OFFSET, 0, 512); - INIT_VLC_STATIC_FROM_LENGTHS(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE, - mpc8_q4_bits, 1, - mpc8_q4_syms, 1, 1, MPC8_Q4_OFFSET, 0, 516); +#define INIT_VLC(vlc, bits, len_counts, symbols, offset, static_size) \ + do { \ + static VLC_TYPE table[static_size][2]; \ + (vlc)->table = table; \ + (vlc)->table_allocated = static_size; \ + build_vlc(vlc, bits, len_counts, symbols, offset); \ + } while (0) + + + INIT_VLC(&band_vlc, MPC8_BANDS_BITS, + mpc8_bands_len_counts, mpc8_bands_syms, 0, 542); + + INIT_VLC(&q1_vlc, MPC8_Q1_BITS, + mpc8_q1_len_counts, mpc8_q1_syms, 0, 520); + INIT_VLC(&q9up_vlc, MPC8_Q9UP_BITS, + mpc8_q9up_len_counts, mpc8_q9up_syms, 0, 524); + + INIT_VLC(&scfi_vlc[0], MPC8_SCFI0_BITS, + mpc8_scfi_len_counts[0], mpc8_scfi0_syms, 0, 1 << MPC8_SCFI0_BITS); + INIT_VLC(&scfi_vlc[1], MPC8_SCFI1_BITS, + mpc8_scfi_len_counts[1], mpc8_scfi1_syms, 0, 1 << MPC8_SCFI1_BITS); + + INIT_VLC(&dscf_vlc[0], MPC8_DSCF0_BITS, + mpc8_dscf_len_counts[0], mpc8_dscf0_syms, 0, 560); + INIT_VLC(&dscf_vlc[1], MPC8_DSCF1_BITS, + mpc8_dscf_len_counts[1], mpc8_dscf1_syms, 0, 598); + + INIT_VLC(&q3_vlc[0], MPC8_Q3_BITS, + mpc8_q3_len_counts, mpc8_q3_syms, MPC8_Q3_OFFSET, 512); + INIT_VLC(&q3_vlc[1], MPC8_Q4_BITS, + mpc8_q4_len_counts, mpc8_q4_syms, MPC8_Q4_OFFSET, 516); for(i = 0; i < 2; i++){ res_vlc[i].table = &codes_table[vlc_offsets[0+i]]; res_vlc[i].table_allocated = vlc_offsets[1+i] - vlc_offsets[0+i]; - ff_init_vlc_from_lengths(&res_vlc[i], MPC8_RES_BITS, MPC8_RES_SIZE, - mpc8_res_bits[i], 1, - mpc8_res_syms[i], 1, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + build_vlc(&res_vlc[i], MPC8_RES_BITS, + mpc8_res_len_counts[i], mpc8_res_syms[i], 0); q2_vlc[i].table = &codes_table[vlc_offsets[2+i]]; q2_vlc[i].table_allocated = vlc_offsets[3+i] - vlc_offsets[2+i]; - ff_init_vlc_from_lengths(&q2_vlc[i], MPC8_Q2_BITS, MPC8_Q2_SIZE, - mpc8_q2_bits[i], 1, - mpc8_q2_syms[i], 1, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + build_vlc(&q2_vlc[i], MPC8_Q2_BITS, + mpc8_q2_len_counts[i], mpc8_q2_syms[i], 0); quant_vlc[0][i].table = &codes_table[vlc_offsets[4+i]]; quant_vlc[0][i].table_allocated = vlc_offsets[5+i] - vlc_offsets[4+i]; - ff_init_vlc_from_lengths(&quant_vlc[0][i], MPC8_Q5_BITS, MPC8_Q5_SIZE, - mpc8_q5_bits[i], 1, - mpc8_q5_syms[i], 1, 1, - MPC8_Q5_OFFSET, INIT_VLC_USE_NEW_STATIC, NULL); + build_vlc(&quant_vlc[0][i], MPC8_Q5_BITS, + mpc8_q5_len_counts[i], mpc8_q5_syms[i], MPC8_Q5_OFFSET); quant_vlc[1][i].table = &codes_table[vlc_offsets[6+i]]; quant_vlc[1][i].table_allocated = vlc_offsets[7+i] - vlc_offsets[6+i]; - ff_init_vlc_from_lengths(&quant_vlc[1][i], MPC8_Q6_BITS, MPC8_Q6_SIZE, - mpc8_q6_bits[i], 1, - mpc8_q6_syms[i], 1, 1, - MPC8_Q6_OFFSET, INIT_VLC_USE_NEW_STATIC, NULL); + build_vlc(&quant_vlc[1][i], MPC8_Q6_BITS, + mpc8_q6_len_counts[i], mpc8_q6_syms[i], MPC8_Q6_OFFSET); quant_vlc[2][i].table = &codes_table[vlc_offsets[8+i]]; quant_vlc[2][i].table_allocated = vlc_offsets[9+i] - vlc_offsets[8+i]; - ff_init_vlc_from_lengths(&quant_vlc[2][i], MPC8_Q7_BITS, MPC8_Q7_SIZE, - mpc8_q7_bits[i], 1, - mpc8_q7_syms[i], 1, 1, - MPC8_Q7_OFFSET, INIT_VLC_USE_NEW_STATIC, NULL); + build_vlc(&quant_vlc[2][i], MPC8_Q7_BITS, + mpc8_q7_len_counts[i], mpc8_q7_syms[i], MPC8_Q7_OFFSET); quant_vlc[3][i].table = &codes_table[vlc_offsets[10+i]]; quant_vlc[3][i].table_allocated = vlc_offsets[11+i] - vlc_offsets[10+i]; - ff_init_vlc_from_lengths(&quant_vlc[3][i], MPC8_Q8_BITS, MPC8_Q8_SIZE, - mpc8_q8_bits[i], 1, - mpc8_q8_syms[i], 1, 1, - MPC8_Q8_OFFSET, INIT_VLC_USE_NEW_STATIC, NULL); + build_vlc(&quant_vlc[3][i], MPC8_Q8_BITS, + mpc8_q8_len_counts[i], mpc8_q8_syms[i], MPC8_Q8_OFFSET); } vlc_initialized = 1; diff --git a/libavcodec/mpc8huff.h b/libavcodec/mpc8huff.h index 687c9f7e98..8838751fd6 100644 --- a/libavcodec/mpc8huff.h +++ b/libavcodec/mpc8huff.h @@ -24,6 +24,8 @@ #include +#define MPC8_MAX_VLC_SIZE 256 + #define MPC8_BANDS_SIZE 33 #define MPC8_BANDS_BITS 9 @@ -31,9 +33,8 @@ static const uint8_t mpc8_bands_syms[MPC8_BANDS_SIZE] = { 13, 19, 10, 11, 12, 14, 15, 16, 17, 18, 20, 21, 22, 9, 23, 24, 25, 8, 26, 27, 7, 28, 5, 6, 29, 4, 3, 30, 2, 31, 1, 32, 0 }; -static const uint8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = { - 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, - 10, 9, 9, 8, 8, 8, 7, 6, 6, 5, 5, 3, 2, 1 +static const uint8_t mpc8_bands_len_counts[16] = { + 1, 1, 1, 0, 2, 2, 1, 3, 2, 3, 4, 11, 2, 0, 0, 0 }; #define MPC8_SCFI0_SIZE 4 @@ -42,9 +43,6 @@ static const uint8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = { static const uint8_t mpc8_scfi0_syms[MPC8_SCFI0_SIZE] = { 0, 1, 3, 2 }; -static const uint8_t mpc8_scfi0_bits[MPC8_SCFI0_SIZE] = { - 3, 3, 2, 1 -}; #define MPC8_SCFI1_SIZE 16 #define MPC8_SCFI1_BITS 7 @@ -52,8 +50,10 @@ static const uint8_t mpc8_scfi0_bits[MPC8_SCFI0_SIZE] = { static const uint8_t mpc8_scfi1_syms[MPC8_SCFI1_SIZE] = { 1, 4, 0, 2, 3, 8, 12, 5, 6, 7, 9, 13, 11, 14, 10, 15 }; -static const uint8_t mpc8_scfi1_bits[MPC8_SCFI1_SIZE] = { - 7, 7, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 3, 3, 2, 2 + +static const uint8_t mpc8_scfi_len_counts[2][16] = { + { 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 2, 2, 0, 5, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }; #define MPC8_DSCF0_SIZE 64 @@ -65,12 +65,6 @@ static const uint8_t mpc8_dscf0_syms[MPC8_DSCF0_SIZE] = { 17, 18, 41, 42, 43, 19, 20, 21, 22, 40, 23, 24, 38, 39, 25, 28, 37, 26, 27, 29, 30, 32, 36, 33, 34, 35, }; -static const uint8_t mpc8_dscf0_bits[MPC8_DSCF0_SIZE] = { - 14, 14, 14, 14, 14, 14, 13, 13, 13, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, - 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 8, 8, - 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 4, 4, - 4, 4, 4, 4, 3, 3, 3 -}; #define MPC8_DSCF1_SIZE 65 #define MPC8_DSCF1_BITS 9 @@ -81,11 +75,10 @@ static const uint8_t mpc8_dscf1_syms[MPC8_DSCF1_SIZE] = { 44, 45, 18, 19, 20, 41, 42, 21, 22, 39, 40, 23, 24, 38, 25, 37, 26, 35, 36, 27, 28, 34, 29, 30, 31, 32, 33, }; -static const uint8_t mpc8_dscf1_bits[MPC8_DSCF1_SIZE] = { - 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, - 10, 10, 9, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 6, 6, 5, 5, 5, - 4, 4, 4, 3, 3, 3, 3, 3 + +static const uint8_t mpc8_dscf_len_counts[2][16] = { + { 0, 0, 3, 6, 3, 4, 5, 7, 7, 9, 6, 5, 3, 6, 0, 0 }, + { 0, 0, 5, 3, 3, 2, 3, 4, 5, 7, 7, 9, 6, 5, 6, 0 }, }; #define MPC8_RES_SIZE 17 @@ -99,13 +92,10 @@ static const uint8_t mpc8_res_syms[2][MPC8_RES_SIZE] = { 8, 9, 10, 11, 7, 12, 6, 13, 5, 4, 14, 3, 15, 2, 0, 1, 16, } }; -static const uint8_t mpc8_res_bits[2][MPC8_RES_SIZE] = { - { - 16, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 - }, - { - 14, 14, 14, 14, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 2, 2 - } + +static const uint8_t mpc8_res_len_counts[2][16] = { + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 }, + { 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, 0, 0 }, }; #define MPC8_Q1_SIZE 19 @@ -114,8 +104,9 @@ static const uint8_t mpc8_res_bits[2][MPC8_RES_SIZE] = { static const uint8_t mpc8_q1_syms[MPC8_Q1_SIZE] = { 17, 18, 16, 15, 14, 13, 12, 0, 11, 1, 2, 8, 9, 10, 3, 4, 5, 6, 7, }; -static const uint8_t mpc8_q1_bits[MPC8_Q1_SIZE] = { - 12, 12, 11, 10, 9, 8, 7, 6, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3 + +static const uint8_t mpc8_q1_len_counts[16] = { + 0, 0, 5, 5, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0 }; #define MPC8_Q9UP_SIZE 256 @@ -141,21 +132,9 @@ static const uint8_t mpc8_q9up_syms[MPC8_Q9UP_SIZE] = { 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 127, 128, }; -static const uint8_t mpc8_q9up_bits[MPC8_Q9UP_SIZE] = { - 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 6, 6 + +static const uint8_t mpc8_q9up_len_counts[16] = { + 0, 0, 0, 0, 0, 2, 38, 134, 71, 9, 2, 0, 0, 0, 0, 0 }; #define MPC8_Q2_SIZE 125 @@ -185,35 +164,18 @@ static const uint8_t mpc8_q2_syms[2][MPC8_Q2_SIZE] = { 82, 86, 87, 92, 62, } }; -static const uint8_t mpc8_q2_bits[2][MPC8_Q2_SIZE] = { -{ - 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 3 -}, -{ - 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, - 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4 -} + +static const uint8_t mpc8_q2_len_counts[2][16] = { + { 0, 0, 1, 6, 0, 17, 9, 24, 24, 9, 27, 4, 4, 0, 0, 0 }, + { 0, 0, 0, 1, 16, 10, 6, 48, 9, 27, 4, 4, 0, 0, 0, 0 }, }; #define MPC8_Q3_SIZE 49 #define MPC8_Q3_BITS 9 #define MPC8_Q3_OFFSET -48 -static const uint8_t mpc8_q3_bits[MPC8_Q3_SIZE] = { - 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, - 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 3, +static const uint8_t mpc8_q3_len_counts[16] = { + 0, 0, 1, 6, 6, 11, 13, 8, 4, 0, 0, 0, 0, 0, 0, 0 }; static const uint8_t mpc8_q3_syms[MPC8_Q3_SIZE] = { 13, 3, 109, 99, 14, 2, 29, 19, 93, 83, 110, 98, 15, 0, 1, @@ -226,12 +188,8 @@ static const uint8_t mpc8_q3_syms[MPC8_Q3_SIZE] = { #define MPC8_Q4_BITS 9 #define MPC8_Q4_OFFSET -64 -static const uint8_t mpc8_q4_bits[MPC8_Q4_SIZE] = { - 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 4, +static const uint8_t mpc8_q4_len_counts[16] = { + 0, 0, 0, 1, 12, 23, 14, 19, 8, 4, 0, 0, 0, 0, 0, 0 }; static const uint8_t mpc8_q4_syms[MPC8_Q4_SIZE] = { 12, 4, 140, 132, 13, 3, 28, 20, 124, 116, 141, 131, 14, 1, 2, @@ -254,13 +212,10 @@ static const uint8_t mpc8_q5_syms[2][MPC8_Q5_SIZE] = { 0, 1, 13, 14, 2, 12, 3, 4, 10, 11, 5, 6, 7, 8, 9, } }; -static const uint8_t mpc8_q5_bits[2][MPC8_Q5_SIZE] = { -{ - 7, 7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 3, 3, 2 -}, -{ - 6, 6, 6, 6, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 3 -} + +static const uint8_t mpc8_q5_len_counts[2][16] = { + { 0, 1, 4, 2, 2, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 5, 4, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }; #define MPC8_Q6_SIZE 31 @@ -277,15 +232,10 @@ static const uint8_t mpc8_q6_syms[2][MPC8_Q6_SIZE] = { 23, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, } }; -static const uint8_t mpc8_q6_bits[2][MPC8_Q6_SIZE] = { -{ - 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 6, 6, 6, 6, 6, - 6, 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 2 -}, -{ - 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 5, - 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 -} + +static const uint8_t mpc8_q6_len_counts[2][16] = { + { 0, 1, 2, 4, 3, 7, 2, 4, 8, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 11, 6, 4, 6, 4, 0, 0, 0, 0, 0, 0, 0, 0 }, }; #define MPC8_Q7_SIZE 63 @@ -306,19 +256,10 @@ static const uint8_t mpc8_q7_syms[2][MPC8_Q7_SIZE] = { 36, 37, 38, 39, 40, 41, } }; -static const uint8_t mpc8_q7_bits[2][MPC8_Q7_SIZE] = { -{ - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, - 5, 4, 4, 3, 3, 2 -}, -{ - 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5 -} + +static const uint8_t mpc8_q7_len_counts[2][MPC8_Q7_SIZE] = { + { 0, 1, 2, 2, 4, 6, 10, 10, 12, 16, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 20, 15, 10, 14, 4, 0, 0, 0, 0, 0, 0, 0 }, }; #define MPC8_Q8_SIZE 127 @@ -349,25 +290,10 @@ static const uint8_t mpc8_q8_syms[2][MPC8_Q8_SIZE] = { 69, 70, 71, 72, 73, 74, 76, } }; -static const uint8_t mpc8_q8_bits[2][MPC8_Q8_SIZE] = { -{ - 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, - 6, 6, 6, 6, 6, 6, 5, 5, 5, 4, 3, 3, 2 -}, -{ - 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 -} + +static const uint8_t mpc8_q8_len_counts[2][16] = { + { 0, 1, 2, 1, 3, 8, 8, 15, 24, 42, 17, 6, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 26, 55, 38, 8, 0, 0, 0, 0, 0, 0, 0 }, }; #endif /* AVCODEC_MPC8HUFF_H */ From patchwork Fri Nov 20 07:19: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: 23804 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 5237444A644 for ; Fri, 20 Nov 2020 09:33:45 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 30EA968BB0A; Fri, 20 Nov 2020 09:25:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E3BC068BAE8 for ; Fri, 20 Nov 2020 09:25:03 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id cq7so8476633edb.4 for ; Thu, 19 Nov 2020 23:25:03 -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=iOltP6FUV7Gdi1bIGCpbYDLZzVnp3QK3jTzEHMxtplU=; b=LJwI3LUggTwZ3lfYbYsPJQh65npRy7ocncW5fd3m2DHVRaqgx/nRdhPw5WaYW/xcWH 6EIRZV8ftbog/lAWEV26LVf2ExBLfApgzq+7CEdYE0G6CE1wRzpX1F84rpsrNnCnforQ JUviosNUlaitYUUoIsdj4F3s0qQBHag2xjoqxhkXJoWv4E0uyUv225z1WwTZa8glx6pm yUjWgz0hBZPWQCTCqar9z9ovyL4YgRGbeVvVcmBh0Ybh3mLOJKPaGa+GC2jWGFCFrhnF VlnSRq3tsCN1TbMxY9p5QZEF/Bu5+RF/a/BUaK/Nd2W6PPtjIhLzAgy4+QKUoRQfjEtk Cshw== 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=iOltP6FUV7Gdi1bIGCpbYDLZzVnp3QK3jTzEHMxtplU=; b=WSV6qVBHaANUprclG8qmrQLGBMLZ2LHUKoplEDEC7HOYwoTvYWNWSgxBGs85pa+noy p6UQBC/hPoBA6SmTEpkvcAvPLS60lwkdpxj+tuFkQfQ530PjJQSVKSfi/PA0kfrCNgzM vHIdlesaYLfad9HccZbBSX/UvUlNxSVYPD88VB3F6fV2ljQ6FzKKua0E0XKA8Ma8E4fp 27nchIwhDoQDCtpYNcOAaubBq1rRFk7Qv/TrsriEqZT9DC3mr99/husFb+rhNAthZIp+ yG0g8xIxSHrMHibt4M+z5/nEqJwHZq6SLGQmkdGxluE5IWls7k7+pjlK/Zm5xOhBrHO7 RQJg== X-Gm-Message-State: AOAM532WuRYLN+GxKeq/inxl+JrC8HgvAb3Rqx7Wb/37hjFxiyyP6iDI UshNGB5Tak4xgdK4ABnoCFXUCLA3F5raOA== X-Google-Smtp-Source: ABdhPJwpqE/EHzMazZNKyFgNiCGGNpR/HSAra2qwkBjnKu3pHXsktvhi11XK8p2blzzUsdR4GoH3Vw== X-Received: by 2002:aa7:d601:: with SMTP id c1mr33604199edr.323.1605857103136; Thu, 19 Nov 2020 23:25:03 -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.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:02 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:25 +0100 Message-Id: <20201120072116.818090-53-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 052/162] avcodec/mpc8: Reduce the size of some 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" Several of the quantisation VLCs come in pairs and up until now the number of bits used for each VLC was set to the same value for both VLCs in such a pair even when one of the two required only a lower number. This is a waste given that the get_vlc2() call is compatible with these two VLCs using a different number of bits (it uses vlc->bits). Given that the code lengths are descending it is easily possible to know the length of the longest code for a given VLC: It is the length of the first one. With this information one can easily use the least amount of bits. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc8.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index 64b1967d8d..e7c631f1a6 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -87,10 +87,10 @@ static int mpc8_get_mask(GetBitContext *gb, int size, int t) } static const uint16_t vlc_offsets[13] = { - 0, 640, 1184, 1748, 2298, 2426, 2554, 3066, 3578, 4106, 4618, 5196, 5708 + 0, 640, 1184, 1748, 2298, 2426, 2490, 3002, 3258, 3786, 4298, 4876, 5388 }; -static av_cold void build_vlc(VLC *vlc, int nb_bits, +static av_cold void build_vlc(VLC *vlc, const uint8_t codes_counts[16], const uint8_t syms[], int offset) { @@ -101,7 +101,7 @@ static av_cold void build_vlc(VLC *vlc, int nb_bits, for (unsigned tmp = num + codes_counts[i - 1]; num < tmp; num++) len[num] = i; - ff_init_vlc_from_lengths(vlc, nb_bits, num, len, 1, + ff_init_vlc_from_lengths(vlc, FFMIN(len[0], 9), num, len, 1, syms, 1, 1, offset, INIT_VLC_USE_NEW_STATIC, NULL); } @@ -112,7 +112,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) GetBitContext gb; static int vlc_initialized = 0; int channels; - static VLC_TYPE codes_table[5708][2]; + static VLC_TYPE codes_table[5388][2]; if(avctx->extradata_size < 2){ av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\n", avctx->extradata_size); @@ -152,7 +152,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) static VLC_TYPE table[static_size][2]; \ (vlc)->table = table; \ (vlc)->table_allocated = static_size; \ - build_vlc(vlc, bits, len_counts, symbols, offset); \ + build_vlc(vlc, len_counts, symbols, offset); \ } while (0) @@ -182,29 +182,29 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) for(i = 0; i < 2; i++){ res_vlc[i].table = &codes_table[vlc_offsets[0+i]]; res_vlc[i].table_allocated = vlc_offsets[1+i] - vlc_offsets[0+i]; - build_vlc(&res_vlc[i], MPC8_RES_BITS, + build_vlc(&res_vlc[i], mpc8_res_len_counts[i], mpc8_res_syms[i], 0); q2_vlc[i].table = &codes_table[vlc_offsets[2+i]]; q2_vlc[i].table_allocated = vlc_offsets[3+i] - vlc_offsets[2+i]; - build_vlc(&q2_vlc[i], MPC8_Q2_BITS, + build_vlc(&q2_vlc[i], mpc8_q2_len_counts[i], mpc8_q2_syms[i], 0); quant_vlc[0][i].table = &codes_table[vlc_offsets[4+i]]; quant_vlc[0][i].table_allocated = vlc_offsets[5+i] - vlc_offsets[4+i]; - build_vlc(&quant_vlc[0][i], MPC8_Q5_BITS, + build_vlc(&quant_vlc[0][i], mpc8_q5_len_counts[i], mpc8_q5_syms[i], MPC8_Q5_OFFSET); quant_vlc[1][i].table = &codes_table[vlc_offsets[6+i]]; quant_vlc[1][i].table_allocated = vlc_offsets[7+i] - vlc_offsets[6+i]; - build_vlc(&quant_vlc[1][i], MPC8_Q6_BITS, + build_vlc(&quant_vlc[1][i], mpc8_q6_len_counts[i], mpc8_q6_syms[i], MPC8_Q6_OFFSET); quant_vlc[2][i].table = &codes_table[vlc_offsets[8+i]]; quant_vlc[2][i].table_allocated = vlc_offsets[9+i] - vlc_offsets[8+i]; - build_vlc(&quant_vlc[2][i], MPC8_Q7_BITS, + build_vlc(&quant_vlc[2][i], mpc8_q7_len_counts[i], mpc8_q7_syms[i], MPC8_Q7_OFFSET); quant_vlc[3][i].table = &codes_table[vlc_offsets[10+i]]; quant_vlc[3][i].table_allocated = vlc_offsets[11+i] - vlc_offsets[10+i]; - build_vlc(&quant_vlc[3][i], MPC8_Q8_BITS, + build_vlc(&quant_vlc[3][i], mpc8_q8_len_counts[i], mpc8_q8_syms[i], MPC8_Q8_OFFSET); } vlc_initialized = 1; From patchwork Fri Nov 20 07:19:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23805 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 BE70C44A644 for ; Fri, 20 Nov 2020 09:33:55 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3CE5268BB5D; Fri, 20 Nov 2020 09:25:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 555F368BA2D for ; Fri, 20 Nov 2020 09:25:05 +0200 (EET) Received: by mail-ej1-f43.google.com with SMTP id a16so11513392ejj.5 for ; Thu, 19 Nov 2020 23:25:05 -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=KGzKxsIeNaI2QMbdkzFSHo1h1npA9wrlOgSK08jCplw=; b=h7M0TvWnFzh4zqSAut3FJDzKLhobKJqxChafMg5iCOgxydLYZhB/1nBAh+pgChftn+ 0Pf4FtGp3lsMI9OZWYTBlqcy7yIKDYXuXJxcJCUlTFL9bQOl+KzTno9alykW+VC/8PPs stgZ7vHYMPJTUz3REip0BP5te1e5o879zMsZ81lIIlbobNeKAsbI8kaACck5nu/IRbmN 4pNE3J/GUM6H9AGaNNnEqUbizIHifdRDB8X5npFM4csGSXjPfC+AF0Wv4ef4+mT7F5PZ oLkginHfGiEhL0lmJP2pqWYOM/cLP4tW685EWmsqxM/KG3IFNSPSPvOqhY1w9BbfLuLf sGHQ== 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=KGzKxsIeNaI2QMbdkzFSHo1h1npA9wrlOgSK08jCplw=; b=HqrzsD6l55NbCcpe3suKbwebFABnewyukpbYbF8T+lCAbHE5F2AujSomQjf5fVjDKm a34cIZ8/6uS5euN7CQDlUzyWw7WKF7KNTB5YYy2KHZvy6HMZjBtsSZsykLuIDWR4d1Zw BtT4JkM5Dkrs69Yh4Noi0bKi1jS/KfR+wHQ09Oxgv1jNygLy5AUGl/SUezolO7puBx9h /v+bMLHCTbctYUMHGamIgWnTjOKb2b/2IN2kNdsNB0gbxvCd9rJANzqxO3CgWMJSdKpH PjN5OH4OLEn0iO+3lEBYBjpO28SpUMl3WTJj+JC89msQBQnVziisqfkTOqPsTuJb125L QxvQ== X-Gm-Message-State: AOAM5310UbFtak/D33TQ0icKuOEbEDPWyXnu0mA88YdYlFVPOuqTlgX+ OVnnlL8rE51eR58QFIweendDUZpSdYbXdw== X-Google-Smtp-Source: ABdhPJzUkJRLE/ErPyBxuf+BlngQbD4DkTIfiThcGMDW22RFdZ1D02kcP/3X2BnSDiH+FlunqJzX0A== X-Received: by 2002:a17:906:1381:: with SMTP id f1mr31227071ejc.87.1605857104094; Thu, 19 Nov 2020 23:25:04 -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.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:03 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:26 +0100 Message-Id: <20201120072116.818090-54-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 053/162] avcodec/mpc8: 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" Up until now, VLCs that were part of an array of VLCs were often not initialized in a loop, but separately. The probable reason for this was that these VLCs differed slightly in the parameters to be used for them (i.e. the number of codes or the number of bits to be used differs), so that one would have to provide these parameters e.g. via arrays. Yet these problems have actually largely been solved by now: The length information is contained in a run-length encoded form that is the same for all VLCs and both the number of codes as well as the number of bits to use for each VLC can be easily derived from them. There is just one problem to be solved: When the underlying tables have a different number of elements, putting them into an array of arrays would be wasteful; using an array of pointers to the arrays would also be wasteful. Therefore this commit combines the tables into bigger tables. (Given that all the length tables have the same layout this applies only to the symbols tables.) Finally, the array containing the offset of the VLC's buffer in the big buffer has also been removed. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc8.c | 89 +++++---------- libavcodec/mpc8huff.h | 257 +++++++++++++++--------------------------- 2 files changed, 120 insertions(+), 226 deletions(-) diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index e7c631f1a6..b36e47ce66 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -86,33 +86,37 @@ static int mpc8_get_mask(GetBitContext *gb, int size, int t) return mask; } -static const uint16_t vlc_offsets[13] = { - 0, 640, 1184, 1748, 2298, 2426, 2490, 3002, 3258, 3786, 4298, 4876, 5388 -}; - -static av_cold void build_vlc(VLC *vlc, +static av_cold void build_vlc(VLC *vlc, unsigned *buf_offset, const uint8_t codes_counts[16], - const uint8_t syms[], int offset) + const uint8_t **syms, int offset) { + static VLC_TYPE vlc_buf[9296][2]; uint8_t len[MPC8_MAX_VLC_SIZE]; unsigned num = 0; + vlc->table = &vlc_buf[*buf_offset]; + vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *buf_offset; + for (int i = 16; i > 0; i--) for (unsigned tmp = num + codes_counts[i - 1]; num < tmp; num++) len[num] = i; ff_init_vlc_from_lengths(vlc, FFMIN(len[0], 9), num, len, 1, - syms, 1, 1, offset, INIT_VLC_USE_NEW_STATIC, NULL); + *syms, 1, 1, offset, INIT_VLC_STATIC_OVERLONG, NULL); + *buf_offset += vlc->table_size; + *syms += num; } static av_cold int mpc8_decode_init(AVCodecContext * avctx) { - int i; + int i, offset = 0; MPCContext *c = avctx->priv_data; GetBitContext gb; static int vlc_initialized = 0; + const uint8_t *q_syms = mpc8_q_syms, *bands_syms = mpc8_bands_syms; + const uint8_t *res_syms = mpc8_res_syms, *scfi_syms = mpc8_scfi_syms; + const uint8_t *dscf_syms = mpc8_dscf_syms; int channels; - static VLC_TYPE codes_table[5388][2]; if(avctx->extradata_size < 2){ av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\n", avctx->extradata_size); @@ -147,65 +151,24 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) if(vlc_initialized) return 0; av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n"); -#define INIT_VLC(vlc, bits, len_counts, symbols, offset, static_size) \ - do { \ - static VLC_TYPE table[static_size][2]; \ - (vlc)->table = table; \ - (vlc)->table_allocated = static_size; \ - build_vlc(vlc, len_counts, symbols, offset); \ - } while (0) - + build_vlc(&band_vlc, &offset, mpc8_bands_len_counts, &bands_syms, 0); - INIT_VLC(&band_vlc, MPC8_BANDS_BITS, - mpc8_bands_len_counts, mpc8_bands_syms, 0, 542); + build_vlc(&q1_vlc, &offset, mpc8_q1_len_counts, &q_syms, 0); + build_vlc(&q9up_vlc, &offset, mpc8_q9up_len_counts, &q_syms, 0); - INIT_VLC(&q1_vlc, MPC8_Q1_BITS, - mpc8_q1_len_counts, mpc8_q1_syms, 0, 520); - INIT_VLC(&q9up_vlc, MPC8_Q9UP_BITS, - mpc8_q9up_len_counts, mpc8_q9up_syms, 0, 524); - - INIT_VLC(&scfi_vlc[0], MPC8_SCFI0_BITS, - mpc8_scfi_len_counts[0], mpc8_scfi0_syms, 0, 1 << MPC8_SCFI0_BITS); - INIT_VLC(&scfi_vlc[1], MPC8_SCFI1_BITS, - mpc8_scfi_len_counts[1], mpc8_scfi1_syms, 0, 1 << MPC8_SCFI1_BITS); + for(i = 0; i < 2; i++){ + build_vlc(&scfi_vlc[i], &offset, mpc8_scfi_len_counts[i], &scfi_syms, 0); - INIT_VLC(&dscf_vlc[0], MPC8_DSCF0_BITS, - mpc8_dscf_len_counts[0], mpc8_dscf0_syms, 0, 560); - INIT_VLC(&dscf_vlc[1], MPC8_DSCF1_BITS, - mpc8_dscf_len_counts[1], mpc8_dscf1_syms, 0, 598); + build_vlc(&dscf_vlc[i], &offset, mpc8_dscf_len_counts[i], &dscf_syms, 0); - INIT_VLC(&q3_vlc[0], MPC8_Q3_BITS, - mpc8_q3_len_counts, mpc8_q3_syms, MPC8_Q3_OFFSET, 512); - INIT_VLC(&q3_vlc[1], MPC8_Q4_BITS, - mpc8_q4_len_counts, mpc8_q4_syms, MPC8_Q4_OFFSET, 516); + build_vlc(&res_vlc[i], &offset, mpc8_res_len_counts[i], &res_syms, 0); - for(i = 0; i < 2; i++){ - res_vlc[i].table = &codes_table[vlc_offsets[0+i]]; - res_vlc[i].table_allocated = vlc_offsets[1+i] - vlc_offsets[0+i]; - build_vlc(&res_vlc[i], - mpc8_res_len_counts[i], mpc8_res_syms[i], 0); - - q2_vlc[i].table = &codes_table[vlc_offsets[2+i]]; - q2_vlc[i].table_allocated = vlc_offsets[3+i] - vlc_offsets[2+i]; - build_vlc(&q2_vlc[i], - mpc8_q2_len_counts[i], mpc8_q2_syms[i], 0); - - quant_vlc[0][i].table = &codes_table[vlc_offsets[4+i]]; - quant_vlc[0][i].table_allocated = vlc_offsets[5+i] - vlc_offsets[4+i]; - build_vlc(&quant_vlc[0][i], - mpc8_q5_len_counts[i], mpc8_q5_syms[i], MPC8_Q5_OFFSET); - quant_vlc[1][i].table = &codes_table[vlc_offsets[6+i]]; - quant_vlc[1][i].table_allocated = vlc_offsets[7+i] - vlc_offsets[6+i]; - build_vlc(&quant_vlc[1][i], - mpc8_q6_len_counts[i], mpc8_q6_syms[i], MPC8_Q6_OFFSET); - quant_vlc[2][i].table = &codes_table[vlc_offsets[8+i]]; - quant_vlc[2][i].table_allocated = vlc_offsets[9+i] - vlc_offsets[8+i]; - build_vlc(&quant_vlc[2][i], - mpc8_q7_len_counts[i], mpc8_q7_syms[i], MPC8_Q7_OFFSET); - quant_vlc[3][i].table = &codes_table[vlc_offsets[10+i]]; - quant_vlc[3][i].table_allocated = vlc_offsets[11+i] - vlc_offsets[10+i]; - build_vlc(&quant_vlc[3][i], - mpc8_q8_len_counts[i], mpc8_q8_syms[i], MPC8_Q8_OFFSET); + build_vlc(&q2_vlc[i], &offset, mpc8_q2_len_counts[i], &q_syms, 0); + build_vlc(&q3_vlc[i], &offset, mpc8_q34_len_counts[i], + &q_syms, -48 - 16 * i); + for (int j = 0; j < 4; j++) + build_vlc(&quant_vlc[j][i], &offset, mpc8_q5_8_len_counts[i][j], + &q_syms, -((8 << j) - 1)); } vlc_initialized = 1; diff --git a/libavcodec/mpc8huff.h b/libavcodec/mpc8huff.h index 8838751fd6..51997df3ed 100644 --- a/libavcodec/mpc8huff.h +++ b/libavcodec/mpc8huff.h @@ -37,18 +37,11 @@ static const uint8_t mpc8_bands_len_counts[16] = { 1, 1, 1, 0, 2, 2, 1, 3, 2, 3, 4, 11, 2, 0, 0, 0 }; -#define MPC8_SCFI0_SIZE 4 -#define MPC8_SCFI0_BITS 3 - -static const uint8_t mpc8_scfi0_syms[MPC8_SCFI0_SIZE] = { - 0, 1, 3, 2 -}; - -#define MPC8_SCFI1_SIZE 16 -#define MPC8_SCFI1_BITS 7 - -static const uint8_t mpc8_scfi1_syms[MPC8_SCFI1_SIZE] = { - 1, 4, 0, 2, 3, 8, 12, 5, 6, 7, 9, 13, 11, 14, 10, 15 +static const uint8_t mpc8_scfi_syms[] = { + /* SCFI[0] VLC symbols - 4 entries */ + 0, 1, 3, 2, + /* SCFI[1] VLC symbols - 16 entries */ + 1, 4, 0, 2, 3, 8, 12, 5, 6, 7, 9, 13, 11, 14, 10, 15 }; static const uint8_t mpc8_scfi_len_counts[2][16] = { @@ -56,20 +49,16 @@ static const uint8_t mpc8_scfi_len_counts[2][16] = { { 0, 2, 2, 0, 5, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }; -#define MPC8_DSCF0_SIZE 64 #define MPC8_DSCF0_BITS 9 +#define MPC8_DSCF1_BITS 9 -static const uint8_t mpc8_dscf0_syms[MPC8_DSCF0_SIZE] = { +static const uint8_t mpc8_dscf_syms[] = { + /* DSCF[0] VLC symbols - 64 entries */ 58, 59, 60, 61, 62, 63, 55, 56, 57, 0, 1, 2, 53, 54, 3, 4, 5, 50, 51, 52, 6, 7, 8, 9, 10, 31, 47, 48, 49, 11, 12, 13, 14, 44, 45, 46, 15, 16, 17, 18, 41, 42, 43, 19, 20, 21, 22, 40, 23, 24, 38, 39, 25, 28, 37, 26, 27, 29, 30, 32, 36, 33, 34, 35, -}; - -#define MPC8_DSCF1_SIZE 65 -#define MPC8_DSCF1_BITS 9 - -static const uint8_t mpc8_dscf1_syms[MPC8_DSCF1_SIZE] = { + /* DSCF[1] VLC symbols - 65 entries */ 0, 59, 60, 61, 62, 63, 1, 2, 56, 57, 58, 3, 4, 5, 53, 54, 55, 6, 7, 8, 9, 49, 50, 51, 52, 64, 10, 11, 12, 13, 46, 47, 48, 14, 15, 16, 17, 43, 44, 45, 18, 19, 20, 41, 42, 21, 22, 39, 40, 23, 24, 38, 25, 37, 26, 35, 36, @@ -81,16 +70,13 @@ static const uint8_t mpc8_dscf_len_counts[2][16] = { { 0, 0, 5, 3, 3, 2, 3, 4, 5, 7, 7, 9, 6, 5, 6, 0 }, }; -#define MPC8_RES_SIZE 17 #define MPC8_RES_BITS 9 -static const uint8_t mpc8_res_syms[2][MPC8_RES_SIZE] = { - { +static const uint8_t mpc8_res_syms[] = { + /* RES[0] VLC symbols - 17 entries */ 13, 14, 12, 11, 10, 9, 8, 7, 6, 15, 5, 4, 3, 2, 16, 1, 0, - }, - { + /* RES[1] VLC symbols - 17 entries */ 8, 9, 10, 11, 7, 12, 6, 13, 5, 4, 14, 3, 15, 2, 0, 1, 16, - } }; static const uint8_t mpc8_res_len_counts[2][16] = { @@ -98,21 +84,53 @@ static const uint8_t mpc8_res_len_counts[2][16] = { { 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, 0, 0 }, }; -#define MPC8_Q1_SIZE 19 #define MPC8_Q1_BITS 9 -static const uint8_t mpc8_q1_syms[MPC8_Q1_SIZE] = { - 17, 18, 16, 15, 14, 13, 12, 0, 11, 1, 2, 8, 9, 10, 3, 4, 5, 6, 7, -}; - static const uint8_t mpc8_q1_len_counts[16] = { 0, 0, 5, 5, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0 }; -#define MPC8_Q9UP_SIZE 256 #define MPC8_Q9UP_BITS 9 -static const uint8_t mpc8_q9up_syms[MPC8_Q9UP_SIZE] = { +static const uint8_t mpc8_q9up_len_counts[16] = { + 0, 0, 0, 0, 0, 2, 38, 134, 71, 9, 2, 0, 0, 0, 0, 0 +}; + +#define MPC8_Q2_BITS 9 + +static const uint8_t mpc8_q2_len_counts[2][16] = { + { 0, 0, 1, 6, 0, 17, 9, 24, 24, 9, 27, 4, 4, 0, 0, 0 }, + { 0, 0, 0, 1, 16, 10, 6, 48, 9, 27, 4, 4, 0, 0, 0, 0 }, +}; + +#define MPC8_Q3_BITS 9 +#define MPC8_Q4_BITS 9 + +static const uint8_t mpc8_q34_len_counts[2][16] = { + { 0, 0, 1, 6, 6, 11, 13, 8, 4, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 1, 12, 23, 14, 19, 8, 4, 0, 0, 0, 0, 0, 0 }, +}; + +static const uint8_t mpc8_q5_8_len_counts[2][4][16] = { + { /* Q5[0], Q6[0], Q7[0], Q8[0] */ + { 0, 1, 4, 2, 2, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 2, 4, 3, 7, 2, 4, 8, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 2, 2, 4, 6, 10, 10, 12, 16, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 2, 1, 3, 8, 8, 15, 24, 42, 17, 6, 0, 0, 0, 0 }, + }, + { /* Q5[1], Q6[1], Q7[1], Q8[1] */ + { 0, 0, 5, 4, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 11, 6, 4, 6, 4, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 20, 15, 10, 14, 4, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 26, 55, 38, 8, 0, 0, 0, 0, 0, 0, 0 }, + } +}; + +static const uint8_t mpc8_q_syms[] = { + /* Q1 VLC symbols - 19 entries */ + 17, 18, 16, 15, 14, 13, 12, 0, 11, 1, 2, 8, 9, 10, 3, + 4, 5, 6, 7, + /* Q9UP VLC symbols - 256 entries */ 254, 255, 0, 1, 2, 3, 4, 250, 251, 252, 253, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, @@ -131,17 +149,7 @@ static const uint8_t mpc8_q9up_syms[MPC8_Q9UP_SIZE] = { 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 127, 128, -}; - -static const uint8_t mpc8_q9up_len_counts[16] = { - 0, 0, 0, 0, 0, 2, 38, 134, 71, 9, 2, 0, 0, 0, 0, 0 -}; - -#define MPC8_Q2_SIZE 125 -#define MPC8_Q2_BITS 9 - -static const uint8_t mpc8_q2_syms[2][MPC8_Q2_SIZE] = { -{ + /* Q2[0] VLC symbols - 125 entries */ 4, 24, 100, 120, 0, 20, 104, 124, 1, 3, 5, 9, 10, 14, 15, 19, 21, 23, 25, 29, 45, 49, 75, 79, 95, 99, 101, 103, 105, 109, 114, 115, 119, 121, 123, 2, 22, 50, 54, 70, 74, 102, 110, 122, 6, @@ -151,8 +159,34 @@ static const uint8_t mpc8_q2_syms[2][MPC8_Q2_SIZE] = { 113, 117, 12, 33, 43, 52, 60, 64, 72, 91, 112, 31, 32, 36, 38, 41, 42, 56, 58, 66, 68, 81, 82, 83, 86, 88, 92, 93, 37, 57, 61, 63, 67, 87, 62, -}, -{ + /* Q3 VLC symbols - 49 entries */ + 13, 3, 109, 99, 14, 2, 29, 19, 93, 83, 110, 98, 15, 0, 1, + 18, 45, 35, 61, 51, 77, 67, 111, 96, 97, 30, 31, 17, 46, 34, + 78, 66, 94, 95, 81, 82, 16, 33, 62, 50, 79, 80, 47, 32, 63, + 49, 64, 65, 48, + /* Q5[0] VLC symbols - 15 entries */ + 0, 1, 13, 14, 2, 12, 3, 11, 4, 10, 5, 6, 8, 9, 7, + /* Q6[0] VLC symbols - 31 entries */ + 0, 1, 2, 3, 27, 28, 29, 30, 4, 5, 25, 26, 6, 24, 7, + 8, 9, 20, 21, 22, 23, 10, 11, 19, 12, 13, 17, 18, 14, 16, + 15, + /* Q7[0] VLC symbols - 63 entries */ + 0, 1, 2, 5, 6, 7, 8, 9, 53, 54, 55, 56, 57, 60, 61, + 62, 3, 4, 10, 11, 12, 13, 49, 50, 51, 52, 58, 59, 14, 15, + 16, 17, 18, 43, 45, 46, 47, 48, 19, 20, 21, 22, 23, 39, 40, + 41, 42, 44, 24, 25, 26, 36, 37, 38, 27, 28, 34, 35, 29, 33, + 30, 32, 31, + /* Q8[0] VLC symbols - 127 entries */ + 11, 12, 111, 113, 114, 115, 0, 1, 13, 14, 15, 16, 17, 18, 19, + 21, 104, 105, 107, 108, 109, 110, 112, 2, 3, 4, 5, 6, 8, 10, + 20, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 92, + 93, 95, 96, 97, 98, 99, 100, 101, 102, 103, 106, 116, 117, 120, 121, + 122, 123, 124, 125, 126, 7, 9, 30, 36, 37, 38, 39, 40, 41, 42, + 43, 45, 83, 84, 85, 86, 87, 88, 89, 90, 91, 94, 118, 119, 44, + 46, 47, 48, 49, 50, 51, 75, 76, 77, 78, 79, 80, 81, 82, 52, + 53, 54, 55, 71, 72, 73, 74, 56, 57, 58, 59, 67, 68, 69, 70, + 60, 65, 66, 61, 62, 64, 63, + /* Q2[1] VLC symbols - 125 entries */ 4, 24, 100, 120, 0, 20, 104, 124, 1, 3, 5, 9, 10, 15, 19, 21, 23, 25, 29, 45, 49, 75, 79, 95, 99, 101, 102, 103, 105, 109, 114, 115, 119, 121, 123, 2, 14, 22, 50, 54, 70, 74, 110, 122, 6, @@ -162,123 +196,26 @@ static const uint8_t mpc8_q2_syms[2][MPC8_Q2_SIZE] = { 117, 118, 12, 52, 60, 64, 72, 112, 31, 33, 36, 41, 43, 81, 83, 88, 91, 93, 32, 37, 38, 42, 56, 57, 58, 61, 63, 66, 67, 68, 82, 86, 87, 92, 62, -} -}; - -static const uint8_t mpc8_q2_len_counts[2][16] = { - { 0, 0, 1, 6, 0, 17, 9, 24, 24, 9, 27, 4, 4, 0, 0, 0 }, - { 0, 0, 0, 1, 16, 10, 6, 48, 9, 27, 4, 4, 0, 0, 0, 0 }, -}; - -#define MPC8_Q3_SIZE 49 -#define MPC8_Q3_BITS 9 -#define MPC8_Q3_OFFSET -48 - -static const uint8_t mpc8_q3_len_counts[16] = { - 0, 0, 1, 6, 6, 11, 13, 8, 4, 0, 0, 0, 0, 0, 0, 0 -}; -static const uint8_t mpc8_q3_syms[MPC8_Q3_SIZE] = { - 13, 3, 109, 99, 14, 2, 29, 19, 93, 83, 110, 98, 15, 0, 1, - 18, 45, 35, 61, 51, 77, 67, 111, 96, 97, 30, 31, 17, 46, 34, - 78, 66, 94, 95, 81, 82, 16, 33, 62, 50, 79, 80, 47, 32, 63, - 49, 64, 65, 48, -}; - -#define MPC8_Q4_SIZE 81 -#define MPC8_Q4_BITS 9 -#define MPC8_Q4_OFFSET -64 - -static const uint8_t mpc8_q4_len_counts[16] = { - 0, 0, 0, 1, 12, 23, 14, 19, 8, 4, 0, 0, 0, 0, 0, 0 -}; -static const uint8_t mpc8_q4_syms[MPC8_Q4_SIZE] = { + /* Q4 VLC symbols - 81 entries */ 12, 4, 140, 132, 13, 3, 28, 20, 124, 116, 141, 131, 14, 1, 2, 29, 19, 44, 36, 60, 52, 92, 84, 108, 100, 125, 115, 142, 143, 129, 130, 15, 0, 30, 18, 45, 35, 76, 68, 109, 99, 126, 127, 114, 128, 31, 16, 17, 46, 47, 33, 34, 61, 62, 50, 51, 77, 67, 93, 94, 82, 83, 110, 111, 97, 98, 112, 113, 32, 63, 48, 49, 78, 79, 65, 66, 95, 80, 81, 96, 64, -}; - -#define MPC8_Q5_SIZE 15 -#define MPC8_Q5_BITS 7 -#define MPC8_Q5_OFFSET -7 - -static const uint8_t mpc8_q5_syms[2][MPC8_Q5_SIZE] = { -{ - 0, 1, 13, 14, 2, 12, 3, 11, 4, 10, 5, 6, 8, 9, 7, -}, -{ - 0, 1, 13, 14, 2, 12, 3, 4, 10, 11, 5, 6, 7, 8, 9, -} -}; - -static const uint8_t mpc8_q5_len_counts[2][16] = { - { 0, 1, 4, 2, 2, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 5, 4, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, -}; - -#define MPC8_Q6_SIZE 31 -#define MPC8_Q6_BITS 9 -#define MPC8_Q6_OFFSET -15 - -static const uint8_t mpc8_q6_syms[2][MPC8_Q6_SIZE] = { -{ - 0, 1, 2, 3, 27, 28, 29, 30, 4, 5, 25, 26, 6, 24, 7, 8, 9, 20, 21, - 22, 23, 10, 11, 19, 12, 13, 17, 18, 14, 16, 15, -}, -{ - 0, 1, 29, 30, 2, 3, 4, 26, 27, 28, 5, 6, 24, 25, 7, 8, 9, 21, 22, - 23, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, -} -}; - -static const uint8_t mpc8_q6_len_counts[2][16] = { - { 0, 1, 2, 4, 3, 7, 2, 4, 8, 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 11, 6, 4, 6, 4, 0, 0, 0, 0, 0, 0, 0, 0 }, -}; - -#define MPC8_Q7_SIZE 63 -#define MPC8_Q7_BITS 9 -#define MPC8_Q7_OFFSET -31 - -static const uint8_t mpc8_q7_syms[2][MPC8_Q7_SIZE] = { -{ - 0, 1, 2, 5, 6, 7, 8, 9, 53, 54, 55, 56, 57, 60, 61, 62, 3, 4, 10, - 11, 12, 13, 49, 50, 51, 52, 58, 59, 14, 15, 16, 17, 18, 43, 45, 46, 47, 48, - 19, 20, 21, 22, 23, 39, 40, 41, 42, 44, 24, 25, 26, 36, 37, 38, 27, 28, 34, - 35, 29, 33, 30, 32, 31, -}, -{ - 0, 1, 61, 62, 2, 3, 4, 5, 6, 7, 8, 54, 55, 56, 57, 58, 59, 60, 9, - 10, 11, 12, 13, 49, 50, 51, 52, 53, 14, 15, 16, 17, 18, 19, 20, 21, 42, 43, - 44, 45, 46, 47, 48, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, -} -}; - -static const uint8_t mpc8_q7_len_counts[2][MPC8_Q7_SIZE] = { - { 0, 1, 2, 2, 4, 6, 10, 10, 12, 16, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 20, 15, 10, 14, 4, 0, 0, 0, 0, 0, 0, 0 }, -}; - -#define MPC8_Q8_SIZE 127 -#define MPC8_Q8_BITS 9 -#define MPC8_Q8_OFFSET -63 - -static const uint8_t mpc8_q8_syms[2][MPC8_Q8_SIZE] = { -{ - 11, 12, 111, 113, 114, 115, 0, 1, 13, 14, 15, 16, 17, 18, 19, - 21, 104, 105, 107, 108, 109, 110, 112, 2, 3, 4, 5, 6, 8, 10, - 20, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 92, - 93, 95, 96, 97, 98, 99, 100, 101, 102, 103, 106, 116, 117, 120, 121, - 122, 123, 124, 125, 126, 7, 9, 30, 36, 37, 38, 39, 40, 41, 42, - 43, 45, 83, 84, 85, 86, 87, 88, 89, 90, 91, 94, 118, 119, 44, - 46, 47, 48, 49, 50, 51, 75, 76, 77, 78, 79, 80, 81, 82, 52, - 53, 54, 55, 71, 72, 73, 74, 56, 57, 58, 59, 67, 68, 69, 70, - 60, 65, 66, 61, 62, 64, 63, -}, -{ + /* Q5[1] VLC symbols - 15 entries */ + 0, 1, 13, 14, 2, 12, 3, 4, 10, 11, 5, 6, 7, 8, 9, + /* Q6[1] VLC symbols - 31 entries */ + 0, 1, 29, 30, 2, 3, 4, 26, 27, 28, 5, 6, 24, 25, 7, + 8, 9, 21, 22, 23, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, + /* Q7[1] VLC symbols - 63 entries */ + 0, 1, 61, 62, 2, 3, 4, 5, 6, 7, 8, 54, 55, 56, 57, + 58, 59, 60, 9, 10, 11, 12, 13, 49, 50, 51, 52, 53, 14, 15, + 16, 17, 18, 19, 20, 21, 42, 43, 44, 45, 46, 47, 48, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, + /* Q8[1] VLC symbols - 127 entries */ 0, 1, 2, 3, 123, 124, 125, 126, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, @@ -288,12 +225,6 @@ static const uint8_t mpc8_q8_syms[2][MPC8_Q8_SIZE] = { 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 76, -} -}; - -static const uint8_t mpc8_q8_len_counts[2][16] = { - { 0, 1, 2, 1, 3, 8, 8, 15, 24, 42, 17, 6, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 26, 55, 38, 8, 0, 0, 0, 0, 0, 0, 0 }, }; #endif /* AVCODEC_MPC8HUFF_H */ From patchwork Fri Nov 20 07:19:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23808 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 2336D44A644 for ; Fri, 20 Nov 2020 09:34:07 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2B2C068BB58; Fri, 20 Nov 2020 09:25:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1870468BA5E for ; Fri, 20 Nov 2020 09:25:05 +0200 (EET) Received: by mail-ej1-f48.google.com with SMTP id gj5so11499411ejb.8 for ; Thu, 19 Nov 2020 23:25:05 -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=hYuwVehIc7GiTFLM8fkw6XhsJa8oSGzQ8VoByVcUdkA=; b=OfF2X6rwvr8RkuLsErHV0ZVBAQrX4BL7blnhjw6sgf9YbyWAp+jWgn4WPWF3Q0qNU6 nj3zuEEzXHFTKR0T/RJVqVxf1v8ARfivYiOPb0wLZao6lrfgKn13m7kpTtUKAfbaw8OQ 4H6R2sigg65yAvFc+6tVs6W5TYQpoKfmuMljgK1BDwdfBZWDikkNsdTseeknDLAg6s2Z M7KJQu/6/Uq1n7NoWxbTY579ZWLPUaxYSDmjUb2nvOxXg3jRXCajaR0pq5lsbvPEwXs2 Vs1BO2jV85Q2pIcdPUaVyoH2Nzqi60eEjFq6RwkH/CY8qP+Ea9fLsqiZEFS0jEntpkSX d51A== 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=hYuwVehIc7GiTFLM8fkw6XhsJa8oSGzQ8VoByVcUdkA=; b=fOyBsF+nOO+2L4ifK2jBmFpXV1t+kHEwse/IRu0l6IvtcOZYAwT9cj2oCwDbufE0QZ S5GVLoanSPgaiWjegns8x+j65EqfwKmOe141e9YoKvEQ24HicsaX+UDVGaFDMJ/W5q7T 7XZ4myIldJVumFECh8xxPEqTxvh8rbol2V6LhBIXHYwUAiBnFuiM2SXGNRdt2FuiePIz Q27zZb6ACY3llmmMtxV476zpQMVmijcC5MswCQhv5CXgY6AiRDvF9tcUn6/zbIx2KviA vhQynA/G+qOXD8dlVx0GTq8ekuGe/sbyI6ZV6OGcbG3CEbUj+pN0pdn2w1nXDtHoV8EF Dp1g== X-Gm-Message-State: AOAM530c4L4HASIaJOWTEtJenQBWD3ovtsVYuh0q2znbBa6sfFOHt+n+ NWI73/XI3OQaeiwHaE8bVy7CaPhiuhjr/g== X-Google-Smtp-Source: ABdhPJwrn4XfUQ3vL3ZfUIr6W7i7jpuSOJxJaBsyRCVZDhCT9Cujxnpm/t1ye3OttXFzHvtXlRXXxg== X-Received: by 2002:a17:906:f10e:: with SMTP id gv14mr31194428ejb.346.1605857105017; Thu, 19 Nov 2020 23:25:05 -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.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:04 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:27 +0100 Message-Id: <20201120072116.818090-55-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 054/162] avcodec/mpegaudiodsp: Combine initializing float and int tables 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" This avoids code duplication in the functions used to initialize them and allows to remove an AVOnce. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegaudiodsp.c | 54 +++++++++++++++++++++++++++--- libavcodec/mpegaudiodsp.h | 3 -- libavcodec/mpegaudiodsp_template.c | 42 ----------------------- 3 files changed, 50 insertions(+), 49 deletions(-) diff --git a/libavcodec/mpegaudiodsp.c b/libavcodec/mpegaudiodsp.c index 3cafca27bf..0a14ff549e 100644 --- a/libavcodec/mpegaudiodsp.c +++ b/libavcodec/mpegaudiodsp.c @@ -21,20 +21,66 @@ #include "config.h" #include "libavutil/attributes.h" #include "libavutil/thread.h" +#include "mpegaudio.h" #include "mpegaudiodsp.h" #include "dct.h" #include "dct32.h" -static AVOnce mpadsp_float_table_init = AV_ONCE_INIT; -static AVOnce mpadsp_fixed_table_init = AV_ONCE_INIT; +static AVOnce mpadsp_table_init = AV_ONCE_INIT; + +static av_cold void mpadsp_init_tabs(void) +{ + int i, j; + /* compute mdct windows */ + for (i = 0; i < 36; i++) { + for (j = 0; j < 4; j++) { + double d; + + if (j == 2 && i % 3 != 1) + continue; + + d = sin(M_PI * (i + 0.5) / 36.0); + if (j == 1) { + if (i >= 30) d = 0; + else if (i >= 24) d = sin(M_PI * (i - 18 + 0.5) / 12.0); + else if (i >= 18) d = 1; + } else if (j == 3) { + if (i < 6) d = 0; + else if (i < 12) d = sin(M_PI * (i - 6 + 0.5) / 12.0); + else if (i < 18) d = 1; + } + //merge last stage of imdct into the window coefficients + d *= 0.5 * IMDCT_SCALAR / cos(M_PI * (2 * i + 19) / 72); + + if (j == 2) { + ff_mdct_win_float[j][i/3] = d / (1 << 5); + ff_mdct_win_fixed[j][i/3] = d / (1 << 5) * (1LL << 32) + 0.5; + } else { + int idx = i < 18 ? i : i + (MDCT_BUF_SIZE/2 - 18); + ff_mdct_win_float[j][idx] = d / (1 << 5); + ff_mdct_win_fixed[j][idx] = d / (1 << 5) * (1LL << 32) + 0.5; + } + } + } + + /* NOTE: we do frequency inversion after the MDCT by changing + the sign of the right window coefs */ + for (j = 0; j < 4; j++) { + for (i = 0; i < MDCT_BUF_SIZE; i += 2) { + ff_mdct_win_float[j + 4][i ] = ff_mdct_win_float[j][i ]; + ff_mdct_win_float[j + 4][i + 1] = -ff_mdct_win_float[j][i + 1]; + ff_mdct_win_fixed[j + 4][i ] = ff_mdct_win_fixed[j][i ]; + ff_mdct_win_fixed[j + 4][i + 1] = -ff_mdct_win_fixed[j][i + 1]; + } + } +} av_cold void ff_mpadsp_init(MPADSPContext *s) { DCTContext dct; ff_dct_init(&dct, 5, DCT_II); - ff_thread_once(&mpadsp_float_table_init, &ff_init_mpadsp_tabs_float); - ff_thread_once(&mpadsp_fixed_table_init, &ff_init_mpadsp_tabs_fixed); + ff_thread_once(&mpadsp_table_init, &mpadsp_init_tabs); s->apply_window_float = ff_mpadsp_apply_window_float; s->apply_window_fixed = ff_mpadsp_apply_window_fixed; diff --git a/libavcodec/mpegaudiodsp.h b/libavcodec/mpegaudiodsp.h index 0e4352deab..28dcec576c 100644 --- a/libavcodec/mpegaudiodsp.h +++ b/libavcodec/mpegaudiodsp.h @@ -82,9 +82,6 @@ void ff_imdct36_blocks_float(float *out, float *buf, float *in, void ff_imdct36_blocks_fixed(int *out, int *buf, int *in, int count, int switch_point, int block_type); -void ff_init_mpadsp_tabs_float(void); -void ff_init_mpadsp_tabs_fixed(void); - /** For SSE implementation, MDCT_BUF_SIZE/2 should be 128-bit aligned */ #define MDCT_BUF_SIZE FFALIGN(36, 2*4) diff --git a/libavcodec/mpegaudiodsp_template.c b/libavcodec/mpegaudiodsp_template.c index e531f8a904..f8d0870df6 100644 --- a/libavcodec/mpegaudiodsp_template.c +++ b/libavcodec/mpegaudiodsp_template.c @@ -221,48 +221,6 @@ av_cold void RENAME(ff_mpa_synth_init)(MPA_INT *window) window[512+128+16*i+j] = window[64*i+48-j]; } -av_cold void RENAME(ff_init_mpadsp_tabs)(void) -{ - int i, j; - /* compute mdct windows */ - for (i = 0; i < 36; i++) { - for (j = 0; j < 4; j++) { - double d; - - if (j == 2 && i % 3 != 1) - continue; - - d = sin(M_PI * (i + 0.5) / 36.0); - if (j == 1) { - if (i >= 30) d = 0; - else if (i >= 24) d = sin(M_PI * (i - 18 + 0.5) / 12.0); - else if (i >= 18) d = 1; - } else if (j == 3) { - if (i < 6) d = 0; - else if (i < 12) d = sin(M_PI * (i - 6 + 0.5) / 12.0); - else if (i < 18) d = 1; - } - //merge last stage of imdct into the window coefficients - d *= 0.5 * IMDCT_SCALAR / cos(M_PI * (2 * i + 19) / 72); - - if (j == 2) - RENAME(ff_mdct_win)[j][i/3] = FIXHR((d / (1<<5))); - else { - int idx = i < 18 ? i : i + (MDCT_BUF_SIZE/2 - 18); - RENAME(ff_mdct_win)[j][idx] = FIXHR((d / (1<<5))); - } - } - } - - /* NOTE: we do frequency inversion adter the MDCT by changing - the sign of the right window coefs */ - for (j = 0; j < 4; j++) { - for (i = 0; i < MDCT_BUF_SIZE; i += 2) { - RENAME(ff_mdct_win)[j + 4][i ] = RENAME(ff_mdct_win)[j][i ]; - RENAME(ff_mdct_win)[j + 4][i + 1] = -RENAME(ff_mdct_win)[j][i + 1]; - } - } -} /* cos(pi*i/18) */ #define C1 FIXHR(0.98480775301220805936/2) #define C2 FIXHR(0.93969262078590838405/2) From patchwork Fri Nov 20 07:19:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23810 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 3DA2D44AD73 for ; Fri, 20 Nov 2020 09:34:19 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2231468BB69; Fri, 20 Nov 2020 09:25:19 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E9E7168BAA5 for ; Fri, 20 Nov 2020 09:25:06 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id d18so8469839edt.7 for ; Thu, 19 Nov 2020 23:25:06 -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=M4OzrxtMv0gXEQLnauRa4dv7SjxvQK9EdktXNOtl0+w=; b=D3p2pOqYiRAnt0CeHvoJHORn5Rw5qdTnbFwbmmMWbLL+MDkBgRH6qoCLbnXI7Injkc 3HFj1wi0xwtro3je1G08S0BRVPQ5iB8532wauoWZSGqMBsA8vPlC+M9h3DkDt4wkfcQI p6ire+WNOV6Fv1U28eLgeFETN0RVD2Iq4KU4yUckD4h6b2oPc9g07Fv0hLG+cNj8XEwv ZhagUjLEnvisFibKuQxuCTfenBkwfdKlEwj5PlucddrT9mzk9YKg9idgRd8U7TPgY4wV 6YMPpaRVnDGMmFpbx6tDJog8NuVnEV5Up3nYvul4tEqB+ViPuKxLKaKpN3viLyDJY9xc gcEA== 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=M4OzrxtMv0gXEQLnauRa4dv7SjxvQK9EdktXNOtl0+w=; b=jG/8H67jsYC26LPwx7KG4RHkqc2w7hQaBpjpErjdXApGIjU4AYf6y76IENy3nR2kEx 5XXYE1447ZI/dbplLAS/3BHMyV8f7GwbeWnbcOmqCnPogaINDldzvEiyVFgPlXddGamB UwdKIPeyMOXyVAvVwpO6PDjqysM1mL8ey24X+Xl7PCx8M8Nn9jumFSgn4LrbjuEr89RK DEm79vMdMBA2ReJdVyVf48pHvOtnB4aCAtSHT55Fi1E00eqQ8lFz/zrabLkn+pduCiaQ rVWHwzuV7tqpaknd8SjiRNdHiNdahjzvFYXVDDubcjTX2bfTm7WLxjSk4AZTCgO91wob 8dvQ== X-Gm-Message-State: AOAM530E0YxfNBm+Ovca3yffeqfHpmA4Q1t/oQQmkkLxM4rKUkqjUvaa QzgwS+pjab2MIrPReu6Oq7Tk0M+h3lM2mQ== X-Google-Smtp-Source: ABdhPJxMsYXWKx4U3ssaR0nJ8pvnLd5JMB/bOrrzR6QozkHe86olhXTGo4I78Hh4WVHVE6c5/OMtKw== X-Received: by 2002:a50:c30d:: with SMTP id a13mr11069307edb.89.1605857106122; Thu, 19 Nov 2020 23:25:06 -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.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:05 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:28 +0100 Message-Id: <20201120072116.818090-56-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 055/162] avcodec/fft_template, fft_init_table: Make ff_fft_init() thread-safe 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" Commit 1af615683e4a1a858407afbaa2fd686842da7e49 put initializing the ff_fft_offsets_lut (which is typically used if FFT_FIXED_32) behind an ff_thread_once() to make ff_fft_init() thread-safe; yet there is a second place where said table may be initialized which is not guarded by this AVOnce: ff_fft_init_mips(). MIPS uses this LUT even for ordinary floating point FFTs, so that ff_fft_init() is not thread-safe (on MIPS) for both 32bit fixed-point as well as floating-point FFTs; e.g. ff_mdct_init() inherits this flaw and therefore initializing e.g. the AAC decoders is not thread-safe (on MIPS) despite them having FF_CODEC_CAP_INIT_CLEANUP set. This commit fixes this by moving the AVOnce to fft_init_table.c and using it to guard all initializations of ff_fft_offsets_lut. (It is not that bad in practice, because every entry of ff_fft_offsets_lut is never read during initialization and is only once ever written to (namely to its final value); but even these are conflicting actions which are (by definition) data races and lead to undefined behaviour.) Signed-off-by: Andreas Rheinhardt --- I don't have a MIPS, so the MIPS part is untested. libavcodec/fft_init_table.c | 24 ++++++++++++++++++++---- libavcodec/fft_table.h | 2 +- libavcodec/fft_template.c | 12 +----------- libavcodec/mips/fft_mips.c | 4 +--- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/libavcodec/fft_init_table.c b/libavcodec/fft_init_table.c index c488018f62..83e35ffb7c 100644 --- a/libavcodec/fft_init_table.c +++ b/libavcodec/fft_init_table.c @@ -51,6 +51,8 @@ * @file * definitions and initialization of LUT table for FFT */ +#include "libavutil/thread.h" + #include "libavcodec/fft_table.h" const int32_t ff_w_tab_sr[MAX_FFT_SIZE/(4*16)] = { @@ -314,15 +316,29 @@ const int32_t ff_w_tab_sr[MAX_FFT_SIZE/(4*16)] = { uint16_t ff_fft_offsets_lut[21845]; -void ff_fft_lut_init(uint16_t *table, int off, int size, int *index) +static void fft_lut_init(uint16_t *table, int off, int size, int *index) { if (size < 16) { table[*index] = off >> 2; (*index)++; } else { - ff_fft_lut_init(table, off, size>>1, index); - ff_fft_lut_init(table, off+(size>>1), size>>2, index); - ff_fft_lut_init(table, off+3*(size>>2), size>>2, index); + fft_lut_init(table, off, size >> 1, index); + fft_lut_init(table, off + (size >> 1), size >> 2, index); + fft_lut_init(table, off + 3 * (size >> 2), size >> 2, index); } } + +static void fft_lut_init_start(void) +{ + int n = 0; + + fft_lut_init(ff_fft_offsets_lut, 0, 1 << 17, &n); +} + +void ff_fft_lut_init(void) +{ + static AVOnce init_once = AV_ONCE_INIT; + + ff_thread_once(&init_once, fft_lut_init_start); +} diff --git a/libavcodec/fft_table.h b/libavcodec/fft_table.h index ed0a6588b4..09df49f2b8 100644 --- a/libavcodec/fft_table.h +++ b/libavcodec/fft_table.h @@ -61,6 +61,6 @@ extern const int32_t ff_w_tab_sr[]; extern uint16_t ff_fft_offsets_lut[]; -void ff_fft_lut_init(uint16_t *table, int off, int size, int *index); +void ff_fft_lut_init(void); #endif /* AVCODEC_FFT_TABLE_H */ diff --git a/libavcodec/fft_template.c b/libavcodec/fft_template.c index 20a62e4290..8825e39f79 100644 --- a/libavcodec/fft_template.c +++ b/libavcodec/fft_template.c @@ -35,13 +35,6 @@ #if FFT_FIXED_32 #include "fft_table.h" - -static void av_cold fft_lut_init(void) -{ - int n = 0; - ff_fft_lut_init(ff_fft_offsets_lut, 0, 1 << 17, &n); -} - #else /* FFT_FIXED_32 */ /* cos(2*pi*x/n) for 0<=x<=n/4, followed by its reverse */ @@ -236,10 +229,7 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse) #endif #if FFT_FIXED_32 - { - static AVOnce control = AV_ONCE_INIT; - ff_thread_once(&control, fft_lut_init); - } + ff_fft_lut_init(); #else /* FFT_FIXED_32 */ #if FFT_FLOAT if (ARCH_AARCH64) ff_fft_init_aarch64(s); diff --git a/libavcodec/mips/fft_mips.c b/libavcodec/mips/fft_mips.c index 69abdc8a08..a6656d9650 100644 --- a/libavcodec/mips/fft_mips.c +++ b/libavcodec/mips/fft_mips.c @@ -500,9 +500,7 @@ static void ff_imdct_calc_mips(FFTContext *s, FFTSample *output, const FFTSample av_cold void ff_fft_init_mips(FFTContext *s) { - int n=0; - - ff_fft_lut_init(ff_fft_offsets_lut, 0, 1 << 17, &n); + ff_fft_lut_init(); ff_init_ff_cos_tabs(17); #if HAVE_INLINE_ASM From patchwork Fri Nov 20 07:19:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23811 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 935BA44AD73 for ; Fri, 20 Nov 2020 09:34:32 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1680968BB72; Fri, 20 Nov 2020 09:25:20 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA12D68BAEB for ; Fri, 20 Nov 2020 09:25:07 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id f23so11521425ejk.2 for ; Thu, 19 Nov 2020 23:25:07 -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=slB3UvUeHXYoe0pUS5oGbArjbZuRYUBr6s/mYvX+uKE=; b=HLtVIRx4cr02kI7TT3KN2Z/gZzV6tOpKl8+xruY37uL/0bfeLECPQZ8Tlf7Wt4bVfS ArdIo17iPLwxu00SIZIXZPxAb6QeeT7Uz3GZBcHWt3+xg51u3ezaIg/DMcyBgGnAtdfs ABaa2cmZ73/nPcXjZrvM5j1YlWL0ttb/XDe8hhfqsEaNwlBFkYkmVIVfybiKB0uovttC VEwiEqriXHWSL7v8UWNPDHCCzEKHusuXohsRE7jjFR+Z6GQ0n4NxmJQ4vZ/rUqBJOhvZ UuvLV3fU43kzXnx5Fn+rtukYvGjv+SvBJHO8kTj6+4CNqIDG5bV6GNhMqZ0ppwapl+Dw Y6jQ== 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=slB3UvUeHXYoe0pUS5oGbArjbZuRYUBr6s/mYvX+uKE=; b=A6iJGpnOUghhE3x2CQpO+GiS+6Do4qMRyoB7qoV0CUkgR7ek1A6WkrSZYmo/QIoKUQ jOIdwgSJA44iMWf6xrotLTySpc6E+AH3XH1r02SDoagvHq9lEgZH4d/T6AYx6JdcOObh 7lHWUEq4swoXz9VQKb4LdbNckTmtht43J/3pZhnXqpvt75effY7d80ZlqnjDZk7KVSUt RRK+dlhZBNO49j3rOa1UbTtFrvCYA+43/nVWWOtvabU2uCmb/1uHQXdas6iM0tlRvrUr bkJM4UUFIPhJKyTcqUOh0EHGUGlXILd+Ckz0z4wmB+XOk6SnB/zHskjnnvDUYh3U7Wu4 Tmmg== X-Gm-Message-State: AOAM533wd/Qtb1a7pdkPs4+89mhHC/xm6MLTrjIvDKbCoQWNpvDeVpEC S4rPDW1T469I3+FCkAdIHv5r3MzEw0/vgQ== X-Google-Smtp-Source: ABdhPJymYETwn6yHrPRc6/qsgSjb6a68ZTkSKPBOr9yekqrO71BrmUp/gyQk0G5YPtlJj7SHMeikwg== X-Received: by 2002:a17:907:11d9:: with SMTP id va25mr13255561ejb.431.1605857107024; Thu, 19 Nov 2020 23:25:07 -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.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:06 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:29 +0100 Message-Id: <20201120072116.818090-57-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 056/162] avcodec/imc: Make imc/iac decoders init-threadsafe 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/imc.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index deb88d4d5d..c26d8b0149 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -38,6 +38,7 @@ #include "libavutil/ffmath.h" #include "libavutil/float_dsp.h" #include "libavutil/internal.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "bswapdsp.h" #include "get_bits.h" @@ -171,10 +172,27 @@ static av_cold void iac_generate_tabs(IMCContext *q, int sampling_rate) } } +static av_cold void imc_init_static(void) +{ + /* initialize the VLC tables */ + for (int i = 0, offset = 0; i < 4 ; i++) { + for (int j = 0; j < 4; j++) { + huffman_vlc[i][j].table = &vlc_tables[offset]; + huffman_vlc[i][j].table_allocated = VLC_TABLES_SIZE - offset;; + ff_init_vlc_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i], + imc_huffman_lens[i][j], 1, + imc_huffman_syms[i][j], 1, 1, + 0, INIT_VLC_STATIC_OVERLONG, NULL); + offset += huffman_vlc[i][j].table_size; + } + } +} + static av_cold int imc_decode_init(AVCodecContext *avctx) { int i, j, ret; IMCContext *q = avctx->priv_data; + static AVOnce init_static_once = AV_ONCE_INIT; AVFloatDSPContext *fdsp; double r1, r2; @@ -229,19 +247,6 @@ static av_cold int imc_decode_init(AVCodecContext *avctx) for (i = 0; i < 30; i++) q->sqrt_tab[i] = sqrt(i); - /* initialize the VLC tables */ - for (int i = 0, offset = 0; i < 4 ; i++) { - for (j = 0; j < 4; j++) { - huffman_vlc[i][j].table = &vlc_tables[offset]; - huffman_vlc[i][j].table_allocated = VLC_TABLES_SIZE - offset;; - ff_init_vlc_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i], - imc_huffman_lens[i][j], 1, - imc_huffman_syms[i][j], 1, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); - offset += huffman_vlc[i][j].table_size; - } - } - if (avctx->codec_id == AV_CODEC_ID_IAC) { iac_generate_tabs(q, avctx->sample_rate); } else { @@ -266,6 +271,8 @@ static av_cold int imc_decode_init(AVCodecContext *avctx) avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO; + ff_thread_once(&init_static_once, imc_init_static); + return 0; } @@ -1088,6 +1095,7 @@ AVCodec ff_imc_decoder = { .capabilities = AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_IAC_DECODER @@ -1104,5 +1112,6 @@ AVCodec ff_iac_decoder = { .capabilities = AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif From patchwork Fri Nov 20 07:19:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23812 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 0A10944AD73 for ; Fri, 20 Nov 2020 09:34:45 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F258B68BB75; Fri, 20 Nov 2020 09:25:20 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E0E7868BAA0 for ; Fri, 20 Nov 2020 09:25:08 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id t11so8445075edj.13 for ; Thu, 19 Nov 2020 23:25:08 -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=0GLnlGSGAwBn75b0MQeaSNqtdr0OID8M1d194gsidV0=; b=NM3U/hpo7INo4uIEU6IrZQc9XrASIfu+pbsn1E+8Pv546337wAnQHOYq3ZMUuJmGkd tQvOrS1insVY1u0eJ8FF/JBzqeHhdZT+yKRIR0nIMXqBpUGU1byuqsTbRzmo7mee6lnj QmVizBSeQe6B2CWZiTmDVXgJe51iknZIJiY2KDx1M+7iPuUP9pu2KnnbSOjIrYqnwCVH MJom0B4U9MoZjgztGs33uiy12b5fc3dSuONQOyujekyeCGTA6YymVnBrwpO98ARrP1BO hbuBfHorReLAyb1zAu7M0oFMLJWjTR7kXoXkcM4PvqRsMLBbUFb6SxVfoc7y02nr0h/D JeoQ== 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=0GLnlGSGAwBn75b0MQeaSNqtdr0OID8M1d194gsidV0=; b=PTTw/ZZz1++XbRrakLwOagLC8VZmaX88sA5t6f9/WjdctD8bIe6czvFcHrnGuXzJvZ PSSQS6mnvMYspQ1UoEewaFHxBO8HS8la35b2vTJBgi7mfbNwoP6A470Bb9yqkSEmfZMe dhlyo3lC7pWpjsv2IwSKi7giVQ4rjqlodVrZ5DmmVSOTHNqDzw5fYSHLtb1QC1x8PwFx Rzm1SKEbvZqoPS1wGdqTXE04f677RUEml6QGkSAVH+l0tYkQOJEJfCQjxZoQhcTbVx2c eM5z+zRY+tY/mSITwsg1kNKS60x+lyIKn7wTqmvYkHQijG3BEIe/tnh463nVenMo/Hl7 bEEg== X-Gm-Message-State: AOAM532Li7HZJzHKd1hgLYm+iQUpVBcjcID7bH/FUlAHpzkWh0pnBK0I JG8HoTip+gQzt4G0mm/rlnhmvvxgxd6vhg== X-Google-Smtp-Source: ABdhPJzyWqITIGoy505ySVOUzgkdhgN5OYMWBpsD8yAEhGlnp1yAPrlSE71fOCJ8IfvYQa8HrCoszw== X-Received: by 2002:aa7:cd9a:: with SMTP id x26mr34833359edv.226.1605857107984; Thu, 19 Nov 2020 23:25:07 -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.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:07 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:30 +0100 Message-Id: <20201120072116.818090-58-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 057/162] avcodec/mpegaudiodsp: Make ff_mpadsp_init() thread-safe 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 only thing missing for this is to make ff_mpadsp_init_x86() thread-safe; it currently isn't because a static table is initialized every time ff_mpadsp_init() is called (when ARCH_X86 is true). Solve this by initializing this table only once, namely together with the ordinary not-arch specific tables. This also allows to reuse their AVOnce. Signed-off-by: Andreas Rheinhardt --- This is needed for Musepack 7 and 8 as well as qdm2 and the MPEG audio decoders. libavcodec/mpegaudiodsp.c | 3 +++ libavcodec/mpegaudiodsp.h | 1 + libavcodec/x86/mpegaudiodsp.c | 9 ++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libavcodec/mpegaudiodsp.c b/libavcodec/mpegaudiodsp.c index 0a14ff549e..f03e244644 100644 --- a/libavcodec/mpegaudiodsp.c +++ b/libavcodec/mpegaudiodsp.c @@ -73,6 +73,9 @@ static av_cold void mpadsp_init_tabs(void) ff_mdct_win_fixed[j + 4][i + 1] = -ff_mdct_win_fixed[j][i + 1]; } } + + if (ARCH_X86) + ff_mpadsp_init_x86_tabs(); } av_cold void ff_mpadsp_init(MPADSPContext *s) diff --git a/libavcodec/mpegaudiodsp.h b/libavcodec/mpegaudiodsp.h index 28dcec576c..4c9b05ebac 100644 --- a/libavcodec/mpegaudiodsp.h +++ b/libavcodec/mpegaudiodsp.h @@ -63,6 +63,7 @@ void ff_mpadsp_init_aarch64(MPADSPContext *s); void ff_mpadsp_init_arm(MPADSPContext *s); void ff_mpadsp_init_ppc(MPADSPContext *s); void ff_mpadsp_init_x86(MPADSPContext *s); +void ff_mpadsp_init_x86_tabs(void); void ff_mpadsp_init_mipsfpu(MPADSPContext *s); void ff_mpadsp_init_mipsdsp(MPADSPContext *s); diff --git a/libavcodec/x86/mpegaudiodsp.c b/libavcodec/x86/mpegaudiodsp.c index f46a5c4f3d..d646c6dbcb 100644 --- a/libavcodec/x86/mpegaudiodsp.c +++ b/libavcodec/x86/mpegaudiodsp.c @@ -239,10 +239,8 @@ DECL_IMDCT_BLOCKS(avx,avx) #endif #endif /* HAVE_X86ASM */ -av_cold void ff_mpadsp_init_x86(MPADSPContext *s) +av_cold void ff_mpadsp_init_x86_tabs(void) { - av_unused int cpu_flags = av_get_cpu_flags(); - int i, j; for (j = 0; j < 4; j++) { for (i = 0; i < 40; i ++) { @@ -256,6 +254,11 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s) mdct_win_sse[1][j][4*i + 3] = ff_mdct_win_float[j + 4][i]; } } +} + +av_cold void ff_mpadsp_init_x86(MPADSPContext *s) +{ + av_unused int cpu_flags = av_get_cpu_flags(); #if HAVE_6REGS && HAVE_SSE_INLINE if (INLINE_SSE(cpu_flags)) { From patchwork Fri Nov 20 07:19:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23813 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 6FDA344AD73 for ; Fri, 20 Nov 2020 09:34:57 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EB59F68BB80; Fri, 20 Nov 2020 09:25:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D173068BB0F for ; Fri, 20 Nov 2020 09:25:09 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id a16so11513591ejj.5 for ; Thu, 19 Nov 2020 23:25:09 -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=DJoeplEUVrcPmSibUHdttKLWcBqJ2pklRDiZ+KN7pss=; b=ZD5tcqX2bM+K5Q+0PFgrTgFtpW82hTikAy9Oxf2QmzJugelEv+aBA+gaXpLrUQpKFN S6y77l16jry/aKKASli3PC32Wb07FSSOmMr4sLMGu9riplUjcITGcVV3n+n2KK914cbx Z/bmniSyiKnMXazMYu2k6JIXK7dTunAdLUKjRV/AWHBd1Mf5hDkvc0g8KHxf1e6duFVm CuTJLlsupkloj8vviSSq53auGQg/636TQdUS7dM/61h8nDnJOzP0v4YFeZm6TU/oYdQ1 9jFLSZtUTK1K2l93f8uhuVUDlrxYHLiQ2ZeO4xkbdkVyCrFkXiByZGF0UXDBGbJbof7x lv0A== 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=DJoeplEUVrcPmSibUHdttKLWcBqJ2pklRDiZ+KN7pss=; b=coxHq9zRAEduGQKFXZ8vhAXhfDjZV9si+1sprHCTZpQa8adwNmHCKLdF9JPC0WHAU+ dR4J8neQZZDPHdVNz3v8c/w/Noa1uSAGwRe2kHcAF5/pmHWycLLIs+766iClQOn13rkm TXdZ4XPjv3RnVdXDMlxOkTrz+022hWyl7w7h4JWqgNp4oVWjZNHsLrRosONhbykGP9ux 0kb0H2iUSqKbrs2KiXAvvS2lr3ghK1DtTeVYuSIrB9Fn6ih1hqy86FX+0NwAD7NABO6S JEdY1UddCWYUvnxrD5qnCerOAEMVS5qI1YSt85myWCoIrVuwoMAeU32G1cHMhDIH8ilG 9sgw== X-Gm-Message-State: AOAM530kxN0sCXOF4GV0d08aVnHyGoQ31pq2Uvyztdu2N2YNJYeZ9KGX oBrROpmVYsbSTbJuELnPPn4s7tGDrMBt9A== X-Google-Smtp-Source: ABdhPJwEWQ2H1ms0JOZivWcYMHWruLEWUMqLgqPmgFjM0lj1l773VTToq/LfQyW+/0yWB0ZxY0ozsA== X-Received: by 2002:a17:906:8496:: with SMTP id m22mr29785204ejx.298.1605857108890; Thu, 19 Nov 2020 23:25:08 -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.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:08 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:31 +0100 Message-Id: <20201120072116.818090-59-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 058/162] avcodec/mpegaudiodsp: Make initializing synth windows thread-safe 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" These arrays are used by the Musepack decoders, the MPEG audio decoders as well as qdm2 and up until now, these arrays might be initialized more than once, leading to potential data races as well as unnecessary initializations. Therefore this commit ensures that each array will only be initialized once. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc.c | 5 ----- libavcodec/mpc.h | 1 - libavcodec/mpc7.c | 2 +- libavcodec/mpc8.c | 3 +-- libavcodec/mpegaudiodec_template.c | 3 +-- libavcodec/mpegaudiodsp.h | 4 ++-- libavcodec/mpegaudiodsp_template.c | 14 +++++++++++++- libavcodec/qdm2.c | 3 ++- 8 files changed, 20 insertions(+), 15 deletions(-) diff --git a/libavcodec/mpc.c b/libavcodec/mpc.c index e56b608d8c..e29b823460 100644 --- a/libavcodec/mpc.c +++ b/libavcodec/mpc.c @@ -34,11 +34,6 @@ #include "mpc.h" #include "mpcdata.h" -av_cold void ff_mpc_init(void) -{ - ff_mpa_synth_init_fixed(ff_mpa_synth_window_fixed); -} - /** * Process decoded Musepack data and produce PCM */ diff --git a/libavcodec/mpc.h b/libavcodec/mpc.h index df462af6b7..704edc9a38 100644 --- a/libavcodec/mpc.h +++ b/libavcodec/mpc.h @@ -70,7 +70,6 @@ typedef struct MPCContext { DECLARE_ALIGNED(16, int32_t, sb_samples)[MPA_MAX_CHANNELS][36][SBLIMIT]; } MPCContext; -void ff_mpc_init(void); void ff_mpc_dequantize_and_synth(MPCContext *c, int maxband, int16_t **out, int channels); #endif /* AVCODEC_MPC_H */ diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 0b9e6f0088..b067d77c4b 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -64,7 +64,6 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) ff_bswapdsp_init(&c->bdsp); ff_mpadsp_init(&c->mpadsp); c->bdsp.bswap_buf((uint32_t *) buf, (const uint32_t *) avctx->extradata, 4); - ff_mpc_init(); init_get_bits(&gb, buf, 128); c->IS = get_bits1(&gb); @@ -109,6 +108,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) } } vlc_initialized = 1; + ff_mpa_synth_init_fixed(); return 0; } diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index b36e47ce66..c263762c8b 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -126,8 +126,6 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) av_lfg_init(&c->rnd, 0xDEADBEEF); ff_mpadsp_init(&c->mpadsp); - ff_mpc_init(); - init_get_bits(&gb, avctx->extradata, 16); skip_bits(&gb, 3);//sample rate @@ -171,6 +169,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) &q_syms, -((8 << j) - 1)); } vlc_initialized = 1; + ff_mpa_synth_init_fixed(); return 0; } diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 12c1964446..849e3e5c09 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -289,8 +289,6 @@ static av_cold void decode_init_static(void) scale_factor_mult[i][2]); } - RENAME(ff_mpa_synth_init)(RENAME(ff_mpa_synth_window)); - /* huffman decode tables */ offset = 0; for (i = 1; i < 16; i++) { @@ -408,6 +406,7 @@ static av_cold void decode_init_static(void) csa_table[i][3] = ca - cs; #endif } + RENAME(ff_mpa_synth_init)(); } static av_cold int decode_init(AVCodecContext * avctx) diff --git a/libavcodec/mpegaudiodsp.h b/libavcodec/mpegaudiodsp.h index 4c9b05ebac..4577d515d9 100644 --- a/libavcodec/mpegaudiodsp.h +++ b/libavcodec/mpegaudiodsp.h @@ -67,8 +67,8 @@ void ff_mpadsp_init_x86_tabs(void); void ff_mpadsp_init_mipsfpu(MPADSPContext *s); void ff_mpadsp_init_mipsdsp(MPADSPContext *s); -void ff_mpa_synth_init_float(float *window); -void ff_mpa_synth_init_fixed(int32_t *window); +void ff_mpa_synth_init_float(void); +void ff_mpa_synth_init_fixed(void); void ff_mpadsp_apply_window_float(float *synth_buf, float *window, int *dither_state, float *samples, diff --git a/libavcodec/mpegaudiodsp_template.c b/libavcodec/mpegaudiodsp_template.c index f8d0870df6..c67c456e8a 100644 --- a/libavcodec/mpegaudiodsp_template.c +++ b/libavcodec/mpegaudiodsp_template.c @@ -22,6 +22,7 @@ #include "libavutil/attributes.h" #include "libavutil/mem.h" +#include "libavutil/thread.h" #include "dct32.h" #include "mathops.h" #include "mpegaudiodsp.h" @@ -192,7 +193,7 @@ void RENAME(ff_mpa_synth_filter)(MPADSPContext *s, MPA_INT *synth_buf_ptr, *synth_buf_offset = offset; } -av_cold void RENAME(ff_mpa_synth_init)(MPA_INT *window) +static av_cold void mpa_synth_init(MPA_INT *window) { int i, j; @@ -221,6 +222,17 @@ av_cold void RENAME(ff_mpa_synth_init)(MPA_INT *window) window[512+128+16*i+j] = window[64*i+48-j]; } +static av_cold void mpa_synth_window_init(void) +{ + mpa_synth_init(RENAME(ff_mpa_synth_window)); +} + +av_cold void RENAME(ff_mpa_synth_init)(void) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + ff_thread_once(&init_static_once, mpa_synth_window_init); +} + /* cos(pi*i/18) */ #define C1 FIXHR(0.98480775301220805936/2) #define C2 FIXHR(0.93969262078590838405/2) diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 657b2da64d..bd365739ce 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1604,11 +1604,12 @@ static av_cold void qdm2_init_static_data(void) { return; qdm2_init_vlc(); - ff_mpa_synth_init_float(ff_mpa_synth_window_float); softclip_table_init(); rnd_table_init(); init_noise_samples(); + ff_mpa_synth_init_float(); + done = 1; } From patchwork Fri Nov 20 07:19:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23814 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 B3E1744AD73 for ; Fri, 20 Nov 2020 09:35:09 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DAACB68BB85; Fri, 20 Nov 2020 09:25:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A434B68BB23 for ; Fri, 20 Nov 2020 09:25:10 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id y17so11454368ejh.11 for ; Thu, 19 Nov 2020 23:25:10 -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=NdDhb+zJskZMYqIOWFKb0mbE4OncFdgKp7guwyMWm68=; b=KnZll9AdMy2YH/2eRNUf6+ECIE1a5rYvJ7MThu4LaOSaPk0sa2O3spSwtFJ81lCloK tIkrecXveuo1X9mVaSIl2lzYrcseMKnZv6vpY2lZ3NepTr1YyvC/lKQdiQWSjH6i4UvO 8jyNWZVrgUJmeV8eOKJAbatS2IlHy8FijkOtM0Ppizvt/2DfjG/Q+1G1FH1520kvHg6Y dhmMbUidY87Ifum3Nqt6pMtPlvlVtMg9AZ7VsbkJDgYDwBp9Ei/MC0IzkGrmi5Z2gcKU 2wo2/ImmnPt/hLp2ciTsshhePzpezYJTSe1ZCv9ThOp0XrbgRTCn21xp6fTYRSvhQw5h hwjA== 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=NdDhb+zJskZMYqIOWFKb0mbE4OncFdgKp7guwyMWm68=; b=fvM1vd5chk13DpOnPpLfl3NfLZUPi7YmnDSrW86vO2Ymm6IPr1VLRlBccDZOfUNHTJ F6wN/RFmPnyKMsGDuBW5x1lqZ7XfcnWeVH9iTvRpF0xoKvFrIb9t0MiO3vf9G6M0ax8W poFdVOMFGvrdL3laEHO2M1jNRBOE6GS2Y/m+Idmp/1vTABLhHkRtrxLF/qP57gPAO/wD gbT8Ob+9wcgL3D1l0IYc/lycswHxcLITYrpqKwSn+U5/ePAz8oBX67TVOvaFNK41CepX BRyyksPjN1foKJs5jaE8kFIHG8eUgjfZ/PQDH+yk3WunQyehKElmnJNyxKLM4XgbyG3J A6GQ== X-Gm-Message-State: AOAM531oHVBJE+YGbPy5LxdKMLWqVGEpYvWMBTCrq6F3/nCfNNYwfJ/N BHF6pb3a1vLr35ncHS2xTRiGEqXjwqY/Yw== X-Google-Smtp-Source: ABdhPJxw7UiEiW9P7thG5Eeah5XIlVlI+DTvS7+bcGuHv1qQsvtYaYJnrT3Es3fZ8BfYp8R/ACdVeQ== X-Received: by 2002:a17:907:20ac:: with SMTP id pw12mr4219688ejb.245.1605857109863; Thu, 19 Nov 2020 23:25:09 -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.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:09 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:32 +0100 Message-Id: <20201120072116.818090-60-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 059/162] avcodec/mpc7: Make decoder init-threadsafe 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/mpc7.c | 65 +++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index b067d77c4b..720d67623f 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -28,6 +28,7 @@ #include "libavutil/channel_layout.h" #include "libavutil/internal.h" #include "libavutil/lfg.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "get_bits.h" #include "internal.h" @@ -38,16 +39,42 @@ static VLC scfi_vlc, dscf_vlc, hdr_vlc, quant_vlc[MPC7_QUANT_VLC_TABLES][2]; +static av_cold void mpc7_init_static(void) +{ + static VLC_TYPE quant_tables[7224][2]; + const uint8_t *raw_quant_table = mpc7_quant_vlcs; + + INIT_VLC_STATIC_FROM_LENGTHS(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE, + &mpc7_scfi[1], 2, + &mpc7_scfi[0], 2, 1, 0, 0, 1 << MPC7_SCFI_BITS); + INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE, + &mpc7_dscf[1], 2, + &mpc7_dscf[0], 2, 1, -7, 0, 1 << MPC7_DSCF_BITS); + INIT_VLC_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, + &mpc7_hdr[1], 2, + &mpc7_hdr[0], 2, 1, -5, 0, 1 << MPC7_HDR_BITS); + for (unsigned i = 0, offset = 0; i < MPC7_QUANT_VLC_TABLES; i++){ + for (int j = 0; j < 2; j++) { + quant_vlc[i][j].table = &quant_tables[offset]; + quant_vlc[i][j].table_allocated = FF_ARRAY_ELEMS(quant_tables) - offset; + ff_init_vlc_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], + &raw_quant_table[1], 2, + &raw_quant_table[0], 2, 1, + mpc7_quant_vlc_off[i], + INIT_VLC_STATIC_OVERLONG, NULL); + raw_quant_table += 2 * mpc7_quant_vlc_sizes[i]; + offset += quant_vlc[i][j].table_size; + } + } + ff_mpa_synth_init_fixed(); +} + static av_cold int mpc7_decode_init(AVCodecContext * avctx) { - int j; + static AVOnce init_static_once = AV_ONCE_INIT; MPCContext *c = avctx->priv_data; GetBitContext gb; LOCAL_ALIGNED_16(uint8_t, buf, [16]); - static int vlc_initialized = 0; - - static VLC_TYPE quant_tables[7224][2]; - const uint8_t *raw_quant_table = mpc7_quant_vlcs; /* Musepack SV7 is always stereo */ if (avctx->channels != 2) { @@ -83,32 +110,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) avctx->sample_fmt = AV_SAMPLE_FMT_S16P; avctx->channel_layout = AV_CH_LAYOUT_STEREO; - if(vlc_initialized) return 0; - av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n"); - INIT_VLC_STATIC_FROM_LENGTHS(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE, - &mpc7_scfi[1], 2, - &mpc7_scfi[0], 2, 1, 0, 0, 1 << MPC7_SCFI_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE, - &mpc7_dscf[1], 2, - &mpc7_dscf[0], 2, 1, -7, 0, 1 << MPC7_DSCF_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, - &mpc7_hdr[1], 2, - &mpc7_hdr[0], 2, 1, -5, 0, 1 << MPC7_HDR_BITS); - for (unsigned i = 0, offset = 0; i < MPC7_QUANT_VLC_TABLES; i++){ - for(j = 0; j < 2; j++){ - quant_vlc[i][j].table = &quant_tables[offset]; - quant_vlc[i][j].table_allocated = FF_ARRAY_ELEMS(quant_tables) - offset; - ff_init_vlc_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], - &raw_quant_table[1], 2, - &raw_quant_table[0], 2, 1, - mpc7_quant_vlc_off[i], - INIT_VLC_STATIC_OVERLONG, NULL); - raw_quant_table += 2 * mpc7_quant_vlc_sizes[i]; - offset += quant_vlc[i][j].table_size; - } - } - vlc_initialized = 1; - ff_mpa_synth_init_fixed(); + ff_thread_once(&init_static_once, mpc7_init_static); return 0; } @@ -317,4 +319,5 @@ AVCodec ff_mpc7_decoder = { .capabilities = AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Fri Nov 20 07:19:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23815 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 5C5E444AFE3 for ; Fri, 20 Nov 2020 09:35:21 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DBEF768BB46; Fri, 20 Nov 2020 09:25:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A24D768BB29 for ; Fri, 20 Nov 2020 09:25:11 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id l5so8453302edq.11 for ; Thu, 19 Nov 2020 23:25:11 -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=s0+iFVivPwOS6nYG3yKHBgLufttVbFUEKMbfd0hI90Q=; b=WIEw8SVU8AaMvYk2MWKF62EH8HGG5rd7mZOx+/appVwE9RbqI3rOGZlbQ/MtCJZYGV 9T6Ix3CUDDUjCg43RGKN1HspY0vZmcukKc3NajPdNpmBicCKZGSp9jllmcTBhvnBX59R sA3Ig8Sm0a8tJGDGsYZqjKEgG6IOovZzT36zNWDz5moSgnjF40nj6JnE2Ll+CzU4g1mX Rj0fxvkjfVOHG6qdLpRtHwg+b+uWMqHQWdmM8u/8Sc1jMkv7MLVg+h0f5ozURHjPBm1b x1GozGY94eGsqRMDXa2A2nYVXhPRQSqa9mShVP/hFl/ewPYLlQL7aQy5PBj8ttXoWbnH pEnQ== 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=s0+iFVivPwOS6nYG3yKHBgLufttVbFUEKMbfd0hI90Q=; b=EwWszzP8kcXY+cIx+pb95r43vPRCLzJt4Y4dezh3FMiNNz9niMU/qqXqk3WGNsURGO s8BFvrqPMCUmfIUbnVWPT6L4PPCl/hhtFwbDIVkWgaQYAmISTAGsH716iuc9ckm/Qems WwwOw1BWAspdDJwKOWTeDDbR+M+g+Xmxfzp/L3A9b8XrJ+s7XAquAOhSOvRbR6ktSl7r MOyKZhCQxbdZDDGjtye7r6bROgaCuffhL9GnORThVYIqgqc3GeqhRFy/MLhrKzyddJli fAq88d1ox7RooOO6cj3bHeSIsioMJdIrzaUTINZhVoWC8l3797RscZVCZXIaZiQ9mVWb w53Q== X-Gm-Message-State: AOAM53062kGyf0jHujxSKHTqTVCPDxqNKsfw62lRGHvQLVwKk+tZ5+Z2 /E84uG9GQ1lLRkg1+/vQc4P3E5rKtkqUpA== X-Google-Smtp-Source: ABdhPJywYNby6usYTZf/xlD78621AQXW1r4RUui4c6C0swOA/4qIuCj0e44XZLLGEauENDYPbhBjuA== X-Received: by 2002:aa7:cdd9:: with SMTP id h25mr34497393edw.294.1605857110739; Thu, 19 Nov 2020 23:25:10 -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.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:10 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:33 +0100 Message-Id: <20201120072116.818090-61-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 060/162] avcodec/mpc8: Make decoder init-threadsafe 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/mpc8.c | 62 +++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index c263762c8b..6939716176 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -27,6 +27,7 @@ #include "libavutil/channel_layout.h" #include "libavutil/lfg.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "get_bits.h" #include "internal.h" @@ -107,15 +108,40 @@ static av_cold void build_vlc(VLC *vlc, unsigned *buf_offset, *syms += num; } -static av_cold int mpc8_decode_init(AVCodecContext * avctx) +static av_cold void mpc8_init_static(void) { - int i, offset = 0; - MPCContext *c = avctx->priv_data; - GetBitContext gb; - static int vlc_initialized = 0; const uint8_t *q_syms = mpc8_q_syms, *bands_syms = mpc8_bands_syms; const uint8_t *res_syms = mpc8_res_syms, *scfi_syms = mpc8_scfi_syms; const uint8_t *dscf_syms = mpc8_dscf_syms; + unsigned offset = 0; + + build_vlc(&band_vlc, &offset, mpc8_bands_len_counts, &bands_syms, 0); + + build_vlc(&q1_vlc, &offset, mpc8_q1_len_counts, &q_syms, 0); + build_vlc(&q9up_vlc, &offset, mpc8_q9up_len_counts, &q_syms, 0); + + for (int i = 0; i < 2; i++){ + build_vlc(&scfi_vlc[i], &offset, mpc8_scfi_len_counts[i], &scfi_syms, 0); + + build_vlc(&dscf_vlc[i], &offset, mpc8_dscf_len_counts[i], &dscf_syms, 0); + + build_vlc(&res_vlc[i], &offset, mpc8_res_len_counts[i], &res_syms, 0); + + build_vlc(&q2_vlc[i], &offset, mpc8_q2_len_counts[i], &q_syms, 0); + build_vlc(&q3_vlc[i], &offset, mpc8_q34_len_counts[i], + &q_syms, -48 - 16 * i); + for (int j = 0; j < 4; j++) + build_vlc(&quant_vlc[j][i], &offset, mpc8_q5_8_len_counts[i][j], + &q_syms, -((8 << j) - 1)); + } + ff_mpa_synth_init_fixed(); +} + +static av_cold int mpc8_decode_init(AVCodecContext * avctx) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + MPCContext *c = avctx->priv_data; + GetBitContext gb; int channels; if(avctx->extradata_size < 2){ @@ -146,30 +172,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) avctx->channel_layout = (channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; avctx->channels = channels; - if(vlc_initialized) return 0; - av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n"); - - build_vlc(&band_vlc, &offset, mpc8_bands_len_counts, &bands_syms, 0); - - build_vlc(&q1_vlc, &offset, mpc8_q1_len_counts, &q_syms, 0); - build_vlc(&q9up_vlc, &offset, mpc8_q9up_len_counts, &q_syms, 0); - - for(i = 0; i < 2; i++){ - build_vlc(&scfi_vlc[i], &offset, mpc8_scfi_len_counts[i], &scfi_syms, 0); - - build_vlc(&dscf_vlc[i], &offset, mpc8_dscf_len_counts[i], &dscf_syms, 0); - - build_vlc(&res_vlc[i], &offset, mpc8_res_len_counts[i], &res_syms, 0); - - build_vlc(&q2_vlc[i], &offset, mpc8_q2_len_counts[i], &q_syms, 0); - build_vlc(&q3_vlc[i], &offset, mpc8_q34_len_counts[i], - &q_syms, -48 - 16 * i); - for (int j = 0; j < 4; j++) - build_vlc(&quant_vlc[j][i], &offset, mpc8_q5_8_len_counts[i][j], - &q_syms, -((8 << j) - 1)); - } - vlc_initialized = 1; - ff_mpa_synth_init_fixed(); + ff_thread_once(&init_static_once, mpc8_init_static); return 0; } @@ -392,4 +395,5 @@ AVCodec ff_mpc8_decoder = { .capabilities = AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Fri Nov 20 07:19:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23816 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 4714644AFE3 for ; Fri, 20 Nov 2020 09:35:33 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E5E6068BB52; Fri, 20 Nov 2020 09:25:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B6D2568BB30 for ; Fri, 20 Nov 2020 09:25:12 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id s25so11497105ejy.6 for ; Thu, 19 Nov 2020 23:25:12 -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=RbQ9XrwHGCFgFQWPAHUJi8p1fBTm0bCUCAofhk8YIOg=; b=QXiDy6IyxJU8PyiDeQzhIWpHWW/PLQbEp52zXt+MTpxMHtTwaXofPPWSMBObi8S7Hz SlW7FjhIenXp7rEHeeyhEnatj9Xvz1RXJBgPI0jBq8IuNRuhGGFDmJABJHvse/gp48e8 Uz208kAm+wAjqO/rAzXaW0LtXikdhjbULevciyQbjtuMXuwIdbKiTVSPJ12q7HCmb96x 1BByRlQflgWGYmEsPpdMyTSSGvQna0XSMBwpbF/h2VafIva40uXIC829nxuB87A/rgBV ijB4yXX5Ipr8/4OrhcS0LpRzaN+fR0qbMCiKnT0L+2lFf/ERNa59Zb9k0SV3XaHzbzo1 +O3Q== 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=RbQ9XrwHGCFgFQWPAHUJi8p1fBTm0bCUCAofhk8YIOg=; b=gZsAwsFdwLIezoYBey/E+jfzsE4yICGNvfiMxPr9dlzZ9q742NxbMIS8MqzJyysXZ9 rdFt0ZwxyodhGkk6quY9lV5ECUwekysD9CYW8m+E7hE+huwjM2OmxN4Qc2cFZbiIZ3wi wq91Jlwr/RWlOP8zAmAZg7kMK/HjSNXyoPd/TW0sbCRHRCISDnPBk8qBGfXj2/2sD1QB CO1ceDJWUZizYZFk2y5vX6iLdOjdHCYUmDmJ+2lzYAMMtvukhkq8ohB+bgslg0mSxanO fms1CS9hqm4ssMush6A+Am+SXDD91iY36Kq02+YiBSj1Dh9eL8pcjIcGV2momzQef/XD yAJA== X-Gm-Message-State: AOAM533cN2SYNFBNTw+KgsvQ/LrkjRJZm44ZzKAU+nLxkvKqoe7kV1sg wwgrVFXfDYOUKLmFst1oofYTZwgddkrcCw== X-Google-Smtp-Source: ABdhPJzZDf+HUx0daWwD6FOWgVgInMWzTcCBdNZdYj92eDVlAQqmZX3GWkpXYXqDqiD57Q1HL8TmOg== X-Received: by 2002:a17:906:2345:: with SMTP id m5mr186157eja.329.1605857111682; Thu, 19 Nov 2020 23:25:11 -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.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:11 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:34 +0100 Message-Id: <20201120072116.818090-62-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 061/162] avcodec/mobiclip: Avoid redundant codes table to initialize 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" If both codes, lengths and symbols tables are ordered so that the codes are sorted from left to right in the tree, the codes can be easily derived from the lengths and therefore become redundant. This is exploited in this commit to remove the codes tables for the mobiclip decoder; notice that tables for the run-length VLC were already ordered correctly. Signed-off-by: Andreas Rheinhardt --- libavcodec/mobiclip.c | 204 ++++++++++++++++-------------------------- 1 file changed, 75 insertions(+), 129 deletions(-) diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c index 42d33cf6a5..db9266f72a 100644 --- a/libavcodec/mobiclip.c +++ b/libavcodec/mobiclip.c @@ -128,19 +128,6 @@ static const uint8_t bits0[] = { 6, 6, 6, 6, 6, 6, 5, 5, 5, 4, 2, 3, 4, 4, }; -static const uint8_t codes0[] = { - 0x0, 0x4, 0x5, 0x6, 0x7, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, - 0xB, 0xC, 0xD, 0xE, 0xF, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, - 0x26, 0x27, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x3, 0x20, - 0x21, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, - 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, - 0x24, 0x25, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, - 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x10, 0x11, 0x12, 0x13, 0x14, - 0x15, 0x16, 0x17, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, - 0x13, 0x14, 0x15, 0xB, 0xC, 0xD, 0x7, 0x2, 0x6, 0xE, 0xF, -}; - static const uint16_t syms0[] = { 0x0, 0x822, 0x803, 0xB, 0xA, 0xB81, 0xB61, 0xB41, 0xB21, 0x122, 0x102, 0xE2, 0xC2, 0xA2, 0x63, 0x43, 0x24, 0xC, 0x25, 0x2E1, 0x301, @@ -172,122 +159,82 @@ static const uint8_t mv_len[16] = static const uint8_t mv_bits[16][10] = { - { 1, 3, 3, 4, 4, 5, 5, 5, 6, 6 }, - { 2, 2, 3, 3, 3, 4, 5, 5 }, - { 2, 2, 3, 3, 4, 4, 4, 4 }, - { 1, 3, 3, 4, 4, 4, 4 }, - { 2, 2, 3, 3, 3, 4, 5, 5 }, - { 2, 3, 3, 3, 3, 3, 4, 4 }, + { 3, 4, 5, 5, 3, 5, 6, 6, 4, 1 }, + { 2, 3, 4, 5, 5, 2, 3, 3 }, + { 2, 4, 4, 3, 3, 4, 4, 2 }, + { 1, 4, 4, 3, 4, 4, 3 }, + { 3, 3, 2, 4, 5, 5, 3, 2 }, + { 3, 4, 4, 3, 3, 3, 3, 2 }, { 1, 3, 3, 4, 4, 4, 5, 5 }, - { 1, 3, 3, 4, 4, 4, 4 }, - { 2, 2, 3, 3, 4, 4, 4, 4 }, + { 1, 4, 4, 3, 3, 4, 4 }, + { 2, 4, 4, 3, 3, 4, 4, 2 }, { 1, 3, 3, 4, 4, 4, 5, 5 }, - { 2, 2, 3, 3, 4, 4, 4, 4 }, - { 2, 2, 3, 3, 3, 4, 4 }, - { 1, 3, 3, 4, 4, 4, 4 }, - { 1, 3, 3, 4, 4, 4, 4 }, - { 2, 2, 3, 3, 3, 4, 4 }, - { 2, 2, 3, 3, 3, 3 }, -}; - -static const uint8_t mv_codes[16][10] = -{ - { 1, 0, 2, 2, 7, 6, 7, 12, 26, 27 }, - { 0, 2, 2, 6, 7, 6, 14, 15 }, - { 0, 3, 3, 4, 4, 5, 10, 11 }, - { 0, 5, 7, 8, 9, 12, 13 }, - { 1, 3, 0, 1, 5, 8, 18, 19 }, - { 3, 0, 2, 3, 4, 5, 2, 3 }, - { 0, 4, 5, 12, 13, 14, 30, 31 }, - { 0, 5, 6, 8, 9, 14, 15 }, - { 0, 3, 3, 4, 4, 5, 10, 11 }, - { 0, 4, 5, 12, 13, 14, 30, 31 }, - { 0, 3, 2, 5, 6, 7, 8, 9 }, - { 0, 3, 2, 3, 5, 8, 9 }, - { 0, 5, 6, 8, 9, 14, 15 }, - { 0, 5, 6, 8, 9, 14, 15 }, - { 0, 3, 2, 3, 5, 8, 9 }, - { 0, 3, 2, 3, 4, 5 }, + { 2, 3, 4, 4, 4, 4, 3, 2 }, + { 2, 3, 3, 4, 4, 3, 2 }, + { 1, 4, 4, 3, 3, 4, 4 }, + { 1, 4, 4, 3, 3, 4, 4 }, + { 2, 3, 3, 4, 4, 3, 2 }, + { 2, 3, 3, 3, 3, 2 }, }; static const uint8_t mv_syms[16][10] = { - { 0, 8, 1, 2, 9, 3, 6, 7, 5, 4 }, - { 9, 1, 2, 8, 0, 3, 5, 4 }, - { 0, 1, 2, 9, 5, 4, 3, 8 }, - { 1, 2, 0, 5, 4, 8, 3 }, - { 8, 1, 2, 9, 0, 3, 5, 4 }, - { 1, 3, 2, 9, 8, 0, 5, 4 }, + { 8, 2, 3, 6, 1, 7, 5, 4, 9, 0 }, + { 9, 2, 3, 5, 4, 1, 8, 0 }, + { 0, 5, 4, 2, 9, 3, 8, 1 }, + { 1, 5, 4, 2, 8, 3, 0 }, + { 2, 9, 8, 3, 5, 4, 0, 1 }, + { 3, 5, 4, 2, 9, 8, 0, 1 }, { 1, 2, 0, 9, 8, 3, 5, 4 }, - { 1, 2, 0, 8, 5, 4, 3 }, - { 0, 1, 2, 8, 5, 4, 3, 9 }, + { 1, 8, 5, 2, 0, 4, 3 }, + { 0, 5, 4, 2, 8, 3, 9, 1 }, { 1, 2, 0, 9, 8, 3, 5, 4 }, - { 0, 1, 3, 2, 9, 8, 5, 4 }, - { 0, 1, 4, 3, 2, 8, 5 }, - { 1, 2, 0, 5, 4, 9, 3 }, - { 1, 2, 0, 9, 5, 4, 3 }, - { 0, 1, 5, 3, 2, 9, 4 }, - { 0, 1, 4, 5, 3, 2 }, + { 0, 3, 9, 8, 5, 4, 2, 1 }, + { 0, 4, 3, 8, 5, 2, 1 }, + { 1, 5, 4, 2, 0, 9, 3 }, + { 1, 9, 5, 2, 0, 4, 3 }, + { 0, 5, 3, 9, 4, 2, 1 }, + { 0, 4, 5, 3, 2, 1 }, }; static const uint8_t mv_bits_mods[16][10] = { - { 2, 2, 3, 3, 4, 4, 5, 5, 5, 5 }, - { 2, 2, 3, 3, 4, 4, 4, 4 }, - { 2, 2, 3, 3, 4, 4, 4, 4 }, - { 1, 3, 3, 3, 4, 5, 5 }, - { 2, 2, 3, 3, 4, 4, 4, 4 }, - { 2, 2, 3, 3, 4, 4, 4, 4 }, - { 2, 2, 3, 3, 4, 4, 4, 4 }, - { 2, 2, 2, 3, 4, 5, 5 }, - { 2, 2, 3, 3, 4, 4, 4, 4 }, - { 2, 2, 3, 3, 4, 4, 4, 4 }, - { 2, 2, 3, 3, 3, 4, 5, 5 }, - { 2, 2, 3, 3, 3, 4, 4 }, - { 1, 3, 3, 4, 4, 4, 4 }, - { 2, 2, 3, 3, 3, 4, 4 }, - { 2, 2, 3, 3, 3, 4, 4 }, - { 2, 2, 3, 3, 3, 3 }, -}; - -static const uint8_t mv_codes_mods[16][10] = -{ - { 0, 3, 2, 3, 9, 10, 16, 17, 22, 23 }, - { 0, 3, 2, 4, 6, 7, 10, 11 }, - { 1, 3, 0, 5, 2, 3, 8, 9 }, - { 0, 4, 6, 7, 10, 22, 23 }, - { 0, 3, 3, 4, 4, 5, 10, 11 }, - { 0, 3, 2, 5, 6, 7, 8, 9 }, - { 0, 3, 2, 5, 6, 7, 8, 9 }, - { 0, 1, 3, 4, 10, 22, 23 }, - { 0, 3, 2, 4, 6, 7, 10, 11 }, - { 0, 3, 3, 5, 4, 5, 8, 9 }, - { 0, 3, 2, 3, 5, 9, 16, 17 }, - { 0, 3, 2, 4, 5, 6, 7 }, - { 0, 5, 6, 8, 9, 14, 15 }, - { 0, 3, 2, 4, 5, 6, 7 }, - { 0, 3, 2, 4, 5, 6, 7 }, - { 1, 2, 0, 1, 6, 7 }, + { 2, 3, 3, 5, 5, 4, 4, 5, 5, 2 }, + { 2, 3, 4, 4, 3, 4, 4, 2 }, + { 3, 4, 4, 2, 4, 4, 3, 2 }, + { 1, 3, 4, 5, 5, 3, 3 }, + { 2, 4, 4, 3, 3, 4, 4, 2 }, + { 2, 3, 4, 4, 4, 4, 3, 2 }, + { 2, 3, 4, 4, 4, 4, 3, 2 }, + { 2, 2, 3, 4, 5, 5, 2 }, + { 2, 3, 4, 4, 3, 4, 4, 2 }, + { 2, 4, 4, 3, 4, 4, 3, 2 }, + { 2, 3, 3, 5, 5, 4, 3, 2 }, + { 2, 3, 4, 4, 3, 3, 2 }, + { 1, 4, 4, 3, 3, 4, 4 }, + { 2, 3, 4, 4, 3, 3, 2 }, + { 2, 3, 4, 4, 3, 3, 2 }, + { 3, 3, 2, 2, 3, 3 }, }; static const uint8_t mv_syms_mods[16][10] = { - { 1, 0, 8, 9, 2, 7, 4, 3, 5, 6 }, - { 0, 1, 9, 2, 5, 4, 3, 8 }, - { 0, 1, 3, 2, 9, 5, 4, 8 }, - { 1, 3, 2, 0, 4, 8, 5 }, - { 0, 1, 8, 2, 5, 4, 3, 9 }, - { 0, 1, 3, 2, 5, 9, 4, 8 }, - { 0, 1, 3, 2, 9, 5, 8, 4 }, - { 0, 2, 1, 3, 4, 8, 5 }, - { 0, 1, 3, 2, 8, 4, 5, 9 }, - { 2, 1, 3, 0, 8, 9, 5, 4 }, - { 0, 1, 4, 3, 2, 5, 8, 9 }, - { 0, 1, 4, 3, 2, 8, 5 }, - { 1, 2, 0, 9, 4, 5, 3 }, - { 2, 1, 4, 3, 0, 9, 5 }, - { 0, 1, 4, 3, 2, 9, 5 }, - { 1, 0, 5, 4, 3, 2 }, + { 1, 8, 9, 4, 3, 2, 7, 5, 6, 0 }, + { 0, 9, 5, 4, 2, 3, 8, 1 }, + { 3, 9, 5, 0, 4, 8, 2, 1 }, + { 1, 3, 4, 8, 5, 2, 0 }, + { 0, 5, 4, 8, 2, 3, 9, 1 }, + { 0, 3, 5, 9, 4, 8, 2, 1 }, + { 0, 3, 9, 5, 8, 4, 2, 1 }, + { 0, 2, 3, 4, 8, 5, 1 }, + { 0, 3, 8, 4, 2, 5, 9, 1 }, + { 2, 8, 9, 3, 5, 4, 0, 1 }, + { 0, 4, 3, 8, 9, 5, 2, 1 }, + { 0, 4, 8, 5, 3, 2, 1 }, + { 1, 9, 4, 2, 0, 5, 3 }, + { 2, 4, 9, 5, 3, 0, 1 }, + { 0, 4, 9, 5, 3, 2, 1 }, + { 5, 4, 1, 0, 3, 2 }, }; typedef struct BlockXY { @@ -351,30 +298,29 @@ static av_cold int mobiclip_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } - INIT_VLC_SPARSE_STATIC(&rl_vlc[0], MOBI_RL_VLC_BITS, 104, - bits0, sizeof(*bits0), sizeof(*bits0), - codes0, sizeof(*codes0), sizeof(*codes0), + INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[0], MOBI_RL_VLC_BITS, 104, + bits0, sizeof(*bits0), syms0, sizeof(*syms0), sizeof(*syms0), - 1 << MOBI_RL_VLC_BITS); - INIT_VLC_SPARSE_STATIC(&rl_vlc[1], MOBI_RL_VLC_BITS, 104, - bits0, sizeof(*bits0), sizeof(*bits0), - codes0, sizeof(*codes0), sizeof(*codes0), + 0, 0, 1 << MOBI_RL_VLC_BITS); + INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[1], MOBI_RL_VLC_BITS, 104, + bits0, sizeof(*bits0), syms1, sizeof(*syms1), sizeof(*syms1), - 1 << MOBI_RL_VLC_BITS); + 0, 0, 1 << MOBI_RL_VLC_BITS); for (int j = 0; j < 16; j++) { static VLC_TYPE vlc_buf[2 * 16 << MOBI_MV_VLC_BITS][2]; mv_vlc[0][j].table = &vlc_buf[2 * j << MOBI_MV_VLC_BITS]; mv_vlc[0][j].table_allocated = 1 << MOBI_MV_VLC_BITS; - ff_init_vlc_sparse(&mv_vlc[0][j], MOBI_MV_VLC_BITS, mv_len[j], - mv_bits_mods[j], sizeof(*mv_bits_mods[j]), sizeof(*mv_bits_mods[j]), - mv_codes_mods[j], sizeof(*mv_codes_mods[j]), sizeof(*mv_codes_mods[j]), - mv_syms_mods[j], sizeof(*mv_syms_mods[j]), sizeof(*mv_syms_mods[j]), INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&mv_vlc[0][j], MOBI_MV_VLC_BITS, mv_len[j], + mv_bits_mods[j], sizeof(*mv_bits_mods[j]), + mv_syms_mods[j], sizeof(*mv_syms_mods[j]), + sizeof(*mv_syms_mods[j]), 0, + INIT_VLC_USE_NEW_STATIC, NULL); mv_vlc[1][j].table = &vlc_buf[(2 * j + 1) << MOBI_MV_VLC_BITS]; mv_vlc[1][j].table_allocated = 1 << MOBI_MV_VLC_BITS; - ff_init_vlc_sparse(&mv_vlc[1][j], MOBI_MV_VLC_BITS, mv_len[j], - mv_bits[j], sizeof(*mv_bits[j]), sizeof(*mv_bits[j]), - mv_codes[j], sizeof(*mv_codes[j]), sizeof(*mv_codes[j]), - mv_syms[j], sizeof(*mv_syms[j]), sizeof(*mv_syms[j]), INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&mv_vlc[1][j], MOBI_MV_VLC_BITS, mv_len[j], + mv_bits[j], sizeof(*mv_bits[j]), + mv_syms[j], sizeof(*mv_syms[j]), sizeof(*mv_syms[j]), + 0, INIT_VLC_USE_NEW_STATIC, NULL); } return 0; From patchwork Fri Nov 20 07:19:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23817 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 D96EB44AFE3 for ; Fri, 20 Nov 2020 09:35:44 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 08B8268BB4A; Fri, 20 Nov 2020 09:25:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6913E68B9E3 for ; Fri, 20 Nov 2020 09:25:13 +0200 (EET) Received: by mail-ed1-f67.google.com with SMTP id cq7so8477008edb.4 for ; Thu, 19 Nov 2020 23:25:13 -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=N/orFnE3ll/YyZbxoxs6nznrigD32eTyMa2AaP4PI8c=; b=j09iFB/OyjFbmYsfM377hzYFNblnf4SpjVyKdtNAD/WrD7qSwLv2ZoOOl0RKQ/b8oe jdA6lhMbULyxCqQr6QXMCA5mndKAn/3PA5fd8u4Zuaq7JwyIYF2udFWEtbVqXIyIj+hb B5cJP9zb5ykSsMSD6yYHGnLpBKWhmF1YJ08ckm213HRktEzswzzpa2vXzFSqK8G1L8zz gK6ZHlDkfH/R3pasYzB6hz9/V0UqJTMdNaYxOTkVhQ2ywaeNJw8UrofNe2OKnC7sG5hP BdboW29q3Xb2GY3YuOpGPbNI+jidIiO1/iM7G53gvfetosW0IlVOAlb0s+yPOSUJP9/V 0WVQ== 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=N/orFnE3ll/YyZbxoxs6nznrigD32eTyMa2AaP4PI8c=; b=HL2r0E2EtvsKddCdFMf/O52AkdatHgKCJt6lM5XId+cglDwJ3fmZ+V7E50irFrLt41 QLV7kec7JqebUWnzLZ196mrssGGi+VDSudkvgaOrgHDhrsF2WxNWBVJ04s0P7h5fKx71 hqGQCxnV+4JoG4k95ptlACU1WrNxVOeoZR9VEUg3MIoFZkcGEXWv/m7ISjWR1VsBfTxh U91KzQ37NnO60Q0Q3WzeJBg3sW3d8JwcPGaATiLdK1uR1A5CV6+EMr3thcaOP1/tJrww bFKP6fJRKG816DMPAijma2VT4pcur5Rp/iSuk+VeJsenR8Fo68HBS/m4RayeytW5/JmM Qukw== X-Gm-Message-State: AOAM530mb/FUQmNhXgCjtlxEe4F5B3bkE5c+4m0WcDAFPFYDKo4IAl0a qMXOsIUJbmIJ6v659aJoQvEhDURmkg3mcg== X-Google-Smtp-Source: ABdhPJy/0tQeICFcU1oJC9hGC1ZKfu/7S6bhe285I7A4+EnpvGojD+NqfNC0OmKKS4/wzzJaCEuzgA== X-Received: by 2002:aa7:c2d7:: with SMTP id m23mr33985707edp.230.1605857112523; Thu, 19 Nov 2020 23:25:12 -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.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:12 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:35 +0100 Message-Id: <20201120072116.818090-63-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 062/162] avcodec/mobiclip: 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/mobiclip.c | 107 ++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 56 deletions(-) diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c index db9266f72a..d188e1cd57 100644 --- a/libavcodec/mobiclip.c +++ b/libavcodec/mobiclip.c @@ -157,48 +157,9 @@ static const uint8_t mv_len[16] = 10, 8, 8, 7, 8, 8, 8, 7, 8, 8, 8, 7, 7, 7, 7, 6, }; -static const uint8_t mv_bits[16][10] = -{ - { 3, 4, 5, 5, 3, 5, 6, 6, 4, 1 }, - { 2, 3, 4, 5, 5, 2, 3, 3 }, - { 2, 4, 4, 3, 3, 4, 4, 2 }, - { 1, 4, 4, 3, 4, 4, 3 }, - { 3, 3, 2, 4, 5, 5, 3, 2 }, - { 3, 4, 4, 3, 3, 3, 3, 2 }, - { 1, 3, 3, 4, 4, 4, 5, 5 }, - { 1, 4, 4, 3, 3, 4, 4 }, - { 2, 4, 4, 3, 3, 4, 4, 2 }, - { 1, 3, 3, 4, 4, 4, 5, 5 }, - { 2, 3, 4, 4, 4, 4, 3, 2 }, - { 2, 3, 3, 4, 4, 3, 2 }, - { 1, 4, 4, 3, 3, 4, 4 }, - { 1, 4, 4, 3, 3, 4, 4 }, - { 2, 3, 3, 4, 4, 3, 2 }, - { 2, 3, 3, 3, 3, 2 }, -}; - -static const uint8_t mv_syms[16][10] = -{ - { 8, 2, 3, 6, 1, 7, 5, 4, 9, 0 }, - { 9, 2, 3, 5, 4, 1, 8, 0 }, - { 0, 5, 4, 2, 9, 3, 8, 1 }, - { 1, 5, 4, 2, 8, 3, 0 }, - { 2, 9, 8, 3, 5, 4, 0, 1 }, - { 3, 5, 4, 2, 9, 8, 0, 1 }, - { 1, 2, 0, 9, 8, 3, 5, 4 }, - { 1, 8, 5, 2, 0, 4, 3 }, - { 0, 5, 4, 2, 8, 3, 9, 1 }, - { 1, 2, 0, 9, 8, 3, 5, 4 }, - { 0, 3, 9, 8, 5, 4, 2, 1 }, - { 0, 4, 3, 8, 5, 2, 1 }, - { 1, 5, 4, 2, 0, 9, 3 }, - { 1, 9, 5, 2, 0, 4, 3 }, - { 0, 5, 3, 9, 4, 2, 1 }, - { 0, 4, 5, 3, 2, 1 }, -}; - -static const uint8_t mv_bits_mods[16][10] = +static const uint8_t mv_bits[2][16][10] = { + { { 2, 3, 3, 5, 5, 4, 4, 5, 5, 2 }, { 2, 3, 4, 4, 3, 4, 4, 2 }, { 3, 4, 4, 2, 4, 4, 3, 2 }, @@ -215,10 +176,30 @@ static const uint8_t mv_bits_mods[16][10] = { 2, 3, 4, 4, 3, 3, 2 }, { 2, 3, 4, 4, 3, 3, 2 }, { 3, 3, 2, 2, 3, 3 }, + }, + { + { 3, 4, 5, 5, 3, 5, 6, 6, 4, 1 }, + { 2, 3, 4, 5, 5, 2, 3, 3 }, + { 2, 4, 4, 3, 3, 4, 4, 2 }, + { 1, 4, 4, 3, 4, 4, 3 }, + { 3, 3, 2, 4, 5, 5, 3, 2 }, + { 3, 4, 4, 3, 3, 3, 3, 2 }, + { 1, 3, 3, 4, 4, 4, 5, 5 }, + { 1, 4, 4, 3, 3, 4, 4 }, + { 2, 4, 4, 3, 3, 4, 4, 2 }, + { 1, 3, 3, 4, 4, 4, 5, 5 }, + { 2, 3, 4, 4, 4, 4, 3, 2 }, + { 2, 3, 3, 4, 4, 3, 2 }, + { 1, 4, 4, 3, 3, 4, 4 }, + { 1, 4, 4, 3, 3, 4, 4 }, + { 2, 3, 3, 4, 4, 3, 2 }, + { 2, 3, 3, 3, 3, 2 }, + } }; -static const uint8_t mv_syms_mods[16][10] = +static const uint8_t mv_syms[2][16][10] = { + { { 1, 8, 9, 4, 3, 2, 7, 5, 6, 0 }, { 0, 9, 5, 4, 2, 3, 8, 1 }, { 3, 9, 5, 0, 4, 8, 2, 1 }, @@ -235,6 +216,25 @@ static const uint8_t mv_syms_mods[16][10] = { 2, 4, 9, 5, 3, 0, 1 }, { 0, 4, 9, 5, 3, 2, 1 }, { 5, 4, 1, 0, 3, 2 }, + }, + { + { 8, 2, 3, 6, 1, 7, 5, 4, 9, 0 }, + { 9, 2, 3, 5, 4, 1, 8, 0 }, + { 0, 5, 4, 2, 9, 3, 8, 1 }, + { 1, 5, 4, 2, 8, 3, 0 }, + { 2, 9, 8, 3, 5, 4, 0, 1 }, + { 3, 5, 4, 2, 9, 8, 0, 1 }, + { 1, 2, 0, 9, 8, 3, 5, 4 }, + { 1, 8, 5, 2, 0, 4, 3 }, + { 0, 5, 4, 2, 8, 3, 9, 1 }, + { 1, 2, 0, 9, 8, 3, 5, 4 }, + { 0, 3, 9, 8, 5, 4, 2, 1 }, + { 0, 4, 3, 8, 5, 2, 1 }, + { 1, 5, 4, 2, 0, 9, 3 }, + { 1, 9, 5, 2, 0, 4, 3 }, + { 0, 5, 3, 9, 4, 2, 1 }, + { 0, 4, 5, 3, 2, 1 }, + } }; typedef struct BlockXY { @@ -306,21 +306,16 @@ static av_cold int mobiclip_init(AVCodecContext *avctx) bits0, sizeof(*bits0), syms1, sizeof(*syms1), sizeof(*syms1), 0, 0, 1 << MOBI_RL_VLC_BITS); - for (int j = 0; j < 16; j++) { + for (int i = 0; i < 2; i++) { static VLC_TYPE vlc_buf[2 * 16 << MOBI_MV_VLC_BITS][2]; - mv_vlc[0][j].table = &vlc_buf[2 * j << MOBI_MV_VLC_BITS]; - mv_vlc[0][j].table_allocated = 1 << MOBI_MV_VLC_BITS; - ff_init_vlc_from_lengths(&mv_vlc[0][j], MOBI_MV_VLC_BITS, mv_len[j], - mv_bits_mods[j], sizeof(*mv_bits_mods[j]), - mv_syms_mods[j], sizeof(*mv_syms_mods[j]), - sizeof(*mv_syms_mods[j]), 0, - INIT_VLC_USE_NEW_STATIC, NULL); - mv_vlc[1][j].table = &vlc_buf[(2 * j + 1) << MOBI_MV_VLC_BITS]; - mv_vlc[1][j].table_allocated = 1 << MOBI_MV_VLC_BITS; - ff_init_vlc_from_lengths(&mv_vlc[1][j], MOBI_MV_VLC_BITS, mv_len[j], - mv_bits[j], sizeof(*mv_bits[j]), - mv_syms[j], sizeof(*mv_syms[j]), sizeof(*mv_syms[j]), - 0, INIT_VLC_USE_NEW_STATIC, NULL); + for (int j = 0; j < 16; j++) { + mv_vlc[i][j].table = &vlc_buf[(16 * i + j) << MOBI_MV_VLC_BITS]; + mv_vlc[i][j].table_allocated = 1 << MOBI_MV_VLC_BITS; + ff_init_vlc_from_lengths(&mv_vlc[i][j], MOBI_MV_VLC_BITS, mv_len[j], + mv_bits[i][j], sizeof(*mv_bits[i][j]), + mv_syms[i][j], sizeof(*mv_syms[i][j]), sizeof(*mv_syms[i][j]), + 0, INIT_VLC_USE_NEW_STATIC, NULL); + } } return 0; From patchwork Fri Nov 20 07:19:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23818 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 4CEB744AFE3 for ; Fri, 20 Nov 2020 09:35:56 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7A93268BB8E; Fri, 20 Nov 2020 09:25:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 48BE368B9E3 for ; Fri, 20 Nov 2020 09:25:14 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id f20so11492453ejz.4 for ; Thu, 19 Nov 2020 23:25:14 -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=btMYmG8LDu2S58WLkkI7rJN21PLrWDAVykVrq0jsh8A=; b=nrkig9yR7Wxj2avV5aS7hpU99SwaAc/uW3QYdqakcQGoCa7L74zez+Gd82Rnf/Xn7m Iyy0mi6Ekum24qzx6QJDVLWKsEuQjcn/tZok+4uLAANNBCQLvMmgDw+VmGbFxPr9JHwW b49ckQfxJiQXAByxrbu4NWpSuYeqz+XeNRLeM45LwAv/729KG1qtxwEO82ZmRfiqtoob MhYO2Qd0f9gO5qF0kTaUam6+f4nleT86z5i76KxMzih/h7XUYz5+L/7REvaGwrA7nm39 OFgCZE0HWUyZ5CRQNjpfbajgCAVJ/7SWHIydkDIEtFFn2mThe707XA/sYgbQZX6E2JfD VrPQ== 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=btMYmG8LDu2S58WLkkI7rJN21PLrWDAVykVrq0jsh8A=; b=qjxvc0yJMCG2h7ndk1QIHxfAx6knqJKMHeeELJAtj2irNE85+O8ls60QQ9CqP5phQG RPHtlADF+nG/dlXxAY9yIV1vBpIhiP/e0ymOLWwIQGP1tskwUlFz0cY2BKPjeY0IbDYR F7wIDkMMByYGAKxAbTK2ggcMslaozZMWUIEOmRjutr7eenxodi/x5p8QBnRFFEYfljvc gQnRbT0/WkQ4cfPT8OWlEGWmK3FhCotDdY6lNBGTAgqgDgAdwpgo+S6KbEvFJV7QFhhG el0QGbFp6WDCzONjNNQro+oks4EAnnRARXep0P3S/GzbCM8yPZfkaygK/E0JoWT+A6MA ElVQ== X-Gm-Message-State: AOAM530qopM4ejmbUnKNFdGl+q23dYz1RWsrHfgJ0TtWFJh9BslyAeBa lVXd1+XV+aUULBInPInRb+76ACltnrBGuQ== X-Google-Smtp-Source: ABdhPJx64wk97AR10NqoSl6JabKc0sN625yeayX63ZmlboRwomdVXgv3TN4X0OgvEr4gq7seMnzHzA== X-Received: by 2002:a17:907:9d0:: with SMTP id bx16mr32735465ejc.426.1605857113366; Thu, 19 Nov 2020 23:25:13 -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.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:12 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:36 +0100 Message-Id: <20201120072116.818090-64-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 063/162] avcodec/mobiclip: Make decoder init-threadsafe 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/mobiclip.c | 47 +++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c index d188e1cd57..ce9bcf6afb 100644 --- a/libavcodec/mobiclip.c +++ b/libavcodec/mobiclip.c @@ -23,6 +23,7 @@ #include #include "libavutil/avassert.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "bytestream.h" @@ -274,8 +275,32 @@ typedef struct MobiClipContext { static VLC rl_vlc[2]; static VLC mv_vlc[2][16]; +static av_cold void mobiclip_init_static(void) +{ + INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[0], MOBI_RL_VLC_BITS, 104, + bits0, sizeof(*bits0), + syms0, sizeof(*syms0), sizeof(*syms0), + 0, 0, 1 << MOBI_RL_VLC_BITS); + INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[1], MOBI_RL_VLC_BITS, 104, + bits0, sizeof(*bits0), + syms1, sizeof(*syms1), sizeof(*syms1), + 0, 0, 1 << MOBI_RL_VLC_BITS); + for (int i = 0; i < 2; i++) { + static VLC_TYPE vlc_buf[2 * 16 << MOBI_MV_VLC_BITS][2]; + for (int j = 0; j < 16; j++) { + mv_vlc[i][j].table = &vlc_buf[(16 * i + j) << MOBI_MV_VLC_BITS]; + mv_vlc[i][j].table_allocated = 1 << MOBI_MV_VLC_BITS; + ff_init_vlc_from_lengths(&mv_vlc[i][j], MOBI_MV_VLC_BITS, mv_len[j], + mv_bits[i][j], sizeof(*mv_bits[i][j]), + mv_syms[i][j], sizeof(*mv_syms[i][j]), sizeof(*mv_syms[i][j]), + 0, INIT_VLC_USE_NEW_STATIC, NULL); + } + } +} + static av_cold int mobiclip_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; MobiClipContext *s = avctx->priv_data; if (avctx->width & 15 || avctx->height & 15) { @@ -298,25 +323,7 @@ static av_cold int mobiclip_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } - INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[0], MOBI_RL_VLC_BITS, 104, - bits0, sizeof(*bits0), - syms0, sizeof(*syms0), sizeof(*syms0), - 0, 0, 1 << MOBI_RL_VLC_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[1], MOBI_RL_VLC_BITS, 104, - bits0, sizeof(*bits0), - syms1, sizeof(*syms1), sizeof(*syms1), - 0, 0, 1 << MOBI_RL_VLC_BITS); - for (int i = 0; i < 2; i++) { - static VLC_TYPE vlc_buf[2 * 16 << MOBI_MV_VLC_BITS][2]; - for (int j = 0; j < 16; j++) { - mv_vlc[i][j].table = &vlc_buf[(16 * i + j) << MOBI_MV_VLC_BITS]; - mv_vlc[i][j].table_allocated = 1 << MOBI_MV_VLC_BITS; - ff_init_vlc_from_lengths(&mv_vlc[i][j], MOBI_MV_VLC_BITS, mv_len[j], - mv_bits[i][j], sizeof(*mv_bits[i][j]), - mv_syms[i][j], sizeof(*mv_syms[i][j]), sizeof(*mv_syms[i][j]), - 0, INIT_VLC_USE_NEW_STATIC, NULL); - } - } + ff_thread_once(&init_static_once, mobiclip_init_static); return 0; } @@ -1341,5 +1348,5 @@ AVCodec ff_mobiclip_decoder = { .flush = mobiclip_flush, .close = mobiclip_close, .capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Fri Nov 20 07:19:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23819 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 E5C1B44AFE3 for ; Fri, 20 Nov 2020 09:36:06 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A112368BBC8; Fri, 20 Nov 2020 09:25:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2DE8D68BB51 for ; Fri, 20 Nov 2020 09:25:15 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id i19so11472697ejx.9 for ; Thu, 19 Nov 2020 23:25:15 -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=RYNBHrMKQ1kUISL23TFS1JYDG63DXFFwx69kbiPtUpU=; b=SzgmudXQOIJrAgHgqfN+8AP96REIdDQr1j1mIQbHbgizeFHZhFv8IRVrojK5D8O5r+ 5TQ81G7L9SmejpreMI5XWa+m+V4hbc0KAcV1Ied5CqWob/rzXsuNlnjBNXIAzhhzce2+ 2zjsSm+p/BIH2a+olFPeMcBMuv+80UL4ZKqBnps8c/O5xvjsw6VNEUHHeNmOM258k6ED pioDfxZkwhsCIxozi+8lJCY1dEE3jGWLIlC9kjX+iwrl90m7y31vxGZa9Q6ywlCfcL9c HbedLRdsr/gop1EnDgiQTtsq57ZgQ3SHEiMugS25eQbNoS8OjkooMUFRYY/CY+uHeB1j XXeA== 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=RYNBHrMKQ1kUISL23TFS1JYDG63DXFFwx69kbiPtUpU=; b=e0dAefntbAaDaHczNqSt7RrSsj6k9MB3XL9lDBE2L/ejgiEMRbtJ+aCyxTWfDRq5zx 4IFb45c8J1mBGCMxwhgd3evaHppxcLvAVRvzBq6L6CMtTdRyvAZd8idKDJcGH98iSejr hFHx3XT4OYecBWnhhPv6N7txAt8DZlXKfz6YRHt6LNhRVEc0c6YySpsPQnK/isUPYm64 +PdLp8mh1qmQF2D53Lg6eClJL6SWRk4itd3p9NLEgVsN9mN0dfnTIqWmCNaNuMf4lyOw yUnf2890URRxDtgaFONhtv6lmIapJrUyrjVeddYDOWN9i1Z+eb+52TWRzzVEjRSNbG5r j4xQ== X-Gm-Message-State: AOAM531aS8y5nC1ax9Rnn2YeUmmba5bL1TnZ+s3L7v3HpE8MDDUT7XVJ K7tEgxI0jSFpOKnWCQc/wJnzQkFbf4neRg== X-Google-Smtp-Source: ABdhPJwntLTehSFL/zPdoRNSLYoJp6/bRQHiflovWd5IPYn/1w2OmvrZHaz/nbdtxkAmy+PWf0miKg== X-Received: by 2002:a17:906:2f87:: with SMTP id w7mr34148625eji.83.1605857114304; Thu, 19 Nov 2020 23:25:14 -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.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:13 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:37 +0100 Message-Id: <20201120072116.818090-65-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 064/162] avcodec/mobiclip: Reindentation 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/mobiclip.c | 128 +++++++++++++++++++++--------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c index ce9bcf6afb..1969ae3318 100644 --- a/libavcodec/mobiclip.c +++ b/libavcodec/mobiclip.c @@ -161,80 +161,80 @@ static const uint8_t mv_len[16] = static const uint8_t mv_bits[2][16][10] = { { - { 2, 3, 3, 5, 5, 4, 4, 5, 5, 2 }, - { 2, 3, 4, 4, 3, 4, 4, 2 }, - { 3, 4, 4, 2, 4, 4, 3, 2 }, - { 1, 3, 4, 5, 5, 3, 3 }, - { 2, 4, 4, 3, 3, 4, 4, 2 }, - { 2, 3, 4, 4, 4, 4, 3, 2 }, - { 2, 3, 4, 4, 4, 4, 3, 2 }, - { 2, 2, 3, 4, 5, 5, 2 }, - { 2, 3, 4, 4, 3, 4, 4, 2 }, - { 2, 4, 4, 3, 4, 4, 3, 2 }, - { 2, 3, 3, 5, 5, 4, 3, 2 }, - { 2, 3, 4, 4, 3, 3, 2 }, - { 1, 4, 4, 3, 3, 4, 4 }, - { 2, 3, 4, 4, 3, 3, 2 }, - { 2, 3, 4, 4, 3, 3, 2 }, - { 3, 3, 2, 2, 3, 3 }, + { 2, 3, 3, 5, 5, 4, 4, 5, 5, 2 }, + { 2, 3, 4, 4, 3, 4, 4, 2 }, + { 3, 4, 4, 2, 4, 4, 3, 2 }, + { 1, 3, 4, 5, 5, 3, 3 }, + { 2, 4, 4, 3, 3, 4, 4, 2 }, + { 2, 3, 4, 4, 4, 4, 3, 2 }, + { 2, 3, 4, 4, 4, 4, 3, 2 }, + { 2, 2, 3, 4, 5, 5, 2 }, + { 2, 3, 4, 4, 3, 4, 4, 2 }, + { 2, 4, 4, 3, 4, 4, 3, 2 }, + { 2, 3, 3, 5, 5, 4, 3, 2 }, + { 2, 3, 4, 4, 3, 3, 2 }, + { 1, 4, 4, 3, 3, 4, 4 }, + { 2, 3, 4, 4, 3, 3, 2 }, + { 2, 3, 4, 4, 3, 3, 2 }, + { 3, 3, 2, 2, 3, 3 }, }, { - { 3, 4, 5, 5, 3, 5, 6, 6, 4, 1 }, - { 2, 3, 4, 5, 5, 2, 3, 3 }, - { 2, 4, 4, 3, 3, 4, 4, 2 }, - { 1, 4, 4, 3, 4, 4, 3 }, - { 3, 3, 2, 4, 5, 5, 3, 2 }, - { 3, 4, 4, 3, 3, 3, 3, 2 }, - { 1, 3, 3, 4, 4, 4, 5, 5 }, - { 1, 4, 4, 3, 3, 4, 4 }, - { 2, 4, 4, 3, 3, 4, 4, 2 }, - { 1, 3, 3, 4, 4, 4, 5, 5 }, - { 2, 3, 4, 4, 4, 4, 3, 2 }, - { 2, 3, 3, 4, 4, 3, 2 }, - { 1, 4, 4, 3, 3, 4, 4 }, - { 1, 4, 4, 3, 3, 4, 4 }, - { 2, 3, 3, 4, 4, 3, 2 }, - { 2, 3, 3, 3, 3, 2 }, + { 3, 4, 5, 5, 3, 5, 6, 6, 4, 1 }, + { 2, 3, 4, 5, 5, 2, 3, 3 }, + { 2, 4, 4, 3, 3, 4, 4, 2 }, + { 1, 4, 4, 3, 4, 4, 3 }, + { 3, 3, 2, 4, 5, 5, 3, 2 }, + { 3, 4, 4, 3, 3, 3, 3, 2 }, + { 1, 3, 3, 4, 4, 4, 5, 5 }, + { 1, 4, 4, 3, 3, 4, 4 }, + { 2, 4, 4, 3, 3, 4, 4, 2 }, + { 1, 3, 3, 4, 4, 4, 5, 5 }, + { 2, 3, 4, 4, 4, 4, 3, 2 }, + { 2, 3, 3, 4, 4, 3, 2 }, + { 1, 4, 4, 3, 3, 4, 4 }, + { 1, 4, 4, 3, 3, 4, 4 }, + { 2, 3, 3, 4, 4, 3, 2 }, + { 2, 3, 3, 3, 3, 2 }, } }; static const uint8_t mv_syms[2][16][10] = { { - { 1, 8, 9, 4, 3, 2, 7, 5, 6, 0 }, - { 0, 9, 5, 4, 2, 3, 8, 1 }, - { 3, 9, 5, 0, 4, 8, 2, 1 }, - { 1, 3, 4, 8, 5, 2, 0 }, - { 0, 5, 4, 8, 2, 3, 9, 1 }, - { 0, 3, 5, 9, 4, 8, 2, 1 }, - { 0, 3, 9, 5, 8, 4, 2, 1 }, - { 0, 2, 3, 4, 8, 5, 1 }, - { 0, 3, 8, 4, 2, 5, 9, 1 }, - { 2, 8, 9, 3, 5, 4, 0, 1 }, - { 0, 4, 3, 8, 9, 5, 2, 1 }, - { 0, 4, 8, 5, 3, 2, 1 }, - { 1, 9, 4, 2, 0, 5, 3 }, - { 2, 4, 9, 5, 3, 0, 1 }, - { 0, 4, 9, 5, 3, 2, 1 }, - { 5, 4, 1, 0, 3, 2 }, + { 1, 8, 9, 4, 3, 2, 7, 5, 6, 0 }, + { 0, 9, 5, 4, 2, 3, 8, 1 }, + { 3, 9, 5, 0, 4, 8, 2, 1 }, + { 1, 3, 4, 8, 5, 2, 0 }, + { 0, 5, 4, 8, 2, 3, 9, 1 }, + { 0, 3, 5, 9, 4, 8, 2, 1 }, + { 0, 3, 9, 5, 8, 4, 2, 1 }, + { 0, 2, 3, 4, 8, 5, 1 }, + { 0, 3, 8, 4, 2, 5, 9, 1 }, + { 2, 8, 9, 3, 5, 4, 0, 1 }, + { 0, 4, 3, 8, 9, 5, 2, 1 }, + { 0, 4, 8, 5, 3, 2, 1 }, + { 1, 9, 4, 2, 0, 5, 3 }, + { 2, 4, 9, 5, 3, 0, 1 }, + { 0, 4, 9, 5, 3, 2, 1 }, + { 5, 4, 1, 0, 3, 2 }, }, { - { 8, 2, 3, 6, 1, 7, 5, 4, 9, 0 }, - { 9, 2, 3, 5, 4, 1, 8, 0 }, - { 0, 5, 4, 2, 9, 3, 8, 1 }, - { 1, 5, 4, 2, 8, 3, 0 }, - { 2, 9, 8, 3, 5, 4, 0, 1 }, - { 3, 5, 4, 2, 9, 8, 0, 1 }, - { 1, 2, 0, 9, 8, 3, 5, 4 }, - { 1, 8, 5, 2, 0, 4, 3 }, - { 0, 5, 4, 2, 8, 3, 9, 1 }, - { 1, 2, 0, 9, 8, 3, 5, 4 }, - { 0, 3, 9, 8, 5, 4, 2, 1 }, - { 0, 4, 3, 8, 5, 2, 1 }, - { 1, 5, 4, 2, 0, 9, 3 }, - { 1, 9, 5, 2, 0, 4, 3 }, - { 0, 5, 3, 9, 4, 2, 1 }, - { 0, 4, 5, 3, 2, 1 }, + { 8, 2, 3, 6, 1, 7, 5, 4, 9, 0 }, + { 9, 2, 3, 5, 4, 1, 8, 0 }, + { 0, 5, 4, 2, 9, 3, 8, 1 }, + { 1, 5, 4, 2, 8, 3, 0 }, + { 2, 9, 8, 3, 5, 4, 0, 1 }, + { 3, 5, 4, 2, 9, 8, 0, 1 }, + { 1, 2, 0, 9, 8, 3, 5, 4 }, + { 1, 8, 5, 2, 0, 4, 3 }, + { 0, 5, 4, 2, 8, 3, 9, 1 }, + { 1, 2, 0, 9, 8, 3, 5, 4 }, + { 0, 3, 9, 8, 5, 4, 2, 1 }, + { 0, 4, 3, 8, 5, 2, 1 }, + { 1, 5, 4, 2, 0, 9, 3 }, + { 1, 9, 5, 2, 0, 4, 3 }, + { 0, 5, 3, 9, 4, 2, 1 }, + { 0, 4, 5, 3, 2, 1 }, } }; From patchwork Fri Nov 20 07:19:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23820 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 D66CB44B51D for ; Fri, 20 Nov 2020 09:36:17 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 866A368BAA0; Fri, 20 Nov 2020 09:25:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 995F768BB58 for ; Fri, 20 Nov 2020 09:25:16 +0200 (EET) Received: by mail-ej1-f48.google.com with SMTP id o9so11541109ejg.1 for ; Thu, 19 Nov 2020 23:25:16 -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=nMgB3XY7NJnrHIfgMCWRA55awFhjEf7pIkqNFaxvAfQ=; b=AKNWxvrqgqe84WfKUP8L19wB9F5VY1F8wdgiaVDSD7Vh5HPaL547R+EftvJ/KdxJuN AF+1947fEUCIh1hCHsR+2ToRi+yrdMhZj732CAs8xOPuVe7nEXFXa6GsxbMg4332VOZ7 UDCE6m2tcfcl5cwDHantFlN1v5302y2hoEqsUl1NlEYft9wcPIps0bcxF/NjGKcfB/Xu vLYLQSfyXYwa5G+bdqtNtOKFbspaGvUwnrpfXJgXamX/icHdjZrd87ayNZvrycTW9gFM jiWXfyMhzqBDEmv/6MY0NE3M//XGr+TTPEa+e1m9wdTJfTM6MQJN6wvLlt9kTpfka2OT Qnaw== 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=nMgB3XY7NJnrHIfgMCWRA55awFhjEf7pIkqNFaxvAfQ=; b=Eatpvtb7yF/ljhrGB4LevzIMeXMp9ZrPA7Zslsj3JZDHx43Rjgg8S+REn2csNlKlAt gx8NY5xv2aJ9NpXDJFu9Sjlr0rytgOuTP67vGgMmqgHPRBlIcGN17DAkNfd5LD8A+Ba3 dD3EPMCL4bDgtpczhpkaJ5xzY0NiCbOsTzLTt4hnxjgRrJQgy6h+yEmWbqOYs9e0CfSH HsI1fBwzq9jpXAYerPJdt617FW/8R8E2jWsV0NnDbs+enzZJYw760sYfFcDS3BpytZj5 UDWUtOiT1aovfNzh9zrVB/I2rlkRfXKtruwzYcua5imbnHccTAsq2i0hQIz3H4qW6MYE HgWg== X-Gm-Message-State: AOAM531kJpkbprOizlGyiZTUQv/ji39zMEmUwr8VQx3/Iro96X8EQCaV fFse6R0Xt8B3goENNGrgmXKf/HVoXpsD0A== X-Google-Smtp-Source: ABdhPJxtvW5CUM+j3O10cS1e+efMGT3PiGdcrcKVjPmGHRZvDJRzp7E7zbi9h2cqE5fDp8sNwKorqA== X-Received: by 2002:a17:906:4698:: with SMTP id a24mr33247421ejr.90.1605857115304; Thu, 19 Nov 2020 23:25:15 -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.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:14 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:38 +0100 Message-Id: <20201120072116.818090-66-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 065/162] avcodec/qdm2: Make tables used to initialize VLCs 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" After permuting the codes, symbols and lengths tables used to initialize the VLCs so that the codes are ordered from left to right in the Huffman tree, the codes become redundant as they can be easily computed from the lengths at runtime (or at compile time with --enable-hardcoded-tables); in this case one has to use explicit symbol tables, but all the symbols used here fit into an uint8_t, whereas some codes needed uint16_t. Furthermore, the codes had holes because the range of the symbols was not contiguous; these have also been removed. Signed-off-by: Andreas Rheinhardt --- libavcodec/qdm2_tablegen.h | 159 +++++--------------------- libavcodec/qdm2data.h | 226 ++++++++++++++----------------------- 2 files changed, 109 insertions(+), 276 deletions(-) diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h index 2331ebfbb2..d91bd04dc8 100644 --- a/libavcodec/qdm2_tablegen.h +++ b/libavcodec/qdm2_tablegen.h @@ -115,145 +115,40 @@ static const uint16_t qdm2_vlc_offs[] = { static VLC_TYPE qdm2_table[3838][2]; -static av_cold void qdm2_init_vlc(void) +static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, int idx, + const uint8_t tab[][2]) { - vlc_tab_level.table = &qdm2_table[qdm2_vlc_offs[0]]; - vlc_tab_level.table_allocated = qdm2_vlc_offs[1] - qdm2_vlc_offs[0]; - init_vlc(&vlc_tab_level, 8, 24, - vlc_tab_level_huffbits, 1, 1, - vlc_tab_level_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); - - vlc_tab_diff.table = &qdm2_table[qdm2_vlc_offs[1]]; - vlc_tab_diff.table_allocated = qdm2_vlc_offs[2] - qdm2_vlc_offs[1]; - init_vlc(&vlc_tab_diff, 8, 37, - vlc_tab_diff_huffbits, 1, 1, - vlc_tab_diff_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); - - vlc_tab_run.table = &qdm2_table[qdm2_vlc_offs[2]]; - vlc_tab_run.table_allocated = qdm2_vlc_offs[3] - qdm2_vlc_offs[2]; - init_vlc(&vlc_tab_run, 5, 6, - vlc_tab_run_huffbits, 1, 1, - vlc_tab_run_huffcodes, 1, 1, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); - - fft_level_exp_alt_vlc.table = &qdm2_table[qdm2_vlc_offs[3]]; - fft_level_exp_alt_vlc.table_allocated = qdm2_vlc_offs[4] - - qdm2_vlc_offs[3]; - init_vlc(&fft_level_exp_alt_vlc, 8, 28, - fft_level_exp_alt_huffbits, 1, 1, - fft_level_exp_alt_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); - - fft_level_exp_vlc.table = &qdm2_table[qdm2_vlc_offs[4]]; - fft_level_exp_vlc.table_allocated = qdm2_vlc_offs[5] - qdm2_vlc_offs[4]; - init_vlc(&fft_level_exp_vlc, 8, 20, - fft_level_exp_huffbits, 1, 1, - fft_level_exp_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); - - fft_stereo_exp_vlc.table = &qdm2_table[qdm2_vlc_offs[5]]; - fft_stereo_exp_vlc.table_allocated = qdm2_vlc_offs[6] - - qdm2_vlc_offs[5]; - init_vlc(&fft_stereo_exp_vlc, 6, 7, - fft_stereo_exp_huffbits, 1, 1, - fft_stereo_exp_huffcodes, 1, 1, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); - - fft_stereo_phase_vlc.table = &qdm2_table[qdm2_vlc_offs[6]]; - fft_stereo_phase_vlc.table_allocated = qdm2_vlc_offs[7] - - qdm2_vlc_offs[6]; - init_vlc(&fft_stereo_phase_vlc, 6, 9, - fft_stereo_phase_huffbits, 1, 1, - fft_stereo_phase_huffcodes, 1, 1, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); - - vlc_tab_tone_level_idx_hi1.table = - &qdm2_table[qdm2_vlc_offs[7]]; - vlc_tab_tone_level_idx_hi1.table_allocated = qdm2_vlc_offs[8] - - qdm2_vlc_offs[7]; - init_vlc(&vlc_tab_tone_level_idx_hi1, 8, 20, - vlc_tab_tone_level_idx_hi1_huffbits, 1, 1, - vlc_tab_tone_level_idx_hi1_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); - - vlc_tab_tone_level_idx_mid.table = - &qdm2_table[qdm2_vlc_offs[8]]; - vlc_tab_tone_level_idx_mid.table_allocated = qdm2_vlc_offs[9] - - qdm2_vlc_offs[8]; - init_vlc(&vlc_tab_tone_level_idx_mid, 8, 24, - vlc_tab_tone_level_idx_mid_huffbits, 1, 1, - vlc_tab_tone_level_idx_mid_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); - - vlc_tab_tone_level_idx_hi2.table = - &qdm2_table[qdm2_vlc_offs[9]]; - vlc_tab_tone_level_idx_hi2.table_allocated = qdm2_vlc_offs[10] - - qdm2_vlc_offs[9]; - init_vlc(&vlc_tab_tone_level_idx_hi2, 8, 24, - vlc_tab_tone_level_idx_hi2_huffbits, 1, 1, - vlc_tab_tone_level_idx_hi2_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); - - vlc_tab_type30.table = &qdm2_table[qdm2_vlc_offs[10]]; - vlc_tab_type30.table_allocated = qdm2_vlc_offs[11] - qdm2_vlc_offs[10]; - init_vlc(&vlc_tab_type30, 6, 9, - vlc_tab_type30_huffbits, 1, 1, - vlc_tab_type30_huffcodes, 1, 1, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); + vlc->table = &qdm2_table[qdm2_vlc_offs[idx]]; + vlc->table_allocated = qdm2_vlc_offs[idx + 1] - qdm2_vlc_offs[idx]; + 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 | INIT_VLC_LE, NULL); +} - vlc_tab_type34.table = &qdm2_table[qdm2_vlc_offs[11]]; - vlc_tab_type34.table_allocated = qdm2_vlc_offs[12] - qdm2_vlc_offs[11]; - init_vlc(&vlc_tab_type34, 5, 10, - vlc_tab_type34_huffbits, 1, 1, - vlc_tab_type34_huffcodes, 1, 1, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); +static av_cold void qdm2_init_vlc(void) +{ + build_vlc(&vlc_tab_level, 8, 24, 0, tab_level); + build_vlc(&vlc_tab_diff, 8, 33, 1, tab_diff); + build_vlc(&vlc_tab_run, 5, 6, 2, tab_run); - vlc_tab_fft_tone_offset[0].table = - &qdm2_table[qdm2_vlc_offs[12]]; - vlc_tab_fft_tone_offset[0].table_allocated = qdm2_vlc_offs[13] - - qdm2_vlc_offs[12]; - init_vlc(&vlc_tab_fft_tone_offset[0], 8, 23, - vlc_tab_fft_tone_offset_0_huffbits, 1, 1, - vlc_tab_fft_tone_offset_0_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); + build_vlc(&fft_level_exp_alt_vlc, 8, 28, 3, fft_level_exp_alt); + build_vlc(&fft_level_exp_vlc, 8, 20, 4, fft_level_exp); - vlc_tab_fft_tone_offset[1].table = - &qdm2_table[qdm2_vlc_offs[13]]; - vlc_tab_fft_tone_offset[1].table_allocated = qdm2_vlc_offs[14] - - qdm2_vlc_offs[13]; - init_vlc(&vlc_tab_fft_tone_offset[1], 8, 28, - vlc_tab_fft_tone_offset_1_huffbits, 1, 1, - vlc_tab_fft_tone_offset_1_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); + build_vlc(&fft_stereo_exp_vlc, 6, 7, 5, fft_stereo_exp); + build_vlc(&fft_stereo_phase_vlc, 6, 9, 6, fft_stereo_phase); - vlc_tab_fft_tone_offset[2].table = - &qdm2_table[qdm2_vlc_offs[14]]; - vlc_tab_fft_tone_offset[2].table_allocated = qdm2_vlc_offs[15] - - qdm2_vlc_offs[14]; - init_vlc(&vlc_tab_fft_tone_offset[2], 8, 32, - vlc_tab_fft_tone_offset_2_huffbits, 1, 1, - vlc_tab_fft_tone_offset_2_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); + build_vlc(&vlc_tab_tone_level_idx_hi1, 8, 20, 7, tab_tone_level_idx_hi1); + build_vlc(&vlc_tab_tone_level_idx_mid, 8, 13, 8, tab_tone_level_idx_mid); + build_vlc(&vlc_tab_tone_level_idx_hi2, 8, 18, 9, tab_tone_level_idx_hi2); - vlc_tab_fft_tone_offset[3].table = - &qdm2_table[qdm2_vlc_offs[15]]; - vlc_tab_fft_tone_offset[3].table_allocated = qdm2_vlc_offs[16] - - qdm2_vlc_offs[15]; - init_vlc(&vlc_tab_fft_tone_offset[3], 8, 35, - vlc_tab_fft_tone_offset_3_huffbits, 1, 1, - vlc_tab_fft_tone_offset_3_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); + build_vlc(&vlc_tab_type30, 6, 9, 10, tab_type30); + build_vlc(&vlc_tab_type34, 5, 10, 11, tab_type34); - vlc_tab_fft_tone_offset[4].table = - &qdm2_table[qdm2_vlc_offs[16]]; - vlc_tab_fft_tone_offset[4].table_allocated = qdm2_vlc_offs[17] - - qdm2_vlc_offs[16]; - init_vlc(&vlc_tab_fft_tone_offset[4], 8, 38, - vlc_tab_fft_tone_offset_4_huffbits, 1, 1, - vlc_tab_fft_tone_offset_4_huffcodes, 2, 2, - INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); + build_vlc(&vlc_tab_fft_tone_offset[0], 8, 23, 12, tab_fft_tone_offset_0); + build_vlc(&vlc_tab_fft_tone_offset[1], 8, 28, 13, tab_fft_tone_offset_1); + build_vlc(&vlc_tab_fft_tone_offset[2], 8, 31, 14, tab_fft_tone_offset_2); + build_vlc(&vlc_tab_fft_tone_offset[3], 8, 34, 15, tab_fft_tone_offset_3); + build_vlc(&vlc_tab_fft_tone_offset[4], 8, 37, 16, tab_fft_tone_offset_4); } #endif /* CONFIG_HARDCODED_TABLES */ diff --git a/libavcodec/qdm2data.h b/libavcodec/qdm2data.h index 355d61387b..69f66b4571 100644 --- a/libavcodec/qdm2data.h +++ b/libavcodec/qdm2data.h @@ -35,200 +35,138 @@ /** VLC TABLES **/ /* values in this table range from -1..23; adjust retrieved value by -1 */ -static const uint16_t vlc_tab_level_huffcodes[24] = { - 0x037c, 0x0004, 0x003c, 0x004c, 0x003a, 0x002c, 0x001c, 0x001a, - 0x0024, 0x0014, 0x0001, 0x0002, 0x0000, 0x0003, 0x0007, 0x0005, - 0x0006, 0x0008, 0x0009, 0x000a, 0x000c, 0x00fc, 0x007c, 0x017c -}; - -static const uint8_t vlc_tab_level_huffbits[24] = { - 10, 6, 7, 7, 6, 6, 6, 6, 6, 5, 4, 4, 4, 3, 3, 3, 3, 4, 4, 5, 7, 8, 9, 10 +static const uint8_t tab_level[24][2] = { + { 12, 4 }, { 17, 4 }, { 1, 6 }, { 8, 6 }, { 9, 5 }, { 20, 7 }, + { 3, 7 }, { 5, 6 }, { 6, 6 }, { 2, 7 }, { 22, 9 }, { 23, 10 }, + { 0, 10 }, { 21, 8 }, { 11, 4 }, { 19, 5 }, { 7, 6 }, { 4, 6 }, + { 16, 3 }, { 10, 4 }, { 18, 4 }, { 15, 3 }, { 13, 3 }, { 14, 3 }, }; /* values in this table range from -1..36; adjust retrieved value by -1 */ -static const uint16_t vlc_tab_diff_huffcodes[37] = { - 0x1c57, 0x0004, 0x0000, 0x0001, 0x0003, 0x0002, 0x000f, 0x000e, - 0x0007, 0x0016, 0x0037, 0x0027, 0x0026, 0x0066, 0x0006, 0x0097, - 0x0046, 0x01c6, 0x0017, 0x0786, 0x0086, 0x0257, 0x00d7, 0x0357, - 0x00c6, 0x0386, 0x0186, 0x0000, 0x0157, 0x0c57, 0x0057, 0x0000, - 0x0b86, 0x0000, 0x1457, 0x0000, 0x0457 -}; - -static const uint8_t vlc_tab_diff_huffbits[37] = { - 13, 3, 3, 2, 3, 3, 4, 4, 6, 5, 6, 6, 7, 7, 8, 8, - 8, 9, 8, 11, 9, 10, 8, 10, 9, 12, 10, 0, 10, 13, 11, 0, - 12, 0, 13, 0, 13 +static const uint8_t tab_diff[33][2] = { + { 2, 3 }, { 1, 3 }, { 5, 3 }, { 14, 8 }, { 20, 9 }, { 26, 10 }, + { 25, 12 }, { 32, 12 }, { 19, 11 }, { 16, 8 }, { 24, 9 }, { 17, 9 }, + { 12, 7 }, { 13, 7 }, { 9, 5 }, { 7, 4 }, { 3, 2 }, { 4, 3 }, + { 8, 6 }, { 11, 6 }, { 18, 8 }, { 15, 8 }, { 30, 11 }, { 36, 13 }, + { 34, 13 }, { 29, 13 }, { 0, 13 }, { 21, 10 }, { 28, 10 }, { 23, 10 }, + { 22, 8 }, { 10, 6 }, { 6, 4 }, }; /* values in this table range from -1..5; adjust retrieved value by -1 */ -static const uint8_t vlc_tab_run_huffcodes[6] = { - 0x1f, 0x00, 0x01, 0x03, 0x07, 0x0f -}; - -static const uint8_t vlc_tab_run_huffbits[6] = { - 5, 1, 2, 3, 4, 5 +static const uint8_t tab_run[6][2] = { + { 1, 1 }, { 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 0, 5 }, }; /* values in this table range from -1..19; adjust retrieved value by -1 */ -static const uint16_t vlc_tab_tone_level_idx_hi1_huffcodes[20] = { - 0x5714, 0x000c, 0x0002, 0x0001, 0x0000, 0x0004, 0x0034, 0x0054, - 0x0094, 0x0014, 0x0114, 0x0214, 0x0314, 0x0614, 0x0e14, 0x0f14, - 0x2714, 0x0714, 0x1714, 0x3714 -}; - -static const uint8_t vlc_tab_tone_level_idx_hi1_huffbits[20] = { - 15, 4, 2, 1, 3, 5, 6, 7, 8, 10, 10, 11, 11, 12, 12, 12, 14, 14, 15, 14 +static const uint8_t tab_tone_level_idx_hi1[20][2] = { + { 4, 3 }, { 5, 5 }, { 9, 10 }, { 11, 11 }, { 13, 12 }, { 14, 12 }, + { 10, 10 }, { 12, 11 }, { 17, 14 }, { 16, 14 }, { 18, 15 }, { 0, 15 }, + { 19, 14 }, { 15, 12 }, { 8, 8 }, { 7, 7 }, { 6, 6 }, { 1, 4 }, + { 2, 2 }, { 3, 1 }, }; /* values in this table range from -1..23; adjust retrieved value by -1 */ -static const uint16_t vlc_tab_tone_level_idx_mid_huffcodes[24] = { - 0x0fea, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x03ea, 0x00ea, 0x002a, 0x001a, - 0x0006, 0x0001, 0x0000, 0x0002, 0x000a, 0x006a, 0x01ea, 0x07ea -}; - -static const uint8_t vlc_tab_tone_level_idx_mid_huffbits[24] = { - 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 12 +static const uint8_t tab_tone_level_idx_mid[13][2] = { + { 18, 2 }, { 19, 4 }, { 20, 6 }, { 14, 7 }, { 21, 8 }, { 13, 9 }, + { 22, 10 }, { 12, 11 }, { 23, 12 }, { 0, 12 }, { 15, 5 }, { 16, 3 }, + { 17, 1 }, }; /* values in this table range from -1..23; adjust retrieved value by -1 */ -static const uint16_t vlc_tab_tone_level_idx_hi2_huffcodes[24] = { - 0x0664, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0064, 0x00e4, - 0x00a4, 0x0068, 0x0004, 0x0008, 0x0014, 0x0018, 0x0000, 0x0001, - 0x0002, 0x0003, 0x000c, 0x0028, 0x0024, 0x0164, 0x0000, 0x0264 -}; - -static const uint8_t vlc_tab_tone_level_idx_hi2_huffbits[24] = { - 11, 0, 0, 0, 0, 0, 10, 8, 8, 7, 6, 6, 5, 5, 4, 2, 2, 2, 4, 7, 8, 9, 0, 11 +static const uint8_t tab_tone_level_idx_hi2[18][2] = { + { 14, 4 }, { 11, 6 }, { 19, 7 }, { 9, 7 }, { 13, 5 }, { 10, 6 }, + { 20, 8 }, { 8, 8 }, { 6, 10 }, { 23, 11 }, { 0, 11 }, { 21, 9 }, + { 7, 8 }, { 12, 5 }, { 18, 4 }, { 16, 2 }, { 15, 2 }, { 17, 2 }, }; /* values in this table range from -1..8; adjust retrieved value by -1 */ -static const uint8_t vlc_tab_type30_huffcodes[9] = { - 0x3c, 0x06, 0x00, 0x01, 0x03, 0x02, 0x04, 0x0c, 0x1c -}; - -static const uint8_t vlc_tab_type30_huffbits[9] = { - 6, 3, 3, 2, 2, 3, 4, 5, 6 +static const uint8_t tab_type30[9][2] = { + { 2, 3 }, { 6, 4 }, { 7, 5 }, { 8, 6 }, { 0, 6 }, { 5, 3 }, { 1, 3 }, + { 3, 2 }, { 4, 2 }, }; /* values in this table range from -1..9; adjust retrieved value by -1 */ -static const uint8_t vlc_tab_type34_huffcodes[10] = { - 0x18, 0x00, 0x01, 0x04, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08 -}; - -static const uint8_t vlc_tab_type34_huffbits[10] = { - 5, 4, 3, 3, 3, 3, 3, 3, 3, 5 +static const uint8_t tab_type34[10][2] = { + { 1, 4 }, { 9, 5 }, { 0, 5 }, { 3, 3 }, { 7, 3 }, { 8, 3 }, { 2, 3 }, + { 4, 3 }, { 6, 3 }, { 5, 3 }, }; /* values in this table range from -1..22; adjust retrieved value by -1 */ -static const uint16_t vlc_tab_fft_tone_offset_0_huffcodes[23] = { - 0x038e, 0x0001, 0x0000, 0x0022, 0x000a, 0x0006, 0x0012, 0x0002, - 0x001e, 0x003e, 0x0056, 0x0016, 0x000e, 0x0032, 0x0072, 0x0042, - 0x008e, 0x004e, 0x00f2, 0x002e, 0x0036, 0x00c2, 0x018e -}; - -static const uint8_t vlc_tab_fft_tone_offset_0_huffbits[23] = { - 10, 1, 2, 6, 4, 5, 6, 7, 6, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 6, 6, 8, 10 +static const uint8_t tab_fft_tone_offset_0[23][2] = { + { 2, 2 }, { 7, 7 }, { 15, 8 }, { 21, 8 }, { 3, 6 }, { 6, 6 }, + { 13, 7 }, { 14, 8 }, { 18, 8 }, { 4, 4 }, { 5, 5 }, { 11, 7 }, + { 10, 7 }, { 20, 6 }, { 12, 8 }, { 16, 9 }, { 22, 10 }, { 0, 10 }, + { 17, 7 }, { 19, 6 }, { 8, 6 }, { 9, 6 }, { 1, 1 }, }; /* values in this table range from -1..27; adjust retrieved value by -1 */ -static const uint16_t vlc_tab_fft_tone_offset_1_huffcodes[28] = { - 0x07a4, 0x0001, 0x0020, 0x0012, 0x001c, 0x0008, 0x0006, 0x0010, - 0x0000, 0x0014, 0x0004, 0x0032, 0x0070, 0x000c, 0x0002, 0x003a, - 0x001a, 0x002c, 0x002a, 0x0022, 0x0024, 0x000a, 0x0064, 0x0030, - 0x0062, 0x00a4, 0x01a4, 0x03a4 -}; - -static const uint8_t vlc_tab_fft_tone_offset_1_huffbits[28] = { - 11, 1, 6, 6, 5, 4, 3, 6, 6, 5, 6, 6, 7, 6, 6, 6, - 6, 6, 6, 7, 8, 6, 7, 7, 7, 9, 10, 11 +static const uint8_t tab_fft_tone_offset_1[28][2] = { + { 8, 6 }, { 2, 6 }, { 7, 6 }, { 23, 7 }, { 12, 7 }, { 5, 4 }, + { 10, 6 }, { 20, 8 }, { 25, 9 }, { 26, 10 }, { 27, 11 }, { 0, 11 }, + { 22, 7 }, { 9, 5 }, { 13, 6 }, { 17, 6 }, { 4, 5 }, { 14, 6 }, + { 19, 7 }, { 24, 7 }, { 3, 6 }, { 11, 6 }, { 21, 6 }, { 18, 6 }, + { 16, 6 }, { 15, 6 }, { 6, 3 }, { 1, 1 }, }; /* values in this table range from -1..31; adjust retrieved value by -1 */ -static const uint16_t vlc_tab_fft_tone_offset_2_huffcodes[32] = { - 0x1760, 0x0001, 0x0000, 0x0082, 0x000c, 0x0006, 0x0003, 0x0007, - 0x0008, 0x0004, 0x0010, 0x0012, 0x0022, 0x001a, 0x0000, 0x0020, - 0x000a, 0x0040, 0x004a, 0x006a, 0x002a, 0x0042, 0x0002, 0x0060, - 0x00aa, 0x00e0, 0x00c2, 0x01c2, 0x0160, 0x0360, 0x0760, 0x0f60 -}; - -static const uint8_t vlc_tab_fft_tone_offset_2_huffbits[32] = { - 13, 2, 0, 8, 4, 3, 3, 3, 4, 4, 5, 5, 6, 5, 7, 7, - 7, 7, 7, 7, 8, 8, 8, 9, 8, 8, 9, 9, 10, 11, 13, 12 +static const uint8_t tab_fft_tone_offset_2[31][2] = { + { 14, 7 }, { 17, 7 }, { 15, 7 }, { 23, 9 }, { 28, 10 }, { 29, 11 }, + { 30, 13 }, { 0, 13 }, { 31, 12 }, { 25, 8 }, { 10, 5 }, { 8, 4 }, + { 9, 4 }, { 4, 4 }, { 22, 8 }, { 3, 8 }, { 21, 8 }, { 26, 9 }, + { 27, 9 }, { 12, 6 }, { 11, 5 }, { 16, 7 }, { 18, 7 }, { 20, 8 }, + { 24, 8 }, { 19, 7 }, { 13, 5 }, { 5, 3 }, { 1, 2 }, { 6, 3 }, + { 7, 3 }, }; /* values in this table range from -1..34; adjust retrieved value by -1 */ -static const uint16_t vlc_tab_fft_tone_offset_3_huffcodes[35] = { - 0x33ea, 0x0005, 0x0000, 0x000c, 0x0000, 0x0006, 0x0003, 0x0008, - 0x0002, 0x0001, 0x0004, 0x0007, 0x001a, 0x000f, 0x001c, 0x002c, - 0x000a, 0x001d, 0x002d, 0x002a, 0x000d, 0x004c, 0x008c, 0x006a, - 0x00cd, 0x004d, 0x00ea, 0x020c, 0x030c, 0x010c, 0x01ea, 0x07ea, - 0x0bea, 0x03ea, 0x13ea -}; - -static const uint8_t vlc_tab_fft_tone_offset_3_huffbits[35] = { - 14, 4, 0, 10, 4, 3, 3, 4, 4, 3, 4, 4, 5, 4, 5, 6, - 6, 5, 6, 7, 7, 7, 8, 8, 8, 8, 9, 10, 10, 10, 10, 11, - 12, 13, 14 +static const uint8_t tab_fft_tone_offset_3[34][2] = { + { 4, 4 }, { 7, 4 }, { 10, 4 }, { 3, 10 }, { 27, 10 }, { 29, 10 }, + { 28, 10 }, { 22, 8 }, { 21, 7 }, { 15, 6 }, { 14, 5 }, { 8, 4 }, + { 16, 6 }, { 19, 7 }, { 23, 8 }, { 26, 9 }, { 30, 10 }, { 33, 13 }, + { 34, 14 }, { 0, 14 }, { 32, 12 }, { 31, 11 }, { 12, 5 }, { 5, 3 }, + { 9, 3 }, { 1, 4 }, { 20, 7 }, { 25, 8 }, { 24, 8 }, { 18, 6 }, + { 17, 5 }, { 6, 3 }, { 11, 4 }, { 13, 4 }, }; /* values in this table range from -1..37; adjust retrieved value by -1 */ -static const uint16_t vlc_tab_fft_tone_offset_4_huffcodes[38] = { - 0x5282, 0x0016, 0x0000, 0x0136, 0x0004, 0x0000, 0x0007, 0x000a, - 0x000e, 0x0003, 0x0001, 0x000d, 0x0006, 0x0009, 0x0012, 0x0005, - 0x0025, 0x0022, 0x0015, 0x0002, 0x0076, 0x0035, 0x0042, 0x00c2, - 0x0182, 0x00b6, 0x0036, 0x03c2, 0x0482, 0x01c2, 0x0682, 0x0882, - 0x0a82, 0x0082, 0x0282, 0x1282, 0x3282, 0x2282 -}; - -static const uint8_t vlc_tab_fft_tone_offset_4_huffbits[38] = { - 15, 6, 0, 9, 3, 3, 3, 4, 4, 3, 4, 4, 5, 4, 5, 6, - 6, 6, 6, 8, 7, 6, 8, 9, 9, 8, 9, 10, 11, 10, 11, 12, - 12, 12, 14, 15, 14, 14 +static const uint8_t tab_fft_tone_offset_4[37][2] = { + { 5, 3 }, { 4, 3 }, { 19, 8 }, { 33, 12 }, { 31, 12 }, { 28, 11 }, + { 34, 14 }, { 37, 14 }, { 35, 15 }, { 0, 15 }, { 36, 14 }, { 32, 12 }, + { 30, 11 }, { 24, 9 }, { 22, 8 }, { 23, 9 }, { 29, 10 }, { 27, 10 }, + { 17, 6 }, { 14, 5 }, { 7, 4 }, { 12, 5 }, { 1, 6 }, { 26, 9 }, + { 3, 9 }, { 25, 8 }, { 20, 7 }, { 8, 4 }, { 10, 4 }, { 13, 4 }, + { 15, 6 }, { 16, 6 }, { 18, 6 }, { 21, 6 }, { 11, 4 }, { 9, 3 }, + { 6, 3 }, }; /** FFT TABLES **/ /* values in this table range from -1..27; adjust retrieved value by -1 */ -static const uint16_t fft_level_exp_alt_huffcodes[28] = { - 0x1ec6, 0x0006, 0x00c2, 0x0142, 0x0242, 0x0246, 0x00c6, 0x0046, - 0x0042, 0x0146, 0x00a2, 0x0062, 0x0026, 0x0016, 0x000e, 0x0005, - 0x0004, 0x0003, 0x0000, 0x0001, 0x000a, 0x0012, 0x0002, 0x0022, - 0x01c6, 0x02c6, 0x06c6, 0x0ec6 -}; - -static const uint8_t fft_level_exp_alt_huffbits[28] = { - 13, 7, 8, 9, 10, 10, 10, 10, 10, 9, 8, 7, 6, 5, 4, 3, - 3, 2, 3, 3, 4, 5, 7, 8, 9, 11, 12, 13 +static const uint8_t fft_level_exp_alt[28][2] = { + { 18, 3 }, { 16, 3 }, { 22, 7 }, { 8, 10 }, { 4, 10 }, { 3, 9 }, + { 2, 8 }, { 23, 8 }, { 10, 8 }, { 11, 7 }, { 21, 5 }, { 20, 4 }, + { 1, 7 }, { 7, 10 }, { 5, 10 }, { 9, 9 }, { 6, 10 }, { 25, 11 }, + { 26, 12 }, { 27, 13 }, { 0, 13 }, { 24, 9 }, { 12, 6 }, { 13, 5 }, + { 14, 4 }, { 19, 3 }, { 15, 3 }, { 17, 2 }, }; /* values in this table range from -1..19; adjust retrieved value by -1 */ -static const uint16_t fft_level_exp_huffcodes[20] = { - 0x0f24, 0x0001, 0x0002, 0x0000, 0x0006, 0x0005, 0x0007, 0x000c, - 0x000b, 0x0014, 0x0013, 0x0004, 0x0003, 0x0023, 0x0064, 0x00a4, - 0x0024, 0x0124, 0x0324, 0x0724 -}; - -static const uint8_t fft_level_exp_huffbits[20] = { - 12, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 8, 9, 10, 11, 12 +static const uint8_t fft_level_exp[20][2] = { + { 3, 3 }, { 11, 6 }, { 16, 9 }, { 17, 10 }, { 18, 11 }, { 19, 12 }, + { 0, 12 }, { 15, 8 }, { 14, 7 }, { 9, 5 }, { 7, 4 }, { 2, 3 }, + { 4, 3 }, { 1, 3 }, { 5, 3 }, { 12, 6 }, { 13, 6 }, { 10, 5 }, + { 8, 4 }, { 6, 3 }, }; /* values in this table range from -1..6; adjust retrieved value by -1 */ -static const uint8_t fft_stereo_exp_huffcodes[7] = { - 0x3e, 0x01, 0x00, 0x02, 0x06, 0x0e, 0x1e -}; - -static const uint8_t fft_stereo_exp_huffbits[7] = { - 6, 1, 2, 3, 4, 5, 6 +static const uint8_t fft_stereo_exp[7][2] = { + { 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 6, 6 }, { 0, 6 }, { 1, 1 }, }; /* values in this table range from -1..8; adjust retrieved value by -1 */ -static const uint8_t fft_stereo_phase_huffcodes[9] = { - 0x35, 0x02, 0x00, 0x01, 0x0d, 0x15, 0x05, 0x09, 0x03 -}; - -static const uint8_t fft_stereo_phase_huffbits[9] = { - 6, 2, 2, 4, 4, 6, 5, 4, 2 +static const uint8_t fft_stereo_phase[9][2] = { + { 2, 2 }, { 1, 2 }, { 3, 4 }, { 7, 4 }, { 6, 5 }, { 5, 6 }, { 0, 6 }, + { 4, 4 }, { 8, 2 }, }; static const int fft_cutoff_index_table[4][2] = { From patchwork Fri Nov 20 07:19:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23762 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 A52CC44AC1A for ; Fri, 20 Nov 2020 09:25:30 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 83EF068BA86; Fri, 20 Nov 2020 09:25:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1482B68BB58 for ; Fri, 20 Nov 2020 09:25:17 +0200 (EET) Received: by mail-ed1-f54.google.com with SMTP id q16so8461251edv.10 for ; Thu, 19 Nov 2020 23:25:17 -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=c8Fe9AUuQtnogfM7EqJE0JD+reYpFUA4eKwmuOovqbU=; b=NVFuJsIWqxH5SQU5OvrM1gHBSObUM2xKLvWeiG5VyZwTgHV3Vu9twjLf2etGXLGExf uBHGlcM23DWQf7A9h1dvu9W1fceZnnD5av705GMWbVdRK4iyTCoPzGZa05iNMjI7jQOR zJZipwanBimbY9xGwzZQwp3E85C4QvRyqnE6Ih+upcGQeu/VNEY57jgspmJ7alJQfjzU 8TiJfs02cqwzb8ER5CQXcxiM0EpJqUlVRrXbs+6OJV8DSwWVoWWgRdCr25sTtSxBCR2h uBmtk2+sw/vDpoBuawkiJ0o4eEe2uzVIyhDyKYy5ktZ362LdaAolGJ7fyeVWTRtn+BPr YdVA== 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=c8Fe9AUuQtnogfM7EqJE0JD+reYpFUA4eKwmuOovqbU=; b=o8+VaByRQpWbUl6Fljv1EpqyVWcnsADaHwoELtHJQ6zQWydqChXAktUGy2jv4LMr3o G/VjSa83PBLvjISRvwY3Upn5jmcRjf9+m2OVE4okEwi/D0+JTy1hGD+5Qvbb+Jx1mkwv GPdgptYPfvWIr3fKP+8zzq71pX/ifbnqc5aIDtSkcbRPk4AvK33/lIs+svY8ca+fdxhX V9yF0pIoDkSyeANnhw7xnLJee2JII5Z/e0aKMohZ+LsY065NUWAPc2U3xshbHuk4E5/a X32aBFs5hx9vpoZB3JdNJc2ChBvE8YuG5is3qVDE5fdcJHx92fAKdJUfzafuIwBC3ld7 sJAw== X-Gm-Message-State: AOAM531DO9NF13pbfTs0zwVL75evzu2jP+aUf8Is5RkBfsQSVhj+cmi3 1XBxmioGLXYBRLmgIE3Bg00LcjDgAVx72Q== X-Google-Smtp-Source: ABdhPJyqZq2Wrsp3mQsLyqZ4nbos3gBC7fMhYzHh2+LUFiuVhRiX10piYDh/B7DnouZJ4JspLNkK9A== X-Received: by 2002:a50:eb96:: with SMTP id y22mr35056512edr.116.1605857116252; Thu, 19 Nov 2020 23:25:16 -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.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:15 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:39 +0100 Message-Id: <20201120072116.818090-67-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 066/162] avcodec/qdm2: Apply offsets 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/qdm2.c | 2 +- libavcodec/qdm2_tablegen.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index bd365739ce..f2e78c3fa2 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -205,7 +205,7 @@ static int qdm2_get_vlc(GetBitContext *gb, const VLC *vlc, int flag, int depth) value = get_vlc2(gb, vlc->table, vlc->bits, depth); /* stage-2, 3 bits exponent escape sequence */ - if (value-- == 0) + if (value < 0) value = get_bits(gb, get_bits(gb, 3) + 1); /* stage-3, optional */ diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h index d91bd04dc8..e948e92295 100644 --- a/libavcodec/qdm2_tablegen.h +++ b/libavcodec/qdm2_tablegen.h @@ -122,7 +122,7 @@ static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, int idx, vlc->table_allocated = qdm2_vlc_offs[idx + 1] - qdm2_vlc_offs[idx]; 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 | INIT_VLC_LE, NULL); + -1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE, NULL); } static av_cold void qdm2_init_vlc(void) From patchwork Fri Nov 20 07:19:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23821 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 6B3FE44B51D for ; Fri, 20 Nov 2020 09:36:41 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D981A68BB3B; Fri, 20 Nov 2020 09:25:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3FD4F68BB61 for ; Fri, 20 Nov 2020 09:25:18 +0200 (EET) Received: by mail-ed1-f43.google.com with SMTP id q16so8461311edv.10 for ; Thu, 19 Nov 2020 23:25: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=qyJ/An+0y8uYB8mxtbDfWAQcs1N6jLZzmizvJrUIB3U=; b=Y8DZoaYj3CEowYSfrcs4+AseeuHUXiMDoMQR5/pdG8YbZv761WUprvK8znPkB76JT7 GhV0cnHcWRu5DZrgBpRDtmsySIK4lN4n0M/KDoawF3erPB5LDVpg9EUiM8O1hd0tmjT5 oarZz1Z1Rsh63wLihjRd2aRIV9cRMqVyX87psRFM+0J2BaRy40nrN4RG1w7G5y5tnFTE 9FBZMDWQrI59yWbLOPLD/w9J+ySdx7vd9a9MqJ8aNxh/Uv1ou1GLc1BqajNaWuGEROG/ mdm/tzSqUga8dRaC92sa6c+NCuLDcfCzWJzeurOQ4tGBwnOFlJ41gPT61TdEPgs4RxMr buZA== 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=qyJ/An+0y8uYB8mxtbDfWAQcs1N6jLZzmizvJrUIB3U=; b=ocjO3AerEGLKCEHqDQFywfiTkSWL2JdEKQcOiins3GTlsZP0x1k4Uhe0837xwLJrX4 obkNIfgz3SI6DyESZ2cyKoMcKBJaT0O7xOcitQljXgfxbc1V5j377ZXcw5Cjj7HPQK1A uu/D+q32Y/v9buduOyAr0GqHuKRjffhCTLRlzq1eYdG9cqbBT+rzSWgYnPT0lrkP5QXU wzDNBd4nd1Ja/TXwiCfRF/uyOGqPxtjVJdLn6cauyxKkuoWjnh8gUvQxLU9NN0priCKN Ak/mAVTKHE1INelrBAdPPyjn7pKotpvKRMS54CyJf/R07V6Znhc6hesnYgfviy11476L W8Vw== X-Gm-Message-State: AOAM53192FHJuTu0AOKSiND8VCsLgcUjk2tH18UsOA8mq4NQV1gishrD 35+6bVcn1gPzt3y/HACvZRJ4dZL1xs8Qmw== X-Google-Smtp-Source: ABdhPJyR2YS4GrB6qrHc3qYejp5EHha4gn1xbcd90xlkHBM6gxzFpUc2jAdQeAQ5WL+obVRIPU/ifw== X-Received: by 2002:aa7:d6c2:: with SMTP id x2mr32975681edr.206.1605857117262; Thu, 19 Nov 2020 23:25:17 -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.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:16 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:40 +0100 Message-Id: <20201120072116.818090-68-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 067/162] avcodec/qdm2: Initialize array of VLCs in a loop 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/qdm2_tablegen.h | 12 +++++++----- libavcodec/qdm2data.h | 28 ++++++++++------------------ 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h index e948e92295..2ae8449c14 100644 --- a/libavcodec/qdm2_tablegen.h +++ b/libavcodec/qdm2_tablegen.h @@ -127,6 +127,8 @@ static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, int idx, static av_cold void qdm2_init_vlc(void) { + const uint8_t (*tab)[2] = tab_fft_tone_offset; + build_vlc(&vlc_tab_level, 8, 24, 0, tab_level); build_vlc(&vlc_tab_diff, 8, 33, 1, tab_diff); build_vlc(&vlc_tab_run, 5, 6, 2, tab_run); @@ -144,11 +146,11 @@ static av_cold void qdm2_init_vlc(void) build_vlc(&vlc_tab_type30, 6, 9, 10, tab_type30); build_vlc(&vlc_tab_type34, 5, 10, 11, tab_type34); - build_vlc(&vlc_tab_fft_tone_offset[0], 8, 23, 12, tab_fft_tone_offset_0); - build_vlc(&vlc_tab_fft_tone_offset[1], 8, 28, 13, tab_fft_tone_offset_1); - build_vlc(&vlc_tab_fft_tone_offset[2], 8, 31, 14, tab_fft_tone_offset_2); - build_vlc(&vlc_tab_fft_tone_offset[3], 8, 34, 15, tab_fft_tone_offset_3); - build_vlc(&vlc_tab_fft_tone_offset[4], 8, 37, 16, tab_fft_tone_offset_4); + for (int i = 0; i < 5; i++) { + build_vlc(&vlc_tab_fft_tone_offset[i], 8, tab_fft_tone_offset_sizes[i], + 12 + i, tab); + tab += tab_fft_tone_offset_sizes[i]; + } } #endif /* CONFIG_HARDCODED_TABLES */ diff --git a/libavcodec/qdm2data.h b/libavcodec/qdm2data.h index 69f66b4571..713f584269 100644 --- a/libavcodec/qdm2data.h +++ b/libavcodec/qdm2data.h @@ -91,45 +91,37 @@ static const uint8_t tab_type34[10][2] = { { 4, 3 }, { 6, 3 }, { 5, 3 }, }; -/* values in this table range from -1..22; adjust retrieved value by -1 */ -static const uint8_t tab_fft_tone_offset_0[23][2] = { +static const uint8_t tab_fft_tone_offset_sizes[] = { + 23, 28, 31, 34, 37 +}; + +static const uint8_t tab_fft_tone_offset[][2] = { + /* First table - 23 entries with range -1..21 */ { 2, 2 }, { 7, 7 }, { 15, 8 }, { 21, 8 }, { 3, 6 }, { 6, 6 }, { 13, 7 }, { 14, 8 }, { 18, 8 }, { 4, 4 }, { 5, 5 }, { 11, 7 }, { 10, 7 }, { 20, 6 }, { 12, 8 }, { 16, 9 }, { 22, 10 }, { 0, 10 }, { 17, 7 }, { 19, 6 }, { 8, 6 }, { 9, 6 }, { 1, 1 }, -}; - -/* values in this table range from -1..27; adjust retrieved value by -1 */ -static const uint8_t tab_fft_tone_offset_1[28][2] = { + /* Second table - 28 entries with range -1..26 */ { 8, 6 }, { 2, 6 }, { 7, 6 }, { 23, 7 }, { 12, 7 }, { 5, 4 }, { 10, 6 }, { 20, 8 }, { 25, 9 }, { 26, 10 }, { 27, 11 }, { 0, 11 }, { 22, 7 }, { 9, 5 }, { 13, 6 }, { 17, 6 }, { 4, 5 }, { 14, 6 }, { 19, 7 }, { 24, 7 }, { 3, 6 }, { 11, 6 }, { 21, 6 }, { 18, 6 }, { 16, 6 }, { 15, 6 }, { 6, 3 }, { 1, 1 }, -}; - -/* values in this table range from -1..31; adjust retrieved value by -1 */ -static const uint8_t tab_fft_tone_offset_2[31][2] = { + /* Third table - 31 entries with range -1..30 (1 omitted) */ { 14, 7 }, { 17, 7 }, { 15, 7 }, { 23, 9 }, { 28, 10 }, { 29, 11 }, { 30, 13 }, { 0, 13 }, { 31, 12 }, { 25, 8 }, { 10, 5 }, { 8, 4 }, { 9, 4 }, { 4, 4 }, { 22, 8 }, { 3, 8 }, { 21, 8 }, { 26, 9 }, { 27, 9 }, { 12, 6 }, { 11, 5 }, { 16, 7 }, { 18, 7 }, { 20, 8 }, { 24, 8 }, { 19, 7 }, { 13, 5 }, { 5, 3 }, { 1, 2 }, { 6, 3 }, { 7, 3 }, -}; - -/* values in this table range from -1..34; adjust retrieved value by -1 */ -static const uint8_t tab_fft_tone_offset_3[34][2] = { + /* Fourth table - 34 entries with range -1..33 (1 omitted) */ { 4, 4 }, { 7, 4 }, { 10, 4 }, { 3, 10 }, { 27, 10 }, { 29, 10 }, { 28, 10 }, { 22, 8 }, { 21, 7 }, { 15, 6 }, { 14, 5 }, { 8, 4 }, { 16, 6 }, { 19, 7 }, { 23, 8 }, { 26, 9 }, { 30, 10 }, { 33, 13 }, { 34, 14 }, { 0, 14 }, { 32, 12 }, { 31, 11 }, { 12, 5 }, { 5, 3 }, { 9, 3 }, { 1, 4 }, { 20, 7 }, { 25, 8 }, { 24, 8 }, { 18, 6 }, { 17, 5 }, { 6, 3 }, { 11, 4 }, { 13, 4 }, -}; - -/* values in this table range from -1..37; adjust retrieved value by -1 */ -static const uint8_t tab_fft_tone_offset_4[37][2] = { + /* Fifth table - 37 entries with range -1..36 (1 omitted) */ { 5, 3 }, { 4, 3 }, { 19, 8 }, { 33, 12 }, { 31, 12 }, { 28, 11 }, { 34, 14 }, { 37, 14 }, { 35, 15 }, { 0, 15 }, { 36, 14 }, { 32, 12 }, { 30, 11 }, { 24, 9 }, { 22, 8 }, { 23, 9 }, { 29, 10 }, { 27, 10 }, From patchwork Fri Nov 20 07:19:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23822 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 DB4CE44B51D for ; Fri, 20 Nov 2020 09:36:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C3B5768BBA9; Fri, 20 Nov 2020 09:25:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1A5CD68BB68 for ; Fri, 20 Nov 2020 09:25:18 +0200 (EET) Received: by mail-ej1-f45.google.com with SMTP id s25so11497377ejy.6 for ; Thu, 19 Nov 2020 23:25: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=2TkPy2FYbeGod4hfmGkwqpvsrSXGkg26yl66AztyyPg=; b=Dv0y1TbZ2C8Sv4bpbqo2W8Ta4ln2nACIQVXVqfj+9ZJXEHVpdlz50l1HkT9KSD1yb/ FEeaFMKOoneIw8011gEGZXh/l1ca1bwZL7QBbGKoHWsjr7JxuxawSE6FsD9RaPZlsyke 6LFYQ+Q4fKQ05QEiW5s2A5X1RCzZw8iwBA/q9UxmX4CYHODXq2BZGBVgLFhIP9dz+oQc 5niZO0ljALjv27++KEGGp3RybdzqKOkMqUtLHl1RE7NCPQIyF1SFSpDFwHEpTGY4BjU3 V0X7/c+oBzTkw6Zb2Rxv6gw0DO4MeLvYJl/Fzjj5/x4jDmnJLCcI5LXfHD629fksD+mH Du0g== 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=2TkPy2FYbeGod4hfmGkwqpvsrSXGkg26yl66AztyyPg=; b=Fb6P1g9nnPxCHSfpdTPHyzbz11chFzz3cfc24l7l28ERu8hdgb4z/jpByquYBSeYcO naQTwXDZdduAJhiGUC+muN8wBYL13SZK2rgpZrzAE2LcZIMiu3NG18Dxd+j5d1+AVxEl 4ziOI+4fDT8UwusS7EjbUVh1534C6o0p4UWdquwG4JO+sCTFY4C9LDpRN/cc7YzCMXUb +L7BTbmjEDhKUZjUxnyIFSg1MnPepolt8sMRNSnYG4bRiRUhOyfHxIVRv4KPX+R0rmvk 0kQaVNHSIT5CvZJi5mpmDFy6oAKXMhVwVOTKI+8oKKvHyST6B1WNuaOFP2qYGdi/TfPl U7Hg== X-Gm-Message-State: AOAM531FcJPPfGmraiUhQBiQsFRq3Z/emq0fDRHkM1O/q9pjJD101RNo 9R+1f1q8dnj+9VQeDJIshVvxwmbhvfRcDQ== X-Google-Smtp-Source: ABdhPJwggVlJxIcghbbQ0FAUMfivlp1ioa7vWaXe753RTqgTpnZzbydimaes08qspNIJUlT30HDruQ== X-Received: by 2002:a17:906:35da:: with SMTP id p26mr31810067ejb.256.1605857118144; Thu, 19 Nov 2020 23:25: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.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:17 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:41 +0100 Message-Id: <20201120072116.818090-69-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 068/162] avcodec/qdm2: Avoid offsets table 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/qdm2_tablegen.h | 42 ++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h index 2ae8449c14..ca47fea2dc 100644 --- a/libavcodec/qdm2_tablegen.h +++ b/libavcodec/qdm2_tablegen.h @@ -109,46 +109,44 @@ static VLC vlc_tab_type30; static VLC vlc_tab_type34; static VLC vlc_tab_fft_tone_offset[5]; -static const uint16_t qdm2_vlc_offs[] = { - 0,260,566,598,894,1166,1230,1294,1678,1950,2214,2278,2310,2570,2834,3124,3448,3838, -}; - static VLC_TYPE qdm2_table[3838][2]; -static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, int idx, - const uint8_t tab[][2]) +static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, + unsigned *offset, const uint8_t tab[][2]) { - vlc->table = &qdm2_table[qdm2_vlc_offs[idx]]; - vlc->table_allocated = qdm2_vlc_offs[idx + 1] - qdm2_vlc_offs[idx]; + vlc->table = &qdm2_table[*offset]; + vlc->table_allocated = FF_ARRAY_ELEMS(qdm2_table) - *offset; ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, &tab[0][1], 2, &tab[0][0], 2, 1, - -1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE, NULL); + -1, INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE, NULL); + *offset += vlc->table_size; } static av_cold void qdm2_init_vlc(void) { const uint8_t (*tab)[2] = tab_fft_tone_offset; + unsigned offset = 0; - build_vlc(&vlc_tab_level, 8, 24, 0, tab_level); - build_vlc(&vlc_tab_diff, 8, 33, 1, tab_diff); - build_vlc(&vlc_tab_run, 5, 6, 2, tab_run); + build_vlc(&vlc_tab_level, 8, 24, &offset, tab_level); + build_vlc(&vlc_tab_diff, 8, 33, &offset, tab_diff); + build_vlc(&vlc_tab_run, 5, 6, &offset, tab_run); - build_vlc(&fft_level_exp_alt_vlc, 8, 28, 3, fft_level_exp_alt); - build_vlc(&fft_level_exp_vlc, 8, 20, 4, fft_level_exp); + build_vlc(&fft_level_exp_alt_vlc, 8, 28, &offset, fft_level_exp_alt); + build_vlc(&fft_level_exp_vlc, 8, 20, &offset, fft_level_exp); - build_vlc(&fft_stereo_exp_vlc, 6, 7, 5, fft_stereo_exp); - build_vlc(&fft_stereo_phase_vlc, 6, 9, 6, fft_stereo_phase); + build_vlc(&fft_stereo_exp_vlc, 6, 7, &offset, fft_stereo_exp); + build_vlc(&fft_stereo_phase_vlc, 6, 9, &offset, fft_stereo_phase); - build_vlc(&vlc_tab_tone_level_idx_hi1, 8, 20, 7, tab_tone_level_idx_hi1); - build_vlc(&vlc_tab_tone_level_idx_mid, 8, 13, 8, tab_tone_level_idx_mid); - build_vlc(&vlc_tab_tone_level_idx_hi2, 8, 18, 9, tab_tone_level_idx_hi2); + build_vlc(&vlc_tab_tone_level_idx_hi1, 8, 20, &offset, tab_tone_level_idx_hi1); + build_vlc(&vlc_tab_tone_level_idx_mid, 8, 13, &offset, tab_tone_level_idx_mid); + build_vlc(&vlc_tab_tone_level_idx_hi2, 8, 18, &offset, tab_tone_level_idx_hi2); - build_vlc(&vlc_tab_type30, 6, 9, 10, tab_type30); - build_vlc(&vlc_tab_type34, 5, 10, 11, tab_type34); + build_vlc(&vlc_tab_type30, 6, 9, &offset, tab_type30); + build_vlc(&vlc_tab_type34, 5, 10, &offset, tab_type34); for (int i = 0; i < 5; i++) { build_vlc(&vlc_tab_fft_tone_offset[i], 8, tab_fft_tone_offset_sizes[i], - 12 + i, tab); + &offset, tab); tab += tab_fft_tone_offset_sizes[i]; } } From patchwork Fri Nov 20 07:19:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23823 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 DE1A244B51D for ; Fri, 20 Nov 2020 09:37:02 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CB3D668BBB2; Fri, 20 Nov 2020 09:25:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C60F768BA9A for ; Fri, 20 Nov 2020 09:25:19 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id q3so8444876edr.12 for ; Thu, 19 Nov 2020 23:25:19 -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=jh1YmNpcxjkwTgXr3Q0br5qSJT8IGboNZPUqWwDi8Y4=; b=hzTsSiUQ1e+3PpN7NoYooPCee6aj9u/6AMPJazxyNeSjyt5aLP0Ps5kyK/0D7mp8mo 5KeV3TBv6ioL6/Ndsh6X3nr1xze1kgk997Njo/raSRk0QU/pj8rtFZ9S1+XiC7V1c6Pk OcTKIBUHYcEG/bx7QVcG31GojRLCIEWp9j1Brlyc8cO+2RWN7FME6NZ5K72laICIPpxR 1eyJ/F0P01rpx7wKWV5cuw4umCFRvB14oEI4fQCY+hpNMzJpcDt+03T6NCfjaA8SCeZk A3rnAjmW/NQYBb5Weoumn2x5uk2odge9emr7dRenHHITEcgop/qDCsUTYs/bK8XqKbN/ lKRQ== 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=jh1YmNpcxjkwTgXr3Q0br5qSJT8IGboNZPUqWwDi8Y4=; b=nW6oll85lM4SgRCtsvzbSvavDO8xB+v9EJUZ4SlGGvYpLxgD2ajXsvX+OEWhxSZJV/ kJ7SqqidwfJmv6XWqFLxD08emaMwbcUmEihjLHOXxizA/G70+4kUJE6Bd/CA3ZBi4C3B ozBA1g6+spvghKaNuHvZUU5gTQ42FZV+qxvFAAMWbM68OmvtWf7NmNZIR+KzGCmPZijD E1uQFfv0n+OUj3zvHHlfwf/Sk7ts/u4mtMl+jWM68FahxkZY7ltKw2yzeZ0VDMWIonPB 5ngPxDzu8LSwDRrPzl/JszCEXfPvA5o7ShuFGEZEAqCDfNowbNUbJL5+/5V9Mu9cKDtI wzLw== X-Gm-Message-State: AOAM533AgVGxeCI7vdnj4QVg0hTBJObpLP8ER08kQR3N3vtVbt70vsAd v0C79npHFoFaE4JXqnexo3YB0sJxcgZBdA== X-Google-Smtp-Source: ABdhPJxHxEez/M7FlPts0KDTZiF84fHNthC4VaFeID08BNj6YTzL4zAq6fq3DCp0fj5YV7EFRCdPmQ== X-Received: by 2002:aa7:d34e:: with SMTP id m14mr33180486edr.42.1605857119046; Thu, 19 Nov 2020 23:25:19 -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.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:18 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:42 +0100 Message-Id: <20201120072116.818090-70-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 069/162] avcodec/qdm2: Make decoder init-threadsafe 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/qdm2.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index f2e78c3fa2..b1465750c2 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -36,6 +36,7 @@ #include #include "libavutil/channel_layout.h" +#include "libavutil/thread.h" #define BITSTREAM_READER_LE #include "avcodec.h" @@ -1598,19 +1599,12 @@ static void qdm2_synthesis_filter(QDM2Context *q, int index) * @param q context */ static av_cold void qdm2_init_static_data(void) { - static int done; - - if(done) - return; - qdm2_init_vlc(); softclip_table_init(); rnd_table_init(); init_noise_samples(); ff_mpa_synth_init_float(); - - done = 1; } /** @@ -1618,12 +1612,11 @@ static av_cold void qdm2_init_static_data(void) { */ static av_cold int qdm2_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; QDM2Context *s = avctx->priv_data; int tmp_val, tmp, size; GetByteContext gb; - qdm2_init_static_data(); - /* extradata parsing Structure: @@ -1769,6 +1762,8 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx) avctx->sample_fmt = AV_SAMPLE_FMT_S16; + ff_thread_once(&init_static_once, qdm2_init_static_data); + return 0; } @@ -1885,4 +1880,5 @@ AVCodec ff_qdm2_decoder = { .close = qdm2_decode_close, .decode = qdm2_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Fri Nov 20 07:19:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23824 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 AC75544B3D1 for ; Fri, 20 Nov 2020 09:37:13 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B97F668BAF3; Fri, 20 Nov 2020 09:25:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ABA1268BB75 for ; Fri, 20 Nov 2020 09:25:20 +0200 (EET) Received: by mail-ed1-f66.google.com with SMTP id t9so8472028edq.8 for ; Thu, 19 Nov 2020 23:25:20 -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=YHVTd3CAH6R3GFwvbL5rjxC18+BYoK7z/qdEwmT442k=; b=GAlJDrMxzcuvnfBwEnpoIQdxK2m54kig6U68LgcCg4EbMhSdNswcgjhmHKDsx2PbuE 1WDN8g8wi7GL9ZMrWVbVl1SqK7g9YSRiZoRJohm+MnEBUt8UPB3qhqgwLYjA2Tn6dex8 Mb9Szhl9xV2yVLcmh4eORlfK9cTEckvYh9wFU7YVndth/Cm2IddYbWra49PsYn5Hu/Wp Wv2WWJfONBO7cyP96m1l62SNImRu0319iQiitmNXoX+86r8Fo1GBSlXmxwYdOdEgD0tE dIISvUdV3PL4+sKTe8kG5UCdwAEaPq95lC/A0bY3RZRqA5CryaXK5JOOHO/UGiSxUdIq XyJQ== 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=YHVTd3CAH6R3GFwvbL5rjxC18+BYoK7z/qdEwmT442k=; b=QIrEW6daPIji2B9XpHZYEmG4o30mi3U144VYKa+wpAki1Mz/w78VmRD/ZopQA9444e ldDSE2CB+n69sewzqvT6Ingupc+luYNCXR0gCNOP3Zdi//ElzWo8mvx3dEA8k0rItwTu vk/scS3U+AY8EkmBbkjVvVhBmp479w0xjkhp2YGtal5wq5GOu0x5tbIoujo3shQzxw5c pVcoddV8PhwDwVnlrxMqjnGxWhLZwt0NgbXjChWATvO+dXYx2SYVlrTOKlI+WIE5J67y OYOH25V5MxuddSMB3NsmOXGBS67fYnblISJ/YsdkENlM/FwScLOlz8rHyt12cugi+/wc wBlQ== X-Gm-Message-State: AOAM533ds+4nCSEyuL67zy642ry1Fqyv8pHBo0vaG0TPwkFKaWSycIIL GnkWOwZpytOUkp/VVExwME82rE8pXDOd+Q== X-Google-Smtp-Source: ABdhPJx4I9Czm/Kjx/v3vn4G6ncaPaHLX3x/gg+ksZD7ekRdXwDvgZASU9Kt/ZGP3U3VpSCKFzuMLQ== X-Received: by 2002:a05:6402:559:: with SMTP id i25mr36819253edx.128.1605857119956; Thu, 19 Nov 2020 23:25:19 -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.25.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:19 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:43 +0100 Message-Id: <20201120072116.818090-71-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 070/162] avcodec/qdm2: Remove outdated comment 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" Forgotten in f054e309c58894450a5d18cce9799ef58aab9f14. Signed-off-by: Andreas Rheinhardt --- libavcodec/qdm2.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index b1465750c2..fbc4c0cfdd 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1595,8 +1595,6 @@ static void qdm2_synthesis_filter(QDM2Context *q, int index) /** * Init static data (does not depend on specific file) - * - * @param q context */ static av_cold void qdm2_init_static_data(void) { qdm2_init_vlc(); From patchwork Fri Nov 20 07:19:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23825 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 6BF0C4489CB for ; Fri, 20 Nov 2020 09:37:24 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A208D68BBD5; Fri, 20 Nov 2020 09:25:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B296E68BB7C for ; Fri, 20 Nov 2020 09:25:21 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id i19so11473013ejx.9 for ; Thu, 19 Nov 2020 23:25: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:reply-to :mime-version:content-transfer-encoding; bh=OMMeiBWr4E7o0Yi5ZGh4lDiy4V1jsrDbUiYAp46X0Js=; b=aEXSRNx9JmIFqfdQY2g0EksEw3N1tYPWyhPWt8mZx8NaySL0gqW1k+QIyc6LwgJB5L IdlrhxOjuAWtltCLN9i45uhzqLnw+O+fDKxlUFVO7PEwd4OgN/H8YM/OWsB585xj13s6 v60gT+V00n4yvgnkit05lJlSNUgJl/fD4XYP/FSKahu0SsttBKZdSJ0DRMLxhQMqorwu iYg6jvLq7Fd/O5FdE+Z2DSXi3+qln0zTQ0bYvEVFTgHVv76HxXWGKnk1kw6fPLRTXyMq y7xUd0FyuK3K/Uo36nSrtZC0/jmHCojzzdr3ghIVDK8yeV1JNA9tS3rmjbadnh1/ewRF O89w== 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=OMMeiBWr4E7o0Yi5ZGh4lDiy4V1jsrDbUiYAp46X0Js=; b=EZIy3aBteQYPraeFnH9tJgwBNTKTBr7XhSGh0d1a/5aw1RQVbWVfvoxMqaFpxopSrN 9MbhtcW8O6+rA7Cy88rot3NZvtCQGYEe95V1/KguObP8DctmBTc2SlGwlEa1zKeocwdn xkHDXVEm8zWXYOWMQ1yVI4/+Gn8Xd81S51/hNFLW2F233OUyIJGwBxlPuaHSSRJCmCPS xi6aJDjoU7PUuNnIBlCwnub/U64+BcKHX15STc1U26v3nSS4ZzgFMfzUUa7bAqcI3BJV qzHMXkSwUqibsYukZrXsUkRu6hoTOY8YRqbAUEbrDp74UbxXXmop7pYi1Qj6/enUk1li rpCQ== X-Gm-Message-State: AOAM533TGgQoGADL1gE017xoaARiT8p9/IBxDfmwHJpRgynqzdDZ2t9X Me1rAtl5WgYtuhCd7ObPvTO2K8n60vADNQ== X-Google-Smtp-Source: ABdhPJyrm8WvUU4M45DeZ2Bz4LsF59dt/fK/SlXNxZVbvVbYQ88yAV5QY6e7FSjev5Yc7n6opcy0mQ== X-Received: by 2002:a17:906:13cd:: with SMTP id g13mr33375767ejc.394.1605857120927; Thu, 19 Nov 2020 23:25:20 -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.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:20 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:44 +0100 Message-Id: <20201120072116.818090-72-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 071/162] avcodec/rv40vlc2: 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/rv40vlc2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/rv40vlc2.h b/libavcodec/rv40vlc2.h index 15119a145b..4cdc7a4193 100644 --- a/libavcodec/rv40vlc2.h +++ b/libavcodec/rv40vlc2.h @@ -33,7 +33,7 @@ * codes used for the first four block types */ //@{ -#define AIC_TOP_BITS 8 +#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, From patchwork Fri Nov 20 07:19: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: 23826 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 2C0254489CB for ; Fri, 20 Nov 2020 09:37:35 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7E03968BBDA; Fri, 20 Nov 2020 09:25:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2816568BB8F for ; Fri, 20 Nov 2020 09:25:24 +0200 (EET) Received: by mail-ed1-f43.google.com with SMTP id v22so8465041edt.9 for ; Thu, 19 Nov 2020 23:25:24 -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=wpB458t4nhRCAOK6JbKstTKmoaxBbtAmDVcC4kjgZXk=; b=Z5JvlQFQhPWkYteEBit043jAzu1C0zEzo8TuUHGbh+zxOX5+hMjY8TIXbaR4NbpI+C 3m5d/JQufyHfHghuGB75QNStioSGEHQ3V1+bb4lNZGAP2SwGYxcmXrG5aL4FUVyAQnEl qi1ct21sm/j/7FOApodk+l+Kyy51A/LdvAI19BLvTkaKm6WbehWvOcdLQ6RdWMKW4Mkn 9OuaFT+dNUUjrpCta0dM//y5D7nMJzt9roIp/O7cNPRppLHM9GhX5FtkDnAqFbrGA0v2 8kZ/QQixXqTxJjDxR1ww3CgKyhiv/jkpE8tRvFTg/4vvcnKwzAto73blHiuk8FgY6n7u 8fqA== 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=wpB458t4nhRCAOK6JbKstTKmoaxBbtAmDVcC4kjgZXk=; b=emy3fCtVGhHOd6aeadNmbh0gMQ02cTOPTEcX94MAZLMZ0JWpFw8KZNMoL+QyUjayu0 Y88JMkPhmUBMr+itvw6jdmqTGn1RduiyzrJOtIk+Bv3nIVJdAXniP1xOZUyU9FHzu/ol Az/M5zDLHucj3DHUAYCQ/FQ/vnLzYPl9+YjkzXAfAvFBfBvdr4sGVGIm2RxsrFOk+RUi Rn0cVB4XzHhILbuKyMEJG+IzTxDFvURX+bIo6MPukIDYxxMJ4UXI6+l/2JHuXPz+TVxI kFdDmKf8a6pXJLH3IM+xYsZ9bpGl8kC0s8h6W+hApvlxGzcgsW1LXFn3ZfVmXuHzE5bj 3J7A== X-Gm-Message-State: AOAM532B2KiEm1D35KkRf6/zeD7ly7E0XmYh117fu7snN6Y6JHshMzkN hjBMX+PcSRdSrZmkYgVbv2KLFJyLGxLavg== X-Google-Smtp-Source: ABdhPJyypR28oQZW9PFWQ5mDkOiQ5Pj60s5oHC4qoZAMPZRRDwGCWeP3QlesmTAFZEjJjy0/K1YofQ== X-Received: by 2002:aa7:d54b:: with SMTP id u11mr35306375edr.341.1605857122074; Thu, 19 Nov 2020 23:25:22 -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.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:21 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:45 +0100 Message-Id: <20201120072116.818090-73-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 072/162] avcodec/rv40: Make the tables used to initialize VLCs 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" After permuting the codes, symbols and lengths tables used to initialize the VLC so that the codes are ordered from left to right in the Huffman tree, the codes become redundant as they can be easily computed from the lengths at runtime; in this case one has to use explicit symbol tables, but all the symbols used here fit into an uint8_t, whereas some codes needed uint16_t. This saves about 1.6KB. Signed-off-by: Andreas Rheinhardt --- libavcodec/rv40.c | 23 +- libavcodec/rv40vlc2.h | 754 +++++++++++++++++++----------------------- 2 files changed, 361 insertions(+), 416 deletions(-) diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c index 462024c81e..4ecee930ff 100644 --- a/libavcodec/rv40.c +++ b/libavcodec/rv40.c @@ -73,25 +73,26 @@ static av_cold void rv40_init_tables(void) for(i = 0; i < AIC_MODE2_NUM; i++){ aic_mode2_vlc[i].table = &aic_mode2_table[mode2_offs[i]]; aic_mode2_vlc[i].table_allocated = mode2_offs[i + 1] - mode2_offs[i]; - init_vlc(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE, - aic_mode2_vlc_bits[i], 1, 1, - aic_mode2_vlc_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE, + aic_mode2_vlc_bits[i], 1, + aic_mode2_vlc_syms[i], 1, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); } 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_sparse(&ptype_vlc[i], PTYPE_VLC_BITS, PTYPE_VLC_SIZE, - ptype_vlc_bits[i], 1, 1, - ptype_vlc_codes[i], 1, 1, - ptype_vlc_syms, 1, 1, INIT_VLC_USE_NEW_STATIC); + 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, NULL); } 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_sparse(&btype_vlc[i], BTYPE_VLC_BITS, BTYPE_VLC_SIZE, - btype_vlc_bits[i], 1, 1, - btype_vlc_codes[i], 1, 1, - btype_vlc_syms, 1, 1, INIT_VLC_USE_NEW_STATIC); + 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, NULL); } } diff --git a/libavcodec/rv40vlc2.h b/libavcodec/rv40vlc2.h index 4cdc7a4193..58974f6451 100644 --- a/libavcodec/rv40vlc2.h +++ b/libavcodec/rv40vlc2.h @@ -53,370 +53,330 @@ static const uint8_t rv40_aic_top_vlc_bits[AIC_TOP_SIZE] = { #define AIC_MODE2_SIZE 81 #define AIC_MODE2_BITS 9 -static const uint16_t aic_mode2_vlc_codes[AIC_MODE2_NUM][AIC_MODE2_SIZE] = { -{ 0x0001, 0x0001, 0x0005, 0x01F5, 0x0011, 0x0049, 0x0000, 0x0048, 0x004B, - 0x0035, 0x0003, 0x0034, 0x03C9, 0x01F4, 0x00C9, 0x004A, 0x0FD9, 0x03C8, - 0x0010, 0x0037, 0x0001, 0x00C8, 0x0075, 0x01F7, 0x00CB, 0x0074, 0x0002, - 0x01F6, 0x00CA, 0x01F1, 0x01F0, 0x1F81, 0x07F9, 0x1F80, 0x1F83, 0x07F8, - 0x0077, 0x00F5, 0x0036, 0x07FB, 0x0076, 0x1F82, 0x00F4, 0x00F7, 0x07FA, - 0x0071, 0x00F6, 0x03CB, 0x03CA, 0x0FD8, 0x00F1, 0x03F5, 0x1F8D, 0x07E5, - 0x0013, 0x0031, 0x00F0, 0x0FDB, 0x00F3, 0x07E4, 0x0030, 0x01F3, 0x07E7, - 0x03F4, 0x07E6, 0x0070, 0x3F19, 0x01F2, 0x3F18, 0x0FDA, 0x0033, 0x07E1, - 0x01FD, 0x01FC, 0x0073, 0x01FF, 0x0FC5, 0x0FC4, 0x0FC7, 0x03F7, 0x0072, }, -{ 0x0005, 0x0005, 0x0005, 0x0079, 0x0005, 0x000D, 0x001D, 0x0078, 0x0069, - 0x0004, 0x0001, 0x0007, 0x0068, 0x001C, 0x001F, 0x0004, 0x006B, 0x000C, - 0x0004, 0x001E, 0x0006, 0x006A, 0x0015, 0x000F, 0x0014, 0x0017, 0x0007, - 0x0016, 0x000E, 0x0011, 0x0009, 0x00D1, 0x00D0, 0x0181, 0x00D3, 0x007B, - 0x0010, 0x0013, 0x0004, 0x00D2, 0x0007, 0x0319, 0x0008, 0x007A, 0x00DD, - 0x0019, 0x0006, 0x000B, 0x0065, 0x00DC, 0x0012, 0x0064, 0x0180, 0x00DF, - 0x0006, 0x0018, 0x0001, 0x00DE, 0x001D, 0x00D9, 0x001B, 0x0067, 0x000A, - 0x00D8, 0x00DB, 0x001C, 0x0318, 0x00DA, 0x0635, 0x0183, 0x0000, 0x00C5, - 0x0066, 0x0061, 0x0035, 0x00C4, 0x0182, 0x0634, 0x031B, 0x00C7, 0x001F, }, -{ 0x0005, 0x0001, 0x001D, 0x01C1, 0x0035, 0x00F1, 0x006D, 0x00F0, 0x0049, - 0x0000, 0x0004, 0x0003, 0x00F3, 0x0048, 0x0034, 0x006C, 0x01C0, 0x01C3, - 0x0007, 0x0006, 0x0001, 0x006F, 0x0002, 0x004B, 0x006E, 0x001C, 0x0005, - 0x0069, 0x0068, 0x006B, 0x0037, 0x01C2, 0x00F2, 0x0395, 0x01CD, 0x00FD, - 0x006A, 0x0036, 0x0015, 0x01CC, 0x0014, 0x0394, 0x004A, 0x00FC, 0x00FF, - 0x0017, 0x0031, 0x00FE, 0x01CF, 0x0397, 0x00F9, 0x01CE, 0x0725, 0x0396, - 0x0016, 0x0030, 0x0075, 0x0724, 0x00F8, 0x0727, 0x0033, 0x0391, 0x0390, - 0x0011, 0x0032, 0x001F, 0x00FB, 0x0074, 0x0726, 0x00FA, 0x001E, 0x0077, - 0x0019, 0x0018, 0x0004, 0x0010, 0x003D, 0x0076, 0x0071, 0x0013, 0x0001, }, -{ 0x000D, 0x0019, 0x0011, 0x0015, 0x0061, 0x0019, 0x0014, 0x01AD, 0x0060, - 0x0018, 0x0001, 0x0005, 0x001B, 0x0010, 0x0019, 0x0005, 0x0017, 0x0018, - 0x0016, 0x0004, 0x0004, 0x0013, 0x000C, 0x0012, 0x001A, 0x0018, 0x0005, - 0x000F, 0x001B, 0x0004, 0x001D, 0x0011, 0x001C, 0x0010, 0x000E, 0x001B, - 0x0013, 0x001F, 0x001A, 0x0029, 0x0005, 0x0063, 0x001E, 0x0009, 0x0062, - 0x0008, 0x0007, 0x0007, 0x0019, 0x0004, 0x001A, 0x0018, 0x006D, 0x0007, - 0x001B, 0x0007, 0x001A, 0x006C, 0x0006, 0x0012, 0x0005, 0x006F, 0x000B, - 0x006E, 0x0069, 0x001D, 0x0359, 0x0028, 0x002B, 0x002A, 0x001C, 0x00D5, - 0x0358, 0x001F, 0x0001, 0x001E, 0x0068, 0x00D4, 0x00D7, 0x0019, 0x0000, }, -{ 0x00B9, 0x0061, 0x0060, 0x00B8, 0x02B5, 0x01AD, 0x00BB, 0x0AF5, 0x0151, - 0x0001, 0x0001, 0x0005, 0x0000, 0x0003, 0x0005, 0x0004, 0x0063, 0x0025, - 0x00BA, 0x0004, 0x0007, 0x0062, 0x00A5, 0x0024, 0x006D, 0x0002, 0x006C, - 0x02B4, 0x000D, 0x006F, 0x0027, 0x00A4, 0x0026, 0x01AC, 0x0150, 0x01AF, - 0x01AE, 0x0021, 0x006E, 0x02B7, 0x0020, 0x0153, 0x0023, 0x00A7, 0x0152, - 0x00A6, 0x0006, 0x000C, 0x0022, 0x01A9, 0x0019, 0x002D, 0x02B6, 0x01A8, - 0x000F, 0x0007, 0x000E, 0x00A1, 0x0069, 0x002C, 0x0001, 0x01AB, 0x00A0, - 0x02B1, 0x00A3, 0x002F, 0x0AF4, 0x02B0, 0x0AF7, 0x02B3, 0x0068, 0x015D, - 0x0AF6, 0x01AA, 0x0055, 0x015C, 0x02B2, 0x0579, 0x0578, 0x015F, 0x00A2, }, -{ 0x0905, 0x013D, 0x013C, 0x0904, 0x121D, 0x049D, 0x049C, 0x243D, 0x0907, - 0x00ED, 0x0001, 0x0015, 0x0041, 0x013F, 0x0031, 0x0014, 0x025D, 0x025C, - 0x013E, 0x000D, 0x0000, 0x0040, 0x0139, 0x0043, 0x0030, 0x0017, 0x0033, - 0x0906, 0x0032, 0x0042, 0x00EC, 0x025F, 0x00EF, 0x025E, 0x049F, 0x0138, - 0x0901, 0x013B, 0x0259, 0x121C, 0x049E, 0x0900, 0x0258, 0x243C, 0x121F, - 0x0903, 0x003D, 0x00EE, 0x025B, 0x025A, 0x004D, 0x013A, 0x0902, 0x0245, - 0x00E9, 0x0016, 0x00E8, 0x0499, 0x0125, 0x0244, 0x004C, 0x0498, 0x090D, - 0x00EB, 0x003C, 0x0011, 0x049B, 0x049A, 0x0485, 0x00EA, 0x003F, 0x0124, - 0x090C, 0x003E, 0x0039, 0x0095, 0x0247, 0x0246, 0x0484, 0x0094, 0x0038, }, -{ 0x0F09, 0x00CD, 0x01FD, 0x0791, 0x1E6D, 0x0790, 0x03D9, 0x3CD1, 0x3CD0, - 0x0075, 0x0001, 0x0001, 0x0035, 0x00CC, 0x0011, 0x0000, 0x03D8, 0x01FC, - 0x03DB, 0x0010, 0x0003, 0x00CF, 0x03DA, 0x00CE, 0x0074, 0x0034, 0x0077, - 0x0793, 0x0013, 0x0076, 0x0071, 0x03C5, 0x0070, 0x01FF, 0x0792, 0x01FE, - 0x01F9, 0x0037, 0x00C9, 0x0F08, 0x01F8, 0x03C4, 0x00C8, 0x0F0B, 0x079D, - 0x03C7, 0x0001, 0x0012, 0x0073, 0x00CB, 0x0005, 0x0036, 0x03C6, 0x0072, - 0x007D, 0x0002, 0x00CA, 0x079C, 0x01FB, 0x00F5, 0x0031, 0x079F, 0x0F0A, - 0x0F35, 0x079E, 0x01FA, 0x1E6C, 0x1E6F, 0x3CD3, 0x0799, 0x03C1, 0x1E6E, - 0x3CD2, 0x0030, 0x00F4, 0x007C, 0x03C0, 0x03C3, 0x0798, 0x01E5, 0x00F7, }, -{ 0x01A5, 0x0001, 0x001D, 0x0021, 0x00A1, 0x000D, 0x0061, 0x06B9, 0x00A0, - 0x0060, 0x0001, 0x0005, 0x000C, 0x0020, 0x001C, 0x0004, 0x01A4, 0x01A7, - 0x00A3, 0x001F, 0x001E, 0x0023, 0x0022, 0x002D, 0x002C, 0x0063, 0x0062, - 0x1A81, 0x01A6, 0x01A1, 0x06B8, 0x06BB, 0x00A2, 0x06BA, 0x0D59, 0x06A5, - 0x01A0, 0x000F, 0x006D, 0x06A4, 0x002F, 0x00AD, 0x006C, 0x06A7, 0x00AC, - 0x0D58, 0x000E, 0x01A3, 0x00AF, 0x00AE, 0x006F, 0x01A2, 0x0D5B, 0x00A9, - 0x0019, 0x0001, 0x0009, 0x00A8, 0x006E, 0x002E, 0x0000, 0x01AD, 0x00AB, - 0x00AA, 0x0355, 0x0029, 0x1A80, 0x1A83, 0x1A82, 0x0354, 0x01AC, 0x0D5A, - 0x1A8D, 0x01AF, 0x0357, 0x0D45, 0x0D44, 0x0D47, 0x1A8C, 0x06A6, 0x06A1, }, -{ 0x0001, 0x0011, 0x0005, 0x0775, 0x00F9, 0x00F8, 0x0031, 0x0030, 0x0049, - 0x00FB, 0x0010, 0x0033, 0x0EC9, 0x038D, 0x038C, 0x00FA, 0x038F, 0x0774, - 0x0048, 0x0032, 0x0000, 0x01D5, 0x00E5, 0x038E, 0x00E4, 0x0013, 0x000D, - 0x0389, 0x0777, 0x0388, 0x038B, 0x1DF9, 0x0EC8, 0x3BC9, 0x1DF8, 0x038A, - 0x03B5, 0x0776, 0x00E7, 0x3BC8, 0x01D4, 0x3BCB, 0x0ECB, 0x0771, 0x0ECA, - 0x01D7, 0x03B4, 0x01D6, 0x1DFB, 0x0EF5, 0x0770, 0x0EF4, 0x3BCA, 0x0773, - 0x00E6, 0x03B7, 0x004B, 0x1DFA, 0x03B6, 0x0EF7, 0x00E1, 0x0EF6, 0x0EF1, - 0x03B1, 0x01D1, 0x003D, 0x0EF0, 0x0772, 0x077D, 0x077C, 0x003C, 0x01D0, - 0x03B0, 0x01D3, 0x003F, 0x03B3, 0x01D2, 0x0EF3, 0x077F, 0x00E0, 0x004A, }, -{ 0x0015, 0x0049, 0x0014, 0x07D1, 0x03FD, 0x03FC, 0x01C1, 0x01C0, 0x00F1, - 0x0017, 0x0001, 0x0001, 0x01C3, 0x0048, 0x004B, 0x0016, 0x0031, 0x01C2, - 0x004A, 0x0011, 0x0000, 0x01CD, 0x00F0, 0x01CC, 0x0075, 0x0010, 0x000D, - 0x03FF, 0x01CF, 0x01CE, 0x07D0, 0x0F81, 0x07D3, 0x1F1D, 0x0F80, 0x07D2, - 0x01C9, 0x03FE, 0x0074, 0x07DD, 0x00F3, 0x1F1C, 0x07DC, 0x03F9, 0x07DF, - 0x00F2, 0x00FD, 0x0077, 0x07DE, 0x07D9, 0x01C8, 0x07D8, 0x0F83, 0x03F8, - 0x0030, 0x0076, 0x0013, 0x0F82, 0x00FC, 0x03FB, 0x0033, 0x03FA, 0x03E5, - 0x03E4, 0x01CB, 0x0032, 0x1F1F, 0x03E7, 0x07DB, 0x07DA, 0x003D, 0x01CA, - 0x07C5, 0x03E6, 0x0071, 0x0F8D, 0x07C4, 0x1F1E, 0x0F8C, 0x03E1, 0x01F5, }, -{ 0x0019, 0x0065, 0x0018, 0x0351, 0x0350, 0x0353, 0x0021, 0x0020, 0x0064, - 0x001D, 0x0005, 0x0005, 0x01A5, 0x0023, 0x0067, 0x0005, 0x0066, 0x0022, - 0x001B, 0x0004, 0x0001, 0x0004, 0x001C, 0x0061, 0x001A, 0x0005, 0x0004, - 0x0007, 0x002D, 0x0006, 0x002C, 0x01A4, 0x002F, 0x0352, 0x035D, 0x0060, - 0x0001, 0x002E, 0x001F, 0x035C, 0x0000, 0x06B1, 0x01A7, 0x0029, 0x01A6, - 0x0028, 0x0063, 0x0062, 0x035F, 0x01A1, 0x002B, 0x06B0, 0x06B3, 0x01A0, - 0x0003, 0x006D, 0x001E, 0x035E, 0x006C, 0x06B2, 0x0002, 0x01A3, 0x01A2, - 0x000D, 0x0005, 0x0007, 0x01AD, 0x006F, 0x002A, 0x006E, 0x0004, 0x0004, - 0x000C, 0x0007, 0x0006, 0x000F, 0x000E, 0x00D5, 0x0009, 0x0006, 0x0007, }, -{ 0x0065, 0x0181, 0x0064, 0x36C9, 0x06D5, 0x0DB5, 0x0379, 0x0180, 0x0183, - 0x00D5, 0x001D, 0x001C, 0x0DB4, 0x0182, 0x0378, 0x00D4, 0x00D7, 0x06D4, - 0x0067, 0x001F, 0x0001, 0x00D6, 0x00D1, 0x018D, 0x0066, 0x0001, 0x0000, - 0x037B, 0x06D7, 0x037A, 0x0DB7, 0x36C8, 0x06D6, 0x0DB6, 0x1B79, 0x0DB1, - 0x018C, 0x0365, 0x00D0, 0x1B78, 0x00D3, 0x1B7B, 0x0364, 0x06D1, 0x06D0, - 0x018F, 0x018E, 0x00D2, 0x36CB, 0x0367, 0x0366, 0x06D3, 0x0DB0, 0x06D2, - 0x0361, 0x06DD, 0x0189, 0x36CA, 0x0360, 0x36F5, 0x0188, 0x0DB3, 0x36F4, - 0x0009, 0x0008, 0x0005, 0x06DC, 0x00DD, 0x018B, 0x00DC, 0x0004, 0x000B, - 0x018A, 0x0061, 0x0003, 0x0363, 0x00DF, 0x06DF, 0x0362, 0x000A, 0x001E, }, -{ 0x001D, 0x0061, 0x000D, 0x0D55, 0x06B9, 0x06B8, 0x01A5, 0x0021, 0x0020, - 0x0023, 0x000C, 0x0060, 0x0D54, 0x00AD, 0x00AC, 0x0022, 0x00AF, 0x06BB, - 0x000F, 0x001C, 0x0001, 0x002D, 0x0063, 0x01A4, 0x000E, 0x0001, 0x0005, - 0x01A7, 0x06BA, 0x01A6, 0x06A5, 0x0D57, 0x0D56, 0x1ABD, 0x0D51, 0x00AE, - 0x002C, 0x00A9, 0x002F, 0x0D50, 0x01A1, 0x1ABC, 0x06A4, 0x06A7, 0x06A6, - 0x00A8, 0x06A1, 0x01A0, 0x1ABF, 0x0D53, 0x06A0, 0x0D52, 0x1ABE, 0x06A3, - 0x0062, 0x002E, 0x0009, 0x0D5D, 0x01A3, 0x0D5C, 0x006D, 0x00AB, 0x06A2, - 0x006C, 0x001F, 0x0001, 0x06AD, 0x0029, 0x01A2, 0x0028, 0x0004, 0x001E, - 0x01AD, 0x006F, 0x0000, 0x01AC, 0x01AF, 0x06AC, 0x00AA, 0x006E, 0x0019, }, -{ 0x0019, 0x007D, 0x0018, 0x01B5, 0x000D, 0x01B4, 0x007C, 0x007F, 0x01B7, - 0x000C, 0x001B, 0x001A, 0x01B6, 0x000F, 0x00D5, 0x0019, 0x007E, 0x00D4, - 0x0018, 0x001B, 0x0001, 0x000E, 0x0011, 0x0009, 0x0005, 0x0005, 0x0005, - 0x00D7, 0x01B1, 0x0008, 0x01B0, 0x0079, 0x06FD, 0x0371, 0x0370, 0x00D6, - 0x0078, 0x01B3, 0x0010, 0x0373, 0x0013, 0x06FC, 0x007B, 0x007A, 0x00D1, - 0x00D0, 0x00D3, 0x0065, 0x0372, 0x06FF, 0x0064, 0x06FE, 0x037D, 0x00D2, - 0x00DD, 0x0067, 0x0004, 0x037C, 0x0012, 0x01B2, 0x0007, 0x0066, 0x01BD, - 0x0006, 0x0061, 0x0004, 0x01BC, 0x001A, 0x0060, 0x001D, 0x0004, 0x001C, - 0x0063, 0x0001, 0x0007, 0x000B, 0x0000, 0x0062, 0x000A, 0x0005, 0x0007, }, -{ 0x0069, 0x0045, 0x0068, 0x04BD, 0x0255, 0x04BC, 0x00E5, 0x00E4, 0x0031, - 0x0030, 0x0019, 0x0001, 0x0121, 0x00E7, 0x00E6, 0x0033, 0x00E1, 0x00E0, - 0x006B, 0x0018, 0x0001, 0x0044, 0x0032, 0x0047, 0x006A, 0x001B, 0x0005, - 0x003D, 0x0046, 0x0015, 0x0041, 0x0120, 0x0123, 0x04BF, 0x0122, 0x0040, - 0x003C, 0x00E3, 0x0014, 0x0254, 0x0043, 0x0975, 0x012D, 0x00E2, 0x00ED, - 0x0042, 0x00EC, 0x004D, 0x0257, 0x0256, 0x0251, 0x04BE, 0x0974, 0x0250, - 0x00EF, 0x00EE, 0x004C, 0x04B9, 0x012C, 0x04B8, 0x004F, 0x04BB, 0x0253, - 0x003F, 0x0017, 0x0001, 0x0252, 0x00E9, 0x00E8, 0x00EB, 0x0000, 0x0003, - 0x0016, 0x0002, 0x0004, 0x004E, 0x003E, 0x00EA, 0x0049, 0x000D, 0x0007, }, -{ 0x000D, 0x01BD, 0x000C, 0x0D31, 0x0D30, 0x0D33, 0x0359, 0x0358, 0x002D, - 0x0065, 0x001D, 0x001C, 0x0D32, 0x035B, 0x035A, 0x002C, 0x01BC, 0x0345, - 0x000F, 0x001F, 0x0001, 0x002F, 0x0064, 0x01BF, 0x0067, 0x0001, 0x0005, - 0x0066, 0x002E, 0x0061, 0x0029, 0x0695, 0x0694, 0x0697, 0x0696, 0x0060, - 0x01BE, 0x0D3D, 0x0028, 0x1A49, 0x0344, 0x1A48, 0x1A4B, 0x0D3C, 0x0691, - 0x002B, 0x01B9, 0x002A, 0x0D3F, 0x0690, 0x0347, 0x0D3E, 0x1A4A, 0x0346, - 0x00D5, 0x0341, 0x0063, 0x0D39, 0x0340, 0x0D38, 0x01B8, 0x0D3B, 0x0D3A, - 0x00D4, 0x0062, 0x0000, 0x0693, 0x01BB, 0x0343, 0x0342, 0x001E, 0x000E, - 0x006D, 0x0009, 0x0001, 0x006C, 0x00D7, 0x034D, 0x01BA, 0x0008, 0x0004, }, -{ 0x0075, 0x00CD, 0x0035, 0x03C1, 0x03C0, 0x07F9, 0x03C3, 0x1F8D, 0x00CC, - 0x0074, 0x0011, 0x0010, 0x03C2, 0x0FD9, 0x01F1, 0x00CF, 0x03CD, 0x00CE, - 0x0034, 0x0001, 0x0001, 0x0037, 0x00C9, 0x00C8, 0x0036, 0x0000, 0x0001, - 0x0FD8, 0x03CC, 0x00CB, 0x01F0, 0x07F8, 0x03CF, 0x07FB, 0x07FA, 0x00CA, - 0x01F3, 0x03CE, 0x00F5, 0x0FDB, 0x00F4, 0x07E5, 0x07E4, 0x07E7, 0x01F2, - 0x07E6, 0x03C9, 0x01FD, 0x0FDA, 0x1F8C, 0x07E1, 0x1F8F, 0x1F8E, 0x03C8, - 0x03CB, 0x0077, 0x0076, 0x0FC5, 0x03CA, 0x07E0, 0x00F7, 0x0FC4, 0x03F5, - 0x00F6, 0x01FC, 0x0003, 0x03F4, 0x0071, 0x03F7, 0x00F1, 0x0013, 0x0031, - 0x0030, 0x0070, 0x0005, 0x0012, 0x0073, 0x01FF, 0x0072, 0x007D, 0x0002, }, -{ 0x0061, 0x0055, 0x0060, 0x02C9, 0x02C8, 0x02CB, 0x0171, 0x00B5, 0x0054, - 0x0001, 0x0001, 0x0001, 0x0057, 0x0001, 0x0063, 0x001D, 0x0062, 0x0039, - 0x006D, 0x0000, 0x0005, 0x0038, 0x0056, 0x00B4, 0x006C, 0x0003, 0x001C, - 0x006F, 0x003B, 0x0002, 0x003A, 0x0170, 0x00B7, 0x0173, 0x0051, 0x006E, - 0x0025, 0x0050, 0x0069, 0x02CA, 0x0024, 0x0027, 0x0172, 0x00B6, 0x00B1, - 0x000D, 0x000C, 0x001F, 0x017D, 0x0026, 0x0068, 0x0053, 0x017C, 0x006B, - 0x001E, 0x000F, 0x0004, 0x017F, 0x006A, 0x02F5, 0x0019, 0x0021, 0x0052, - 0x02F4, 0x02F7, 0x0020, 0x0BCD, 0x05E5, 0x05E4, 0x0BCC, 0x0023, 0x00B0, - 0x02F6, 0x00B3, 0x0022, 0x02F1, 0x02F0, 0x0BCF, 0x0BCE, 0x017E, 0x005D, }, -{ 0x00BD, 0x0025, 0x01A1, 0x0159, 0x0299, 0x00BC, 0x0024, 0x0505, 0x0504, - 0x01A0, 0x0001, 0x001D, 0x006D, 0x001C, 0x0001, 0x0005, 0x0027, 0x01A3, - 0x0158, 0x001F, 0x001E, 0x01A2, 0x0026, 0x0021, 0x000D, 0x0020, 0x0023, - 0x0298, 0x006C, 0x0022, 0x00BF, 0x00BE, 0x01AD, 0x002D, 0x029B, 0x00B9, - 0x01AC, 0x00B8, 0x01AF, 0x029A, 0x006F, 0x015B, 0x006E, 0x0285, 0x0284, - 0x01AE, 0x0019, 0x002C, 0x01A9, 0x01A8, 0x000C, 0x000F, 0x015A, 0x00BB, - 0x000E, 0x0000, 0x0069, 0x01AB, 0x0018, 0x01AA, 0x0004, 0x0055, 0x00BA, - 0x0507, 0x0145, 0x0054, 0x0506, 0x00A5, 0x0501, 0x00A4, 0x0057, 0x0500, - 0x0A05, 0x0144, 0x00A7, 0x0287, 0x0286, 0x0503, 0x0147, 0x0A04, 0x0146, }, -{ 0x0759, 0x0041, 0x00E5, 0x03BD, 0x0E9D, 0x012D, 0x012C, 0x3A1D, 0x03BC, - 0x012F, 0x000D, 0x0040, 0x00E4, 0x03BF, 0x0043, 0x0042, 0x0758, 0x03BE, - 0x00E7, 0x0001, 0x0000, 0x003D, 0x00E6, 0x0015, 0x0014, 0x0017, 0x003C, - 0x743D, 0x012E, 0x03B9, 0x03B8, 0x0E9C, 0x03BB, 0x075B, 0x3A1C, 0x0E9F, - 0x0129, 0x00E1, 0x0128, 0x0E9E, 0x012B, 0x075A, 0x00E0, 0x0E99, 0x0745, - 0x3A1F, 0x03BA, 0x0744, 0x0E98, 0x1D0D, 0x03A5, 0x0E9B, 0x743C, 0x0E9A, - 0x012A, 0x004D, 0x00E3, 0x0E85, 0x01D5, 0x0E84, 0x004C, 0x0747, 0x1D0C, - 0x01D4, 0x003F, 0x0016, 0x0746, 0x03A4, 0x0741, 0x004F, 0x003E, 0x01D7, - 0x0740, 0x000C, 0x0011, 0x004E, 0x00E2, 0x00ED, 0x00EC, 0x0049, 0x0048, }, +static const uint8_t aic_mode2_vlc_syms[AIC_MODE2_NUM][AIC_MODE2_SIZE] = { + { + 0x06, 0x01, 0x1A, 0x0A, 0x14, 0x12, 0x04, 0x07, 0x05, 0x0F, 0x08, 0x36, + 0x02, 0x3C, 0x37, 0x15, 0x0E, 0x1C, 0x18, 0x46, 0x0B, 0x09, 0x26, 0x13, + 0x41, 0x2D, 0x50, 0x4A, 0x19, 0x16, 0x28, 0x24, 0x38, 0x32, 0x11, 0x0C, + 0x30, 0x2F, 0x3A, 0x2A, 0x25, 0x2E, 0x2B, 0x1E, 0x1D, 0x43, 0x3D, 0x0D, + 0x03, 0x1B, 0x17, 0x21, 0x1F, 0x29, 0x22, 0x47, 0x4D, 0x4C, 0x44, 0x42, + 0x34, 0x4E, 0x3B, 0x35, 0x40, 0x3E, 0x3F, 0x33, 0x31, 0x10, 0x45, 0x39, + 0x4F, 0x49, 0x48, 0x23, 0x20, 0x2C, 0x27, 0x4B, 0x00, + }, + { + 0x46, 0x38, 0x2A, 0x1E, 0x3E, 0x2F, 0x11, 0x05, 0x1C, 0x17, 0x26, 0x04, + 0x2E, 0x28, 0x24, 0x1D, 0x32, 0x25, 0x18, 0x16, 0x1B, 0x19, 0x34, 0x21, + 0x4C, 0x45, 0x49, 0x4B, 0x47, 0x42, 0x29, 0x4D, 0x44, 0x4E, 0x4F, 0x33, + 0x30, 0x48, 0x3D, 0x20, 0x1F, 0x27, 0x22, 0x4A, 0x3F, 0x3B, 0x43, 0x40, + 0x31, 0x2C, 0x39, 0x35, 0x41, 0x3A, 0x07, 0x03, 0x2B, 0x23, 0x50, 0x12, + 0x01, 0x36, 0x1A, 0x0F, 0x02, 0x37, 0x2D, 0x0C, 0x08, 0x15, 0x10, 0x3C, + 0x0D, 0x06, 0x13, 0x0E, 0x09, 0x00, 0x14, 0x0B, 0x0A, + }, + { + 0x09, 0x01, 0x16, 0x0B, 0x50, 0x4B, 0x3F, 0x0D, 0x08, 0x2A, 0x17, 0x4F, + 0x28, 0x26, 0x36, 0x2D, 0x37, 0x2E, 0x40, 0x3C, 0x0E, 0x04, 0x25, 0x1E, + 0x10, 0x03, 0x1F, 0x11, 0x4E, 0x3E, 0x3D, 0x39, 0x34, 0x44, 0x3B, 0x29, + 0x21, 0x35, 0x31, 0x27, 0x22, 0x33, 0x30, 0x43, 0x38, 0x4D, 0x47, 0x07, + 0x05, 0x20, 0x0C, 0x4C, 0x3A, 0x32, 0x45, 0x42, 0x2B, 0x23, 0x2F, 0x2C, + 0x0A, 0x00, 0x13, 0x12, 0x4A, 0x1A, 0x49, 0x48, 0x1C, 0x1B, 0x24, 0x1D, + 0x0F, 0x06, 0x18, 0x15, 0x19, 0x02, 0x46, 0x41, 0x14, + }, + { + 0x50, 0x4A, 0x2D, 0x2B, 0x43, 0x27, 0x45, 0x44, 0x3E, 0x16, 0x00, 0x22, + 0x1B, 0x31, 0x28, 0x3A, 0x35, 0x21, 0x1F, 0x3B, 0x24, 0x06, 0x03, 0x12, + 0x10, 0x08, 0x04, 0x2C, 0x29, 0x4F, 0x4C, 0x40, 0x4D, 0x47, 0x48, 0x42, + 0x07, 0x4E, 0x39, 0x34, 0x3F, 0x3D, 0x46, 0x41, 0x4B, 0x49, 0x1D, 0x1A, + 0x11, 0x05, 0x26, 0x23, 0x2F, 0x0D, 0x02, 0x17, 0x15, 0x3C, 0x33, 0x30, + 0x38, 0x36, 0x20, 0x1E, 0x2A, 0x25, 0x13, 0x0B, 0x09, 0x01, 0x18, 0x0C, + 0x37, 0x14, 0x0F, 0x19, 0x0E, 0x32, 0x1C, 0x2E, 0x0A, + }, + { + 0x0C, 0x09, 0x19, 0x0D, 0x3C, 0x28, 0x25, 0x30, 0x2A, 0x17, 0x11, 0x20, + 0x1E, 0x3E, 0x39, 0x50, 0x40, 0x1F, 0x16, 0x2D, 0x2B, 0x22, 0x08, 0x2C, + 0x29, 0x4A, 0x43, 0x3F, 0x4C, 0x45, 0x1B, 0x04, 0x34, 0x27, 0x4B, 0x47, + 0x4E, 0x4D, 0x42, 0x07, 0x48, 0x44, 0x4F, 0x3B, 0x33, 0x03, 0x00, 0x12, + 0x06, 0x41, 0x2F, 0x1C, 0x38, 0x36, 0x13, 0x0E, 0x2E, 0x14, 0x0F, 0x0B, + 0x02, 0x01, 0x15, 0x10, 0x32, 0x46, 0x3A, 0x35, 0x31, 0x49, 0x3D, 0x21, + 0x05, 0x24, 0x23, 0x1A, 0x18, 0x26, 0x1D, 0x37, 0x0A, + }, + { + 0x14, 0x0A, 0x15, 0x0C, 0x1D, 0x17, 0x41, 0x29, 0x24, 0x34, 0x2D, 0x03, + 0x00, 0x1B, 0x08, 0x4E, 0x44, 0x48, 0x3E, 0x27, 0x04, 0x2B, 0x07, 0x2C, + 0x3B, 0x35, 0x4D, 0x4C, 0x47, 0x3A, 0x3D, 0x39, 0x43, 0x42, 0x06, 0x05, + 0x28, 0x22, 0x4F, 0x4B, 0x2A, 0x26, 0x31, 0x30, 0x11, 0x10, 0x21, 0x1F, + 0x3C, 0x32, 0x23, 0x16, 0x33, 0x25, 0x02, 0x01, 0x12, 0x0D, 0x0F, 0x0B, + 0x37, 0x19, 0x18, 0x0E, 0x1C, 0x1A, 0x13, 0x50, 0x4A, 0x38, 0x36, 0x45, + 0x3F, 0x1E, 0x09, 0x2F, 0x20, 0x40, 0x2E, 0x49, 0x46, + }, + { + 0x0F, 0x0B, 0x37, 0x14, 0x2E, 0x13, 0x0E, 0x2F, 0x1C, 0x32, 0x49, 0x3C, + 0x2A, 0x26, 0x38, 0x31, 0x0D, 0x01, 0x17, 0x15, 0x19, 0x0C, 0x33, 0x25, + 0x20, 0x1E, 0x35, 0x30, 0x18, 0x09, 0x1D, 0x1A, 0x4C, 0x46, 0x27, 0x00, + 0x3E, 0x2B, 0x4D, 0x29, 0x1F, 0x34, 0x2D, 0x05, 0x03, 0x22, 0x1B, 0x4F, + 0x4E, 0x45, 0x08, 0x07, 0x48, 0x44, 0x3F, 0x42, 0x04, 0x47, 0x43, 0x39, + 0x2C, 0x40, 0x3D, 0x4A, 0x3B, 0x10, 0x06, 0x16, 0x12, 0x50, 0x4B, 0x36, + 0x28, 0x24, 0x41, 0x3A, 0x11, 0x02, 0x23, 0x21, 0x0A, + }, + { + 0x3C, 0x01, 0x0D, 0x03, 0x16, 0x15, 0x38, 0x08, 0x04, 0x20, 0x12, 0x41, + 0x39, 0x35, 0x3F, 0x3E, 0x2C, 0x29, 0x31, 0x30, 0x18, 0x17, 0x3B, 0x28, + 0x0C, 0x05, 0x2E, 0x25, 0x37, 0x0F, 0x0B, 0x09, 0x06, 0x1A, 0x19, 0x36, + 0x24, 0x1D, 0x33, 0x2F, 0x10, 0x00, 0x1C, 0x11, 0x42, 0x1B, 0x44, 0x43, + 0x50, 0x4C, 0x4B, 0x4E, 0x48, 0x4D, 0x27, 0x23, 0x4F, 0x2B, 0x45, 0x40, + 0x2D, 0x22, 0x47, 0x34, 0x4A, 0x46, 0x3D, 0x1E, 0x07, 0x21, 0x1F, 0x49, + 0x2A, 0x26, 0x3A, 0x32, 0x0E, 0x02, 0x14, 0x13, 0x0A, + }, + { + 0x14, 0x00, 0x0A, 0x01, 0x12, 0x08, 0x50, 0x38, 0x19, 0x02, 0x07, 0x06, + 0x13, 0x0B, 0x1A, 0x4F, 0x3C, 0x1D, 0x1B, 0x23, 0x1E, 0x0E, 0x0D, 0x17, + 0x10, 0x18, 0x16, 0x36, 0x26, 0x47, 0x40, 0x4C, 0x49, 0x28, 0x15, 0x2F, + 0x2D, 0x48, 0x3F, 0x20, 0x0C, 0x2C, 0x2A, 0x4B, 0x2E, 0x24, 0x3A, 0x37, + 0x32, 0x2B, 0x43, 0x35, 0x11, 0x03, 0x25, 0x1C, 0x42, 0x3E, 0x27, 0x21, + 0x34, 0x29, 0x4D, 0x33, 0x31, 0x3D, 0x3B, 0x45, 0x44, 0x22, 0x1F, 0x39, + 0x30, 0x4E, 0x46, 0x41, 0x05, 0x04, 0x0F, 0x09, 0x4A, + }, + { + 0x14, 0x0B, 0x19, 0x13, 0x0D, 0x01, 0x12, 0x0E, 0x38, 0x02, 0x00, 0x0F, + 0x09, 0x36, 0x10, 0x41, 0x3C, 0x1A, 0x07, 0x06, 0x11, 0x0C, 0x4A, 0x32, + 0x24, 0x47, 0x40, 0x17, 0x15, 0x1D, 0x1C, 0x26, 0x18, 0x37, 0x2F, 0x16, + 0x08, 0x2D, 0x28, 0x46, 0x22, 0x1F, 0x39, 0x34, 0x4F, 0x4C, 0x48, 0x4E, + 0x4B, 0x29, 0x21, 0x4D, 0x42, 0x3F, 0x3E, 0x49, 0x43, 0x1E, 0x03, 0x23, + 0x20, 0x50, 0x33, 0x31, 0x45, 0x44, 0x2A, 0x27, 0x30, 0x2C, 0x3A, 0x2E, + 0x35, 0x2B, 0x3D, 0x3B, 0x05, 0x04, 0x25, 0x1B, 0x0A, + }, + { + 0x28, 0x24, 0x3C, 0x36, 0x15, 0x0F, 0x1D, 0x1B, 0x07, 0x06, 0x11, 0x0D, + 0x4E, 0x2D, 0x2B, 0x44, 0x32, 0x1E, 0x1C, 0x25, 0x20, 0x48, 0x3F, 0x4C, + 0x4B, 0x47, 0x40, 0x4F, 0x49, 0x46, 0x0B, 0x23, 0x17, 0x2F, 0x2E, 0x08, + 0x01, 0x10, 0x0E, 0x35, 0x31, 0x3E, 0x3D, 0x1F, 0x0C, 0x2C, 0x2A, 0x04, + 0x03, 0x21, 0x05, 0x4D, 0x33, 0x29, 0x3B, 0x34, 0x42, 0x27, 0x22, 0x39, + 0x30, 0x3A, 0x37, 0x45, 0x43, 0x16, 0x09, 0x38, 0x26, 0x13, 0x0A, 0x02, + 0x00, 0x18, 0x12, 0x50, 0x1A, 0x19, 0x4A, 0x41, 0x14, + }, + { + 0x1A, 0x19, 0x40, 0x3F, 0x4F, 0x47, 0x4A, 0x14, 0x46, 0x41, 0x07, 0x01, + 0x0D, 0x08, 0x49, 0x3C, 0x38, 0x48, 0x44, 0x24, 0x17, 0x2E, 0x2D, 0x02, + 0x00, 0x18, 0x12, 0x26, 0x16, 0x2F, 0x28, 0x0F, 0x09, 0x15, 0x10, 0x3A, + 0x36, 0x4E, 0x4B, 0x2A, 0x25, 0x32, 0x31, 0x2C, 0x2B, 0x35, 0x33, 0x11, + 0x04, 0x20, 0x1C, 0x34, 0x23, 0x1F, 0x03, 0x39, 0x30, 0x3D, 0x0C, 0x05, + 0x21, 0x1E, 0x42, 0x37, 0x27, 0x22, 0x3E, 0x3B, 0x29, 0x4D, 0x45, 0x43, + 0x0E, 0x06, 0x1D, 0x1B, 0x4C, 0x0B, 0x0A, 0x50, 0x13, + }, + { + 0x4A, 0x19, 0x08, 0x07, 0x0F, 0x09, 0x38, 0x45, 0x43, 0x2D, 0x25, 0x4E, + 0x3D, 0x0E, 0x0D, 0x23, 0x10, 0x24, 0x15, 0x37, 0x26, 0x0A, 0x02, 0x18, + 0x12, 0x41, 0x46, 0x1A, 0x0B, 0x01, 0x36, 0x16, 0x50, 0x2F, 0x28, 0x44, + 0x3A, 0x17, 0x06, 0x1D, 0x1B, 0x32, 0x2E, 0x3E, 0x35, 0x2A, 0x1E, 0x2C, + 0x2B, 0x27, 0x22, 0x33, 0x31, 0x0C, 0x03, 0x20, 0x1F, 0x4D, 0x42, 0x3B, + 0x39, 0x29, 0x21, 0x34, 0x30, 0x4B, 0x48, 0x05, 0x04, 0x1C, 0x11, 0x4C, + 0x3F, 0x3C, 0x4F, 0x49, 0x13, 0x00, 0x47, 0x40, 0x14, + }, + { + 0x4C, 0x49, 0x1D, 0x17, 0x4E, 0x4B, 0x09, 0x04, 0x15, 0x0D, 0x38, 0x18, + 0x3F, 0x3C, 0x26, 0x16, 0x3A, 0x28, 0x4F, 0x44, 0x40, 0x4D, 0x48, 0x32, + 0x2F, 0x3D, 0x37, 0x2D, 0x2C, 0x35, 0x2E, 0x11, 0x0E, 0x23, 0x1B, 0x1E, + 0x1C, 0x3B, 0x25, 0x05, 0x03, 0x0C, 0x08, 0x22, 0x21, 0x30, 0x27, 0x36, + 0x42, 0x3E, 0x39, 0x34, 0x29, 0x20, 0x33, 0x31, 0x47, 0x45, 0x24, 0x1F, + 0x2B, 0x2A, 0x06, 0x01, 0x10, 0x07, 0x46, 0x1A, 0x02, 0x00, 0x0B, 0x0A, + 0x50, 0x41, 0x19, 0x12, 0x0F, 0x43, 0x13, 0x4A, 0x14, + }, + { + 0x46, 0x0B, 0x49, 0x47, 0x41, 0x23, 0x1E, 0x2D, 0x28, 0x15, 0x01, 0x1C, + 0x17, 0x1F, 0x0C, 0x22, 0x20, 0x4E, 0x35, 0x32, 0x42, 0x3E, 0x27, 0x04, + 0x31, 0x30, 0x3A, 0x2A, 0x3B, 0x39, 0x34, 0x29, 0x3D, 0x05, 0x03, 0x33, + 0x21, 0x38, 0x2F, 0x4B, 0x3C, 0x26, 0x1D, 0x48, 0x40, 0x09, 0x08, 0x16, + 0x0F, 0x4F, 0x11, 0x10, 0x2B, 0x25, 0x07, 0x06, 0x0E, 0x0D, 0x44, 0x43, + 0x4D, 0x45, 0x2E, 0x2C, 0x37, 0x36, 0x24, 0x1B, 0x4C, 0x3F, 0x14, 0x4A, + 0x1A, 0x13, 0x0A, 0x02, 0x00, 0x18, 0x12, 0x19, 0x50, + }, + { + 0x41, 0x19, 0x4F, 0x49, 0x26, 0x1E, 0x2F, 0x2D, 0x0F, 0x08, 0x1C, 0x15, + 0x02, 0x00, 0x47, 0x12, 0x4A, 0x50, 0x1A, 0x23, 0x1D, 0x40, 0x38, 0x16, + 0x09, 0x1B, 0x18, 0x3A, 0x37, 0x45, 0x44, 0x28, 0x11, 0x35, 0x32, 0x31, + 0x2C, 0x29, 0x27, 0x34, 0x2A, 0x42, 0x20, 0x1F, 0x22, 0x21, 0x04, 0x03, + 0x0C, 0x05, 0x4D, 0x3B, 0x39, 0x3E, 0x3D, 0x2B, 0x25, 0x33, 0x30, 0x3F, + 0x36, 0x07, 0x06, 0x0E, 0x0D, 0x4C, 0x4B, 0x48, 0x3C, 0x2E, 0x4E, 0x43, + 0x10, 0x01, 0x24, 0x17, 0x0B, 0x0A, 0x46, 0x13, 0x14, + }, + { + 0x19, 0x13, 0x50, 0x41, 0x1A, 0x0B, 0x0A, 0x4B, 0x46, 0x4A, 0x48, 0x47, + 0x17, 0x16, 0x23, 0x1D, 0x08, 0x01, 0x11, 0x0F, 0x12, 0x02, 0x18, 0x15, + 0x49, 0x43, 0x4E, 0x4C, 0x09, 0x00, 0x38, 0x37, 0x04, 0x03, 0x0C, 0x06, + 0x45, 0x35, 0x2E, 0x3A, 0x36, 0x1C, 0x10, 0x25, 0x20, 0x28, 0x26, 0x3F, + 0x3C, 0x1E, 0x0E, 0x2C, 0x24, 0x4F, 0x3B, 0x32, 0x3D, 0x39, 0x31, 0x07, + 0x34, 0x33, 0x2A, 0x29, 0x2D, 0x2B, 0x42, 0x3E, 0x1B, 0x0D, 0x30, 0x27, + 0x44, 0x40, 0x2F, 0x1F, 0x05, 0x22, 0x21, 0x4D, 0x14, + }, + { + 0x13, 0x0D, 0x1D, 0x19, 0x09, 0x41, 0x3D, 0x4A, 0x46, 0x28, 0x24, 0x31, + 0x29, 0x25, 0x22, 0x3E, 0x33, 0x08, 0x01, 0x16, 0x0C, 0x47, 0x2C, 0x04, + 0x03, 0x27, 0x05, 0x49, 0x17, 0x07, 0x2B, 0x20, 0x1F, 0x06, 0x2A, 0x21, + 0x50, 0x4C, 0x4B, 0x44, 0x43, 0x45, 0x42, 0x4E, 0x4D, 0x3F, 0x3B, 0x48, + 0x40, 0x34, 0x30, 0x4F, 0x39, 0x2E, 0x2D, 0x15, 0x11, 0x1E, 0x1C, 0x37, + 0x0B, 0x38, 0x14, 0x02, 0x00, 0x10, 0x0E, 0x3C, 0x32, 0x26, 0x3A, 0x35, + 0x18, 0x12, 0x23, 0x1B, 0x1A, 0x0F, 0x36, 0x2F, 0x0A, + }, + { + 0x37, 0x0E, 0x19, 0x17, 0x1D, 0x1A, 0x06, 0x01, 0x16, 0x10, 0x47, 0x44, + 0x4F, 0x48, 0x4D, 0x08, 0x07, 0x42, 0x3F, 0x2C, 0x2B, 0x4C, 0x4B, 0x49, + 0x40, 0x50, 0x4E, 0x45, 0x43, 0x1B, 0x04, 0x27, 0x22, 0x4A, 0x41, 0x3D, + 0x12, 0x03, 0x34, 0x29, 0x46, 0x2F, 0x21, 0x25, 0x23, 0x3E, 0x35, 0x05, + 0x00, 0x1F, 0x1E, 0x32, 0x18, 0x36, 0x33, 0x0A, 0x3C, 0x0F, 0x3A, 0x2E, + 0x09, 0x02, 0x15, 0x11, 0x38, 0x31, 0x30, 0x3B, 0x39, 0x24, 0x20, 0x2D, + 0x26, 0x1C, 0x0C, 0x2A, 0x28, 0x0D, 0x0B, 0x14, 0x13, + }, + { + 0x14, 0x13, 0x0B, 0x01, 0x0F, 0x0E, 0x4A, 0x50, 0x4F, 0x26, 0x24, 0x36, + 0x28, 0x06, 0x05, 0x1C, 0x09, 0x3C, 0x37, 0x4B, 0x45, 0x18, 0x17, 0x41, + 0x19, 0x49, 0x0A, 0x2A, 0x25, 0x4C, 0x38, 0x0C, 0x02, 0x16, 0x12, 0x48, + 0x44, 0x3B, 0x39, 0x3E, 0x31, 0x22, 0x07, 0x34, 0x1B, 0x2D, 0x2F, 0x2C, + 0x42, 0x3D, 0x43, 0x32, 0x30, 0x2B, 0x35, 0x33, 0x1F, 0x04, 0x27, 0x23, + 0x3F, 0x3A, 0x10, 0x00, 0x29, 0x21, 0x47, 0x4E, 0x4D, 0x1E, 0x1D, 0x2E, + 0x20, 0x08, 0x03, 0x11, 0x0D, 0x1A, 0x15, 0x46, 0x40, + }, }; static const uint8_t aic_mode2_vlc_bits[AIC_MODE2_NUM][AIC_MODE2_SIZE] = { -{ 1, 5, 4, 10, 6, 8, 5, 8, 8, - 7, 5, 7, 11, 10, 9, 8, 13, 11, - 6, 7, 3, 9, 8, 10, 9, 8, 5, - 10, 9, 10, 10, 14, 12, 14, 14, 12, - 8, 9, 7, 12, 8, 14, 9, 9, 12, - 8, 9, 11, 11, 13, 9, 11, 14, 12, - 6, 7, 9, 13, 9, 12, 7, 10, 12, - 11, 12, 8, 15, 10, 15, 13, 7, 12, - 10, 10, 8, 10, 13, 13, 13, 11, 8, }, -{ 4, 6, 5, 11, 8, 10, 7, 11, 9, - 4, 1, 4, 9, 7, 7, 5, 9, 10, - 6, 7, 4, 9, 9, 10, 9, 9, 6, - 9, 10, 9, 10, 12, 12, 13, 12, 11, - 9, 9, 8, 12, 8, 14, 10, 11, 12, - 7, 8, 10, 11, 12, 9, 11, 13, 12, - 6, 7, 8, 12, 9, 12, 7, 11, 10, - 12, 12, 9, 14, 12, 15, 13, 8, 12, - 11, 11, 10, 12, 13, 15, 14, 12, 9, }, -{ 5, 7, 6, 12, 9, 11, 8, 11, 10, - 7, 5, 7, 11, 10, 9, 8, 12, 12, - 5, 5, 1, 8, 7, 10, 8, 6, 4, - 8, 8, 8, 9, 12, 11, 13, 12, 11, - 8, 9, 8, 12, 8, 13, 10, 11, 11, - 8, 9, 11, 12, 13, 11, 12, 14, 13, - 8, 9, 10, 14, 11, 14, 9, 13, 13, - 8, 9, 6, 11, 10, 14, 11, 6, 10, - 6, 6, 4, 8, 9, 10, 10, 8, 5, }, -{ 11, 7, 8, 10, 12, 9, 10, 14, 12, - 7, 1, 5, 7, 8, 6, 4, 10, 9, - 10, 5, 4, 8, 11, 8, 7, 6, 7, - 11, 6, 7, 8, 10, 8, 10, 11, 9, - 10, 8, 9, 13, 9, 12, 8, 11, 12, - 11, 4, 7, 8, 9, 6, 8, 12, 9, - 8, 5, 8, 12, 9, 10, 6, 12, 11, - 12, 12, 10, 15, 13, 13, 13, 10, 13, - 15, 10, 9, 10, 12, 13, 13, 10, 9, }, -{ 11, 8, 8, 11, 13, 10, 11, 15, 12, - 7, 1, 4, 7, 7, 5, 4, 8, 9, - 11, 5, 5, 8, 11, 9, 8, 7, 8, - 13, 7, 8, 9, 11, 9, 10, 12, 10, - 10, 9, 8, 13, 9, 12, 9, 11, 12, - 11, 5, 7, 9, 10, 6, 9, 13, 10, - 7, 4, 7, 11, 8, 9, 5, 10, 11, - 13, 11, 9, 15, 13, 15, 13, 8, 12, - 15, 10, 10, 12, 13, 14, 14, 12, 11, }, -{ 12, 9, 9, 12, 13, 11, 11, 14, 12, - 8, 2, 5, 7, 9, 6, 5, 10, 10, - 9, 4, 2, 7, 9, 7, 6, 5, 6, - 12, 6, 7, 8, 10, 8, 10, 11, 9, - 12, 9, 10, 13, 11, 12, 10, 14, 13, - 12, 6, 8, 10, 10, 7, 9, 12, 10, - 8, 5, 8, 11, 9, 10, 7, 11, 12, - 8, 6, 5, 11, 11, 11, 8, 6, 9, - 12, 6, 6, 8, 10, 10, 11, 8, 6, }, -{ 13, 9, 10, 12, 14, 12, 11, 15, 15, - 8, 1, 5, 7, 9, 6, 5, 11, 10, - 11, 6, 5, 9, 11, 9, 8, 7, 8, - 12, 6, 8, 8, 11, 8, 10, 12, 10, - 10, 7, 9, 13, 10, 11, 9, 13, 12, - 11, 3, 6, 8, 9, 4, 7, 11, 8, - 8, 5, 9, 12, 10, 9, 7, 12, 13, - 13, 12, 10, 14, 14, 15, 12, 11, 14, - 15, 7, 9, 8, 11, 11, 12, 10, 9, }, -{ 10, 5, 6, 9, 11, 7, 8, 12, 11, - 8, 1, 4, 7, 9, 6, 4, 10, 10, - 11, 6, 6, 9, 9, 9, 9, 8, 8, - 14, 10, 10, 12, 12, 11, 12, 13, 12, - 10, 7, 8, 12, 9, 11, 8, 12, 11, - 13, 7, 10, 11, 11, 8, 10, 13, 11, - 6, 3, 7, 11, 8, 9, 5, 10, 11, - 11, 11, 9, 14, 14, 14, 11, 10, 13, - 14, 10, 11, 13, 13, 13, 14, 12, 12, }, -{ 2, 5, 3, 11, 8, 8, 6, 6, 7, - 8, 5, 6, 12, 10, 10, 8, 10, 11, - 7, 6, 2, 9, 8, 10, 8, 5, 4, - 10, 11, 10, 10, 13, 12, 14, 13, 10, - 10, 11, 8, 14, 9, 14, 12, 11, 12, - 9, 10, 9, 13, 12, 11, 12, 14, 11, - 8, 10, 7, 13, 10, 12, 8, 12, 12, - 10, 9, 6, 12, 11, 11, 11, 6, 9, - 10, 9, 6, 10, 9, 12, 11, 8, 7, }, -{ 6, 8, 6, 12, 11, 11, 10, 10, 9, - 6, 1, 3, 10, 8, 8, 6, 7, 10, - 8, 6, 3, 10, 9, 10, 8, 6, 5, - 11, 10, 10, 12, 13, 12, 14, 13, 12, - 10, 11, 8, 12, 9, 14, 12, 11, 12, - 9, 9, 8, 12, 12, 10, 12, 13, 11, - 7, 8, 6, 13, 9, 11, 7, 11, 11, - 11, 10, 7, 14, 11, 12, 12, 7, 10, - 12, 11, 8, 13, 12, 14, 13, 11, 10, }, -{ 7, 10, 7, 13, 13, 13, 11, 11, 10, - 8, 5, 6, 12, 11, 10, 9, 10, 11, - 7, 5, 1, 9, 8, 10, 7, 4, 4, - 9, 11, 9, 11, 12, 11, 13, 13, 10, - 9, 11, 8, 13, 9, 14, 12, 11, 12, - 11, 10, 10, 13, 12, 11, 14, 14, 12, - 9, 10, 8, 13, 10, 14, 9, 12, 12, - 9, 7, 4, 12, 10, 11, 10, 6, 7, - 9, 7, 4, 9, 9, 11, 9, 7, 5, }, -{ 7, 9, 7, 14, 11, 12, 10, 9, 9, - 8, 5, 5, 12, 9, 10, 8, 8, 11, - 7, 5, 2, 8, 8, 9, 7, 4, 4, - 10, 11, 10, 12, 14, 11, 12, 13, 12, - 9, 10, 8, 13, 8, 13, 10, 11, 11, - 9, 9, 8, 14, 10, 10, 11, 12, 11, - 10, 11, 9, 14, 10, 14, 9, 12, 14, - 6, 6, 3, 11, 8, 9, 8, 3, 6, - 9, 7, 4, 10, 8, 11, 10, 6, 5, }, -{ 6, 8, 7, 13, 12, 12, 10, 9, 9, - 9, 7, 8, 13, 11, 11, 9, 11, 12, - 7, 6, 1, 9, 8, 10, 7, 5, 4, - 10, 12, 10, 12, 13, 13, 14, 13, 11, - 9, 11, 9, 13, 10, 14, 12, 12, 12, - 11, 12, 10, 14, 13, 12, 13, 14, 12, - 8, 9, 7, 13, 10, 13, 8, 11, 12, - 8, 6, 3, 12, 9, 10, 9, 4, 6, - 10, 8, 5, 10, 10, 12, 11, 8, 6, }, -{ 7, 10, 7, 12, 9, 12, 10, 10, 12, - 9, 7, 7, 12, 9, 11, 6, 10, 11, - 6, 6, 1, 9, 8, 9, 7, 4, 5, - 11, 12, 9, 12, 10, 14, 13, 13, 11, - 10, 12, 8, 13, 8, 14, 10, 10, 11, - 11, 11, 10, 13, 14, 10, 14, 13, 11, - 11, 10, 7, 13, 8, 12, 7, 10, 12, - 7, 10, 4, 12, 6, 10, 8, 5, 8, - 10, 7, 4, 9, 7, 10, 9, 6, 5, }, -{ 7, 9, 7, 13, 12, 13, 10, 10, 8, - 8, 5, 6, 11, 10, 10, 8, 10, 10, - 7, 5, 2, 9, 8, 9, 7, 5, 3, - 8, 9, 7, 9, 11, 11, 13, 11, 9, - 8, 10, 7, 12, 9, 14, 11, 10, 10, - 9, 10, 9, 12, 12, 12, 13, 14, 12, - 10, 10, 9, 13, 11, 13, 9, 13, 12, - 8, 7, 4, 12, 10, 10, 10, 6, 6, - 7, 6, 3, 9, 8, 10, 9, 6, 3, }, -{ 7, 10, 7, 13, 13, 13, 11, 11, 9, - 8, 6, 6, 13, 11, 11, 9, 10, 11, - 7, 6, 1, 9, 8, 10, 8, 5, 4, - 8, 9, 8, 9, 12, 12, 12, 12, 8, - 10, 13, 9, 14, 11, 14, 14, 13, 12, - 9, 10, 9, 13, 12, 11, 13, 14, 11, - 9, 11, 8, 13, 11, 13, 10, 13, 13, - 9, 8, 5, 12, 10, 11, 11, 6, 7, - 8, 7, 3, 8, 9, 11, 10, 7, 4, }, -{ 8, 9, 7, 11, 11, 12, 11, 14, 9, - 8, 6, 6, 11, 13, 10, 9, 11, 9, - 7, 5, 1, 7, 9, 9, 7, 5, 3, - 13, 11, 9, 10, 12, 11, 12, 12, 9, - 10, 11, 9, 13, 9, 12, 12, 12, 10, - 12, 11, 10, 13, 14, 12, 14, 14, 11, - 11, 8, 8, 13, 11, 12, 9, 13, 11, - 9, 10, 5, 11, 8, 11, 9, 6, 7, - 7, 8, 4, 6, 8, 10, 8, 8, 5, }, -{ 8, 10, 8, 13, 13, 13, 12, 11, 10, - 5, 1, 3, 10, 7, 8, 6, 8, 9, - 8, 7, 4, 9, 10, 11, 8, 7, 6, - 8, 9, 7, 9, 12, 11, 12, 10, 8, - 9, 10, 8, 13, 9, 9, 12, 11, 11, - 7, 7, 6, 12, 9, 8, 10, 12, 8, - 6, 7, 4, 12, 8, 13, 6, 9, 10, - 13, 13, 9, 15, 14, 14, 15, 9, 11, - 13, 11, 9, 13, 13, 15, 15, 12, 10, }, -{ 10, 8, 9, 11, 12, 10, 8, 13, 13, - 9, 2, 5, 7, 5, 4, 3, 8, 9, - 11, 5, 5, 9, 8, 8, 6, 8, 8, - 12, 7, 8, 10, 10, 9, 8, 12, 10, - 9, 10, 9, 12, 7, 11, 7, 12, 12, - 9, 5, 8, 9, 9, 6, 6, 11, 10, - 6, 4, 7, 9, 5, 9, 3, 9, 10, - 13, 11, 9, 13, 10, 13, 10, 9, 13, - 14, 11, 10, 12, 12, 13, 11, 14, 11, }, -{ 11, 7, 8, 10, 12, 9, 9, 14, 10, - 9, 4, 7, 8, 10, 7, 7, 11, 10, - 8, 2, 2, 6, 8, 5, 5, 5, 6, - 15, 9, 10, 10, 12, 10, 11, 14, 12, - 9, 8, 9, 12, 9, 11, 8, 12, 11, - 14, 10, 11, 12, 13, 10, 12, 15, 12, - 9, 7, 8, 12, 9, 12, 7, 11, 13, - 9, 6, 5, 11, 10, 11, 7, 6, 9, - 11, 4, 5, 7, 8, 8, 8, 7, 7, }, + { + 5, 5, 5, 5, 3, 6, 6, 8, 8, 8, 8, 6, 4, 7, 7, 9, 9, + 9, 9, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, + 11, 11, 11, 11, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, + 14, 14, 14, 14, 12, 13, 13, 15, 15, 14, 13, 12, 12, 12, 12, 11, 11, + 13, 13, 13, 13, 11, 10, 10, 12, 12, 12, 12, 10, 1, + }, + { + 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 8, 8, 8, 8, 9, 9, 9, + 9, 9, 9, 9, 9, 13, 13, 13, 13, 11, 12, 12, 14, 14, 15, 15, 14, + 12, 11, 11, 11, 11, 12, 12, 12, 12, 10, 12, 12, 12, 12, 12, 12, 12, + 12, 9, 9, 11, 11, 11, 11, 9, 6, 6, 6, 6, 5, 5, 7, 7, 9, + 9, 9, 9, 7, 7, 7, 7, 7, 4, 4, 4, 4, 1, + }, + { + 7, 7, 7, 7, 5, 8, 8, 10, 10, 10, 10, 8, 8, 8, 8, 8, 9, + 9, 9, 9, 9, 9, 9, 9, 12, 12, 12, 12, 10, 13, 13, 14, 14, 14, + 14, 13, 13, 13, 13, 12, 12, 12, 12, 10, 10, 10, 10, 11, 11, 11, 11, + 9, 11, 11, 11, 11, 11, 11, 11, 11, 5, 5, 5, 5, 4, 4, 6, 6, + 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 6, 6, 1, + }, + { + 9, 9, 11, 11, 13, 13, 13, 13, 11, 11, 11, 11, 11, 9, 9, 9, 9, + 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 10, 12, 12, 13, 13, + 15, 15, 14, 13, 12, 12, 12, 12, 10, 10, 10, 10, 7, 7, 9, 9, 9, + 9, 7, 8, 8, 8, 8, 6, 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, + 7, 7, 7, 7, 5, 4, 4, 6, 6, 6, 6, 4, 1, + }, + { + 7, 7, 7, 7, 5, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, + 11, 11, 11, 11, 12, 12, 12, 12, 10, 13, 13, 13, 13, 13, 13, 13, 13, + 12, 12, 14, 14, 15, 15, 15, 15, 12, 9, 9, 11, 11, 11, 11, 9, 7, + 7, 7, 7, 5, 5, 5, 5, 4, 4, 8, 8, 8, 8, 6, 8, 8, 10, + 10, 10, 10, 10, 10, 10, 10, 8, 8, 8, 8, 4, 1, + }, + { + 2, 2, 7, 7, 7, 7, 5, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, + 12, 12, 13, 13, 14, 14, 13, 10, 10, 10, 10, 9, 9, 11, 11, 11, 11, + 11, 11, 11, 11, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 7, 7, 9, + 9, 9, 9, 9, 9, 9, 9, 5, 5, 5, 5, 6, 6, 6, 6, 4, 6, + 6, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 6, 6, + }, + { + 5, 5, 5, 5, 3, 6, 6, 6, 6, 4, 7, 7, 9, 9, 9, 9, 9, + 9, 9, 9, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 11, 11, + 13, 13, 13, 13, 11, 11, 11, 11, 11, 12, 12, 12, 12, 10, 12, 12, 15, + 15, 15, 15, 13, 14, 14, 14, 14, 12, 12, 12, 12, 9, 9, 11, 11, 11, + 11, 9, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 1, + }, + { + 5, 5, 9, 9, 9, 9, 7, 11, 11, 11, 11, 9, 11, 11, 11, 11, 11, + 11, 11, 11, 9, 9, 9, 9, 7, 7, 7, 7, 3, 4, 4, 8, 8, 8, + 8, 6, 10, 10, 10, 10, 10, 10, 10, 10, 14, 14, 14, 14, 12, 13, 13, + 14, 14, 13, 12, 12, 12, 12, 11, 11, 13, 13, 13, 13, 11, 10, 10, 12, + 12, 12, 12, 10, 8, 8, 8, 8, 6, 6, 6, 6, 1, + }, + { + 2, 2, 5, 5, 7, 7, 7, 7, 5, 3, 6, 6, 6, 6, 4, 8, 8, + 10, 10, 10, 10, 10, 10, 10, 10, 8, 8, 8, 8, 9, 9, 9, 9, 9, + 9, 9, 9, 10, 10, 12, 12, 12, 12, 10, 10, 10, 10, 10, 11, 11, 11, + 11, 11, 11, 11, 11, 12, 12, 14, 14, 14, 14, 12, 12, 12, 12, 12, 11, + 11, 13, 13, 13, 13, 11, 6, 6, 8, 8, 8, 8, 6, + }, + { + 3, 3, 6, 6, 8, 8, 8, 8, 6, 6, 6, 6, 6, 7, 7, 7, 7, + 5, 10, 10, 10, 10, 8, 10, 10, 10, 10, 10, 10, 10, 10, 8, 8, 8, + 8, 9, 9, 9, 9, 7, 13, 13, 13, 13, 11, 12, 12, 13, 13, 14, 14, + 14, 14, 11, 11, 11, 11, 12, 12, 12, 12, 10, 12, 12, 12, 12, 12, 12, + 12, 12, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, 1, + }, + { + 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 9, 11, 11, 11, 11, + 11, 11, 11, 11, 9, 9, 9, 9, 7, 7, 7, 7, 6, 6, 10, 10, 10, + 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, + 11, 14, 14, 14, 14, 12, 13, 13, 13, 13, 10, 10, 10, 10, 8, 8, 8, + 8, 5, 5, 7, 7, 7, 7, 5, 4, 4, 4, 4, 1, + }, + { + 4, 4, 6, 6, 6, 6, 4, 2, 3, 3, 9, 9, 9, 9, 7, 9, 9, + 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, + 8, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, + 12, 12, 14, 14, 14, 14, 12, 12, 12, 12, 12, 11, 11, 13, 13, 14, 14, + 13, 11, 8, 8, 10, 10, 10, 10, 8, 5, 5, 5, 5, + }, + { + 5, 5, 9, 9, 9, 9, 7, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, + 9, 9, 9, 9, 7, 7, 7, 7, 3, 4, 4, 8, 8, 8, 8, 6, 10, + 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, + 13, 13, 13, 13, 13, 13, 12, 12, 13, 13, 14, 14, 14, 14, 10, 10, 12, + 12, 12, 12, 10, 8, 8, 8, 8, 6, 6, 6, 6, 1, + }, + { + 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 8, 8, 8, + 8, 6, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, + 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 11, 12, 12, 13, + 13, 14, 14, 14, 14, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 5, 5, + 7, 7, 7, 7, 5, 4, 4, 6, 6, 6, 6, 4, 1, + }, + { + 6, 6, 6, 6, 4, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, + 9, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 13, 13, 14, 14, 13, 13, + 13, 13, 13, 9, 9, 9, 9, 7, 7, 7, 7, 8, 8, 8, 8, 6, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 8, 8, + 8, 8, 2, 3, 3, 5, 5, 7, 7, 7, 7, 5, 3, + }, + { + 5, 5, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 3, + 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11, 11, 11, + 11, 12, 12, 14, 14, 14, 14, 12, 12, 12, 12, 12, 13, 13, 13, 13, 11, + 13, 13, 13, 13, 13, 13, 13, 13, 9, 9, 11, 11, 11, 11, 9, 8, 8, + 10, 10, 10, 10, 10, 10, 10, 10, 6, 6, 6, 6, 1, + }, + { + 5, 5, 5, 5, 3, 6, 6, 6, 6, 4, 7, 7, 9, 9, 9, 9, 9, + 9, 9, 9, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 11, 11, + 11, 11, 9, 11, 11, 11, 11, 11, 11, 11, 11, 9, 9, 9, 9, 10, 10, + 10, 10, 8, 12, 12, 13, 13, 14, 14, 14, 14, 12, 12, 12, 12, 11, 11, + 13, 13, 13, 13, 11, 10, 10, 12, 12, 12, 12, 10, 1, + }, + { + 7, 7, 7, 7, 5, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, + 10, 10, 10, 10, 11, 11, 13, 13, 13, 13, 11, 11, 11, 11, 11, 12, 12, + 12, 12, 10, 13, 13, 14, 14, 15, 15, 15, 15, 13, 13, 13, 13, 12, 12, + 12, 12, 7, 7, 9, 9, 9, 9, 7, 3, 4, 4, 8, 8, 8, 8, 6, + 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 6, 6, 1, + }, + { + 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 13, 13, 14, 14, 13, 13, 13, + 13, 13, 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, 12, 12, 12, 12, 10, + 9, 9, 11, 11, 11, 11, 9, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, + 6, 6, 6, 6, 2, 3, 3, 5, 5, 9, 9, 9, 9, 7, 9, 9, 9, + 9, 9, 9, 9, 9, 7, 7, 7, 7, 5, 5, 5, 5, + }, + { + 2, 2, 7, 7, 7, 7, 5, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, + 7, 7, 7, 7, 5, 5, 5, 5, 4, 4, 8, 8, 8, 8, 8, 8, 8, + 8, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 14, 11, 11, 11, 11, 10, + 10, 12, 12, 12, 12, 12, 12, 12, 12, 9, 9, 11, 11, 11, 11, 9, 8, + 8, 10, 10, 10, 10, 10, 10, 10, 10, 6, 6, 6, 6, + }, }; //@} @@ -640,31 +600,23 @@ static const uint8_t aic_mode1_vlc_bits[AIC_MODE1_NUM][AIC_MODE1_SIZE] = { #define PTYPE_VLC_SIZE 8 #define PTYPE_VLC_BITS 7 -static const uint8_t ptype_vlc_codes[NUM_PTYPE_VLCS][PTYPE_VLC_SIZE] = { - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 }, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 }, - { 0x0D, 0x05, 0x01, 0x04, 0x01, 0x00, 0x07, 0x0C }, - { 0x09, 0x11, 0x01, 0x00, 0x05, 0x03, 0x21, 0x20 }, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 }, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 }, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 } +static const uint8_t ptype_vlc_tabs[NUM_PTYPE_VLCS][PTYPE_VLC_SIZE][2] = { + { { PBTYPE_ESCAPE, 7 }, { 11, 7 }, { 3, 6 }, { 8, 5 }, + { 9, 4 }, { 2, 3 }, { 1, 2 }, { 0, 1 } }, + { { PBTYPE_ESCAPE, 7 }, { 3, 7 }, { 8, 6 }, { 9, 5 }, + { 11, 4 }, { 0, 3 }, { 2, 2 }, { 1, 1 } }, + { { 9, 3 }, { 8, 3 }, { 3, 4 }, { 1, 4 }, { PBTYPE_ESCAPE, 5 }, + { 0, 5 }, { 11, 4 }, { 2, 1 } }, + { { 3, 2 }, { 2, 2 }, { PBTYPE_ESCAPE, 6 }, { 11, 6 }, + { 1, 5 }, { 0, 4 }, { 8, 3 }, { 9, 2 } }, + { { PBTYPE_ESCAPE, 7 }, { 11, 7 }, { 1, 6 }, { 0, 5 }, + { 3, 4 }, { 9, 3 }, { 8, 2 }, { 2, 1 } }, + { { PBTYPE_ESCAPE, 7 }, { 11, 7 }, { 1, 6 }, { 0, 5 }, + { 3, 4 }, { 8, 3 }, { 9, 2 }, { 2, 1 } }, + { { PBTYPE_ESCAPE, 7 }, { 3, 7 }, { 0, 6 }, { 8, 5 }, + { 9, 4 }, { 1, 3 }, { 2, 2 }, { 11, 1 } }, }; -static const uint8_t ptype_vlc_bits[NUM_PTYPE_VLCS][PTYPE_VLC_SIZE] = { - { 1, 2, 3, 6, 5, 4, 7, 7 }, - { 3, 1, 2, 7, 6, 5, 4, 7 }, - { 5, 4, 1, 4, 3, 3, 4, 5 }, - { 4, 5, 2, 2, 3, 2, 6, 6 }, - { 5, 6, 1, 4, 2, 3, 7, 7 }, - { 5, 6, 1, 4, 3, 2, 7, 7 }, - { 6, 3, 2, 7, 5, 4, 1, 7 } -}; - -static const uint8_t ptype_vlc_syms[PTYPE_VLC_SIZE] = { - 0, 1, 2, 3, 8, 9, 11, PBTYPE_ESCAPE -}; - -/** reverse of ptype_vlc_syms */ static const uint8_t block_num_to_ptype_vlc_num[12] = { 0, 1, 2, 3, 0, 0, 2, 0, 4, 5, 0, 6 }; @@ -676,29 +628,21 @@ static const uint8_t block_num_to_ptype_vlc_num[12] = { #define BTYPE_VLC_SIZE 7 #define BTYPE_VLC_BITS 6 -static const uint8_t btype_vlc_codes[NUM_BTYPE_VLCS][BTYPE_VLC_SIZE] = { - { 0x01, 0x05, 0x00, 0x03, 0x11, 0x09, 0x10 }, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 }, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 }, - { 0x09, 0x01, 0x00, 0x01, 0x05, 0x03, 0x08 }, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 }, - { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 } -}; - -static const uint8_t btype_vlc_bits[NUM_BTYPE_VLCS][PTYPE_VLC_SIZE] = { - { 2, 3, 2, 2, 5, 4, 5 }, - { 4, 1, 3, 2, 6, 5, 6 }, - { 6, 4, 1, 2, 5, 3, 6 }, - { 5, 3, 3, 1, 4, 3, 5 }, - { 6, 5, 3, 2, 4, 1, 6 }, - { 6, 5, 3, 1, 4, 2, 6 } -}; - -static const uint8_t btype_vlc_syms[BTYPE_VLC_SIZE] = { - 0, 1, 4, 5, 10, 7, PBTYPE_ESCAPE +static const uint8_t btype_vlc_tabs[NUM_BTYPE_VLCS][BTYPE_VLC_SIZE][2] = { + { { 4, 2 }, { 0, 2 }, { PBTYPE_ESCAPE, 5 }, + { 10, 5 }, { 7, 4 }, { 1, 3 }, { 5, 2 } }, + { { PBTYPE_ESCAPE, 6 }, { 10, 6 }, { 7, 5 }, + { 0, 4 }, { 4, 3 }, { 5, 2 }, { 1, 1 } }, + { { PBTYPE_ESCAPE, 6 }, { 0, 6 }, { 10, 5 }, + { 1, 4 }, { 7, 3 }, { 5, 2 }, { 4, 1 } }, + { { 4, 3 }, { 1, 3 }, { PBTYPE_ESCAPE, 5 }, + { 0, 5 }, { 10, 4 }, { 7, 3 }, { 5, 1 } }, + { { PBTYPE_ESCAPE, 6 }, { 0, 6 }, { 1, 5 }, + { 10, 4 }, { 4, 3 }, { 5, 2 }, { 7, 1 } }, + { { PBTYPE_ESCAPE, 6 }, { 0, 6 }, { 1, 5 }, + { 10, 4 }, { 4, 3 }, { 7, 2 }, { 5, 1 } }, }; -/** reverse of btype_vlc_syms */ static const uint8_t block_num_to_btype_vlc_num[12] = { 0, 1, 0, 0, 2, 3, 0, 5, 0, 0, 4, 0 }; From patchwork Fri Nov 20 07:19:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23827 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 E60364489CB for ; Fri, 20 Nov 2020 09:37:58 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AA25768BAAD; Fri, 20 Nov 2020 09:25:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8769168BB45 for ; Fri, 20 Nov 2020 09:25:24 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id oq3so11474881ejb.7 for ; Thu, 19 Nov 2020 23:25:24 -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=4dAxn0SG0aTOA0kp7Fxr9AZo5zVIEbHWO1SUp5NMzBs=; b=SDpiVDraluEE7NGZS0nQcs13YaC65KSo2glMYZkVrKs2VnkVNAv4ZwlCnO8e7c0ILb r01tOwGz0MqWpXHz+5WB3E7CiElNHyHHMDYoybd0RbVxoX6X9zsqGdql4IqWAKb0nDum D8IkuHhB4XnO3gzS98ah+hOajJNIf0TmXeUv5oC4Q3sHUHnwFVy/ONxfimvEc4Re+0En 9vyUwv5BeHRQGElXbBJaAfzfoARzM5RVD6PsrOAGHR46w4zSncu9Zci5CSc0LaTumaHz sJor98NobT+1jaOzJGqHQh6qnMpsK+j/NVZnLDl+L6ZEvNC+yNqCFMvWpFYpN0mJcUdB n2ug== 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=4dAxn0SG0aTOA0kp7Fxr9AZo5zVIEbHWO1SUp5NMzBs=; b=UHknx7YvX3uxXfwxuxCXsW6IkBW0xZiNMcDknaLtXsFIOkn15t8SDPHza4BoEmiUJu PNZA+g6OluPe7c7Dq1PGKEnxQtSBng0a32dgpVlnSCti495VxHSboeOo8kG9G9GVeNnL OFnkpZZZ8Ct7k2AmfaDVEaTMo9UALDWlaWQduvDV/WBT/0vBLPSQY2WXrEwv+ueMguEH MKJACJOOEUmFcbegUk8ehzdFjtE5dZrRamUXadqcDMnTSeZt33SIK1tBbGD/Rc/Id8Id d+6iyMGSYqAbSKBM0ogG0shQXIhZuLs0At1a6gHLdaEajK8ikr68CyYUmDL33GiN/boK tyqQ== X-Gm-Message-State: AOAM530h0f/DMCXRZnw0W4fs50x96hCz39Orgk35UJ6nTPh2HtRUezGG MEvUDUTn0XW+ftyVrpKI/pYT3YV/9FHseA== X-Google-Smtp-Source: ABdhPJzBT8bKalxcZKyfyhDSUjK/t0qT++ytH1rc3PrhRo1GVgEAwhp6p7337xCLk3RWttq0vxcVaA== X-Received: by 2002:a17:906:f0c3:: with SMTP id dk3mr21768545ejb.366.1605857123030; Thu, 19 Nov 2020 23:25:23 -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.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:22 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:46 +0100 Message-Id: <20201120072116.818090-74-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 073/162] avcodec/rv40: Make better use of VLC symbols 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" RealVideo 4.0 has a VLC that encodes two intra types per code; each intra type is in the range 0..8 (inclusive) and up until now the VLC used symbols in the range 0..80; one type was encoded as the remainder when dividing the symbol by 9 whereas the other type was encoded as symbol / 9. This is suboptimal; a better way would be to use the high and low nibble to encode each symbol. But an even better way is to use 16bit symbols so that the two intra types can be directly written as a 16bit value. This commit implements this; in order to avoid huge tables the symbols are stored as uint8_t with high and low nibbles encoding one type each; they are only unpacked to uint16_t during initialization. Signed-off-by: Andreas Rheinhardt --- libavcodec/rv40.c | 20 ++- libavcodec/rv40vlc2.h | 356 +++++++++++++++++++++--------------------- 2 files changed, 193 insertions(+), 183 deletions(-) diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c index 4ecee930ff..6f9f2c5665 100644 --- a/libavcodec/rv40.c +++ b/libavcodec/rv40.c @@ -24,6 +24,8 @@ * RV40 decoder */ +#include "config.h" + #include "libavutil/imgutils.h" #include "avcodec.h" @@ -71,12 +73,21 @@ static av_cold void rv40_init_tables(void) aic_mode1_vlc_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); } for(i = 0; i < AIC_MODE2_NUM; i++){ + uint16_t syms[AIC_MODE2_SIZE]; + + for (int j = 0; j < AIC_MODE2_SIZE; j++) { + int first = aic_mode2_vlc_syms[i][j] >> 4; + int second = aic_mode2_vlc_syms[i][j] & 0xF; + if (HAVE_BIGENDIAN) + syms[j] = (first << 8) | second; + else + syms[j] = first | (second << 8); + } aic_mode2_vlc[i].table = &aic_mode2_table[mode2_offs[i]]; aic_mode2_vlc[i].table_allocated = mode2_offs[i + 1] - mode2_offs[i]; ff_init_vlc_from_lengths(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE, aic_mode2_vlc_bits[i], 1, - aic_mode2_vlc_syms[i], 1, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + syms, 2, 2, 0, INIT_VLC_USE_NEW_STATIC, NULL); } for(i = 0; i < NUM_PTYPE_VLCS; i++){ ptype_vlc[i].table = &ptype_table[i << PTYPE_VLC_BITS]; @@ -195,9 +206,8 @@ static int rv40_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t if(pattern == rv40_aic_table_index[k]) break; if(j < 3 && k < MODE2_PATTERNS_NUM){ //pattern is found, decoding 2 coefficients - v = get_vlc2(gb, aic_mode2_vlc[k].table, AIC_MODE2_BITS, 2); - *ptr++ = v/9; - *ptr++ = v%9; + AV_WN16(ptr, get_vlc2(gb, aic_mode2_vlc[k].table, AIC_MODE2_BITS, 2)); + ptr += 2; j++; }else{ if(B != -1 && C != -1) diff --git a/libavcodec/rv40vlc2.h b/libavcodec/rv40vlc2.h index 58974f6451..783b93ba2e 100644 --- a/libavcodec/rv40vlc2.h +++ b/libavcodec/rv40vlc2.h @@ -55,184 +55,184 @@ static const uint8_t rv40_aic_top_vlc_bits[AIC_TOP_SIZE] = { static const uint8_t aic_mode2_vlc_syms[AIC_MODE2_NUM][AIC_MODE2_SIZE] = { { - 0x06, 0x01, 0x1A, 0x0A, 0x14, 0x12, 0x04, 0x07, 0x05, 0x0F, 0x08, 0x36, - 0x02, 0x3C, 0x37, 0x15, 0x0E, 0x1C, 0x18, 0x46, 0x0B, 0x09, 0x26, 0x13, - 0x41, 0x2D, 0x50, 0x4A, 0x19, 0x16, 0x28, 0x24, 0x38, 0x32, 0x11, 0x0C, - 0x30, 0x2F, 0x3A, 0x2A, 0x25, 0x2E, 0x2B, 0x1E, 0x1D, 0x43, 0x3D, 0x0D, - 0x03, 0x1B, 0x17, 0x21, 0x1F, 0x29, 0x22, 0x47, 0x4D, 0x4C, 0x44, 0x42, - 0x34, 0x4E, 0x3B, 0x35, 0x40, 0x3E, 0x3F, 0x33, 0x31, 0x10, 0x45, 0x39, - 0x4F, 0x49, 0x48, 0x23, 0x20, 0x2C, 0x27, 0x4B, 0x00, - }, - { - 0x46, 0x38, 0x2A, 0x1E, 0x3E, 0x2F, 0x11, 0x05, 0x1C, 0x17, 0x26, 0x04, - 0x2E, 0x28, 0x24, 0x1D, 0x32, 0x25, 0x18, 0x16, 0x1B, 0x19, 0x34, 0x21, - 0x4C, 0x45, 0x49, 0x4B, 0x47, 0x42, 0x29, 0x4D, 0x44, 0x4E, 0x4F, 0x33, - 0x30, 0x48, 0x3D, 0x20, 0x1F, 0x27, 0x22, 0x4A, 0x3F, 0x3B, 0x43, 0x40, - 0x31, 0x2C, 0x39, 0x35, 0x41, 0x3A, 0x07, 0x03, 0x2B, 0x23, 0x50, 0x12, - 0x01, 0x36, 0x1A, 0x0F, 0x02, 0x37, 0x2D, 0x0C, 0x08, 0x15, 0x10, 0x3C, - 0x0D, 0x06, 0x13, 0x0E, 0x09, 0x00, 0x14, 0x0B, 0x0A, - }, - { - 0x09, 0x01, 0x16, 0x0B, 0x50, 0x4B, 0x3F, 0x0D, 0x08, 0x2A, 0x17, 0x4F, - 0x28, 0x26, 0x36, 0x2D, 0x37, 0x2E, 0x40, 0x3C, 0x0E, 0x04, 0x25, 0x1E, - 0x10, 0x03, 0x1F, 0x11, 0x4E, 0x3E, 0x3D, 0x39, 0x34, 0x44, 0x3B, 0x29, - 0x21, 0x35, 0x31, 0x27, 0x22, 0x33, 0x30, 0x43, 0x38, 0x4D, 0x47, 0x07, - 0x05, 0x20, 0x0C, 0x4C, 0x3A, 0x32, 0x45, 0x42, 0x2B, 0x23, 0x2F, 0x2C, - 0x0A, 0x00, 0x13, 0x12, 0x4A, 0x1A, 0x49, 0x48, 0x1C, 0x1B, 0x24, 0x1D, - 0x0F, 0x06, 0x18, 0x15, 0x19, 0x02, 0x46, 0x41, 0x14, - }, - { - 0x50, 0x4A, 0x2D, 0x2B, 0x43, 0x27, 0x45, 0x44, 0x3E, 0x16, 0x00, 0x22, - 0x1B, 0x31, 0x28, 0x3A, 0x35, 0x21, 0x1F, 0x3B, 0x24, 0x06, 0x03, 0x12, - 0x10, 0x08, 0x04, 0x2C, 0x29, 0x4F, 0x4C, 0x40, 0x4D, 0x47, 0x48, 0x42, - 0x07, 0x4E, 0x39, 0x34, 0x3F, 0x3D, 0x46, 0x41, 0x4B, 0x49, 0x1D, 0x1A, - 0x11, 0x05, 0x26, 0x23, 0x2F, 0x0D, 0x02, 0x17, 0x15, 0x3C, 0x33, 0x30, - 0x38, 0x36, 0x20, 0x1E, 0x2A, 0x25, 0x13, 0x0B, 0x09, 0x01, 0x18, 0x0C, - 0x37, 0x14, 0x0F, 0x19, 0x0E, 0x32, 0x1C, 0x2E, 0x0A, - }, - { - 0x0C, 0x09, 0x19, 0x0D, 0x3C, 0x28, 0x25, 0x30, 0x2A, 0x17, 0x11, 0x20, - 0x1E, 0x3E, 0x39, 0x50, 0x40, 0x1F, 0x16, 0x2D, 0x2B, 0x22, 0x08, 0x2C, - 0x29, 0x4A, 0x43, 0x3F, 0x4C, 0x45, 0x1B, 0x04, 0x34, 0x27, 0x4B, 0x47, - 0x4E, 0x4D, 0x42, 0x07, 0x48, 0x44, 0x4F, 0x3B, 0x33, 0x03, 0x00, 0x12, - 0x06, 0x41, 0x2F, 0x1C, 0x38, 0x36, 0x13, 0x0E, 0x2E, 0x14, 0x0F, 0x0B, - 0x02, 0x01, 0x15, 0x10, 0x32, 0x46, 0x3A, 0x35, 0x31, 0x49, 0x3D, 0x21, - 0x05, 0x24, 0x23, 0x1A, 0x18, 0x26, 0x1D, 0x37, 0x0A, - }, - { - 0x14, 0x0A, 0x15, 0x0C, 0x1D, 0x17, 0x41, 0x29, 0x24, 0x34, 0x2D, 0x03, - 0x00, 0x1B, 0x08, 0x4E, 0x44, 0x48, 0x3E, 0x27, 0x04, 0x2B, 0x07, 0x2C, - 0x3B, 0x35, 0x4D, 0x4C, 0x47, 0x3A, 0x3D, 0x39, 0x43, 0x42, 0x06, 0x05, - 0x28, 0x22, 0x4F, 0x4B, 0x2A, 0x26, 0x31, 0x30, 0x11, 0x10, 0x21, 0x1F, - 0x3C, 0x32, 0x23, 0x16, 0x33, 0x25, 0x02, 0x01, 0x12, 0x0D, 0x0F, 0x0B, - 0x37, 0x19, 0x18, 0x0E, 0x1C, 0x1A, 0x13, 0x50, 0x4A, 0x38, 0x36, 0x45, - 0x3F, 0x1E, 0x09, 0x2F, 0x20, 0x40, 0x2E, 0x49, 0x46, - }, - { - 0x0F, 0x0B, 0x37, 0x14, 0x2E, 0x13, 0x0E, 0x2F, 0x1C, 0x32, 0x49, 0x3C, - 0x2A, 0x26, 0x38, 0x31, 0x0D, 0x01, 0x17, 0x15, 0x19, 0x0C, 0x33, 0x25, - 0x20, 0x1E, 0x35, 0x30, 0x18, 0x09, 0x1D, 0x1A, 0x4C, 0x46, 0x27, 0x00, - 0x3E, 0x2B, 0x4D, 0x29, 0x1F, 0x34, 0x2D, 0x05, 0x03, 0x22, 0x1B, 0x4F, - 0x4E, 0x45, 0x08, 0x07, 0x48, 0x44, 0x3F, 0x42, 0x04, 0x47, 0x43, 0x39, - 0x2C, 0x40, 0x3D, 0x4A, 0x3B, 0x10, 0x06, 0x16, 0x12, 0x50, 0x4B, 0x36, - 0x28, 0x24, 0x41, 0x3A, 0x11, 0x02, 0x23, 0x21, 0x0A, - }, - { - 0x3C, 0x01, 0x0D, 0x03, 0x16, 0x15, 0x38, 0x08, 0x04, 0x20, 0x12, 0x41, - 0x39, 0x35, 0x3F, 0x3E, 0x2C, 0x29, 0x31, 0x30, 0x18, 0x17, 0x3B, 0x28, - 0x0C, 0x05, 0x2E, 0x25, 0x37, 0x0F, 0x0B, 0x09, 0x06, 0x1A, 0x19, 0x36, - 0x24, 0x1D, 0x33, 0x2F, 0x10, 0x00, 0x1C, 0x11, 0x42, 0x1B, 0x44, 0x43, - 0x50, 0x4C, 0x4B, 0x4E, 0x48, 0x4D, 0x27, 0x23, 0x4F, 0x2B, 0x45, 0x40, - 0x2D, 0x22, 0x47, 0x34, 0x4A, 0x46, 0x3D, 0x1E, 0x07, 0x21, 0x1F, 0x49, - 0x2A, 0x26, 0x3A, 0x32, 0x0E, 0x02, 0x14, 0x13, 0x0A, - }, - { - 0x14, 0x00, 0x0A, 0x01, 0x12, 0x08, 0x50, 0x38, 0x19, 0x02, 0x07, 0x06, - 0x13, 0x0B, 0x1A, 0x4F, 0x3C, 0x1D, 0x1B, 0x23, 0x1E, 0x0E, 0x0D, 0x17, - 0x10, 0x18, 0x16, 0x36, 0x26, 0x47, 0x40, 0x4C, 0x49, 0x28, 0x15, 0x2F, - 0x2D, 0x48, 0x3F, 0x20, 0x0C, 0x2C, 0x2A, 0x4B, 0x2E, 0x24, 0x3A, 0x37, - 0x32, 0x2B, 0x43, 0x35, 0x11, 0x03, 0x25, 0x1C, 0x42, 0x3E, 0x27, 0x21, - 0x34, 0x29, 0x4D, 0x33, 0x31, 0x3D, 0x3B, 0x45, 0x44, 0x22, 0x1F, 0x39, - 0x30, 0x4E, 0x46, 0x41, 0x05, 0x04, 0x0F, 0x09, 0x4A, - }, - { - 0x14, 0x0B, 0x19, 0x13, 0x0D, 0x01, 0x12, 0x0E, 0x38, 0x02, 0x00, 0x0F, - 0x09, 0x36, 0x10, 0x41, 0x3C, 0x1A, 0x07, 0x06, 0x11, 0x0C, 0x4A, 0x32, - 0x24, 0x47, 0x40, 0x17, 0x15, 0x1D, 0x1C, 0x26, 0x18, 0x37, 0x2F, 0x16, - 0x08, 0x2D, 0x28, 0x46, 0x22, 0x1F, 0x39, 0x34, 0x4F, 0x4C, 0x48, 0x4E, - 0x4B, 0x29, 0x21, 0x4D, 0x42, 0x3F, 0x3E, 0x49, 0x43, 0x1E, 0x03, 0x23, - 0x20, 0x50, 0x33, 0x31, 0x45, 0x44, 0x2A, 0x27, 0x30, 0x2C, 0x3A, 0x2E, - 0x35, 0x2B, 0x3D, 0x3B, 0x05, 0x04, 0x25, 0x1B, 0x0A, - }, - { - 0x28, 0x24, 0x3C, 0x36, 0x15, 0x0F, 0x1D, 0x1B, 0x07, 0x06, 0x11, 0x0D, - 0x4E, 0x2D, 0x2B, 0x44, 0x32, 0x1E, 0x1C, 0x25, 0x20, 0x48, 0x3F, 0x4C, - 0x4B, 0x47, 0x40, 0x4F, 0x49, 0x46, 0x0B, 0x23, 0x17, 0x2F, 0x2E, 0x08, - 0x01, 0x10, 0x0E, 0x35, 0x31, 0x3E, 0x3D, 0x1F, 0x0C, 0x2C, 0x2A, 0x04, - 0x03, 0x21, 0x05, 0x4D, 0x33, 0x29, 0x3B, 0x34, 0x42, 0x27, 0x22, 0x39, - 0x30, 0x3A, 0x37, 0x45, 0x43, 0x16, 0x09, 0x38, 0x26, 0x13, 0x0A, 0x02, - 0x00, 0x18, 0x12, 0x50, 0x1A, 0x19, 0x4A, 0x41, 0x14, - }, - { - 0x1A, 0x19, 0x40, 0x3F, 0x4F, 0x47, 0x4A, 0x14, 0x46, 0x41, 0x07, 0x01, - 0x0D, 0x08, 0x49, 0x3C, 0x38, 0x48, 0x44, 0x24, 0x17, 0x2E, 0x2D, 0x02, - 0x00, 0x18, 0x12, 0x26, 0x16, 0x2F, 0x28, 0x0F, 0x09, 0x15, 0x10, 0x3A, - 0x36, 0x4E, 0x4B, 0x2A, 0x25, 0x32, 0x31, 0x2C, 0x2B, 0x35, 0x33, 0x11, - 0x04, 0x20, 0x1C, 0x34, 0x23, 0x1F, 0x03, 0x39, 0x30, 0x3D, 0x0C, 0x05, - 0x21, 0x1E, 0x42, 0x37, 0x27, 0x22, 0x3E, 0x3B, 0x29, 0x4D, 0x45, 0x43, - 0x0E, 0x06, 0x1D, 0x1B, 0x4C, 0x0B, 0x0A, 0x50, 0x13, - }, - { - 0x4A, 0x19, 0x08, 0x07, 0x0F, 0x09, 0x38, 0x45, 0x43, 0x2D, 0x25, 0x4E, - 0x3D, 0x0E, 0x0D, 0x23, 0x10, 0x24, 0x15, 0x37, 0x26, 0x0A, 0x02, 0x18, - 0x12, 0x41, 0x46, 0x1A, 0x0B, 0x01, 0x36, 0x16, 0x50, 0x2F, 0x28, 0x44, - 0x3A, 0x17, 0x06, 0x1D, 0x1B, 0x32, 0x2E, 0x3E, 0x35, 0x2A, 0x1E, 0x2C, - 0x2B, 0x27, 0x22, 0x33, 0x31, 0x0C, 0x03, 0x20, 0x1F, 0x4D, 0x42, 0x3B, - 0x39, 0x29, 0x21, 0x34, 0x30, 0x4B, 0x48, 0x05, 0x04, 0x1C, 0x11, 0x4C, - 0x3F, 0x3C, 0x4F, 0x49, 0x13, 0x00, 0x47, 0x40, 0x14, - }, - { - 0x4C, 0x49, 0x1D, 0x17, 0x4E, 0x4B, 0x09, 0x04, 0x15, 0x0D, 0x38, 0x18, - 0x3F, 0x3C, 0x26, 0x16, 0x3A, 0x28, 0x4F, 0x44, 0x40, 0x4D, 0x48, 0x32, - 0x2F, 0x3D, 0x37, 0x2D, 0x2C, 0x35, 0x2E, 0x11, 0x0E, 0x23, 0x1B, 0x1E, - 0x1C, 0x3B, 0x25, 0x05, 0x03, 0x0C, 0x08, 0x22, 0x21, 0x30, 0x27, 0x36, - 0x42, 0x3E, 0x39, 0x34, 0x29, 0x20, 0x33, 0x31, 0x47, 0x45, 0x24, 0x1F, - 0x2B, 0x2A, 0x06, 0x01, 0x10, 0x07, 0x46, 0x1A, 0x02, 0x00, 0x0B, 0x0A, - 0x50, 0x41, 0x19, 0x12, 0x0F, 0x43, 0x13, 0x4A, 0x14, - }, - { - 0x46, 0x0B, 0x49, 0x47, 0x41, 0x23, 0x1E, 0x2D, 0x28, 0x15, 0x01, 0x1C, - 0x17, 0x1F, 0x0C, 0x22, 0x20, 0x4E, 0x35, 0x32, 0x42, 0x3E, 0x27, 0x04, - 0x31, 0x30, 0x3A, 0x2A, 0x3B, 0x39, 0x34, 0x29, 0x3D, 0x05, 0x03, 0x33, - 0x21, 0x38, 0x2F, 0x4B, 0x3C, 0x26, 0x1D, 0x48, 0x40, 0x09, 0x08, 0x16, - 0x0F, 0x4F, 0x11, 0x10, 0x2B, 0x25, 0x07, 0x06, 0x0E, 0x0D, 0x44, 0x43, - 0x4D, 0x45, 0x2E, 0x2C, 0x37, 0x36, 0x24, 0x1B, 0x4C, 0x3F, 0x14, 0x4A, - 0x1A, 0x13, 0x0A, 0x02, 0x00, 0x18, 0x12, 0x19, 0x50, - }, - { - 0x41, 0x19, 0x4F, 0x49, 0x26, 0x1E, 0x2F, 0x2D, 0x0F, 0x08, 0x1C, 0x15, - 0x02, 0x00, 0x47, 0x12, 0x4A, 0x50, 0x1A, 0x23, 0x1D, 0x40, 0x38, 0x16, - 0x09, 0x1B, 0x18, 0x3A, 0x37, 0x45, 0x44, 0x28, 0x11, 0x35, 0x32, 0x31, - 0x2C, 0x29, 0x27, 0x34, 0x2A, 0x42, 0x20, 0x1F, 0x22, 0x21, 0x04, 0x03, - 0x0C, 0x05, 0x4D, 0x3B, 0x39, 0x3E, 0x3D, 0x2B, 0x25, 0x33, 0x30, 0x3F, - 0x36, 0x07, 0x06, 0x0E, 0x0D, 0x4C, 0x4B, 0x48, 0x3C, 0x2E, 0x4E, 0x43, - 0x10, 0x01, 0x24, 0x17, 0x0B, 0x0A, 0x46, 0x13, 0x14, - }, - { - 0x19, 0x13, 0x50, 0x41, 0x1A, 0x0B, 0x0A, 0x4B, 0x46, 0x4A, 0x48, 0x47, - 0x17, 0x16, 0x23, 0x1D, 0x08, 0x01, 0x11, 0x0F, 0x12, 0x02, 0x18, 0x15, - 0x49, 0x43, 0x4E, 0x4C, 0x09, 0x00, 0x38, 0x37, 0x04, 0x03, 0x0C, 0x06, - 0x45, 0x35, 0x2E, 0x3A, 0x36, 0x1C, 0x10, 0x25, 0x20, 0x28, 0x26, 0x3F, - 0x3C, 0x1E, 0x0E, 0x2C, 0x24, 0x4F, 0x3B, 0x32, 0x3D, 0x39, 0x31, 0x07, - 0x34, 0x33, 0x2A, 0x29, 0x2D, 0x2B, 0x42, 0x3E, 0x1B, 0x0D, 0x30, 0x27, - 0x44, 0x40, 0x2F, 0x1F, 0x05, 0x22, 0x21, 0x4D, 0x14, - }, - { - 0x13, 0x0D, 0x1D, 0x19, 0x09, 0x41, 0x3D, 0x4A, 0x46, 0x28, 0x24, 0x31, - 0x29, 0x25, 0x22, 0x3E, 0x33, 0x08, 0x01, 0x16, 0x0C, 0x47, 0x2C, 0x04, - 0x03, 0x27, 0x05, 0x49, 0x17, 0x07, 0x2B, 0x20, 0x1F, 0x06, 0x2A, 0x21, - 0x50, 0x4C, 0x4B, 0x44, 0x43, 0x45, 0x42, 0x4E, 0x4D, 0x3F, 0x3B, 0x48, - 0x40, 0x34, 0x30, 0x4F, 0x39, 0x2E, 0x2D, 0x15, 0x11, 0x1E, 0x1C, 0x37, - 0x0B, 0x38, 0x14, 0x02, 0x00, 0x10, 0x0E, 0x3C, 0x32, 0x26, 0x3A, 0x35, - 0x18, 0x12, 0x23, 0x1B, 0x1A, 0x0F, 0x36, 0x2F, 0x0A, - }, - { - 0x37, 0x0E, 0x19, 0x17, 0x1D, 0x1A, 0x06, 0x01, 0x16, 0x10, 0x47, 0x44, - 0x4F, 0x48, 0x4D, 0x08, 0x07, 0x42, 0x3F, 0x2C, 0x2B, 0x4C, 0x4B, 0x49, - 0x40, 0x50, 0x4E, 0x45, 0x43, 0x1B, 0x04, 0x27, 0x22, 0x4A, 0x41, 0x3D, - 0x12, 0x03, 0x34, 0x29, 0x46, 0x2F, 0x21, 0x25, 0x23, 0x3E, 0x35, 0x05, - 0x00, 0x1F, 0x1E, 0x32, 0x18, 0x36, 0x33, 0x0A, 0x3C, 0x0F, 0x3A, 0x2E, - 0x09, 0x02, 0x15, 0x11, 0x38, 0x31, 0x30, 0x3B, 0x39, 0x24, 0x20, 0x2D, - 0x26, 0x1C, 0x0C, 0x2A, 0x28, 0x0D, 0x0B, 0x14, 0x13, - }, - { - 0x14, 0x13, 0x0B, 0x01, 0x0F, 0x0E, 0x4A, 0x50, 0x4F, 0x26, 0x24, 0x36, - 0x28, 0x06, 0x05, 0x1C, 0x09, 0x3C, 0x37, 0x4B, 0x45, 0x18, 0x17, 0x41, - 0x19, 0x49, 0x0A, 0x2A, 0x25, 0x4C, 0x38, 0x0C, 0x02, 0x16, 0x12, 0x48, - 0x44, 0x3B, 0x39, 0x3E, 0x31, 0x22, 0x07, 0x34, 0x1B, 0x2D, 0x2F, 0x2C, - 0x42, 0x3D, 0x43, 0x32, 0x30, 0x2B, 0x35, 0x33, 0x1F, 0x04, 0x27, 0x23, - 0x3F, 0x3A, 0x10, 0x00, 0x29, 0x21, 0x47, 0x4E, 0x4D, 0x1E, 0x1D, 0x2E, - 0x20, 0x08, 0x03, 0x11, 0x0D, 0x1A, 0x15, 0x46, 0x40, + 0x06, 0x01, 0x28, 0x11, 0x22, 0x20, 0x04, 0x07, 0x05, 0x16, 0x08, 0x60, + 0x02, 0x66, 0x61, 0x23, 0x15, 0x31, 0x26, 0x77, 0x12, 0x10, 0x42, 0x21, + 0x72, 0x50, 0x88, 0x82, 0x27, 0x24, 0x44, 0x40, 0x62, 0x55, 0x18, 0x13, + 0x53, 0x52, 0x64, 0x46, 0x41, 0x51, 0x47, 0x33, 0x32, 0x74, 0x67, 0x14, + 0x03, 0x30, 0x25, 0x36, 0x34, 0x45, 0x37, 0x78, 0x85, 0x84, 0x75, 0x73, + 0x57, 0x86, 0x65, 0x58, 0x71, 0x68, 0x70, 0x56, 0x54, 0x17, 0x76, 0x63, + 0x87, 0x81, 0x80, 0x38, 0x35, 0x48, 0x43, 0x83, 0x00, + }, + { + 0x77, 0x62, 0x46, 0x33, 0x68, 0x52, 0x18, 0x05, 0x31, 0x25, 0x42, 0x04, + 0x51, 0x44, 0x40, 0x32, 0x55, 0x41, 0x26, 0x24, 0x30, 0x27, 0x57, 0x36, + 0x84, 0x76, 0x81, 0x83, 0x78, 0x73, 0x45, 0x85, 0x75, 0x86, 0x87, 0x56, + 0x53, 0x80, 0x67, 0x35, 0x34, 0x43, 0x37, 0x82, 0x70, 0x65, 0x74, 0x71, + 0x54, 0x48, 0x63, 0x58, 0x72, 0x64, 0x07, 0x03, 0x47, 0x38, 0x88, 0x20, + 0x01, 0x60, 0x28, 0x16, 0x02, 0x61, 0x50, 0x13, 0x08, 0x23, 0x17, 0x66, + 0x14, 0x06, 0x21, 0x15, 0x10, 0x00, 0x22, 0x12, 0x11, + }, + { + 0x10, 0x01, 0x24, 0x12, 0x88, 0x83, 0x70, 0x14, 0x08, 0x46, 0x25, 0x87, + 0x44, 0x42, 0x60, 0x50, 0x61, 0x51, 0x71, 0x66, 0x15, 0x04, 0x41, 0x33, + 0x17, 0x03, 0x34, 0x18, 0x86, 0x68, 0x67, 0x63, 0x57, 0x75, 0x65, 0x45, + 0x36, 0x58, 0x54, 0x43, 0x37, 0x56, 0x53, 0x74, 0x62, 0x85, 0x78, 0x07, + 0x05, 0x35, 0x13, 0x84, 0x64, 0x55, 0x76, 0x73, 0x47, 0x38, 0x52, 0x48, + 0x11, 0x00, 0x21, 0x20, 0x82, 0x28, 0x81, 0x80, 0x31, 0x30, 0x40, 0x32, + 0x16, 0x06, 0x26, 0x23, 0x27, 0x02, 0x77, 0x72, 0x22, + }, + { + 0x88, 0x82, 0x50, 0x47, 0x74, 0x43, 0x76, 0x75, 0x68, 0x24, 0x00, 0x37, + 0x30, 0x54, 0x44, 0x64, 0x58, 0x36, 0x34, 0x65, 0x40, 0x06, 0x03, 0x20, + 0x17, 0x08, 0x04, 0x48, 0x45, 0x87, 0x84, 0x71, 0x85, 0x78, 0x80, 0x73, + 0x07, 0x86, 0x63, 0x57, 0x70, 0x67, 0x77, 0x72, 0x83, 0x81, 0x32, 0x28, + 0x18, 0x05, 0x42, 0x38, 0x52, 0x14, 0x02, 0x25, 0x23, 0x66, 0x56, 0x53, + 0x62, 0x60, 0x35, 0x33, 0x46, 0x41, 0x21, 0x12, 0x10, 0x01, 0x26, 0x13, + 0x61, 0x22, 0x16, 0x27, 0x15, 0x55, 0x31, 0x51, 0x11, + }, + { + 0x13, 0x10, 0x27, 0x14, 0x66, 0x44, 0x41, 0x53, 0x46, 0x25, 0x18, 0x35, + 0x33, 0x68, 0x63, 0x88, 0x71, 0x34, 0x24, 0x50, 0x47, 0x37, 0x08, 0x48, + 0x45, 0x82, 0x74, 0x70, 0x84, 0x76, 0x30, 0x04, 0x57, 0x43, 0x83, 0x78, + 0x86, 0x85, 0x73, 0x07, 0x80, 0x75, 0x87, 0x65, 0x56, 0x03, 0x00, 0x20, + 0x06, 0x72, 0x52, 0x31, 0x62, 0x60, 0x21, 0x15, 0x51, 0x22, 0x16, 0x12, + 0x02, 0x01, 0x23, 0x17, 0x55, 0x77, 0x64, 0x58, 0x54, 0x81, 0x67, 0x36, + 0x05, 0x40, 0x38, 0x28, 0x26, 0x42, 0x32, 0x61, 0x11, + }, + { + 0x22, 0x11, 0x23, 0x13, 0x32, 0x25, 0x72, 0x45, 0x40, 0x57, 0x50, 0x03, + 0x00, 0x30, 0x08, 0x86, 0x75, 0x80, 0x68, 0x43, 0x04, 0x47, 0x07, 0x48, + 0x65, 0x58, 0x85, 0x84, 0x78, 0x64, 0x67, 0x63, 0x74, 0x73, 0x06, 0x05, + 0x44, 0x37, 0x87, 0x83, 0x46, 0x42, 0x54, 0x53, 0x18, 0x17, 0x36, 0x34, + 0x66, 0x55, 0x38, 0x24, 0x56, 0x41, 0x02, 0x01, 0x20, 0x14, 0x16, 0x12, + 0x61, 0x27, 0x26, 0x15, 0x31, 0x28, 0x21, 0x88, 0x82, 0x62, 0x60, 0x76, + 0x70, 0x33, 0x10, 0x52, 0x35, 0x71, 0x51, 0x81, 0x77, + }, + { + 0x16, 0x12, 0x61, 0x22, 0x51, 0x21, 0x15, 0x52, 0x31, 0x55, 0x81, 0x66, + 0x46, 0x42, 0x62, 0x54, 0x14, 0x01, 0x25, 0x23, 0x27, 0x13, 0x56, 0x41, + 0x35, 0x33, 0x58, 0x53, 0x26, 0x10, 0x32, 0x28, 0x84, 0x77, 0x43, 0x00, + 0x68, 0x47, 0x85, 0x45, 0x34, 0x57, 0x50, 0x05, 0x03, 0x37, 0x30, 0x87, + 0x86, 0x76, 0x08, 0x07, 0x80, 0x75, 0x70, 0x73, 0x04, 0x78, 0x74, 0x63, + 0x48, 0x71, 0x67, 0x82, 0x65, 0x17, 0x06, 0x24, 0x20, 0x88, 0x83, 0x60, + 0x44, 0x40, 0x72, 0x64, 0x18, 0x02, 0x38, 0x36, 0x11, + }, + { + 0x66, 0x01, 0x14, 0x03, 0x24, 0x23, 0x62, 0x08, 0x04, 0x35, 0x20, 0x72, + 0x63, 0x58, 0x70, 0x68, 0x48, 0x45, 0x54, 0x53, 0x26, 0x25, 0x65, 0x44, + 0x13, 0x05, 0x51, 0x41, 0x61, 0x16, 0x12, 0x10, 0x06, 0x28, 0x27, 0x60, + 0x40, 0x32, 0x56, 0x52, 0x17, 0x00, 0x31, 0x18, 0x73, 0x30, 0x75, 0x74, + 0x88, 0x84, 0x83, 0x86, 0x80, 0x85, 0x43, 0x38, 0x87, 0x47, 0x76, 0x71, + 0x50, 0x37, 0x78, 0x57, 0x82, 0x77, 0x67, 0x33, 0x07, 0x36, 0x34, 0x81, + 0x46, 0x42, 0x64, 0x55, 0x15, 0x02, 0x22, 0x21, 0x11, + }, + { + 0x22, 0x00, 0x11, 0x01, 0x20, 0x08, 0x88, 0x62, 0x27, 0x02, 0x07, 0x06, + 0x21, 0x12, 0x28, 0x87, 0x66, 0x32, 0x30, 0x38, 0x33, 0x15, 0x14, 0x25, + 0x17, 0x26, 0x24, 0x60, 0x42, 0x78, 0x71, 0x84, 0x81, 0x44, 0x23, 0x52, + 0x50, 0x80, 0x70, 0x35, 0x13, 0x48, 0x46, 0x83, 0x51, 0x40, 0x64, 0x61, + 0x55, 0x47, 0x74, 0x58, 0x18, 0x03, 0x41, 0x31, 0x73, 0x68, 0x43, 0x36, + 0x57, 0x45, 0x85, 0x56, 0x54, 0x67, 0x65, 0x76, 0x75, 0x37, 0x34, 0x63, + 0x53, 0x86, 0x77, 0x72, 0x05, 0x04, 0x16, 0x10, 0x82, + }, + { + 0x22, 0x12, 0x27, 0x21, 0x14, 0x01, 0x20, 0x15, 0x62, 0x02, 0x00, 0x16, + 0x10, 0x60, 0x17, 0x72, 0x66, 0x28, 0x07, 0x06, 0x18, 0x13, 0x82, 0x55, + 0x40, 0x78, 0x71, 0x25, 0x23, 0x32, 0x31, 0x42, 0x26, 0x61, 0x52, 0x24, + 0x08, 0x50, 0x44, 0x77, 0x37, 0x34, 0x63, 0x57, 0x87, 0x84, 0x80, 0x86, + 0x83, 0x45, 0x36, 0x85, 0x73, 0x70, 0x68, 0x81, 0x74, 0x33, 0x03, 0x38, + 0x35, 0x88, 0x56, 0x54, 0x76, 0x75, 0x46, 0x43, 0x53, 0x48, 0x64, 0x51, + 0x58, 0x47, 0x67, 0x65, 0x05, 0x04, 0x41, 0x30, 0x11, + }, + { + 0x44, 0x40, 0x66, 0x60, 0x23, 0x16, 0x32, 0x30, 0x07, 0x06, 0x18, 0x14, + 0x86, 0x50, 0x47, 0x75, 0x55, 0x33, 0x31, 0x41, 0x35, 0x80, 0x70, 0x84, + 0x83, 0x78, 0x71, 0x87, 0x81, 0x77, 0x12, 0x38, 0x25, 0x52, 0x51, 0x08, + 0x01, 0x17, 0x15, 0x58, 0x54, 0x68, 0x67, 0x34, 0x13, 0x48, 0x46, 0x04, + 0x03, 0x36, 0x05, 0x85, 0x56, 0x45, 0x65, 0x57, 0x73, 0x43, 0x37, 0x63, + 0x53, 0x64, 0x61, 0x76, 0x74, 0x24, 0x10, 0x62, 0x42, 0x21, 0x11, 0x02, + 0x00, 0x26, 0x20, 0x88, 0x28, 0x27, 0x82, 0x72, 0x22, + }, + { + 0x28, 0x27, 0x71, 0x70, 0x87, 0x78, 0x82, 0x22, 0x77, 0x72, 0x07, 0x01, + 0x14, 0x08, 0x81, 0x66, 0x62, 0x80, 0x75, 0x40, 0x25, 0x51, 0x50, 0x02, + 0x00, 0x26, 0x20, 0x42, 0x24, 0x52, 0x44, 0x16, 0x10, 0x23, 0x17, 0x64, + 0x60, 0x86, 0x83, 0x46, 0x41, 0x55, 0x54, 0x48, 0x47, 0x58, 0x56, 0x18, + 0x04, 0x35, 0x31, 0x57, 0x38, 0x34, 0x03, 0x63, 0x53, 0x67, 0x13, 0x05, + 0x36, 0x33, 0x73, 0x61, 0x43, 0x37, 0x68, 0x65, 0x45, 0x85, 0x76, 0x74, + 0x15, 0x06, 0x32, 0x30, 0x84, 0x12, 0x11, 0x88, 0x21, + }, + { + 0x82, 0x27, 0x08, 0x07, 0x16, 0x10, 0x62, 0x76, 0x74, 0x50, 0x41, 0x86, + 0x67, 0x15, 0x14, 0x38, 0x17, 0x40, 0x23, 0x61, 0x42, 0x11, 0x02, 0x26, + 0x20, 0x72, 0x77, 0x28, 0x12, 0x01, 0x60, 0x24, 0x88, 0x52, 0x44, 0x75, + 0x64, 0x25, 0x06, 0x32, 0x30, 0x55, 0x51, 0x68, 0x58, 0x46, 0x33, 0x48, + 0x47, 0x43, 0x37, 0x56, 0x54, 0x13, 0x03, 0x35, 0x34, 0x85, 0x73, 0x65, + 0x63, 0x45, 0x36, 0x57, 0x53, 0x83, 0x80, 0x05, 0x04, 0x31, 0x18, 0x84, + 0x70, 0x66, 0x87, 0x81, 0x21, 0x00, 0x78, 0x71, 0x22, + }, + { + 0x84, 0x81, 0x32, 0x25, 0x86, 0x83, 0x10, 0x04, 0x23, 0x14, 0x62, 0x26, + 0x70, 0x66, 0x42, 0x24, 0x64, 0x44, 0x87, 0x75, 0x71, 0x85, 0x80, 0x55, + 0x52, 0x67, 0x61, 0x50, 0x48, 0x58, 0x51, 0x18, 0x15, 0x38, 0x30, 0x33, + 0x31, 0x65, 0x41, 0x05, 0x03, 0x13, 0x08, 0x37, 0x36, 0x53, 0x43, 0x60, + 0x73, 0x68, 0x63, 0x57, 0x45, 0x35, 0x56, 0x54, 0x78, 0x76, 0x40, 0x34, + 0x47, 0x46, 0x06, 0x01, 0x17, 0x07, 0x77, 0x28, 0x02, 0x00, 0x12, 0x11, + 0x88, 0x72, 0x27, 0x20, 0x16, 0x74, 0x21, 0x82, 0x22, + }, + { + 0x77, 0x12, 0x81, 0x78, 0x72, 0x38, 0x33, 0x50, 0x44, 0x23, 0x01, 0x31, + 0x25, 0x34, 0x13, 0x37, 0x35, 0x86, 0x58, 0x55, 0x73, 0x68, 0x43, 0x04, + 0x54, 0x53, 0x64, 0x46, 0x65, 0x63, 0x57, 0x45, 0x67, 0x05, 0x03, 0x56, + 0x36, 0x62, 0x52, 0x83, 0x66, 0x42, 0x32, 0x80, 0x71, 0x10, 0x08, 0x24, + 0x16, 0x87, 0x18, 0x17, 0x47, 0x41, 0x07, 0x06, 0x15, 0x14, 0x75, 0x74, + 0x85, 0x76, 0x51, 0x48, 0x61, 0x60, 0x40, 0x30, 0x84, 0x70, 0x22, 0x82, + 0x28, 0x21, 0x11, 0x02, 0x00, 0x26, 0x20, 0x27, 0x88, + }, + { + 0x72, 0x27, 0x87, 0x81, 0x42, 0x33, 0x52, 0x50, 0x16, 0x08, 0x31, 0x23, + 0x02, 0x00, 0x78, 0x20, 0x82, 0x88, 0x28, 0x38, 0x32, 0x71, 0x62, 0x24, + 0x10, 0x30, 0x26, 0x64, 0x61, 0x76, 0x75, 0x44, 0x18, 0x58, 0x55, 0x54, + 0x48, 0x45, 0x43, 0x57, 0x46, 0x73, 0x35, 0x34, 0x37, 0x36, 0x04, 0x03, + 0x13, 0x05, 0x85, 0x65, 0x63, 0x68, 0x67, 0x47, 0x41, 0x56, 0x53, 0x70, + 0x60, 0x07, 0x06, 0x15, 0x14, 0x84, 0x83, 0x80, 0x66, 0x51, 0x86, 0x74, + 0x17, 0x01, 0x40, 0x25, 0x12, 0x11, 0x77, 0x21, 0x22, + }, + { + 0x27, 0x21, 0x88, 0x72, 0x28, 0x12, 0x11, 0x83, 0x77, 0x82, 0x80, 0x78, + 0x25, 0x24, 0x38, 0x32, 0x08, 0x01, 0x18, 0x16, 0x20, 0x02, 0x26, 0x23, + 0x81, 0x74, 0x86, 0x84, 0x10, 0x00, 0x62, 0x61, 0x04, 0x03, 0x13, 0x06, + 0x76, 0x58, 0x51, 0x64, 0x60, 0x31, 0x17, 0x41, 0x35, 0x44, 0x42, 0x70, + 0x66, 0x33, 0x15, 0x48, 0x40, 0x87, 0x65, 0x55, 0x67, 0x63, 0x54, 0x07, + 0x57, 0x56, 0x46, 0x45, 0x50, 0x47, 0x73, 0x68, 0x30, 0x14, 0x53, 0x43, + 0x75, 0x71, 0x52, 0x34, 0x05, 0x37, 0x36, 0x85, 0x22, + }, + { + 0x21, 0x14, 0x32, 0x27, 0x10, 0x72, 0x67, 0x82, 0x77, 0x44, 0x40, 0x54, + 0x45, 0x41, 0x37, 0x68, 0x56, 0x08, 0x01, 0x24, 0x13, 0x78, 0x48, 0x04, + 0x03, 0x43, 0x05, 0x81, 0x25, 0x07, 0x47, 0x35, 0x34, 0x06, 0x46, 0x36, + 0x88, 0x84, 0x83, 0x75, 0x74, 0x76, 0x73, 0x86, 0x85, 0x70, 0x65, 0x80, + 0x71, 0x57, 0x53, 0x87, 0x63, 0x51, 0x50, 0x23, 0x18, 0x33, 0x31, 0x61, + 0x12, 0x62, 0x22, 0x02, 0x00, 0x17, 0x15, 0x66, 0x55, 0x42, 0x64, 0x58, + 0x26, 0x20, 0x38, 0x30, 0x28, 0x16, 0x60, 0x52, 0x11, + }, + { + 0x61, 0x15, 0x27, 0x25, 0x32, 0x28, 0x06, 0x01, 0x24, 0x17, 0x78, 0x75, + 0x87, 0x80, 0x85, 0x08, 0x07, 0x73, 0x70, 0x48, 0x47, 0x84, 0x83, 0x81, + 0x71, 0x88, 0x86, 0x76, 0x74, 0x30, 0x04, 0x43, 0x37, 0x82, 0x72, 0x67, + 0x20, 0x03, 0x57, 0x45, 0x77, 0x52, 0x36, 0x41, 0x38, 0x68, 0x58, 0x05, + 0x00, 0x34, 0x33, 0x55, 0x26, 0x60, 0x56, 0x11, 0x66, 0x16, 0x64, 0x51, + 0x10, 0x02, 0x23, 0x18, 0x62, 0x54, 0x53, 0x65, 0x63, 0x40, 0x35, 0x50, + 0x42, 0x31, 0x13, 0x46, 0x44, 0x14, 0x12, 0x22, 0x21, + }, + { + 0x22, 0x21, 0x12, 0x01, 0x16, 0x15, 0x82, 0x88, 0x87, 0x42, 0x40, 0x60, + 0x44, 0x06, 0x05, 0x31, 0x10, 0x66, 0x61, 0x83, 0x76, 0x26, 0x25, 0x72, + 0x27, 0x81, 0x11, 0x46, 0x41, 0x84, 0x62, 0x13, 0x02, 0x24, 0x20, 0x80, + 0x75, 0x65, 0x63, 0x68, 0x54, 0x37, 0x07, 0x57, 0x30, 0x50, 0x52, 0x48, + 0x73, 0x67, 0x74, 0x55, 0x53, 0x47, 0x58, 0x56, 0x34, 0x04, 0x43, 0x38, + 0x70, 0x64, 0x17, 0x00, 0x45, 0x36, 0x78, 0x86, 0x85, 0x33, 0x32, 0x51, + 0x35, 0x08, 0x03, 0x18, 0x14, 0x28, 0x23, 0x77, 0x71, }, }; From patchwork Fri Nov 20 07:19:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23763 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 AFAFC44AC1A for ; Fri, 20 Nov 2020 09:25:43 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 982DB68BBBB; Fri, 20 Nov 2020 09:25:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 05E6168BB8F for ; Fri, 20 Nov 2020 09:25:24 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id e18so8491418edy.6 for ; Thu, 19 Nov 2020 23:25:24 -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=6o6hbAL2aRWfoF6KK9sgLAPvHQLgGk7FAAnsRIRWG94=; b=okrPxzPCGAjI6UfTEU0aVLU5JOZ6jV9uf9+xsttl56As53Hj4ywiA5VkjmfwClerRb C30XjEAipi48HmnxrEJjMrlusHoo1bd8lfNfkVn3GneA1vmXBR0rXIZyUlOrnIrBCmd/ d8Qpd99kha2ejxVIE9W11KEVmmRRUNIlUp4iNBQ8or2roLovbXHUgTJybh88bDImLWH9 MHiWUunFHA6n8GQn95m++tCzF2+szIZqWaQjgQy37EKM7StZrtLXMypobg93GBAr6UwB 9GvQQ7P3M/D2jGn1KLGhRFckeWoXlrhbW0F9VyllWF0Weogc9nblUmhCOkec04IAxW4R kaGA== 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=6o6hbAL2aRWfoF6KK9sgLAPvHQLgGk7FAAnsRIRWG94=; b=hqN3mhjsTP/n2vy8q+NZmG4QVo+57HRndlrrLQ/8EoZYXGWtFEC4zelMDi0V0nMSPI igZ514kVR/I/Li5xu9q7FF3vkSvvUE/Apf2m/0wARiOvjulMHzYcTBCDxWns7UBdSjTf 8hLCia7Z6S3E2eMJ72TiJ13pOXVnZKCb0h5iCFD9SdZkRgvBkpSnPpM4TV8iF8JGrNSB 0y+myl7zJ7MxGBhanoz2Z3kM1T40PuDLE22W8HxrnJp4N7Ew42woFTaoqZS6JTBVcZEe Afv5aCCGYF4R3ISBw3L1YEpumK0BhoJOxKMqJIEuoMyQXzb2xxVBxXQ9IieIgSmC0Fi6 Trwg== X-Gm-Message-State: AOAM533WJwhaclatf/zIa09qhoWefMWYzYrqe55TtZcQJxK3JMob4cEW kQiEmN01RymGJ6NHOHkEY9ceOu2qsb/5Ug== X-Google-Smtp-Source: ABdhPJwAC8fnmOpB/ZoAwdGLw76vRVW2ihoaIvnH+V01drgDcPyKp0PWHfmMYAIHBpYBSvKIKeSBRw== X-Received: by 2002:aa7:cdd3:: with SMTP id h19mr34994189edw.330.1605857124182; Thu, 19 Nov 2020 23:25:24 -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.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:23 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:47 +0100 Message-Id: <20201120072116.818090-75-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 074/162] avcodec/rv40: Avoid offset table when initializing static 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/rv40.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c index 6f9f2c5665..b1c434d8f4 100644 --- a/libavcodec/rv40.c +++ b/libavcodec/rv40.c @@ -41,11 +41,6 @@ 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 const int16_t mode2_offs[] = { - 0, 614, 1222, 1794, 2410, 3014, 3586, 4202, 4792, 5382, 5966, 6542, - 7138, 7716, 8292, 8864, 9444, 10030, 10642, 11212, 11814 -}; - /** * Initialize all tables. */ @@ -72,7 +67,7 @@ static av_cold void rv40_init_tables(void) aic_mode1_vlc_bits[i], 1, 1, aic_mode1_vlc_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); } - for(i = 0; i < AIC_MODE2_NUM; i++){ + for (unsigned i = 0, offset = 0; i < AIC_MODE2_NUM; i++){ uint16_t syms[AIC_MODE2_SIZE]; for (int j = 0; j < AIC_MODE2_SIZE; j++) { @@ -83,11 +78,12 @@ static av_cold void rv40_init_tables(void) else syms[j] = first | (second << 8); } - aic_mode2_vlc[i].table = &aic_mode2_table[mode2_offs[i]]; - aic_mode2_vlc[i].table_allocated = mode2_offs[i + 1] - mode2_offs[i]; + aic_mode2_vlc[i].table = &aic_mode2_table[offset]; + aic_mode2_vlc[i].table_allocated = FF_ARRAY_ELEMS(aic_mode2_table) - offset; ff_init_vlc_from_lengths(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE, aic_mode2_vlc_bits[i], 1, - syms, 2, 2, 0, INIT_VLC_USE_NEW_STATIC, NULL); + syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); + 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]; From patchwork Fri Nov 20 07:19:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23829 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 21179448A07 for ; Fri, 20 Nov 2020 09:38:11 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B1A3968BC0C; Fri, 20 Nov 2020 09:25:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 130FD68BAF4 for ; Fri, 20 Nov 2020 09:25:27 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id a15so8503509edy.1 for ; Thu, 19 Nov 2020 23:25:27 -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=VvEorXG068VOr4+igBpLA+g/6hjEeMloZyktDi32ul4=; b=fjyQjcjtHTZnPlRWevLr/OIx+CMRZEuNy4ZRYody3CkVNW3xASdnoSYF+V7IHGAKvQ HO0hMaldmi1qavZPypl0d6j3+UQ6E4Ou2Sy9vvlR/wrl1Fxwnwdlb3SAP9Og+Did6+s7 75XxR7aIXWfPe1NTMMoifcq3IPkIMWi3cZ9Ws+sD9BDi8pRqjId2x0YIYlWTy3Y+CgEI MlbadG/V1BoR4ZKo9/67O2XMq0pY9ZwdsHQpPApFsnIzlRP2gchGDWDRhsmPByh2zo7D xIA1YaVb2LSQ2Gt3cZ5ARm9gMHyKUK7RJbqEuu09GiYHmWcwzMQi07NfQHJDTwbDiwcO QQQg== 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=VvEorXG068VOr4+igBpLA+g/6hjEeMloZyktDi32ul4=; b=scs2rzZp9a81CV72RR8vEn6rgcw/2BM7BaiRr/79r0uYFN0OsyESx9L97C3nGDBB4u 3+hQ5fi0j38MVEC9ikBBJ/5++A6idtzZU+w4NsZnFAzPF0m+bKFn9zTn8d9XGSGIW1dy 4xYWt1XXI24Mbjf9nRrV+A2CALRdzsaW11t95U/F9rZ79J8rI4qbALqMCTlzUhzC5fJv G9pb5XVRe8EkIE/wJ1tn79OXnLPY4ShUFOo1CmGqyGnGLiW01GYWWDv0ed0c3mfb5XZb MVG+XQvCFAKvNVEuritcgiFtPMdPIyWAsTp1J21OPUmunrtD1cxC1sHVLMo+pZFF5uED 3npw== X-Gm-Message-State: AOAM530wDRUMPaCPnswWt3mPJKQEOdrUFCP8+QXJBxTXgQHwxwk4n84N bwBqN00eh/oH0ZZHMUoojtwMLqyikrhveA== X-Google-Smtp-Source: ABdhPJz6pTOU0rRLl7mlnZ60C3NzjOF0r/IELY/ghJYsw395VN/QQMDDYn092JXluHO7fx+/EyNOkw== X-Received: by 2002:a50:fd16:: with SMTP id i22mr385431eds.147.1605857125566; Thu, 19 Nov 2020 23:25:25 -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.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:24 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:48 +0100 Message-Id: <20201120072116.818090-76-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 075/162] 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 b1c434d8f4..e0903226b9 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, NULL); +} + /** * 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, NULL); + 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, NULL); + 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, 3, 6, 3, 5, 3, 7, 7,}, - { 6, 1, 4, 4, 5, 2, 4, 7, 7,}, - { 7, 1, 5, 7, 4, 3, 2, 7, 7,}, - { 5, 3, 2, 7, 5, 6, 1, 5, 7,}, - { 4, 1, 2, 6, 7, 5, 4, 7, 4,}, - { 1, 0, 1, 0, 0, 0, 0, 0, 0,}, - - { 3, 3, 1, 5, 5, 6, 6, 5, 3,}, - { 6, 2, 1, 5, 6, 5, 4, 4, 5,}, - { 6, 4, 1, 7, 6, 7, 6, 3, 2,}, - { 4, 3, 1, 4, 6, 4, 6, 5, 3,}, - { 6, 5, 1, 7, 4, 7, 3, 3, 3,}, - { 7, 2, 2, 3, 7, 2, 4, 6, 5,}, - { 6, 2, 2, 6, 4, 5, 2, 4, 4,}, - { 4, 4, 1, 7, 6, 7, 5, 2, 4,}, - { 5, 4, 1, 5, 6, 6, 5, 4, 2,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - - { 2, 2, 2, 3, 5, 5, 6, 6, 5,}, - { 7, 1, 3, 3, 6, 3, 4, 7, 5,}, - { 2, 4, 1, 4, 6, 7, 7, 5, 4,}, - { 7, 4, 3, 1, 5, 3, 6, 7, 3,}, - { 4, 3, 3, 4, 1, 6, 4, 6, 5,}, - { 7, 4, 4, 2, 6, 1, 4, 7, 5,}, - { 5, 2, 3, 4, 4, 3, 2, 5, 4,}, - { 3, 5, 2, 3, 2, 5, 5, 5, 3,}, - { 6, 4, 4, 2, 5, 4, 7, 7, 1,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - - { 2, 2, 2, 7, 3, 7, 4, 5, 6,}, - { 4, 1, 3, 6, 4, 4, 3, 6, 5,}, - { 2, 4, 1, 7, 3, 7, 6, 6, 6,}, - { 3, 4, 3, 5, 1, 4, 4, 6, 6,}, - { 4, 5, 2, 7, 1, 7, 3, 7, 7,}, - { 6, 2, 3, 5, 3, 3, 2, 6, 4,}, - { 4, 4, 4, 7, 2, 5, 1, 6, 7,}, - { 4, 5, 2, 7, 1, 7, 4, 4, 6,}, - { 2, 4, 2, 6, 2, 4, 6, 5, 4,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - - { 1, 3, 3, 5, 6, 3, 5, 6, 5,}, - { 7, 1, 4, 4, 6, 2, 4, 7, 5,}, - { 2, 2, 2, 6, 5, 3, 5, 6, 5,}, - { 7, 4, 4, 2, 6, 1, 5, 7, 4,}, - { 3, 2, 2, 4, 4, 3, 4, 5, 5,}, - { 7, 2, 5, 3, 7, 1, 4, 7, 7,}, - { 6, 2, 3, 4, 5, 2, 2, 7, 7,}, - { 3, 2, 2, 5, 5, 4, 4, 4, 3,}, - { 3, 2, 2, 4, 6, 3, 5, 6, 3,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - - { 1, 3, 3, 7, 4, 6, 3, 5, 7,}, - { 4, 1, 4, 7, 4, 5, 2, 6, 7,}, - { 2, 4, 1, 7, 5, 7, 3, 7, 7,}, - { 3, 2, 3, 5, 3, 4, 2, 6, 6,}, - { 3, 5, 4, 7, 2, 7, 1, 7, 7,}, - { 4, 1, 3, 6, 5, 3, 3, 7, 7,}, - { 4, 2, 5, 7, 3, 7, 1, 7, 7,}, - { 7, 4, 1, 7, 3, 7, 2, 5, 7,}, - { 4, 2, 2, 6, 4, 5, 2, 6, 4,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - - { 3, 4, 1, 7, 6, 7, 6, 2, 6,}, - { 4, 2, 2, 6, 6, 5, 4, 2, 4,}, - { 4, 4, 1, 7, 5, 7, 6, 2, 4,}, - { 3, 3, 2, 5, 4, 4, 5, 2, 4,}, - { 4, 5, 2, 7, 2, 7, 3, 2, 6,}, - { 4, 3, 2, 5, 5, 4, 3, 2, 4,}, - { 7, 4, 2, 7, 2, 5, 3, 2, 6,}, - { 4, 6, 2, 7, 3, 7, 6, 1, 6,}, - { 5, 5, 1, 6, 4, 6, 5, 2, 4,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - - { 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 */ }; //@} From patchwork Fri Nov 20 07:19:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23830 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 A1916448A07 for ; Fri, 20 Nov 2020 09:38:23 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 842D768BBEB; Fri, 20 Nov 2020 09:25:46 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5510168BB04 for ; Fri, 20 Nov 2020 09:25:27 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id oq3so11475023ejb.7 for ; Thu, 19 Nov 2020 23:25:27 -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=wp27dglr9Ec2vlyz0jFxBWDYiLrww9hNQpMb2Fx4eS4=; b=GauZceyJKBdJx50mNnjmR5gRaBFo+ttLqOZXQ/l0c1GtTI1QetNN/M95xQpz5DcWog kF+qwvmWVdqCHHdkmdXJrrlsb+borsFnE6KxUyfYMTOtCgrfK8wBZs64WXEVgqsZJIeo fD2SLCDSZ10eeYjia5W1u61mL3diRVytucIeJamlgyr1eUr55/yKw7h/e0RyAK1L+jL2 UZ8P8b50LsQ+QqD/keiSe1R3UsY/3eedak/aAVSH1Hs329wvvo+W85CjMl/yQVLg/AiB DuWrelzn8tejagUzvB/cpjkiddiDS2hjkEWM3JF5bqT/dLk5/Z/Ui+jU3130EveHb8tA Kikw== 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=wp27dglr9Ec2vlyz0jFxBWDYiLrww9hNQpMb2Fx4eS4=; b=eKIyWc+qzwceHMCR/blKBvI6ZKSpqNFSyEpmBLLmynv2BiVIJn6TEhyxFN8YSg6A+M sagdG1zb4WBQ/2sxNk7AFxsdEaDkVYX8J31/tWbr0CpoJdCCMNSOGlfzlQxSg9OlDzrn JrpE2Fzbjq4VbVey90UDweZ/dC45bGd4WYFIu7Ym3PCj5st2sAqxY5nU51PDBhhwkn6G t0bS9TAbwGuIv/UIDoZKDpY43z6IvIhmCso3SmiDO8zi/sPvCHzpvSXzqxt7xHJ2g4yy BwF92YfjzWQXTUpEeiabPWcvZK3DwIHFxD0yeSEAgPvs8r4UQhUMnfGTSCV5XpzDe7nW ig/w== X-Gm-Message-State: AOAM532wvJ23odonOXMoPO4mWqLiGQ4kqYCYu6DTf+pggfiuFB3VG6pk FKib0S4TugbIzXxYOOeH9a6Cfo8+I8dctg== X-Google-Smtp-Source: ABdhPJx9C6WPpRzUfmxX+uatRFUnAylhiAOh6O1MpbD8ZV4m4eAlk03iOLgRPnv3rjNQBGMXxBCdjA== X-Received: by 2002:a17:906:46d5:: with SMTP id k21mr32261200ejs.495.1605857126561; Thu, 19 Nov 2020 23:25:26 -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.25.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:25 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:49 +0100 Message-Id: <20201120072116.818090-77-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 076/162] avcodec/mss4: Simplify creating VLC tables 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 lengths of the codes used by the mss4 decoder are ascending from left to right and therefore the lengths can be run-length encoded and the codes can be easily derived from them. And this is how it is indeed done. Yet some things can nevertheless be improved: a) The number of entries of the current VLC is implicitly contained in the run-length table and needn't be externally prescribed. b) The maximum length of a code is just the length of the last code (given that the lengths are ascending), so there is no point in setting max_bits in the loop itself. c) One can offload the actual calculation of the codes to ff_init_vlc_from_lengths(). Signed-off-by: Andreas Rheinhardt --- libavcodec/mss4.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c index c421a07c5d..baf3c14d02 100644 --- a/libavcodec/mss4.c +++ b/libavcodec/mss4.c @@ -143,25 +143,21 @@ typedef struct MSS4Context { } MSS4Context; static av_cold int mss4_init_vlc(VLC *vlc, const uint8_t *lens, - const uint8_t *syms, int num_syms) + const uint8_t *syms) { uint8_t bits[MAX_ENTRIES]; - uint16_t codes[MAX_ENTRIES]; int i, j; - int prefix = 0, max_bits = 0, idx = 0; + int idx = 0; for (i = 0; i < 16; i++) { for (j = 0; j < lens[i]; j++) { bits[idx] = i + 1; - codes[idx] = prefix++; - max_bits = i + 1; idx++; } - prefix <<= 1; } - return ff_init_vlc_sparse(vlc, FFMIN(max_bits, 9), num_syms, bits, 1, 1, - codes, 2, 2, syms, 1, 1, 0); + return ff_init_vlc_from_lengths(vlc, FFMIN(bits[idx - 1], 9), idx, + bits, 1, syms, 1, 1, 0, 0, NULL); } static av_cold int mss4_init_vlcs(MSS4Context *ctx) @@ -169,15 +165,15 @@ static av_cold int mss4_init_vlcs(MSS4Context *ctx) int ret, i; for (i = 0; i < 2; i++) { - ret = mss4_init_vlc(&ctx->dc_vlc[i], mss4_dc_vlc_lens[i], NULL, 12); + ret = mss4_init_vlc(&ctx->dc_vlc[i], mss4_dc_vlc_lens[i], NULL); if (ret) return ret; ret = mss4_init_vlc(&ctx->ac_vlc[i], mss4_ac_vlc_lens[i], - mss4_ac_vlc_syms[i], 162); + mss4_ac_vlc_syms[i]); if (ret) return ret; ret = mss4_init_vlc(&ctx->vec_entry_vlc[i], mss4_vec_entry_vlc_lens[i], - mss4_vec_entry_vlc_syms[i], 9); + mss4_vec_entry_vlc_syms[i]); if (ret) return ret; } From patchwork Fri Nov 20 07:19: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: 23831 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 58CF9448A07 for ; Fri, 20 Nov 2020 09:38:34 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8069668BC1D; Fri, 20 Nov 2020 09:25:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4844768BB04 for ; Fri, 20 Nov 2020 09:25:28 +0200 (EET) Received: by mail-ej1-f48.google.com with SMTP id o21so11496091ejb.3 for ; Thu, 19 Nov 2020 23:25:28 -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=HYLjQxfQuTxvxE1dPVlbwA4tHK87J+DYlPH4UFi9cfc=; b=kPQTeVP78uG74+jOaqg8E2tit2B3dT1MQ1F0znA9FF1RFZwEAQQdIt1uC5axYcgPLk Xc8deOS8FnhZP24XtX9wsQXE9CQEITiwYsDQiLTA4bhzfXe8pEJpeXbafC7t9vgTDvYM npp+Sa44hnVnhuE5L5hE67MkQwOi0YZR4kFUMM13RTA9j7u7CWBdxP6G3HlTnsXaUIHJ mBF5DS8MT0et8jo0oTuqzd6Yk58ggSKcftk//ldK7XVB+2kcU92UmArmmQZ7Fj7UHS4O i97RDJm8uR490gY4Crn5o0UExdnC0wPbmGQtVMOGsBALRFSQFWzHdqa/hyalfYR5NONw l7qQ== 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=HYLjQxfQuTxvxE1dPVlbwA4tHK87J+DYlPH4UFi9cfc=; b=q8Es1B1fnErRFUNlGDDzbX7cOVP1Ny7S/N3VIZcxYQkwM+Y3DlpHbX0Fhoq4hVWt8U iYBVCbtwsIrFq9PUfIF7Qw52pYLfKYdhuYvVnQVaIzUJEgf7ow27mkPFjdj7lL124dc8 KYDfKq53uAb5A/zS9jFWjRnSU2f7T3BuoR5qKtPM0GPNZKEEgQ++QV1Dtsjcgcvp5J9x VOxBszOKQ0l9Z0M21ks+tioja25m3UBiZjZz/6PBb9rmWERUf0Ux/qVgORCGzO7pgGzT BSgQGUMZbrQ89kB26zBn+9bEQTZ946LaJZm+EUMvNQQoOy4Z/dDKVHEIVelEpyaIOwVf OLRQ== X-Gm-Message-State: AOAM5321s/GjwqqUelB4DUgmEK0470Gr4yhujbHIEYfkjFvukCt0nGpf 3yV8bIqafDR4iIVI1Xob82uz3y4gi4P04A== X-Google-Smtp-Source: ABdhPJwk0LQq7Gxnm5P0iPgJfQt3Fbz77Ud3h9YSXAEF4EC4CLYVhcyae4TC91wiq3ZNx/ClAgd8Uw== X-Received: by 2002:a17:906:b0c5:: with SMTP id bk5mr14495027ejb.217.1605857127411; Thu, 19 Nov 2020 23:25:27 -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.25.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:26 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:50 +0100 Message-Id: <20201120072116.818090-78-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 077/162] avcodec/mss4: Don't duplicate standard JPEG tables 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 --- configure | 2 +- libavcodec/mss4.c | 58 +++++------------------------------------------ 2 files changed, 7 insertions(+), 53 deletions(-) diff --git a/configure b/configure index 51e43fbf66..10cf61007b 100755 --- a/configure +++ b/configure @@ -2801,7 +2801,7 @@ msmpeg4v2_encoder_select="h263_encoder" msmpeg4v3_decoder_select="h263_decoder" msmpeg4v3_encoder_select="h263_encoder" mss2_decoder_select="mpegvideo qpeldsp vc1_decoder" -mts2_decoder_select="mss34dsp" +mts2_decoder_select="jpegtables mss34dsp" mv30_decoder_select="aandcttables blockdsp" mvha_decoder_deps="zlib" mvha_decoder_select="llviddsp" diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c index baf3c14d02..74132fd7c1 100644 --- a/libavcodec/mss4.c +++ b/libavcodec/mss4.c @@ -29,6 +29,7 @@ #include "bytestream.h" #include "get_bits.h" #include "internal.h" +#include "jpegtables.h" #include "mss34dsp.h" #include "unary.h" @@ -57,56 +58,6 @@ static const uint8_t mss4_dc_vlc_lens[2][16] = { { 0, 3, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0 } }; -static const uint8_t mss4_ac_vlc_lens[2][16] = { - { 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125 }, - { 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119 } -}; - -static const uint8_t mss4_ac_vlc_syms[2][162] = { - { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, - 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, - 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, - 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, - 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, - 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, - 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, - 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, - 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, - 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, - 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, - 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, - 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, - 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, - 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, - 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, - 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, - 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, - 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, - 0xF9, 0xFA }, - { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, - 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, - 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, - 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, - 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, - 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, - 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, - 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, - 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, - 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, - 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, - 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, - 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, - 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, - 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, - 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, - 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, - 0xF9, 0xFA } -}; - static const uint8_t vec_len_syms[2][4] = { { 4, 2, 3, 1 }, { 4, 1, 2, 3 } @@ -168,8 +119,11 @@ static av_cold int mss4_init_vlcs(MSS4Context *ctx) ret = mss4_init_vlc(&ctx->dc_vlc[i], mss4_dc_vlc_lens[i], NULL); if (ret) return ret; - ret = mss4_init_vlc(&ctx->ac_vlc[i], mss4_ac_vlc_lens[i], - mss4_ac_vlc_syms[i]); + ret = mss4_init_vlc(&ctx->ac_vlc[i], + i ? avpriv_mjpeg_bits_ac_chrominance + 1 + : avpriv_mjpeg_bits_ac_luminance + 1, + i ? avpriv_mjpeg_val_ac_chrominance + : avpriv_mjpeg_val_ac_luminance); if (ret) return ret; ret = mss4_init_vlc(&ctx->vec_entry_vlc[i], mss4_vec_entry_vlc_lens[i], From patchwork Fri Nov 20 07:19:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23832 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 0FC20448A07 for ; Fri, 20 Nov 2020 09:38:44 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4D19468BC35; Fri, 20 Nov 2020 09:25:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0975668BBCA for ; Fri, 20 Nov 2020 09:25:28 +0200 (EET) Received: by mail-ej1-f42.google.com with SMTP id a16so11514626ejj.5 for ; Thu, 19 Nov 2020 23:25:28 -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=HZRJkm39izWd39keLG5HMfpmjOMzCa0ssUAWFP/iUpM=; b=eCOQzZiPZaTBHOeVnJJTBnQ60dG1stUDxJet0MQfTE0ObcrQ+9++x3o/hatxKP1UiV icYFyEZQuoNn2dUDTY9CKh8RXK8Rie/hyhjZJMRGK3iRpUtZr2cwP6CydV83yaxb6Hhs pFPjzoSLRtOJeFWQQkbCxIo9PIiza4fB0gKi0njsUZa5lRzhJKV7214q5FL2WdmAyFhP bTI//nR4dmY8+04szEdrbTxE2yVDscYh55W2WVbOU2pZo/qw7dwoV3AvjnelQg15wpt9 AtgEkhQqYIVkekvac3KU1fyfuC+zwfNg7W4kJxsftrGcTG2ikE+ifTIQnm47fKwzsElY gxSQ== 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=HZRJkm39izWd39keLG5HMfpmjOMzCa0ssUAWFP/iUpM=; b=hfZtvIHrSyOgVk9pTt0Ygasv2paRmQdSYp7whK0GyubkDaNj0pDbmLNzYKl9ZYzcGy 60rWVWupfEoDqHasCAX6A1IIZMWqL6l82j2MhaEOeJqhwE/4aa3yq7N1eoJbDP+9dw4F STOQd1Sd5JFK3d7RmEsB7MBfdhhBarR06jAm46TsKGyrH5ns8ZXQAbMZeJpca+kiRKAH mjJ5pr5QpgdfdiqNFkjX621/jT5K5k4WCkJtQsm5mMgPsHFFhRt0L0i36MyWh6SHOlF5 QfhWsdIs90eZ9+tazx01FCos3nhyi6kv7TEf+3MBix0XsjaSF7Wfh5o35vgf33KmFnFE swrg== X-Gm-Message-State: AOAM530q7HPk9FZNoHwWz1/3FIyskLEUOdwAzGEmU+NdXMcgrWiyXnAe MChLA/kd4JWCqniuSz+1jhHMo+OGtrwxQg== X-Google-Smtp-Source: ABdhPJzhAnIsaOy61KrmzTs80sw9XcS7bCyz4ju5kGxfRtmniKTVq42X3s8ivVvSfgK0yFGcnQ8BFA== X-Received: by 2002:a17:906:3a55:: with SMTP id a21mr30915744ejf.357.1605857128350; Thu, 19 Nov 2020 23:25:28 -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.25.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:27 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:51 +0100 Message-Id: <20201120072116.818090-79-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 078/162] avcodec/mss4: Mark decoder as init-threadsafe 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/mss4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c index 74132fd7c1..f8edaac4cd 100644 --- a/libavcodec/mss4.c +++ b/libavcodec/mss4.c @@ -628,5 +628,5 @@ AVCodec ff_mts2_decoder = { .close = mss4_decode_end, .decode = mss4_decode_frame, .capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Fri Nov 20 07:19:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23833 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 4B5B1448A07 for ; Fri, 20 Nov 2020 09:38:54 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 35DE268BC41; Fri, 20 Nov 2020 09:25:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4B2BD68BB3B for ; Fri, 20 Nov 2020 09:25:30 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id lv15so5643174ejb.12 for ; Thu, 19 Nov 2020 23:25:30 -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=gz4ABEUASiotGwksfChRLz90QN9b5AnWbDFy7RS5RKk=; b=SdH9zg6MmiC/CM1s0oksq0y5HINCEabepciHNrTyNxshAHOCsfz0c1v2gbFjPbesYS VLt89qObmlJzjz0t9bJtjg0wGHKxg3iyUURBzkWL5y2TNQfZkzp7SrAMvbp7mPHgADvm cQ1/CHcdbB98e+ITzZFzt9lUIxtu9HJegrdanS6eKsJpoZv4DAriHdguFCTlKrAfR3cM ZGZoOBXFCavEPEQ3xPfMUcmsJJKCVC9afLY3hKKZISTV1aRXtso0F3oS93gEXJSTtCdR yL58TjLpv0Jf9yKhFHbkchO07/Ni2pQbTvO89CiUi7tGf6b446XnfSvTsiPXlhz15ZeJ wV3A== 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=gz4ABEUASiotGwksfChRLz90QN9b5AnWbDFy7RS5RKk=; b=tN+pHCybXIt7h71bMpePtugb96YeruuTx7Bz5rjEl5ArN6JKvi3hjmTZhL+J1HWQNz /zsMa2q37UwhGew98U+2x0n8puqQOMOLEB2FACuoTFcWcR4aLsyWb1UxBxsQqdSmfES2 xjnhsAl3PCNPjOWimQ9XFLw6R23uNiyStHjrX4x0yXRUYaGrzJ7bLdCISaP533c9P5u3 pPX597m40fzeuArF0AVLdXJqFwmAqR1TvvpLwBL+PZmFT1rJ5PpqPO64AShfg0Qk/0iz i6w5QFBn5UYv7LdCwAVlloMLXdKFMgWsHxVnjHNOpeVereoMGWbdpxXysgasVQqrwdZ5 X+CQ== X-Gm-Message-State: AOAM530+Tm+QJZzpZbpTpMkMAUnabg9nq8+GvKL9Rr9q5K9/0DcxSHjK 1GNuHxnzIvI0qJh2dygcB4HJ8FHL5uYtMQ== X-Google-Smtp-Source: ABdhPJwtx3zf1g/dUM3XcXdKSfoU4SUMGyU+ahi28b/UVA6bCKjBBmTxub3HZt7clo+GgVdLPzjOKA== X-Received: by 2002:a17:906:3644:: with SMTP id r4mr31567949ejb.517.1605857129482; Thu, 19 Nov 2020 23:25:29 -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.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:28 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:52 +0100 Message-Id: <20201120072116.818090-80-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 079/162] avcodec/mss4: Make VLCs static 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/mss4.c | 74 +++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 44 deletions(-) diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c index f8edaac4cd..7f11f30dc8 100644 --- a/libavcodec/mss4.c +++ b/libavcodec/mss4.c @@ -25,6 +25,8 @@ * aka Microsoft Expression Encoder Screen) decoder */ +#include "libavutil/thread.h" + #include "avcodec.h" #include "bytestream.h" #include "get_bits.h" @@ -78,8 +80,6 @@ static const uint8_t mss4_vec_entry_vlc_syms[2][9] = { typedef struct MSS4Context { AVFrame *pic; - VLC dc_vlc[2], ac_vlc[2]; - VLC vec_entry_vlc[2]; int block[64]; uint8_t imgbuf[3][16 * 16]; @@ -93,9 +93,13 @@ typedef struct MSS4Context { int prev_vec[3][4]; } MSS4Context; -static av_cold int mss4_init_vlc(VLC *vlc, const uint8_t *lens, - const uint8_t *syms) +static VLC dc_vlc[2], ac_vlc[2]; +static VLC vec_entry_vlc[2]; + +static av_cold void mss4_init_vlc(VLC *vlc, unsigned *offset, + const uint8_t *lens, const uint8_t *syms) { + static VLC_TYPE vlc_buf[2146][2]; uint8_t bits[MAX_ENTRIES]; int i, j; int idx = 0; @@ -107,41 +111,25 @@ static av_cold int mss4_init_vlc(VLC *vlc, const uint8_t *lens, } } - return ff_init_vlc_from_lengths(vlc, FFMIN(bits[idx - 1], 9), idx, - bits, 1, syms, 1, 1, 0, 0, NULL); + vlc->table = &vlc_buf[*offset]; + vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; + ff_init_vlc_from_lengths(vlc, FFMIN(bits[idx - 1], 9), idx, + bits, 1, syms, 1, 1, + 0, INIT_VLC_STATIC_OVERLONG, NULL); + *offset += vlc->table_size; } -static av_cold int mss4_init_vlcs(MSS4Context *ctx) +static av_cold void mss4_init_vlcs(void) { - int ret, i; - - for (i = 0; i < 2; i++) { - ret = mss4_init_vlc(&ctx->dc_vlc[i], mss4_dc_vlc_lens[i], NULL); - if (ret) - return ret; - ret = mss4_init_vlc(&ctx->ac_vlc[i], - i ? avpriv_mjpeg_bits_ac_chrominance + 1 - : avpriv_mjpeg_bits_ac_luminance + 1, - i ? avpriv_mjpeg_val_ac_chrominance - : avpriv_mjpeg_val_ac_luminance); - if (ret) - return ret; - ret = mss4_init_vlc(&ctx->vec_entry_vlc[i], mss4_vec_entry_vlc_lens[i], - mss4_vec_entry_vlc_syms[i]); - if (ret) - return ret; - } - return 0; -} - -static av_cold void mss4_free_vlcs(MSS4Context *ctx) -{ - int i; - - for (i = 0; i < 2; i++) { - ff_free_vlc(&ctx->dc_vlc[i]); - ff_free_vlc(&ctx->ac_vlc[i]); - ff_free_vlc(&ctx->vec_entry_vlc[i]); + for (unsigned i = 0, offset = 0; i < 2; i++) { + mss4_init_vlc(&dc_vlc[i], &offset, mss4_dc_vlc_lens[i], NULL); + mss4_init_vlc(&ac_vlc[i], &offset, + i ? avpriv_mjpeg_bits_ac_chrominance + 1 + : avpriv_mjpeg_bits_ac_luminance + 1, + i ? avpriv_mjpeg_val_ac_chrominance + : avpriv_mjpeg_val_ac_luminance); + mss4_init_vlc(&vec_entry_vlc[i], &offset, mss4_vec_entry_vlc_lens[i], + mss4_vec_entry_vlc_syms[i]); } } @@ -239,7 +227,7 @@ static int mss4_decode_dct_block(MSS4Context *c, GetBitContext *gb, int xpos = mb_x * 2 + i; c->dc_cache[j][TOP_LEFT] = c->dc_cache[j][TOP]; c->dc_cache[j][TOP] = c->prev_dc[0][mb_x * 2 + i]; - ret = mss4_decode_dct(gb, c->dc_vlc, c->ac_vlc, c->block, + ret = mss4_decode_dct(gb, &dc_vlc[0], &ac_vlc[0], c->block, c->dc_cache[j], xpos, mb_y * 2 + j, c->quant_mat[0]); if (ret) @@ -255,7 +243,7 @@ static int mss4_decode_dct_block(MSS4Context *c, GetBitContext *gb, for (i = 1; i < 3; i++) { c->dc_cache[i + 1][TOP_LEFT] = c->dc_cache[i + 1][TOP]; c->dc_cache[i + 1][TOP] = c->prev_dc[i][mb_x]; - ret = mss4_decode_dct(gb, c->dc_vlc + 1, c->ac_vlc + 1, + ret = mss4_decode_dct(gb, &dc_vlc[1], &ac_vlc[1], c->block, c->dc_cache[i + 1], mb_x, mb_y, c->quant_mat[1]); if (ret) @@ -347,7 +335,7 @@ static int mss4_decode_image_block(MSS4Context *ctx, GetBitContext *gb, for (i = 0; i < 3; i++) { vec_len[i] = vec_len_syms[!!i][get_unary(gb, 0, 3)]; for (j = 0; j < vec_len[i]; j++) { - vec[i][j] = get_coeff(gb, &ctx->vec_entry_vlc[!!i]); + vec[i][j] = get_coeff(gb, &vec_entry_vlc[!!i]); vec[i][j] += ctx->prev_vec[i][j]; ctx->prev_vec[i][j] = vec[i][j]; } @@ -586,20 +574,16 @@ static av_cold int mss4_decode_end(AVCodecContext *avctx) av_frame_free(&c->pic); for (i = 0; i < 3; i++) av_freep(&c->prev_dc[i]); - mss4_free_vlcs(c); return 0; } static av_cold int mss4_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; MSS4Context * const c = avctx->priv_data; int i; - if (mss4_init_vlcs(c)) { - av_log(avctx, AV_LOG_ERROR, "Cannot initialise VLCs\n"); - return AVERROR(ENOMEM); - } for (i = 0; i < 3; i++) { c->dc_stride[i] = FFALIGN(avctx->width, 16) >> (2 + !!i); c->prev_dc[i] = av_malloc_array(c->dc_stride[i], sizeof(**c->prev_dc)); @@ -615,6 +599,8 @@ static av_cold int mss4_decode_init(AVCodecContext *avctx) avctx->pix_fmt = AV_PIX_FMT_YUV444P; + ff_thread_once(&init_static_once, mss4_init_vlcs); + return 0; } From patchwork Fri Nov 20 07:19:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23834 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 669C4448A07 for ; Fri, 20 Nov 2020 09:39:04 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1E93C68BC47; Fri, 20 Nov 2020 09:25:50 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4B18668BB0B for ; Fri, 20 Nov 2020 09:25:31 +0200 (EET) Received: by mail-ed1-f45.google.com with SMTP id e18so8491666edy.6 for ; Thu, 19 Nov 2020 23:25: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=WNNlpnsbFWK4OcTyiJb03KHuOO5OJKbpzDBUjRj3T6A=; b=bienbogDf6lGCZgtvl5CTUw1oWaRQOis3tkSVo/XI/YQVvmxm9/AfrXiXw1lEFm6se Nq+Fwgjst7MvF8kxSV9aS95gWhgpG02jVwLDI60eQ0BEYqWfw6aO5RC4v50sczJKinbG N1NiGdUEgbCAC0R6ixs9L34bq80ZOSIdgWAP9E/FeNX4R5hL0CeSB99eV4qv+1xKHeUb 36+JLHly+9mu7ETSootT0cuQ1AnZgEwELZ0M/F8o45AlVi4i4r6Ri7vYs3ZdQeklKF7k qbY0iKwVz1hhRAB0237VNsI/4MOUzjdlO+xPK3yjhfDVyxG/CyilgC55yDAUFuQzP3mB HioQ== 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=WNNlpnsbFWK4OcTyiJb03KHuOO5OJKbpzDBUjRj3T6A=; b=IC2Ji1o+C8ZBqQnOtjpbbdpmo2u7WVIr62dRJuUUJ8sEsUiWZr7+B7MCdQF3ZsjvV1 4IlOyUFsRHP6l691JFqSQ8baW75V3Am0azrgxEoa6cCjsbuvMEkn67URO3CN2WZBB9ea FUuYI/jip664c9NiMp5w698i8M///1oYCbBovItoUE8Z/jMO9lh46d7f5a8nm/9NFe9T GnefKUffIfoYZL9keL3UhCpGY4rdGMFwiAUtfrlQxe2BHp3xquYpkOCLZeOrBZPt6ZYz W9VGHU6inHzhspA9YseACnGcdcYa2nzD96hxy3dB12BhKzC3T95aqM8nUgwalvkuYQUV ZXvw== X-Gm-Message-State: AOAM533sh2uM51eXuhATQAE4skLQPCDb4aZs9h5YISWR6O18TtnxWeh7 EES3ySsrg/HRWYTa93/54xnuzgEyPOTp/A== X-Google-Smtp-Source: ABdhPJwOzNSx4n2aLKTqeGzHT09H5ryQhKCg31U8XP/+gWUR7D1Gl4CEnsZdIyJA6hRKl9zbN8DtLg== X-Received: by 2002:a50:e149:: with SMTP id i9mr34991454edl.56.1605857130324; Thu, 19 Nov 2020 23:25:30 -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.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:29 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:53 +0100 Message-Id: <20201120072116.818090-81-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 080/162] avcodec/sheervideo: Add av_cold to build_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" It is an init function even when called from decode_frame(). Signed-off-by: Andreas Rheinhardt --- libavcodec/sheervideo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c index 976c21c445..3e60ef26a5 100644 --- a/libavcodec/sheervideo.c +++ b/libavcodec/sheervideo.c @@ -1781,7 +1781,7 @@ static void decode_rgb(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb) } } -static int build_vlc(VLC *vlc, const SheerTable *table) +static av_cold int build_vlc(VLC *vlc, const SheerTable *table) { const uint8_t *cur = table->lens; uint16_t codes[1024]; From patchwork Fri Nov 20 07:19:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23764 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 7DE1E44AC1A for ; Fri, 20 Nov 2020 09:25:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4540768BBA1; Fri, 20 Nov 2020 09:25:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1C67A68B9A1 for ; Fri, 20 Nov 2020 09:25:32 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id o9so11541892ejg.1 for ; Thu, 19 Nov 2020 23:25:32 -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=Csn2sLU4D+jLqugqtx4BzcYkROjEsPoj5zH4Zgx/p0Q=; b=jUm1ClcX1XnbtdKDFJWtwuH4QhC1LsVta6SeXmsIjhLaNCVXK4jqbhv8SJI2/CHQ4J 7JCcMjhDcJd/Oj2WYOlD2J6ipeLCDmxBC9VCi6M8LVumLTBi4VKyCzpzYMEIwWeQ/fHA koTy5a72YVO6mUM7A6iRKj4QohbVJju6I4vIM873yytgjf4Y7Nd930/Qm3ijglAo11+z 2Vs8r1KeHL2eqCT/ZjCqMGTLIjmZ0qZ/7qJ6Vs02fo5U6qG+gmiMo1nBqRfUbrjyvmA5 vFezJZSO7gMVsU5P9xTQMmGgAvmr3a/SC6XYNI7D+92eu8VwZL1RVPPop0er2Ci//nEH GZJw== 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=Csn2sLU4D+jLqugqtx4BzcYkROjEsPoj5zH4Zgx/p0Q=; b=QV57J/3FTT3Kl0VyBEH+HyIcOuH2WsjtOirQJ2JnH4FNd/B4yXM6ye3ofah/KjgHlR 4b4+SdJuiXP79tNjlh5ZOSDozEChvXEnSpM6QhsgikRuSWNHlqu2f1nNmFHgMRm0fZtc oPu/wrKUmmFhe/vi1WG1sXClGicQ/GpnVMRQkdfJe2jps7DcYX697nYljQ9Npl6jWHGZ S7eZ12Q6Kyu+Qq1NqIps8V/AP8LdfzlsnET4nkSJ4HgQEuK7gMjzqxy9JvTiUbjzy+NF eHllhzfaEIahOZcwJU4wpItFUJyEF5v7RoXaS6GdqEXD2AE3OeMj7Ojgc/vNchi1ZVWn 7sLw== X-Gm-Message-State: AOAM533HnKcD3dSSttq+LqQWG3cPfIbaw6dfKmpa2GE79lbYq4zWZcXA /oB429cLfGbMJrCgY/zgdaqjz7Ko3Gt/CQ== X-Google-Smtp-Source: ABdhPJzLqhrJUOV6GlPMs4ggPUYUsBgaWTCKGBQcjqWLFOmnKTwVfxkCSQK3yYKVZGUR/5WXgRGVaw== X-Received: by 2002:a17:906:1381:: with SMTP id f1mr31228216ejc.87.1605857131304; Thu, 19 Nov 2020 23:25:31 -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.25.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:30 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:54 +0100 Message-Id: <20201120072116.818090-82-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 081/162] avcodec/sheervideo: Simplify creating VLC 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" ff_init_vlc_from_lengths() can be used to offload the computation of the codes; it also needn't check whether the codes are already properly ordered (they are). Signed-off-by: Andreas Rheinhardt --- libavcodec/sheervideo.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c index 3e60ef26a5..876b5cace6 100644 --- a/libavcodec/sheervideo.c +++ b/libavcodec/sheervideo.c @@ -1784,11 +1784,10 @@ static void decode_rgb(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb) static av_cold int build_vlc(VLC *vlc, const SheerTable *table) { const uint8_t *cur = table->lens; - uint16_t codes[1024]; uint8_t lens[1024]; unsigned count = 0; - for (unsigned step = 1, len = 1, index = 0; len > 0; len += step) { + for (unsigned step = 1, len = 1; len > 0; len += step) { unsigned new_count = count; if (len == 16) { @@ -1797,17 +1796,13 @@ static av_cold int build_vlc(VLC *vlc, const SheerTable *table) } else new_count += *cur++; - for (; count < new_count; count++) { - codes[count] = index >> (32 - len); - index += 1U << (32 - len); + for (; count < new_count; count++) lens[count] = len; - } } ff_free_vlc(vlc); - return init_vlc(vlc, SHEER_VLC_BITS, count, - lens, sizeof(*lens), sizeof(*lens), - codes, sizeof(*codes), sizeof(*codes), 0); + return ff_init_vlc_from_lengths(vlc, SHEER_VLC_BITS, count, + lens, sizeof(*lens), NULL, 0, 0, 0, 0, NULL); } static int decode_frame(AVCodecContext *avctx, From patchwork Fri Nov 20 07:19: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: 23835 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 40F1F448ACD for ; Fri, 20 Nov 2020 09:39:26 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B015C68BB70; Fri, 20 Nov 2020 09:25:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0F59268BA2A for ; Fri, 20 Nov 2020 09:25:33 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id k27so11455895ejs.10 for ; Thu, 19 Nov 2020 23:25:33 -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=IL/ZQvPYbxK6n4rsq6/JfEe/+m9y9VUBbF2WI9APe9U=; b=AJJDU6QANYyjVkGzXAhtspSMuGj1g9J2SAqINxJO+CFmxW4joJVmtHHfs8/dSAJ2nu QEyXxcYowVHo+j6Y7pG1u1eqYBW5XeUBbiDhNA1ZPoj1lYJueLRvn8UXS8xbqT78jKON JZ0J6Ws9t1VnjD9hvqS/yV7/wqycT+csvLglTzr48nVl+aBhzVi/ugF9ise264c8aH9a VyM+phptQXuvCDqkn0OMNiOlO8jOq/0Xleg8T0cJPohdXZRXRtQFR+wQXrBVChmy4pTz kvOy+XSJPRv+xPhoZKSj0K4UGAcAsq7kFnJFpwQQo0AvtnAMXGWsvY2T0iG33PWZPo75 ca6g== 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=IL/ZQvPYbxK6n4rsq6/JfEe/+m9y9VUBbF2WI9APe9U=; b=NJd+IvZL6bF/6mvElYngkRHuHzqpW/5xPRbtcamVZ3cdGPY2bmHwzR6wTK/WyWP/Mq U5Ij5CpNIMpssHbvCmHehg/cEkC/maw8oc8g+ZWMtXlUGkW01uy1rzzCVAXk4UX+RN4Z nqB8pADrovA7a6uwY/H7H7ciK9Bzx82KSzJeq2LzfzmSxHoYTWGGlybHs+Q56NDz/qA9 1iQ1//ltV659yxwCW21bjWQIT43Tq7LMMplSTsJ9xGoDWMzaOsbT8D54karUcWNW/BVx iYeRL4u9epg70BhmP6MVcCY0IH84J2v3QtNMKkd2rLDE8YSf7w0eP/i5VFNAwrAdwFJt l0sw== X-Gm-Message-State: AOAM533Zx7L1EUZFIvxh5eLIgvhXKIdT+8H7GEfo1bXBlu1HlRfSmXQB gtQMqy3uGVDYmx+ubCERiimAFlHe7/nXmw== X-Google-Smtp-Source: ABdhPJwURWV0jsysmiogNAJQu/VUM/dF2ifa+Qj1DGcExxzKnd7prjvyhMyYcvNSusd3pQ/EnoD62w== X-Received: by 2002:a17:906:8282:: with SMTP id h2mr32899979ejx.50.1605857132308; Thu, 19 Nov 2020 23:25:32 -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.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:31 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:55 +0100 Message-Id: <20201120072116.818090-83-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 082/162] avcodec/g2meet: Use least max_depth in get_vlc2() 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 longest AC codes of the standard JPEG tables are 16 bits long; for the DC tables, the maximum is 11, so using max_depth of two is sufficient. Signed-off-by: Andreas Rheinhardt --- libavcodec/g2meet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 6b870ae3d4..f6aa636bde 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -248,7 +248,7 @@ static int jpg_decode_block(JPGContext *c, GetBitContext *gb, return AVERROR_INVALIDDATA; c->bdsp.clear_block(block); - dc = get_vlc2(gb, c->dc_vlc[is_chroma].table, 9, 3); + dc = get_vlc2(gb, c->dc_vlc[is_chroma].table, 9, 2); if (dc < 0) return AVERROR_INVALIDDATA; if (dc) @@ -259,7 +259,7 @@ static int jpg_decode_block(JPGContext *c, GetBitContext *gb, pos = 0; while (pos < 63) { - val = get_vlc2(gb, c->ac_vlc[is_chroma].table, 9, 3); + val = get_vlc2(gb, c->ac_vlc[is_chroma].table, 9, 2); if (val < 0) return AVERROR_INVALIDDATA; pos += val >> 4; From patchwork Fri Nov 20 07:19:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23780 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 CFD2844AB58 for ; Fri, 20 Nov 2020 09:29:28 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E1FE368BB9D; Fri, 20 Nov 2020 09:25:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2454E68BA16 for ; Fri, 20 Nov 2020 09:25:34 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id f20so11493560ejz.4 for ; Thu, 19 Nov 2020 23:25:34 -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=T46IY1Wd56GNaqP2zS5a0DIRg7qj1qTNaLJchIPAHAo=; b=tRYgS/IK7x4tLjDiuYW+dbRiTpt2X5BEOWPggpwFQre3U/dBhWTZp4Q9uOCMOZUpSW vc0PXWXqG2NC10wKtoM06HuCel/V9y3s1a1Z1/qklTASAnh/JA9DatH3FUsgOBKgmml0 TbGOmjZ1E+mSahVGu2R8+m1nCz5DTBev1l8abDXcvvYNy1nnlB05jKs7rAuOsqAeVqEI 13FVNGCDAu/UopP7/0g5aSffNMaPZ97t8uNn1rgzSOwsZBMIUkGG2bR23KLKLedeStPP 809HB1y+m+CbZ5yyT6JD4SYvWdov5Uh8x23jwL4c7BvQb6vEza01tPSnhRbccbvMSzmg mQtA== 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=T46IY1Wd56GNaqP2zS5a0DIRg7qj1qTNaLJchIPAHAo=; b=NVpDV4zQPduRYGbDPss3nKNYCs4NSvu+tmzo0uJw4eWXCqqNydSKmJygXZo+uB4ZrC Z5Va+SDiMvvTCsGJ2x51Qh5E9wP3jN6vkWYGnRJx1lPqAaGrglSiaViCs7Buo0uzwfW6 Cos7KVZxdaD/niph13CJ7zvLbnYBIyqp1CMFokXOzPfgD0ShAduKfP0ieGS5bseOcDrE 1l1xce3Wx2KE2FtTR1xJtwXHNCkLWt+HYfTTb3cDnElja5SJquiHSONryW1//Ct4/yKJ mZMrvapBL1pBNkQK5Ytu6U9j7Qu4OXSkpDVol+8e1myHqFbt9tqL4W8tADl5VUGSvggS aYQg== X-Gm-Message-State: AOAM532nOG0NhNvdntj62FLJhPEwH8w6HJ04GKINzD9+I38SOkETnk2A ccJwqB/JQNjvFKiNrmB20VwHwgTbh5miyg== X-Google-Smtp-Source: ABdhPJy/7jqF0cGkZPbVWUz4OoHAwbqgOAtYdRqFlh43F/AYV2PxD2EGUIn/YA7pJ+znGIa8lWW8jg== X-Received: by 2002:a17:906:c084:: with SMTP id f4mr17662387ejz.4.1605857133359; Thu, 19 Nov 2020 23:25:33 -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.25.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:32 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:56 +0100 Message-Id: <20201120072116.818090-84-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 083/162] avcodec/mjpegdec: Simplify creating VLC 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" ff_init_vlc_from_lengths() can be used to offload the computation of the codes; it also allows to omit the check whether the codes are already properly ordered (they are). Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegdec.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 147dd819e5..e101e582da 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -50,33 +50,28 @@ #include "bytestream.h" -static void build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code, - const uint8_t *bits_table) +static void build_huffman_codes(uint8_t *huff_size, const uint8_t *bits_table) { - for (int i = 1, code = 0, k = 0; i <= 16; i++) { + for (int i = 1, k = 0; i <= 16; i++) { int nb = bits_table[i]; for (int j = 0; j < nb;j++) { huff_size[k] = i; - huff_code[k] = code; - code++; k++; } - code <<= 1; } } static int build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table, int nb_codes, - int is_ac) + int is_ac, void *logctx) { uint8_t huff_size[256]; - uint16_t huff_code[256]; uint16_t huff_sym[256]; int i; av_assert0(nb_codes <= 256); - build_huffman_codes(huff_size, huff_code, bits_table); + build_huffman_codes(huff_size, bits_table); for (i = 0; i < nb_codes; i++) { huff_sym[i] = val_table[i] + 16 * is_ac; @@ -85,8 +80,8 @@ static int build_vlc(VLC *vlc, const uint8_t *bits_table, huff_sym[i] = 16 * 256; } - return ff_init_vlc_sparse(vlc, 9, nb_codes, huff_size, 1, 1, - huff_code, 2, 2, huff_sym, 2, 2, 0); + return ff_init_vlc_from_lengths(vlc, 9, nb_codes, huff_size, 1, + huff_sym, 2, 2, 0, 0, logctx); } static int init_default_huffman_tables(MJpegDecodeContext *s) @@ -116,7 +111,7 @@ static int init_default_huffman_tables(MJpegDecodeContext *s) for (i = 0; i < FF_ARRAY_ELEMS(ht); i++) { ret = build_vlc(&s->vlcs[ht[i].class][ht[i].index], ht[i].bits, ht[i].values, ht[i].length, - ht[i].class == 1); + ht[i].class == 1, s->avctx); if (ret < 0) return ret; @@ -296,13 +291,13 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) av_log(s->avctx, AV_LOG_DEBUG, "class=%d index=%d nb_codes=%d\n", class, index, n); if ((ret = build_vlc(&s->vlcs[class][index], bits_table, val_table, - n, class > 0)) < 0) + n, class > 0, s->avctx)) < 0) return ret; if (class > 0) { ff_free_vlc(&s->vlcs[2][index]); if ((ret = build_vlc(&s->vlcs[2][index], bits_table, val_table, - n, 0)) < 0) + n, 0, s->avctx)) < 0) return ret; } From patchwork Fri Nov 20 07:19:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23836 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 C3B72448ACD for ; Fri, 20 Nov 2020 09:39:47 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4056468BC57; Fri, 20 Nov 2020 09:25:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5C58668BBD5 for ; Fri, 20 Nov 2020 09:25:35 +0200 (EET) Received: by mail-ed1-f48.google.com with SMTP id a15so8503856edy.1 for ; Thu, 19 Nov 2020 23:25:35 -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=In7Y4mVL2yI/UvBgyyPHfsOfXz7ORlImNTsVm8R2IsM=; b=cziJhzFETQilkqRiEvGv1SJp1QUCHFUzQJqwf5nkTwRpYHlDWX8WbO1m7V6qhoU748 L/y3GGf0l796S2FsTNspE/hgtNLKGSbdtWYDm947+lTI8Q/uC5W0EdKDw4Ps1I/spHvl DkfxKnPnhftDEoFpZj0InO5HX8zrNHVbz7MvmrnSR+3Um0rcEp1Xa5C03dVkTt5awB2H XYh120V+YHL1gtgiBJfltnbuNfYOW4AfjNyo8dDhv0zYyglwN5LTTj0+KS9hS1/sO0RA lcaMWs2RyH8MNYHvr/Y4qqWL34W4oEs9Ba6uuGmUK2enNMbs3M9HeFWDEgAJEEJu31e6 mLcw== 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=In7Y4mVL2yI/UvBgyyPHfsOfXz7ORlImNTsVm8R2IsM=; b=se4LyvXsnDvIh6k3K/pmPcQMeWn1s2nT6CHVjEmTsIIFI2LmGRxlsvvN+4l/RF/JTi v2mK8VHJJM4AFXDoB9IXdBC7SoLWnd9D05cyvJMPV2a1YT3LhdMQhe5QLtqETCSw1ouh DGVjnEBdiHBwsTGN0NKgwpt6WtLPqm8nSu4le/n62TYbCB0PTS5kvrFFfd0FeW60DkKn 0CvFL/dzez2peu2ZZpG7k8hdOXDd/FhX03U0nLjgwu3hF0tR+YK03VoHz1XWbelOVhmN vYG50es40GdqEyguXnRWp3iMNXQk9hD901Pqbuq+W06GxJ5f1q0or8nwi8JJ5qklUVZK B+jA== X-Gm-Message-State: AOAM533WCP5COliaIT7FXpzpWPnAYWHXUT1hXcV6J+8L2P4GIpGyHD81 7+lBWEEI/UiAdolJJLIlrZXbAL0XaQPrtQ== X-Google-Smtp-Source: ABdhPJyhQyo8Nm+/ihofyDfHzV4ffW0dgTrp6lhawBxjxWmew7J5nVseEoMYyqFDJtTDdz3bnlMdRA== X-Received: by 2002:aa7:da01:: with SMTP id r1mr35143715eds.45.1605857134302; Thu, 19 Nov 2020 23:25:34 -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.25.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:33 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:57 +0100 Message-Id: <20201120072116.818090-85-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 084/162] avcodec/indeo2: Make tables used to initialize VLCs 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" Switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() allows to replace codes which are so long that they need to be stored in an uint16_t by symbols which fit into an uint8_t; furthermore, it is also easily possible to already incorporate the offset (the real range of Indeo 2 symbols starts at one, not zero) into the symbols. Signed-off-by: Andreas Rheinhardt --- libavcodec/indeo2.c | 8 ++--- libavcodec/indeo2data.h | 67 ++++++++++++++++++----------------------- 2 files changed, 34 insertions(+), 41 deletions(-) diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 7a568bfbc4..5a9c0e77be 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -46,7 +46,7 @@ static VLC ir2_vlc; /* Indeo 2 codes are in range 0x01..0x7F and 0x81..0x90 */ static inline int ir2_get_code(GetBitContext *gb) { - return get_vlc2(gb, ir2_vlc.table, CODE_VLC_BITS, 1) + 1; + return get_vlc2(gb, ir2_vlc.table, CODE_VLC_BITS, 1); } static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst, @@ -237,9 +237,9 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx) if (!ic->picture) return AVERROR(ENOMEM); - INIT_LE_VLC_STATIC(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, - &ir2_codes[0][1], 4, 2, - &ir2_codes[0][0], 4, 2, 1 << CODE_VLC_BITS); + INIT_VLC_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, + &ir2_tab[0][1], 2, &ir2_tab[0][0], 2, 1, + 0, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); return 0; } diff --git a/libavcodec/indeo2data.h b/libavcodec/indeo2data.h index bfdb0a68a3..9981a3b2c0 100644 --- a/libavcodec/indeo2data.h +++ b/libavcodec/indeo2data.h @@ -25,43 +25,36 @@ #include #define IR2_CODES 143 -static const uint16_t ir2_codes[IR2_CODES][2] = { - { 0x0000, 3 }, { 0x0004, 3 }, { 0x0006, 3 }, { 0x0001, 5 }, - { 0x0009, 5 }, { 0x0019, 5 }, { 0x000D, 5 }, { 0x001D, 5 }, - { 0x0023, 6 }, { 0x0013, 6 }, { 0x0033, 6 }, { 0x000B, 6 }, - { 0x002B, 6 }, { 0x001B, 6 }, { 0x0007, 8 }, { 0x0087, 8 }, - { 0x0027, 8 }, { 0x00A7, 8 }, { 0x0067, 8 }, { 0x00E7, 8 }, - { 0x0097, 8 }, { 0x0057, 8 }, { 0x0037, 8 }, { 0x00B7, 8 }, - { 0x00F7, 8 }, { 0x000F, 9 }, { 0x008F, 9 }, { 0x018F, 9 }, - { 0x014F, 9 }, { 0x00CF, 9 }, { 0x002F, 9 }, { 0x012F, 9 }, - { 0x01AF, 9 }, { 0x006F, 9 }, { 0x00EF, 9 }, { 0x01EF, 9 }, - { 0x001F, 10 }, { 0x021F, 10 }, { 0x011F, 10 }, { 0x031F, 10 }, - { 0x009F, 10 }, { 0x029F, 10 }, { 0x019F, 10 }, { 0x039F, 10 }, - { 0x005F, 10 }, { 0x025F, 10 }, { 0x015F, 10 }, { 0x035F, 10 }, - { 0x00DF, 10 }, { 0x02DF, 10 }, { 0x01DF, 10 }, { 0x03DF, 10 }, - { 0x003F, 13 }, { 0x103F, 13 }, { 0x083F, 13 }, { 0x183F, 13 }, - { 0x043F, 13 }, { 0x143F, 13 }, { 0x0C3F, 13 }, { 0x1C3F, 13 }, - { 0x023F, 13 }, { 0x123F, 13 }, { 0x0A3F, 13 }, { 0x1A3F, 13 }, - { 0x063F, 13 }, { 0x163F, 13 }, { 0x0E3F, 13 }, { 0x1E3F, 13 }, - { 0x013F, 13 }, { 0x113F, 13 }, { 0x093F, 13 }, { 0x193F, 13 }, - { 0x053F, 13 }, { 0x153F, 13 }, { 0x0D3F, 13 }, { 0x1D3F, 13 }, - { 0x033F, 13 }, { 0x133F, 13 }, { 0x0B3F, 13 }, { 0x1B3F, 13 }, - { 0x073F, 13 }, { 0x173F, 13 }, { 0x0F3F, 13 }, { 0x1F3F, 13 }, - { 0x00BF, 13 }, { 0x10BF, 13 }, { 0x08BF, 13 }, { 0x18BF, 13 }, - { 0x04BF, 13 }, { 0x14BF, 13 }, { 0x0CBF, 13 }, { 0x1CBF, 13 }, - { 0x02BF, 13 }, { 0x12BF, 13 }, { 0x0ABF, 13 }, { 0x1ABF, 13 }, - { 0x06BF, 13 }, { 0x16BF, 13 }, { 0x0EBF, 13 }, { 0x1EBF, 13 }, - { 0x01BF, 13 }, { 0x11BF, 13 }, { 0x09BF, 13 }, { 0x19BF, 13 }, - { 0x05BF, 13 }, { 0x15BF, 13 }, { 0x0DBF, 13 }, { 0x1DBF, 13 }, - { 0x03BF, 13 }, { 0x13BF, 13 }, { 0x0BBF, 13 }, { 0x1BBF, 13 }, - { 0x07BF, 13 }, { 0x17BF, 13 }, { 0x0FBF, 13 }, { 0x1FBF, 13 }, - { 0x007F, 14 }, { 0x207F, 14 }, { 0x107F, 14 }, { 0x307F, 14 }, - { 0x087F, 14 }, { 0x287F, 14 }, { 0x187F, 14 }, { 0x387F, 14 }, - { 0x047F, 14 }, { 0x247F, 14 }, { 0x147F, 14 }, { 0x0002, 3 }, - { 0x0011, 5 }, { 0x0005, 5 }, { 0x0015, 5 }, { 0x0003, 6 }, - { 0x003B, 6 }, { 0x0047, 8 }, { 0x00C7, 8 }, { 0x0017, 8 }, - { 0x00D7, 8 }, { 0x0077, 8 }, { 0x010F, 9 }, { 0x004F, 9 }, - { 0x01CF, 9 }, { 0x00AF, 9 }, { 0x016F, 9 }, +static const uint8_t ir2_tab[IR2_CODES][2] = { + { 0x01, 3 }, { 0x02, 3 }, { 0x80, 3 }, { 0x03, 3 }, { 0x04, 5 }, + { 0x81, 5 }, { 0x05, 5 }, { 0x06, 5 }, { 0x82, 5 }, { 0x83, 5 }, + { 0x07, 5 }, { 0x08, 5 }, { 0x84, 6 }, { 0x09, 6 }, { 0x0A, 6 }, + { 0x0B, 6 }, { 0x0C, 6 }, { 0x0D, 6 }, { 0x0E, 6 }, { 0x85, 6 }, + { 0x0F, 8 }, { 0x10, 8 }, { 0x86, 8 }, { 0x87, 8 }, { 0x11, 8 }, + { 0x12, 8 }, { 0x13, 8 }, { 0x14, 8 }, { 0x88, 8 }, { 0x15, 8 }, + { 0x16, 8 }, { 0x89, 8 }, { 0x17, 8 }, { 0x18, 8 }, { 0x8A, 8 }, + { 0x19, 8 }, { 0x1A, 9 }, { 0x8B, 9 }, { 0x1B, 9 }, { 0x1C, 9 }, + { 0x8C, 9 }, { 0x1D, 9 }, { 0x1E, 9 }, { 0x8D, 9 }, { 0x1F, 9 }, + { 0x20, 9 }, { 0x8E, 9 }, { 0x21, 9 }, { 0x22, 9 }, { 0x8F, 9 }, + { 0x23, 9 }, { 0x24, 9 }, { 0x25, 10 }, { 0x26, 10 }, { 0x27, 10 }, + { 0x28, 10 }, { 0x29, 10 }, { 0x2A, 10 }, { 0x2B, 10 }, { 0x2C, 10 }, + { 0x2D, 10 }, { 0x2E, 10 }, { 0x2F, 10 }, { 0x30, 10 }, { 0x31, 10 }, + { 0x32, 10 }, { 0x33, 10 }, { 0x34, 10 }, { 0x35, 13 }, { 0x36, 13 }, + { 0x37, 13 }, { 0x38, 13 }, { 0x39, 13 }, { 0x3A, 13 }, { 0x3B, 13 }, + { 0x3C, 13 }, { 0x3D, 13 }, { 0x3E, 13 }, { 0x3F, 13 }, { 0x40, 13 }, + { 0x41, 13 }, { 0x42, 13 }, { 0x43, 13 }, { 0x44, 13 }, { 0x45, 13 }, + { 0x46, 13 }, { 0x47, 13 }, { 0x48, 13 }, { 0x49, 13 }, { 0x4A, 13 }, + { 0x4B, 13 }, { 0x4C, 13 }, { 0x4D, 13 }, { 0x4E, 13 }, { 0x4F, 13 }, + { 0x50, 13 }, { 0x51, 13 }, { 0x52, 13 }, { 0x53, 13 }, { 0x54, 13 }, + { 0x55, 13 }, { 0x56, 13 }, { 0x57, 13 }, { 0x58, 13 }, { 0x59, 13 }, + { 0x5A, 13 }, { 0x5B, 13 }, { 0x5C, 13 }, { 0x5D, 13 }, { 0x5E, 13 }, + { 0x5F, 13 }, { 0x60, 13 }, { 0x61, 13 }, { 0x62, 13 }, { 0x63, 13 }, + { 0x64, 13 }, { 0x65, 13 }, { 0x66, 13 }, { 0x67, 13 }, { 0x68, 13 }, + { 0x69, 13 }, { 0x6A, 13 }, { 0x6B, 13 }, { 0x6C, 13 }, { 0x6D, 13 }, + { 0x6E, 13 }, { 0x6F, 13 }, { 0x70, 13 }, { 0x71, 13 }, { 0x72, 13 }, + { 0x73, 13 }, { 0x74, 13 }, { 0x75, 14 }, { 0x76, 14 }, { 0x77, 14 }, + { 0x78, 14 }, { 0x79, 14 }, { 0x7A, 14 }, { 0x7B, 14 }, { 0x7C, 14 }, + { 0x7D, 14 }, { 0x7E, 14 }, { 0x7F, 14 }, }; static const uint8_t ir2_delta_table[4][256] = { From patchwork Fri Nov 20 07:19:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23837 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 1F8D0448ACD for ; Fri, 20 Nov 2020 09:39:58 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5FCB768BBCF; Fri, 20 Nov 2020 09:25:56 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F3BD968BBD8 for ; Fri, 20 Nov 2020 09:25:35 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id s25so11498270ejy.6 for ; Thu, 19 Nov 2020 23:25:35 -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=IKcDdMaR2wVaI45OZZVHtgSYkB73LhN3Bzn31yZfyo4=; b=YstvDUs0grIDpnwESyulu6F+dtKJZyIbnaEnGRwmXxK2YX2EM2bxeKAlTkkq3SvdNr Lp7XVJ9pwucF/OS2OasInQMUczfVTztBevSJT8IPkA+khNF/98qnxp4VNKC35m9WAu+m Ym0+n4v2C5kLYU1HWHWIdsms4SIQWK/njf88Q1OV/FMDFqLabrmBkGhB6SD6PylCkDkX io83VNxl4b3g9FJxD7cFpxv/9BXHQaJujaEOLZtS0nIyFoTqJ059UUipj/4WWI5jkx/r I+RkwiVvgbzdJZqN8BU5FlTOx2/5LH5VVn7kWYB3O4nWb+VesSpvbo95mT9f9GubjxDW tH3w== 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=IKcDdMaR2wVaI45OZZVHtgSYkB73LhN3Bzn31yZfyo4=; b=njxGDnzNahMF4ElNvvRyrmDCEW16C54nBwoo9kAc5lBq0ylhihPoav8TN+j0s7ixO2 LmHI/+1gwD2m8xsGfKCRUl8dt28LSiGTBXcnGGPccfewEl0suKGI+nGw2qzlRKfT8fxq 0vfleeY88cTOB4WIW/TU0Mnl5qZVWTlqxCqCjMo/NnUt1UCwK543AKqBpe8QWxKhRmP7 8iVhRf5lq+nyIlSlhzeqVnZu/6u3z3oUQ/4/Yrj5vl05gu2XEZzyvh169ZVTh+KBOORc uJmZy0Y+Wvilpj84e8RJ8yeJbdDtdRZ4AdlUFTb2u4/tGxh3BTiSXfhtY2wiAPPQL+Iw BeTg== X-Gm-Message-State: AOAM531+0S8qiyz0yNJtNwKpzbopkxaCpdZo55mW3CPd5SIan41vlFvm peLC/5IA0yr5vXhUD2hGlJlgLMhYfzwovQ== X-Google-Smtp-Source: ABdhPJxdkRsCwCYtA4b3+lOb4IqF0JSFHl+N2SanR5JVj2HSrsL/Fli9WCErvLDTYQWVhKRlyl9dEA== X-Received: by 2002:a17:907:11d9:: with SMTP id va25mr13256668ejb.431.1605857135224; Thu, 19 Nov 2020 23:25:35 -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.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:34 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:58 +0100 Message-Id: <20201120072116.818090-86-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 085/162] avcodec/indeo2: Make decoder thread-safe 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/indeo2.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 5a9c0e77be..5721308267 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -25,6 +25,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/thread.h" #define BITSTREAM_READER_LE #include "avcodec.h" @@ -225,8 +226,16 @@ static int ir2_decode_frame(AVCodecContext *avctx, return buf_size; } +static av_cold void ir2_init_static(void) +{ + INIT_VLC_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, + &ir2_tab[0][1], 2, &ir2_tab[0][0], 2, 1, + 0, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); +} + static av_cold int ir2_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; Ir2Context * const ic = avctx->priv_data; ic->avctx = avctx; @@ -237,9 +246,7 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx) if (!ic->picture) return AVERROR(ENOMEM); - INIT_VLC_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, - &ir2_tab[0][1], 2, &ir2_tab[0][0], 2, 1, - 0, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); + ff_thread_once(&init_static_once, ir2_init_static); return 0; } @@ -263,4 +270,5 @@ AVCodec ff_indeo2_decoder = { .close = ir2_decode_end, .decode = ir2_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Fri Nov 20 07:19:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23839 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 92658448F87 for ; Fri, 20 Nov 2020 09:40:08 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4EF7268BBE3; Fri, 20 Nov 2020 09:25:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7933768BB43 for ; Fri, 20 Nov 2020 09:25:37 +0200 (EET) Received: by mail-ej1-f44.google.com with SMTP id o21so11496522ejb.3 for ; Thu, 19 Nov 2020 23:25:37 -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=CZX93qf0S9OT9q+T+Ie+0kn1CGoqWml0yM46YIG31Is=; b=CbEtaZUyO2rtExYUSHg4HHTCCdCYnSjRunqL7ha4ike2DVdiVWOql9WUaTdjihVHv5 4O6YRq5t4eyE9dQrryVBRfClwIFR70pr7Aywmgmo+XP/Cp0yPsk3Yg2WeTLv/wlHEvXQ ZZ3+V2BwCeIIbcvOHkyFFFFFAxYup19tcjYm1sq2lucakTEhRG0hHHQBdsVNELnGC0ow VbDLvbA4mfHqeNJ7bA3jAQnoFQGP7KODdw71WbpCEdUqPx/Y+iH++86ANn5dHsBjEOdB GZE2DCp8B5e5UJ8d8HlTgMrgQ41S/2FGCp0+o2bqy693DlttxR7NjtBjdKMmoeuJSLtF 2mJQ== 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=CZX93qf0S9OT9q+T+Ie+0kn1CGoqWml0yM46YIG31Is=; b=f+yGlARUFuMnyetHbW5A/pW/EkIqdow3jeukAYkEixJY4rK+FeW5C8E7aAO+RiyKIl nUBDp0pAwlvq1/rrfsJCsEeprI7Pp0n6ubML8vfkamNJEHnL0B1UOvR3tV9dmuingehT E9OHT+qgd9dCpEmE0J/2kGkAXSDyI0aWPb6s+58YhCiv5R7zJwIa1jxoqGkP9eWoVdKa M6TM5ozAJFe+K2uZHVqUCcKe9o10QHSiYXUmovPiVgiN3KGMg7yEeCMPBGD33GK75b4L PkzIAPrl5ogu7RltM+iajiFHM5uePt924c8hIg9+YG12Ij1A77l+qbVLQA9RDDSKxZu/ BXXw== X-Gm-Message-State: AOAM530fptKUcQFRym1bdQev8Afu4fKgW4UeqaiMcnng4x52qwJRQf0d a9kRKR+A79hdSlR3ko+0iz3cbYhRux7KiQ== X-Google-Smtp-Source: ABdhPJyLqGDL8ZCw37LhWI+xUNDtaFzAwgQTDBltps/dR9Hnw69mp+wyLSwx3IQkBt0InQwBgQBiWw== X-Received: by 2002:a17:906:7d1:: with SMTP id m17mr31862812ejc.98.1605857136293; Thu, 19 Nov 2020 23:25:36 -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.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:35 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:59 +0100 Message-Id: <20201120072116.818090-87-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 086/162] avcodec/mpeg4video: Make tables used to initialize VLCs 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" Switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() allows to replace codes which are so long that they need to be stored in an uint16_t by symbols which fit into an uint8_t; and even these can be avoided in case of the sprite trajectory VLC. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg4data.h | 150 +++++++++++++++---------------------- libavcodec/mpeg4video.h | 8 +- libavcodec/mpeg4videodec.c | 31 ++++---- 3 files changed, 80 insertions(+), 109 deletions(-) diff --git a/libavcodec/mpeg4data.h b/libavcodec/mpeg4data.h index 4756e9ea1d..30179d9801 100644 --- a/libavcodec/mpeg4data.h +++ b/libavcodec/mpeg4data.h @@ -323,10 +323,8 @@ RLTable ff_rvlc_rl_intra = { intra_rvlc_level, }; -const uint16_t ff_sprite_trajectory_tab[15][2] = { - {0x00, 2}, {0x02, 3}, {0x03, 3}, {0x04, 3}, {0x05, 3}, {0x06, 3}, - {0x0E, 4}, {0x1E, 5}, {0x3E, 6}, {0x7E, 7}, {0xFE, 8}, - {0x1FE, 9},{0x3FE, 10},{0x7FE, 11},{0xFFE, 12}, +const uint8_t ff_sprite_trajectory_lens[15] = { + 2, 3, 3, 3, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, }; const uint8_t ff_mb_type_b_tab[4][2] = { @@ -374,119 +372,91 @@ const uint8_t ff_mpeg4_dc_threshold[8]={ }; /* Note these are different in studio mode */ -const uint16_t ff_mpeg4_studio_dc_luma[19][2]={ - {0x0e, 6}, {0x06, 5}, {0x00, 4}, {0x02, 4}, - {0x07, 3}, {0x05, 3}, {0x03, 3}, {0x02, 3}, - {0x04, 3}, {0x06, 3}, {0x01, 4}, {0x1e, 7}, - {0x3e, 8}, {0x7e, 9}, {0xfe, 10}, {0x1fe, 11}, - {0x3fe, 12}, {0x7fe, 13}, {0x7ff, 13} +const uint8_t ff_mpeg4_studio_dc_luma[19][2] = { + { 2, 4 }, { 10, 4 }, { 3, 4 }, { 1, 5 }, { 0, 6 }, { 11, 7 }, + { 12, 8 }, { 13, 9 }, { 14, 10 }, { 15, 11 }, { 16, 12 }, { 17, 13 }, + { 18, 13 }, { 7, 3 }, { 6, 3 }, { 8, 3 }, { 5, 3 }, { 9, 3 }, + { 4, 3 }, }; -const uint16_t ff_mpeg4_studio_dc_chroma[19][2]={ - {0x00, 4}, {0x02, 4}, {0x07, 3}, {0x05, 3}, - {0x03, 3}, {0x02, 3}, {0x04, 3}, {0x06, 3}, - {0x01, 4}, {0x06, 5}, {0x0e, 6}, {0x1e, 7}, - {0x3e, 8}, {0x7e, 9}, {0xfe, 10}, {0x1fe, 11}, - {0x3fe, 12}, {0x7fe, 13}, {0x7ff, 13} +const uint8_t ff_mpeg4_studio_dc_chroma[19][2] = { + { 0, 4 }, { 8, 4 }, { 1, 4 }, { 9, 5 }, { 10, 6 }, { 11, 7 }, + { 12, 8 }, { 13, 9 }, { 14, 10 }, { 15, 11 }, { 16, 12 }, { 17, 13 }, + { 18, 13 }, { 5, 3 }, { 4, 3 }, { 6, 3 }, { 3, 3 }, { 7, 3 }, + { 2, 3 }, }; -const uint16_t ff_mpeg4_studio_intra[12][22][2]={ +const uint8_t ff_mpeg4_studio_intra[12][24][2] = { { - {0x05, 4}, {0x04, 4}, {0x05, 7}, {0x09, 9}, - {0x21, 11}, {0x41, 12}, {0x81, 13}, {0x03, 4}, - {0x03, 5}, {0x05, 6}, {0x04, 7}, {0x03, 7}, - {0x05, 8}, {0x03, 2}, {0x05, 3}, {0x04, 3}, - {0x03, 3}, {0x02, 4}, {0x04, 6}, {0x03, 6}, - {0x11, 10}, {0x80, 13} + { 0, -6 }, { 21, 13 }, { 6, 13 }, { 5, 12 }, { 4, 11 }, { 20, 10 }, + { 3, 9 }, { 12, 8 }, { 11, 7 }, { 10, 7 }, { 2, 7 }, { 19, 6 }, + { 18, 6 }, { 9, 6 }, { 8, 5 }, { 17, 4 }, { 7, 4 }, { 1, 4 }, + { 0, 4 }, { 16, 3 }, { 15, 3 }, { 14, 3 }, { 13, 2 }, }, { - {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}, - {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}, - {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}, - {0x00, 0}, {0x00, 0}, {0x01, 1}, {0x01, 2}, - {0x01, 3}, {0x01, 4}, {0x01, 5}, {0x03, 7}, - {0x05, 8}, {0x04, 8} + { 0, -6 }, { 21, 8 }, { 20, 8 }, { 19, 7 }, { 18, 5 }, { 17, 4 }, + { 16, 3 }, { 15, 2 }, { 14, 1 }, }, { - {0x05, 3}, {0x03, 5}, {0x02, 5}, {0x03, 7}, - {0x09, 9}, {0x103, 14}, {0x102, 14}, {0x04, 3}, - {0x03, 3}, {0x03, 4}, {0x02, 4}, {0x03, 6}, - {0x11, 10}, {0x03, 2}, {0x02, 3}, {0x02, 6}, - {0x05, 8}, {0x21, 11}, {0x83, 13}, {0x101, 14}, - {0x201, 15}, {0x82, 13} + { 0, -6 }, { 0,-15 }, { 20, 15 }, { 19, 14 }, { 6, 14 }, { 5, 14 }, + { 21, 13 }, { 18, 13 }, { 17, 11 }, { 12, 10 }, { 4, 9 }, { 16, 8 }, + { 3, 7 }, { 15, 6 }, { 11, 6 }, { 2, 5 }, { 1, 5 }, { 10, 4 }, + { 9, 4 }, { 14, 3 }, { 8, 3 }, { 7, 3 }, { 0, 3 }, { 13, 2 }, }, { - {0x05, 5}, {0x05, 4}, {0x04, 5}, {0x03, 6}, - {0x09, 9}, {0x83, 13}, {0x82, 13}, {0x03, 3}, - {0x04, 4}, {0x03, 4}, {0x03, 5}, {0x05, 8}, - {0x81, 13}, {0x03, 2}, {0x02, 2}, {0x02, 5}, - {0x02, 6}, {0x03, 7}, {0x11, 10}, {0x43, 12}, - {0x80, 13}, {0x42, 12} + { 0, -6 }, { 20, 13 }, { 12, 13 }, { 6, 13 }, { 5, 13 }, { 21, 12 }, + { 19, 12 }, { 18, 10 }, { 4, 9 }, { 11, 8 }, { 17, 7 }, { 16, 6 }, + { 3, 6 }, { 15, 5 }, { 10, 5 }, { 2, 5 }, { 0, 5 }, { 9, 4 }, + { 8, 4 }, { 1, 4 }, { 7, 3 }, { 14, 2 }, { 13, 2 }, }, { - {0x05, 7}, {0x03, 4}, {0x03, 5}, {0x04, 7}, - {0x09, 9}, {0x83, 13}, {0x101, 14}, {0x03, 3}, - {0x02, 4}, {0x05, 6}, {0x03, 7}, {0x11, 10}, - {0x201, 15}, {0x03, 2}, {0x02, 2}, {0x02, 3}, - {0x04, 6}, {0x03, 6}, {0x05, 8}, {0x21, 11}, - {0x82, 13}, {0x81, 13} + { 0, -6 }, { 0,-15 }, { 12, 15 }, { 6, 14 }, { 21, 13 }, { 20, 13 }, + { 5, 13 }, { 19, 11 }, { 11, 10 }, { 4, 9 }, { 18, 8 }, { 10, 7 }, + { 3, 7 }, { 0, 7 }, { 17, 6 }, { 16, 6 }, { 9, 6 }, { 2, 5 }, + { 8, 4 }, { 1, 4 }, { 15, 3 }, { 7, 3 }, { 14, 2 }, { 13, 2 }, }, { - {0x13, 10}, {0x03, 5}, {0x05, 7}, {0x12, 10}, - {0x43, 12}, {0x83, 13}, {0x82, 13}, {0x02, 5}, - {0x04, 7}, {0x05, 8}, {0x23, 11}, {0x81, 13}, - {0x101, 14}, {0x03, 2}, {0x02, 2}, {0x01, 2}, - {0x01, 3}, {0x03, 6}, {0x03, 7}, {0x22, 11}, - {0x201, 15}, {0x42, 12} + { 0, -6 }, { 0,-15 }, { 20, 15 }, { 12, 14 }, { 11, 13 }, { 6, 13 }, + { 5, 13 }, { 21, 12 }, { 4, 12 }, { 19, 11 }, { 10, 11 }, { 3, 10 }, + { 0, 10 }, { 9, 8 }, { 18, 7 }, { 8, 7 }, { 2, 7 }, { 17, 6 }, + { 7, 5 }, { 1, 5 }, { 16, 3 }, { 15, 2 }, { 14, 2 }, { 13, 2 }, }, { - {0x23, 11}, {0x01, 4}, {0x07, 8}, {0x13, 10}, - {0x22, 11}, {0x103, 14}, {0x102, 14}, {0x03, 6}, - {0x06, 8}, {0x12, 10}, {0x43, 12}, {0x101, 14}, - {0x201, 15}, {0x03, 3}, {0x02, 3}, {0x03, 2}, - {0x02, 2}, {0x01, 3}, {0x02, 6}, {0x05, 8}, - {0x42, 12}, {0x41, 12} + { 0, -6 }, { 0,-15 }, { 12, 15 }, { 11, 14 }, { 6, 14 }, { 5, 14 }, + { 21, 12 }, { 20, 12 }, { 10, 12 }, { 4, 11 }, { 0, 11 }, { 9, 10 }, + { 3, 10 }, { 19, 8 }, { 8, 8 }, { 2, 8 }, { 18, 6 }, { 7, 6 }, + { 1, 4 }, { 17, 3 }, { 14, 3 }, { 13, 3 }, { 16, 2 }, { 15, 2 }, }, { - {0x0b, 9}, {0x03, 5}, {0x07, 8}, {0x07, 7}, - {0x06, 7}, {0x23, 11}, {0x41, 12}, {0x05, 7}, - {0x06, 8}, {0x0a, 9}, {0x13, 10}, {0x22, 11}, - {0x40, 12}, {0x03, 4}, {0x02, 4}, {0x03, 2}, - {0x02, 2}, {0x01, 2}, {0x02, 5}, {0x04, 7}, - {0x12, 10}, {0x21, 11} + { 0, -6 }, { 12, 12 }, { 6, 12 }, { 21, 11 }, { 11, 11 }, { 5, 11 }, + { 20, 10 }, { 10, 10 }, { 9, 9 }, { 0, 9 }, { 8, 8 }, { 2, 8 }, + { 19, 7 }, { 7, 7 }, { 4, 7 }, { 3, 7 }, { 18, 5 }, { 1, 5 }, + { 14, 4 }, { 13, 4 }, { 17, 2 }, { 16, 2 }, { 15, 2 }, }, { - {0x15, 10}, {0x03, 6}, {0x14, 10}, {0x23, 11}, - {0x07, 8}, {0x43, 12}, {0x81, 13}, {0x06, 8}, - {0x0b, 9}, {0x13, 10}, {0x12, 10}, {0x42, 12}, - {0x80, 13}, {0x01, 4}, {0x03, 3}, {0x02, 3}, - {0x03, 2}, {0x02, 2}, {0x01, 3}, {0x02, 6}, - {0x22, 11}, {0x41, 12} + { 0, -6 }, { 12, 13 }, { 6, 13 }, { 21, 12 }, { 11, 12 }, { 5, 12 }, + { 20, 11 }, { 3, 11 }, { 10, 10 }, { 9, 10 }, { 2, 10 }, { 0, 10 }, + { 8, 9 }, { 7, 8 }, { 4, 8 }, { 19, 6 }, { 1, 6 }, { 13, 4 }, + { 18, 3 }, { 15, 3 }, { 14, 3 }, { 17, 2 }, { 16, 2 }, }, { - {0x43, 12}, {0x05, 6}, {0x07, 8}, {0x04, 6}, - {0x03, 6}, {0x13, 10}, {0x42, 12}, {0x05, 7}, - {0x04, 7}, {0x06, 8}, {0x12, 10}, {0x41, 12}, - {0x40, 12}, {0x03, 5}, {0x03, 4}, {0x03, 3}, - {0x02, 3}, {0x03, 2}, {0x02, 2}, {0x02, 4}, - {0x05, 8}, {0x11, 10} + { 0, -6 }, { 12, 12 }, { 11, 12 }, { 6, 12 }, { 0, 12 }, { 21, 10 }, + { 10, 10 }, { 5, 10 }, { 20, 8 }, { 9, 8 }, { 2, 8 }, { 8, 7 }, + { 7, 7 }, { 4, 6 }, { 3, 6 }, { 1, 6 }, { 13, 5 }, { 19, 4 }, + { 14, 4 }, { 16, 3 }, { 15, 3 }, { 18, 2 }, { 17, 2 }, }, { - {0x83, 13}, {0x05, 7}, {0x07, 8}, {0x03, 4}, - {0x21, 11}, {0x82, 13}, {0x81, 13}, {0x04, 7}, - {0x06, 8}, {0x0b, 9}, {0x0a, 9}, {0x11, 10}, - {0x80, 13}, {0x03, 5}, {0x02, 5}, {0x02, 4}, - {0x03, 3}, {0x02, 3}, {0x03, 2}, {0x02, 2}, - {0x03, 6}, {0x09, 9} + { 0, -6 }, { 12, 13 }, { 6, 13 }, { 5, 13 }, { 0, 13 }, { 4, 11 }, + { 11, 10 }, { 21, 9 }, { 10, 9 }, { 9, 9 }, { 8, 8 }, { 2, 8 }, + { 7, 7 }, { 1, 7 }, { 20, 6 }, { 14, 5 }, { 13, 5 }, { 15, 4 }, + { 3, 4 }, { 17, 3 }, { 16, 3 }, { 19, 2 }, { 18, 2 }, }, { - {0x13, 10}, {0x03, 5}, {0x03, 6}, {0x0d, 9}, - {0x0c, 9}, {0x21, 11}, {0x20, 11}, {0x02, 5}, - {0x02, 6}, {0x07, 8}, {0x0b, 9}, {0x12, 10}, - {0x11, 10}, {0x05, 3}, {0x04, 3}, {0x05, 4}, - {0x04, 4}, {0x03, 4}, {0x02, 4}, {0x03, 3}, - {0x03, 2}, {0x0a, 9} - } + { 0, -6 }, { 6, 11 }, { 5, 11 }, { 12, 10 }, { 11, 10 }, { 0, 10 }, + { 21, 9 }, { 10, 9 }, { 4, 9 }, { 3, 9 }, { 9, 8 }, { 8, 6 }, + { 2, 6 }, { 7, 5 }, { 1, 5 }, { 18, 4 }, { 17, 4 }, { 16, 4 }, + { 15, 4 }, { 19, 3 }, { 14, 3 }, { 13, 3 }, { 20, 2 }, + }, }; #endif /* AVCODEC_MPEG4DATA_H */ diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h index 1a5da31928..3de598465f 100644 --- a/libavcodec/mpeg4video.h +++ b/libavcodec/mpeg4video.h @@ -138,7 +138,7 @@ extern RLTable ff_mpeg4_rl_intra; extern RLTable ff_rvlc_rl_inter; extern RLTable ff_rvlc_rl_intra; -extern const uint16_t ff_sprite_trajectory_tab[15][2]; +extern const uint8_t ff_sprite_trajectory_lens[15]; extern const uint8_t ff_mb_type_b_tab[4][2]; /* these matrixes will be permuted for the idct */ @@ -151,9 +151,9 @@ extern const uint16_t ff_mpeg4_resync_prefix[8]; extern const uint8_t ff_mpeg4_dc_threshold[8]; -extern const uint16_t ff_mpeg4_studio_dc_luma[19][2]; -extern const uint16_t ff_mpeg4_studio_dc_chroma[19][2]; -extern const uint16_t ff_mpeg4_studio_intra[12][22][2]; +extern const uint8_t ff_mpeg4_studio_dc_luma[19][2]; +extern const uint8_t ff_mpeg4_studio_dc_chroma[19][2]; +extern const uint8_t ff_mpeg4_studio_intra[12][24][2]; void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index ff5c6acf67..cc3c36d722 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -3394,9 +3394,9 @@ av_cold void ff_mpeg4videodec_static_init(void) { INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */, &ff_mpeg4_DCtab_chrom[0][1], 2, 1, &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512); - INIT_VLC_STATIC(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, - &ff_sprite_trajectory_tab[0][1], 4, 2, - &ff_sprite_trajectory_tab[0][0], 4, 2, 128); + INIT_VLC_STATIC_FROM_LENGTHS(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, + ff_sprite_trajectory_lens, 1, + NULL, 0, 0, 0, 0, 128); INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, &ff_mb_type_b_tab[0][1], 2, 1, &ff_mb_type_b_tab[0][0], 2, 1, 16); @@ -3506,26 +3506,27 @@ static av_cold int init_studio_vlcs(Mpeg4DecContext *ctx) int i, ret; for (i = 0; i < 12; i++) { - ret = init_vlc(&ctx->studio_intra_tab[i], STUDIO_INTRA_BITS, 22, - &ff_mpeg4_studio_intra[i][0][1], 4, 2, - &ff_mpeg4_studio_intra[i][0][0], 4, 2, - 0); + ret = ff_init_vlc_from_lengths(&ctx->studio_intra_tab[i], + STUDIO_INTRA_BITS, 24, + &ff_mpeg4_studio_intra[i][0][1], 2, + &ff_mpeg4_studio_intra[i][0][0], 2, 1, + 0, 0, NULL); if (ret < 0) return ret; } - ret = init_vlc(&ctx->studio_luma_dc, STUDIO_INTRA_BITS, 19, - &ff_mpeg4_studio_dc_luma[0][1], 4, 2, - &ff_mpeg4_studio_dc_luma[0][0], 4, 2, - 0); + ret = ff_init_vlc_from_lengths(&ctx->studio_luma_dc, STUDIO_INTRA_BITS, 19, + &ff_mpeg4_studio_dc_luma[0][1], 2, + &ff_mpeg4_studio_dc_luma[0][0], 2, 1, + 0, 0, NULL); if (ret < 0) return ret; - ret = init_vlc(&ctx->studio_chroma_dc, STUDIO_INTRA_BITS, 19, - &ff_mpeg4_studio_dc_chroma[0][1], 4, 2, - &ff_mpeg4_studio_dc_chroma[0][0], 4, 2, - 0); + ret = ff_init_vlc_from_lengths(&ctx->studio_chroma_dc, STUDIO_INTRA_BITS, 19, + &ff_mpeg4_studio_dc_chroma[0][1], 2, + &ff_mpeg4_studio_dc_chroma[0][0], 2, 1, + 0, 0, NULL); if (ret < 0) return ret; From patchwork Fri Nov 20 07:20:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23840 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 AFDC7448F87 for ; Fri, 20 Nov 2020 09:40:19 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2859A68BC52; Fri, 20 Nov 2020 09:25:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5439868BB4D for ; Fri, 20 Nov 2020 09:25:38 +0200 (EET) Received: by mail-ed1-f51.google.com with SMTP id q3so8445574edr.12 for ; Thu, 19 Nov 2020 23:25:38 -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=hQ0UUNPZsP/janMwKgjcg92p4dfXyf0etoKRiXzSS2M=; b=kBS/1lloaR8lQm6vgHvQOHsrqNhoK9GkLdFahWX/BwvEqbj8udmnx3wMtVNIPqFYZX 9w8ygMvqKfdeJ7PyjoeoWStQHTGqdhPy2rK3nhh0ZVwV/Zx4mcgTvINfm2ZvOZgm7Q2C lK/YXIp2a3bYskO4RgBgU/5hJxfbTVIR6fqDYpC217dD+Vs0ZmyIA350j7j6rPnLrmz9 FFSfWW2MsA1bxRL+rlVwjvZd1kqyea1Lv7s45tK15fHIWAPmoKSGmXoyY8h5cQ0ti8/N lKN+BA7BDTyIF1ro0D8Tysa5j28XnjUsG+qY6fhKPluOvIYVG0DoKRV3EQT4xHXldWA1 wD+Q== 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=hQ0UUNPZsP/janMwKgjcg92p4dfXyf0etoKRiXzSS2M=; b=SAyzS21GBNXKZuwV6ueS2zWPYoQyiY5UoAxTHC9LgWqdwFg8S5xAPbXyNKCBz2Kxhs jygKHe59Uyv+hEuXid3MnUU5Xx4Vxw+HZInN7s4/Hz9YNzQVpO5jyRM4SP/oqUoCz8+A ggy3MwwihmWoNfVb+OVqBb57VgCwZX7OvhJCZ0MoLycf+xl602xFxuauVRsofu/AgcJi XJmJivrbs2lz2s+gF7imkk0/eYj+B6EhyrTtcCjyPwvPK7ibT0L3IaAHt8lM0hYExYaI qvPcIogZmKz/GyiAjNJhav76dzn0RnhcnVGWVvapJwaJ+dlbD9Vjp62CsrgDwEXPOg+E 1Aug== X-Gm-Message-State: AOAM530WEjL7TnBLQAdHFaBKorFwPqQUsH1TUrHANX5cHbzxlRQA5f0J namZsDLqPgRW/0j2JaoLKk5IXOK739uUdg== X-Google-Smtp-Source: ABdhPJw3cuHeF3b01NfAgaJY7Ierz4Ftd+kSsL044S+QRCSV7dSdDPR9MJeDZ3Jw4o8dT37dp61qkA== X-Received: by 2002:a05:6402:3098:: with SMTP id de24mr33472973edb.155.1605857137237; Thu, 19 Nov 2020 23:25:37 -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.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:36 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:00 +0100 Message-Id: <20201120072116.818090-88-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 087/162] avcodec/mpeg4videodec: Make studio VLCs static 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/mpeg4video.h | 4 -- libavcodec/mpeg4videodec.c | 88 ++++++++++++++++---------------------- 2 files changed, 36 insertions(+), 56 deletions(-) diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h index 3de598465f..e919db87a5 100644 --- a/libavcodec/mpeg4video.h +++ b/libavcodec/mpeg4video.h @@ -115,10 +115,6 @@ typedef struct Mpeg4DecContext { int cplx_estimation_trash_p; int cplx_estimation_trash_b; - VLC studio_intra_tab[12]; - VLC studio_luma_dc; - VLC studio_chroma_dc; - int rgb; } Mpeg4DecContext; diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index cc3c36d722..19dcaff764 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -25,6 +25,7 @@ #include "libavutil/internal.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" +#include "libavutil/thread.h" #include "error_resilience.h" #include "hwconfig.h" #include "idctdsp.h" @@ -53,6 +54,9 @@ static int decode_studio_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb); static VLC dc_lum, dc_chrom; static VLC sprite_trajectory; static VLC mb_type_b_vlc; +static VLC studio_intra_tab[12]; +static VLC studio_luma_dc; +static VLC studio_chroma_dc; static const int mb_type_b_map[4] = { MB_TYPE_DIRECT2 | MB_TYPE_L0L1, @@ -1820,7 +1824,7 @@ static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n int cc, dct_dc_size, dct_diff, code, j, idx = 1, group = 0, run = 0, additional_code_len, sign, mismatch; - VLC *cur_vlc = &ctx->studio_intra_tab[0]; + const VLC *cur_vlc = &studio_intra_tab[0]; uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; uint32_t flc; @@ -1834,14 +1838,14 @@ static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n if (n < 4) { cc = 0; - dct_dc_size = get_vlc2(&s->gb, ctx->studio_luma_dc.table, STUDIO_INTRA_BITS, 2); + dct_dc_size = get_vlc2(&s->gb, studio_luma_dc.table, STUDIO_INTRA_BITS, 2); quant_matrix = s->intra_matrix; } else { cc = (n & 1) + 1; if (ctx->rgb) - dct_dc_size = get_vlc2(&s->gb, ctx->studio_luma_dc.table, STUDIO_INTRA_BITS, 2); + dct_dc_size = get_vlc2(&s->gb, studio_luma_dc.table, STUDIO_INTRA_BITS, 2); else - dct_dc_size = get_vlc2(&s->gb, ctx->studio_chroma_dc.table, STUDIO_INTRA_BITS, 2); + dct_dc_size = get_vlc2(&s->gb, studio_chroma_dc.table, STUDIO_INTRA_BITS, 2); quant_matrix = s->chroma_intra_matrix; } @@ -1878,7 +1882,7 @@ static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n } additional_code_len = ac_state_tab[group][0]; - cur_vlc = &ctx->studio_intra_tab[ac_state_tab[group][1]]; + cur_vlc = &studio_intra_tab[ac_state_tab[group][1]]; if (group == 0) { /* End of Block */ @@ -3501,40 +3505,36 @@ static int mpeg4_update_thread_context(AVCodecContext *dst, } #endif -static av_cold int init_studio_vlcs(Mpeg4DecContext *ctx) +static av_cold void mpeg4_init_static(void) { - int i, ret; - - for (i = 0; i < 12; i++) { - ret = ff_init_vlc_from_lengths(&ctx->studio_intra_tab[i], - STUDIO_INTRA_BITS, 24, - &ff_mpeg4_studio_intra[i][0][1], 2, - &ff_mpeg4_studio_intra[i][0][0], 2, 1, - 0, 0, NULL); - - if (ret < 0) - return ret; + INIT_VLC_STATIC_FROM_LENGTHS(&studio_luma_dc, STUDIO_INTRA_BITS, 19, + &ff_mpeg4_studio_dc_luma[0][1], 2, + &ff_mpeg4_studio_dc_luma[0][0], 2, 1, + 0, 0, 528); + + INIT_VLC_STATIC_FROM_LENGTHS(&studio_chroma_dc, STUDIO_INTRA_BITS, 19, + &ff_mpeg4_studio_dc_chroma[0][1], 2, + &ff_mpeg4_studio_dc_chroma[0][0], 2, 1, + 0, 0, 528); + + for (unsigned i = 0, offset = 0; i < 12; i++) { + static VLC_TYPE vlc_buf[6498][2]; + + studio_intra_tab[i].table = &vlc_buf[offset]; + studio_intra_tab[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; + ff_init_vlc_from_lengths(&studio_intra_tab[i], + STUDIO_INTRA_BITS, 24, + &ff_mpeg4_studio_intra[i][0][1], 2, + &ff_mpeg4_studio_intra[i][0][0], 2, 1, + 0, INIT_VLC_STATIC_OVERLONG, NULL); + offset += studio_intra_tab[i].table_size; } - - ret = ff_init_vlc_from_lengths(&ctx->studio_luma_dc, STUDIO_INTRA_BITS, 19, - &ff_mpeg4_studio_dc_luma[0][1], 2, - &ff_mpeg4_studio_dc_luma[0][0], 2, 1, - 0, 0, NULL); - if (ret < 0) - return ret; - - ret = ff_init_vlc_from_lengths(&ctx->studio_chroma_dc, STUDIO_INTRA_BITS, 19, - &ff_mpeg4_studio_dc_chroma[0][1], 2, - &ff_mpeg4_studio_dc_chroma[0][0], 2, 1, - 0, 0, NULL); - if (ret < 0) - return ret; - - return 0; + ff_mpeg4videodec_static_init(); } static av_cold int decode_init(AVCodecContext *avctx) { + static AVOnce static_init_once = AV_ONCE_INIT; Mpeg4DecContext *ctx = avctx->priv_data; MpegEncContext *s = &ctx->m; int ret; @@ -3547,10 +3547,6 @@ static av_cold int decode_init(AVCodecContext *avctx) if ((ret = ff_h263_decode_init(avctx)) < 0) return ret; - ff_mpeg4videodec_static_init(); - if ((ret = init_studio_vlcs(ctx)) < 0) - return ret; - s->h263_pred = 1; s->low_delay = 0; /* default, might be overridden in the vol header during header parsing */ s->decode_mb = mpeg4_decode_mb; @@ -3558,21 +3554,9 @@ static av_cold int decode_init(AVCodecContext *avctx) avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; - return 0; -} + ff_thread_once(&static_init_once, mpeg4_init_static); -static av_cold int decode_end(AVCodecContext *avctx) -{ - Mpeg4DecContext *ctx = avctx->priv_data; - int i; - - for (i = 0; i < 12; i++) - ff_free_vlc(&ctx->studio_intra_tab[i]); - - ff_free_vlc(&ctx->studio_luma_dc); - ff_free_vlc(&ctx->studio_chroma_dc); - - return ff_h263_decode_end(avctx); + return 0; } static const AVOption mpeg4_options[] = { @@ -3595,7 +3579,7 @@ AVCodec ff_mpeg4_decoder = { .id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(Mpeg4DecContext), .init = decode_init, - .close = decode_end, + .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_DELAY | From patchwork Fri Nov 20 07:20:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23841 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 75F0C448F87 for ; Fri, 20 Nov 2020 09:40:30 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 207D468BC39; Fri, 20 Nov 2020 09:25:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1090D68BB9D for ; Fri, 20 Nov 2020 09:25:39 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id gj5so11500952ejb.8 for ; Thu, 19 Nov 2020 23:25:38 -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=ziELYeJ7lLzU/HoMxep2WKuGk80o1WqqPy6pdcW9c1k=; b=TJQU37x0+UVuGE/7qK4uWaOboP3D2Dy35dx9yFUsq4aMUKi1uIHRRuTWfr8sVTJrb+ sg8k7m/usnmgzepk/7gAQh7VSEjbTDfc0REcOOQXFF5M5VJvg6LLLOMQkcViBJFrG7/n 17apZiWT7nzdXE9NA4aoT0tv05M9aFTt3R6YtK7fFz8H4UrAJTuVOK/2Rz/IYt9bCdXj JLUSuzDK+QtBGriXvgH7fuURv4FsgZ0lxFLr+5s8uK/lSmUsJEqSFFBWP3ubVz1hIK6e DeQl+EbkS9SgYytzsNTVK3vr4PXFrBkNK5DQJkyjL7Rfps/4ClBy7rZR6t1WnSHnmajN RHnA== 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=ziELYeJ7lLzU/HoMxep2WKuGk80o1WqqPy6pdcW9c1k=; b=ZPhPX3MNHL/TRjxnKi8ba/Q97j5fA5RF7dmOZQzplqauOfwdgc9/aw/NqX3kyFwmul buRnw6vYG66fYKPXOHgPBv3weqkFffilameYhsb+Xv4uXFIRuxFneqwzqqmY8FNfhZBB rr0/llJB9oeIEesc+qdhUH/5tlbf2aRkX+9oeaxp1UfnCVDqDVbnOV2hcfthPOVt1Ez9 fj+5ez7HvhNOw2aB+0/Ydu1nMBtRwPRYS13q8675p2uim36S2MHKm4SS0A0CQXX5N3ZC oaq3bNed9cMkIKr/O7ClvTLBCghBPlPyUlPUX8Sa/96cUIjzB/2o26Htv+wzsO6elEFW Pq6A== X-Gm-Message-State: AOAM532CpWOO4wGNOIf1Eg6IGyFb2wb6ls60MnFdHbhnvw0q8VL6eOPf 9GQvCIPrJc59eizbyMNEZNJUE8TZhSvbig== X-Google-Smtp-Source: ABdhPJwSLpyCPQij4xa8tFpCh2uPL8YCRN+YYu94fpqDKuvkkwf8ic3j1AadH7vTqydMGnBcXIeHyQ== X-Received: by 2002:a17:907:1008:: with SMTP id ox8mr30990224ejb.189.1605857138131; Thu, 19 Nov 2020 23:25:38 -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.25.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:37 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:01 +0100 Message-Id: <20201120072116.818090-89-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 088/162] avcodec/truemotion2: Simplify creating VLC 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" ff_init_vlc_from_lengths() can be used to offload the computation of the codes; it also allows to omit the check whether the codes are already properly ordered (they are). In this case, this also allows to avoid the allocation of the buffer for the codes. This improves performance: The amount of decicycles for one call to tm2_build_huff_tables() when decoding tm20.avi from the FATE-suite decreased from 46239 to 40035. This test consisted of looping 50 times over the file and iterating the test ten times. Signed-off-by: Andreas Rheinhardt --- libavcodec/truemotion2.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index 0f4f345a6c..d6375ad489 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -108,15 +108,14 @@ typedef struct TM2Huff { int num; ///< current number filled int max_num; ///< total number of codes int *nums; ///< literals - uint32_t *bits; ///< codes - int *lens; ///< codelengths + uint8_t *lens; ///< codelengths } TM2Huff; /** * * @returns the length of the longest code or an AVERROR code */ -static int tm2_read_tree(TM2Context *ctx, uint32_t prefix, int length, TM2Huff *huff) +static int tm2_read_tree(TM2Context *ctx, int length, TM2Huff *huff) { int ret, ret2; if (length > huff->max_bits) { @@ -134,14 +133,13 @@ static int tm2_read_tree(TM2Context *ctx, uint32_t prefix, int length, TM2Huff * return AVERROR_INVALIDDATA; } huff->nums[huff->num] = get_bits_long(&ctx->gb, huff->val_bits); - huff->bits[huff->num] = prefix; huff->lens[huff->num] = length; huff->num++; return length; } else { /* non-terminal node */ - if ((ret2 = tm2_read_tree(ctx, prefix << 1, length + 1, huff)) < 0) + if ((ret2 = tm2_read_tree(ctx, length + 1, huff)) < 0) return ret2; - if ((ret = tm2_read_tree(ctx, (prefix << 1) | 1, length + 1, huff)) < 0) + if ((ret = tm2_read_tree(ctx, length + 1, huff)) < 0) return ret; } return FFMAX(ret, ret2); @@ -177,15 +175,14 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code) /* allocate space for codes - it is exactly ceil(nodes / 2) entries */ huff.max_num = (huff.nodes + 1) >> 1; huff.nums = av_calloc(huff.max_num, sizeof(int)); - huff.bits = av_calloc(huff.max_num, sizeof(uint32_t)); - huff.lens = av_calloc(huff.max_num, sizeof(int)); + huff.lens = av_mallocz(huff.max_num); - if (!huff.nums || !huff.bits || !huff.lens) { + if (!huff.nums || !huff.lens) { res = AVERROR(ENOMEM); goto out; } - res = tm2_read_tree(ctx, 0, 0, &huff); + res = tm2_read_tree(ctx, 0, &huff); if (res >= 0 && res != huff.max_bits) { av_log(ctx->avctx, AV_LOG_ERROR, "Got less bits than expected: %i of %i\n", @@ -200,9 +197,9 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code) /* convert codes to vlc_table */ if (res >= 0) { - res = init_vlc(&code->vlc, huff.max_bits, huff.max_num, - huff.lens, sizeof(int), sizeof(int), - huff.bits, sizeof(uint32_t), sizeof(uint32_t), 0); + res = ff_init_vlc_from_lengths(&code->vlc, huff.max_bits, huff.max_num, + huff.lens, sizeof(huff.lens[0]), + NULL, 0, 0, 0, 0, ctx->avctx); if (res < 0) av_log(ctx->avctx, AV_LOG_ERROR, "Cannot build VLC table\n"); else { @@ -216,7 +213,6 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code) out: /* free allocated memory */ av_free(huff.nums); - av_free(huff.bits); av_free(huff.lens); return res; From patchwork Fri Nov 20 07:20:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23842 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 A9A45448F87 for ; Fri, 20 Nov 2020 09:40:40 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0499368BC67; Fri, 20 Nov 2020 09:26:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EDF1968B9E9 for ; Fri, 20 Nov 2020 09:25:39 +0200 (EET) Received: by mail-ej1-f46.google.com with SMTP id k27so11456195ejs.10 for ; Thu, 19 Nov 2020 23:25:39 -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=m/MZ+gVApriQJ+hTO7V1WkM7duDbUpdalqcGvE2Zrpk=; b=oszjN6AU/jAZfMkBo5EJdG/srjVatr4l6WOPWx27V7kLkDRmCtSuxx+QIpirujnT27 OeG0+LOoHG0K4MhvRahDIXIBjs4Pv+CUctLhVhWE7Q7rU0I+Fo60JTvd2JstFdk+cyoY XFebsrcHFd6J9BF4+qfpwLAC4dX7cUqOTmdzSktzFk7riqKEI8YRWPM/j89QECX2D7zJ I3OLV+QFTVWdGmGjiXWdkcxr/siRiiA2J6Z73GooCoQvxIVbmmIIIP5ncI84B6m0Q1vI i64H7XmTIhHgzZAeKKPWEoxHeDD422UJ/uQuvwwnXJ70sH01vsi4eSaXDNfV+HMyTQ3a BipQ== 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=m/MZ+gVApriQJ+hTO7V1WkM7duDbUpdalqcGvE2Zrpk=; b=pJFD/s4XmO/D41UJKM8r93BqkHs26a3RcPHMh4HC69scX4SJ2PiGEXHSNFAfEQ+So7 iIhDLYtkmLCbQirNdzK2Xt0l+OdRoNVvgqEjxz35EEWxYT9tyHzPd+YC/wpuh+HYHzgw tk2wV4UMAN1pAMpWm9pxJoMbRj16tiingIYZrh4pOdTKL0FvwaBeOEKxHWomBnNrgN4E Pk5oAYbV0pPiPI445Jk5ZyzQPAtqXtz3u1YXHThHvdu1NBJU3M6Dv9PBzDwA5QZ9vCyK mUMXNKW4dl9BvFEF1ROMcb5bpo8QvQ61gwSFi4FkTr4ZebV9/+XX9360jb5iNFmherwg G/RA== X-Gm-Message-State: AOAM530GBlJtHY1/WOVVeL9PEpNCcEepeLajjNQWQB/Ux9BGxBRrIyJe iPECn6+GbQoDaeDFUZ67uM61sFRtawPz+Q== X-Google-Smtp-Source: ABdhPJxo3yLxM6HgmosAM40azgaV02hrFlT4HGqnb0WZLsxJLKrg8uz5GEZhUpAGeNHox7fuNKXRbA== X-Received: by 2002:a17:906:8496:: with SMTP id m22mr29786385ejx.298.1605857139275; Thu, 19 Nov 2020 23:25:39 -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.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:38 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:02 +0100 Message-Id: <20201120072116.818090-90-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 089/162] avcodec/truemotion2: Mark decoder as init-threadsafe 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/truemotion2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index d6375ad489..012ad4ffde 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -1018,5 +1018,5 @@ AVCodec ff_truemotion2_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Fri Nov 20 07:20:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23843 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 BCBBD448F87 for ; Fri, 20 Nov 2020 09:40:52 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E85B468BC62; Fri, 20 Nov 2020 09:26:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 053C868BB43 for ; Fri, 20 Nov 2020 09:25:40 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id k27so11456240ejs.10 for ; Thu, 19 Nov 2020 23:25:40 -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=Y6VzCF886BhzS8iljlIDjiTeXZXVAdYIT++kEXg9Dkc=; b=SrNnu1he3upyELlDtBmpPlsdbwhxyEXmLVh0OM2HvlYAXkgKioOQZ4v6vawXOPesfX pPmQ8WOt2SQiuf1P8kLeLe9du2p1zY0fEPNEwQ1cR9Q9QI9gdMJl0UgAtjYtLMak5Wa7 mbJYwJqAVbNqfiIxkbn8i6E5+M0MvtYEohXNf8VDHk44O1Bgj5NK9s/5Ld9pQKO25Fsq wx8lamlLJPNjomEvzdT2G1pnrk00QVULmBsnjFNqBQ4JWVi3ZKVWtqh4+dXwhCNO4LKj KQd6PUD9SXjaQqrsfe43Lh+fsYXMO9fnnVqRh+wJtK77zUvwI1PzY3fdDbc/TD1XdOmv H00w== 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=Y6VzCF886BhzS8iljlIDjiTeXZXVAdYIT++kEXg9Dkc=; b=L+2C3vq3ww5IT0oqQIIjvuLRchM2gJn/MmcATFOH6zU/XbH8tbu3A55QFvCN9dMoJO F9Jqe7n7CkUq27/A2tafwuM3FUt2nRTOj4a2Vsi7pY68BQ8uPOYLCTL5EwwIfDc9BgPQ RivsRdpyhd7bVdsOVfCI5UjCUOO9Elv1zfuz/ty2XIDaIo1I4iKiX8B2dfuLMIgY4gPy Iz9g31gtIXgSWB+NH3zsKdlMz17udDZOEEX3p8SwCcefrL0LP7POdLLyeRZfRUEJmovD E9hUHv4H3F/Ht8Jw3f4eawjKSiQbGUCQJJPxhJkWvplhGHlaFI/Igu8rmpm9Fkqyy3aG eWbg== X-Gm-Message-State: AOAM530ONfktPn0hI9CyxzK/4gYCMUl9cQZsBQwXnLJsP0ctVS8fMu9u +S4DdyiLBmUUXaCbXR+XsW/sZWhBVEJ0mQ== X-Google-Smtp-Source: ABdhPJyiupzUaB8yVifUFn4nN3Mg34wl0UTn9dpvicI3welu7XYm+L6cl7J6uS8lfum2A0fLkypypg== X-Received: by 2002:a17:906:af47:: with SMTP id ly7mr33410539ejb.532.1605857140221; Thu, 19 Nov 2020 23:25:40 -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.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:39 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:03 +0100 Message-Id: <20201120072116.818090-91-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 090/162] avcodec/atrac3plus: Simplify creating 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" Use ff_init_vlc_from_lengths() to offload the computation of the codes. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac3plus.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c index 6b046a887e..f527d3b9fc 100644 --- a/libavcodec/atrac3plus.c +++ b/libavcodec/atrac3plus.c @@ -51,9 +51,7 @@ static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t *xlat, int *tab_offset, VLC *out_vlc) { int i, b; - uint16_t codes[256]; uint8_t bits[256]; - unsigned code = 0; int index = 0; int min_len = *cb++; // get shortest codeword length int max_len = *cb++; // get longest codeword length @@ -62,17 +60,15 @@ static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t *xlat, for (i = *cb++; i > 0; i--) { av_assert0(index < 256); bits[index] = b; - codes[index] = code++; index++; } - code <<= 1; } out_vlc->table = &tables_data[*tab_offset]; out_vlc->table_allocated = 1 << max_len; - ff_init_vlc_sparse(out_vlc, max_len, index, bits, 1, 1, codes, 2, 2, - xlat, 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(out_vlc, max_len, index, bits, 1, + xlat, 1, 1, 0, INIT_VLC_USE_NEW_STATIC, NULL); *tab_offset += 1 << max_len; } From patchwork Fri Nov 20 07:20:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23844 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 D576B448F87 for ; Fri, 20 Nov 2020 09:41:04 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EC34F68BC6F; Fri, 20 Nov 2020 09:26:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6E0D06879A0 for ; Fri, 20 Nov 2020 09:25:42 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id s25so11498588ejy.6 for ; Thu, 19 Nov 2020 23:25:42 -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=RS8wcS/G5VWyrUOXTcTyiXhAxCMybP5N6fx0qvCe1DM=; b=CS6vnDsrE9g4c7ePizr4NUamHjX3kRz24LN+S+dycTihFVNtpKHf0vl84F1kO5/8Yf fGnERwon+Zx00F8fx03hdaZFBnItbPVcr/B3A/QEzv97ST2KuXV8yL6DBvFpgIMP29gU ZzqEXn+VhA9tLneUlpUDtSsGiYVV9KGqaqbqzWbEzcqB0J78UbJaL2orJ1ZOY4N6mGdU D0BMrRBW+XKacexwm8q+DJ1Aw7+GrflBXivCBjJ7lrwhuNTAaPH7BUkVq+HfXVtmlRDY yd/nClwOiN+r5nUV6J0TW0ivFfd0pScgbtkqI8ws61h2MH8sKNwwj0LGZkCuTZWuBhnk jmHQ== 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=RS8wcS/G5VWyrUOXTcTyiXhAxCMybP5N6fx0qvCe1DM=; b=Pl29KdLsfqtjLQQSJvpQv7MSW5ri42oec/O+ODLTjiaJ8owwjb6JhAh8Ng69EMrGW0 al0g5mBNsRdhu26qmAiZGHAvbaBU4gKFhDdtk/8Ek1dBQKs1v5/MWwOzC1TZ406m0wqp j3/BY6rm7+0IxKlv4Rkf6pTT58xrE9T8r+GmJ46R54LTHwXyd0N50++kfnPWDoLcbOX2 bib9A+xjfAehB/gXvwUS0aUSUb5MBSt1eCenD7NatOmhWYE82eqrQSmu3c+hG5yv91HY M4zma1DuPI52apRcrQD23pdztPkp4j+Y0vsheScSNg5qtGuDjH/Iya1Tt6Vccpujb2Qg ef9Q== X-Gm-Message-State: AOAM533TdadCaQftXSxnhxQtpAEMXFioEhVED/kbrHhR52Kva9mNgr9i 1+wAGCAMNQ0pawnSrYXyqHQiK/SgmoZmbg== X-Google-Smtp-Source: ABdhPJxs1MtH7jEph3e+D0HXWR5Wa1tbP2KvSSGlXFPtN+jxjqBeHBP/VGj8CE3vNRrTtCz35kOR9g== X-Received: by 2002:a17:906:8691:: with SMTP id g17mr250460ejx.317.1605857141253; Thu, 19 Nov 2020 23:25:41 -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.25.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:40 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:04 +0100 Message-Id: <20201120072116.818090-92-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 091/162] avcodec/atrac3plus: Make tables used to initialize VLCs 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 ATRAC3+ decoder currently uses ff_init_vlc_sparse() to initialize several VLCs; sometimes a symbols table is used, sometimes not; some of the codes tables are uint16_t, some are uint8_t. Because of these two latter facts it makes sense to switch to ff_init_vlc_from_lengths() because it allows to remove the codes at the cost of adding symbols tables of type uint8_t in the cases where there were none before. Notice that sometimes the same codes and lengths tables were reused with two different symbols tables; this could have been preserved (meaning one could use a lengths table twice), but hasn't, because this allows to use only one pointer to both the symbols and lengths instead of two pointers. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac3plus.c | 72 ++++------- libavcodec/atrac3plus_data.h | 226 ++++++++++++++++------------------- 2 files changed, 124 insertions(+), 174 deletions(-) diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c index f527d3b9fc..c93d42ab39 100644 --- a/libavcodec/atrac3plus.c +++ b/libavcodec/atrac3plus.c @@ -79,47 +79,24 @@ av_cold void ff_atrac3p_init_vlcs(void) static const uint8_t wl_nb_bits[4] = { 2, 3, 5, 5 }; static const uint8_t wl_nb_codes[4] = { 3, 5, 8, 8 }; - static const uint8_t * const wl_bits[4] = { - atrac3p_wl_huff_bits1, atrac3p_wl_huff_bits2, - atrac3p_wl_huff_bits3, atrac3p_wl_huff_bits4 - }; - static const uint8_t * const wl_codes[4] = { - atrac3p_wl_huff_code1, atrac3p_wl_huff_code2, - atrac3p_wl_huff_code3, atrac3p_wl_huff_code4 - }; - static const uint8_t * const wl_xlats[4] = { - atrac3p_wl_huff_xlat1, atrac3p_wl_huff_xlat2, NULL, NULL + static const uint8_t (*const wl_huffs[4])[2] = { + atrac3p_wl_huff1, atrac3p_wl_huff2, + atrac3p_wl_huff3, atrac3p_wl_huff4 }; static const uint8_t ct_nb_bits[4] = { 3, 4, 4, 4 }; static const uint8_t ct_nb_codes[4] = { 4, 8, 8, 8 }; - static const uint8_t * const ct_bits[4] = { - atrac3p_ct_huff_bits1, atrac3p_ct_huff_bits2, - atrac3p_ct_huff_bits2, atrac3p_ct_huff_bits3 - }; - static const uint8_t * const ct_codes[4] = { - atrac3p_ct_huff_code1, atrac3p_ct_huff_code2, - atrac3p_ct_huff_code2, atrac3p_ct_huff_code3 - }; - static const uint8_t * const ct_xlats[4] = { - NULL, NULL, atrac3p_ct_huff_xlat1, NULL + static const uint8_t (*const ct_huffs[4])[2] = { + atrac3p_ct_huff1, atrac3p_ct_huff2, + atrac3p_ct_huff3, atrac3p_ct_huff4 }; static const uint8_t sf_nb_bits[8] = { 9, 9, 9, 9, 6, 6, 7, 7 }; - static const uint8_t sf_nb_codes[8] = { 64, 64, 64, 64, 16, 16, 16, 16 }; - static const uint8_t * const sf_bits[8] = { - atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits2, - atrac3p_sf_huff_bits3, atrac3p_sf_huff_bits4, atrac3p_sf_huff_bits4, - atrac3p_sf_huff_bits5, atrac3p_sf_huff_bits6 - }; - static const uint16_t * const sf_codes[8] = { - atrac3p_sf_huff_code1, atrac3p_sf_huff_code1, atrac3p_sf_huff_code2, - atrac3p_sf_huff_code3, atrac3p_sf_huff_code4, atrac3p_sf_huff_code4, - atrac3p_sf_huff_code5, atrac3p_sf_huff_code6 - }; - static const uint8_t * const sf_xlats[8] = { - atrac3p_sf_huff_xlat1, atrac3p_sf_huff_xlat2, NULL, NULL, - atrac3p_sf_huff_xlat4, atrac3p_sf_huff_xlat5, NULL, NULL + static const uint8_t sf_nb_codes[8] = { 64, 64, 64, 64, 15, 15, 15, 15 }; + static const uint8_t (*const sf_huffs[8])[2] = { + atrac3p_sf_huff1, atrac3p_sf_huff2, atrac3p_sf_huff3, + atrac3p_sf_huff4, atrac3p_sf_huff5, atrac3p_sf_huff6, + atrac3p_sf_huff7, atrac3p_sf_huff8 }; static const uint8_t * const gain_cbs[11] = { @@ -156,17 +133,15 @@ av_cold void ff_atrac3p_init_vlcs(void) ct_vlc_tabs[i].table = &tables_data[ct_vlc_offs]; ct_vlc_tabs[i].table_allocated = 1 << ct_nb_bits[i]; - ff_init_vlc_sparse(&wl_vlc_tabs[i], wl_nb_bits[i], wl_nb_codes[i], - wl_bits[i], 1, 1, - wl_codes[i], 1, 1, - wl_xlats[i], 1, 1, - INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&wl_vlc_tabs[i], wl_nb_bits[i], wl_nb_codes[i], + &wl_huffs[i][0][1], 2, + &wl_huffs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); - ff_init_vlc_sparse(&ct_vlc_tabs[i], ct_nb_bits[i], ct_nb_codes[i], - ct_bits[i], 1, 1, - ct_codes[i], 1, 1, - ct_xlats[i], 1, 1, - INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ct_vlc_tabs[i], ct_nb_bits[i], ct_nb_codes[i], + &ct_huffs[i][0][1], 2, + &ct_huffs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); wl_vlc_offs += wl_vlc_tabs[i].table_allocated; ct_vlc_offs += ct_vlc_tabs[i].table_allocated; @@ -176,11 +151,10 @@ av_cold void ff_atrac3p_init_vlcs(void) sf_vlc_tabs[i].table = &tables_data[sf_vlc_offs]; sf_vlc_tabs[i].table_allocated = 1 << sf_nb_bits[i]; - ff_init_vlc_sparse(&sf_vlc_tabs[i], sf_nb_bits[i], sf_nb_codes[i], - sf_bits[i], 1, 1, - sf_codes[i], 2, 2, - sf_xlats[i], 1, 1, - INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&sf_vlc_tabs[i], sf_nb_bits[i], sf_nb_codes[i], + &sf_huffs[i][0][1], 2, + &sf_huffs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); sf_vlc_offs += sf_vlc_tabs[i].table_allocated; } diff --git a/libavcodec/atrac3plus_data.h b/libavcodec/atrac3plus_data.h index 2a107eef1f..418735abc5 100644 --- a/libavcodec/atrac3plus_data.h +++ b/libavcodec/atrac3plus_data.h @@ -27,149 +27,125 @@ #include /** VLC tables for wordlen */ -static const uint8_t atrac3p_wl_huff_code1[3] = { 0, 2, 3 }; - -static const uint8_t atrac3p_wl_huff_bits1[3] = { 1, 2, 2 }; - -static const uint8_t atrac3p_wl_huff_xlat1[3] = { 0, 1, 7 }; - -static const uint8_t atrac3p_wl_huff_code2[5] = { 0, 4, 5, 6, 7 }; - -static const uint8_t atrac3p_wl_huff_bits2[5] = { 1, 3, 3, 3, 3 }; - -static const uint8_t atrac3p_wl_huff_xlat2[5] = { 0, 1, 2, 6, 7 }; - -static const uint8_t atrac3p_wl_huff_code3[8] = { - 0, 4, 0xC, 0x1E, 0x1F, 0xD, 0xE, 5 -}; - -static const uint8_t atrac3p_wl_huff_bits3[8] = { 1, 3, 4, 5, 5, 4, 4, 3 }; - -static const uint8_t atrac3p_wl_huff_code4[8] = { - 0, 4, 0xC, 0xD, 0x1E, 0x1F, 0xE, 5 -}; - -static const uint8_t atrac3p_wl_huff_bits4[8] = { 1, 3, 4, 4, 5, 5, 4, 3 }; - -/** VLC tables for scale factor indexes */ -static const uint16_t atrac3p_sf_huff_code1[64] = { - 0, 2, 3, 4, 5, 0xC, 0xD, 0xE0, - 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0x1CE, 0x1CF, - 0x1D0, 0x1D1, 0x1D2, 0x1D3, 0x1D4, 0x1D5, 0x1D6, 0x1D7, - 0x1D8, 0x1D9, 0x1DA, 0x1DB, 0x1DC, 0x1DD, 0x1DE, 0x1DF, - 0x1E0, 0x1E1, 0x1E2, 0x1E3, 0x1E4, 0x1E5, 0x1E6, 0x1E7, - 0x1E8, 0x1E9, 0x1EA, 0x1EB, 0x1EC, 0x1ED, 0x1EE, 0x1EF, - 0x1F0, 0x1F1, 0x1F2, 0x1F3, 0x1F4, 0x1F5, 0x1F6, 0x1F7, - 0x1F8, 0x1F9, 0x1FA, 0x1FB, 0x1FC, 0x1FD, 0x1FE, 0x1FF -}; - -static const uint8_t atrac3p_sf_huff_bits1[64] = { - 2, 3, 3, 3, 3, 4, 4, 8, 8, 8, 8, 8, 8, 8, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 -}; - -static const uint8_t atrac3p_sf_huff_xlat1[64] = { - 0, 1, 61, 62, 63, 2, 60, 3, 4, 5, 6, 57, 58, 59, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56 -}; - -static const uint8_t atrac3p_sf_huff_xlat2[64] = { - 0, 1, 2, 62, 63, 3, 61, 4, 5, 6, 57, 58, 59, 60, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56 +static const uint8_t atrac3p_wl_huff1[3][2] = { + { 0, 1 }, { 1, 2 }, { 7, 2 }, }; -static const uint16_t atrac3p_sf_huff_code2[64] = { - 0, 4, 0x18, 0x19, 0x70, 0x1CA, 0x1CB, 0x1CC, - 0x1CD, 0x1CE, 0x1CF, 0x1D0, 0x1D1, 0x1D2, 0x1D3, 0x1D4, - 0x1D5, 0x1D6, 0x1D7, 0x1D8, 0x1D9, 0x1DA, 0x1DB, 0x1DC, - 0x1DD, 0x1DE, 0x1DF, 0x1E0, 0x1E1, 0x1E2, 0x1E3, 0x1E4, - 0x1E5, 0x1E6, 0x1E7, 0x1E8, 0x1E9, 0x1EA, 0x1EB, 0x1EC, - 0x1ED, 0x1EE, 0x1EF, 0x1F0, 0x1F1, 0x1F2, 0x1F3, 0x1F4, - 0x1F5, 0x1F6, 0x1F7, 0x1F8, 0x1F9, 0x1FA, 0x1FB, 0x1FC, - 0x1FD, 0x1FE, 0x1FF, 0xE4, 0x71, 0x1A, 0x1B, 5 +static const uint8_t atrac3p_wl_huff2[5][2] = { + { 0, 1 }, { 1, 3 }, { 2, 3 }, { 6, 3 }, { 7, 3 }, }; -static const uint8_t atrac3p_sf_huff_bits2[64] = { - 1, 3, 5, 5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 7, 5, 5, 3 +static const uint8_t atrac3p_wl_huff3[8][2] = { + { 0, 1 }, { 1, 3 }, { 7, 3 }, { 2, 4 }, { 5, 4 }, { 6, 4 }, { 3, 5 }, + { 4, 5 }, }; -static const uint16_t atrac3p_sf_huff_code3[64] = { - 0, 2, 3, 0x18, 0x19, 0x70, 0x1CC, 0x1CD, - 0x1CE, 0x1CF, 0x1D0, 0x1D1, 0x1D2, 0x1D3, 0x1D4, 0x1D5, - 0x1D6, 0x1D7, 0x1D8, 0x1D9, 0x1DA, 0x1DB, 0x1DC, 0x1DD, - 0x1DE, 0x1DF, 0x1E0, 0x1E1, 0x1E2, 0x1E3, 0x1E4, 0x1E5, - 0x1E6, 0x1E7, 0x1E8, 0x1E9, 0x1EA, 0x1EB, 0x1EC, 0x1ED, - 0x1EE, 0x1EF, 0x1F0, 0x1F1, 0x1F2, 0x1F3, 0x1F4, 0x1F5, - 0x1F6, 0x1F7, 0x1F8, 0x1F9, 0x1FA, 0x1FB, 0x1FC, 0x1FD, - 0x1FE, 0x1FF, 0x71, 0x72, 0x1A, 0x1B, 4, 5 +static const uint8_t atrac3p_wl_huff4[8][2] = { + { 0, 1 }, { 1, 3 }, { 7, 3 }, { 2, 4 }, { 3, 4 }, { 6, 4 }, { 4, 5 }, + { 5, 5 }, }; -static const uint8_t atrac3p_sf_huff_bits3[64] = { - 2, 3, 3, 5, 5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 5, 5, 3, 3 -}; - -static const uint16_t atrac3p_sf_huff_code4[16] = { - 0, 2, 3, 4, 5, 0xC, 0xD, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0, 0x3D, 0x3E, 0x3F -}; - -static const uint8_t atrac3p_sf_huff_bits4[16] = { - 2, 3, 3, 3, 3, 4, 4, 6, 6, 6, 6, 6, 0, 6, 6, 6 -}; - -static const uint8_t atrac3p_sf_huff_xlat4[16] = { - 0, 1, 13, 14, 15, 2, 12, 3, 4, 5, 6, 7, 8, 9, 10, 11 -}; - -static const uint8_t atrac3p_sf_huff_xlat5[16] = { - 0, 1, 2, 14, 15, 3, 13, 4, 5, 6, 7, 9, 8, 10, 11, 12 -}; - -static const uint16_t atrac3p_sf_huff_code5[16] = { - 0, 4, 0xC, 0x1C, 0x78, 0x79, 0x7A, 0x7B, - 0, 0x7C, 0x7D, 0x7E, 0x7F, 0x1D, 0xD, 5 +/** VLC tables for scale factor indexes */ +static const uint8_t atrac3p_sf_huff1[64][2] = { + { 0, 2 }, { 1, 3 }, { 61, 3 }, { 62, 3 }, { 63, 3 }, { 2, 4 }, + { 60, 4 }, { 3, 8 }, { 4, 8 }, { 5, 8 }, { 6, 8 }, { 57, 8 }, + { 58, 8 }, { 59, 8 }, { 7, 9 }, { 8, 9 }, { 9, 9 }, { 10, 9 }, + { 11, 9 }, { 12, 9 }, { 13, 9 }, { 14, 9 }, { 15, 9 }, { 16, 9 }, + { 17, 9 }, { 18, 9 }, { 19, 9 }, { 20, 9 }, { 21, 9 }, { 22, 9 }, + { 23, 9 }, { 24, 9 }, { 25, 9 }, { 26, 9 }, { 27, 9 }, { 28, 9 }, + { 29, 9 }, { 30, 9 }, { 31, 9 }, { 32, 9 }, { 33, 9 }, { 34, 9 }, + { 35, 9 }, { 36, 9 }, { 37, 9 }, { 38, 9 }, { 39, 9 }, { 40, 9 }, + { 41, 9 }, { 42, 9 }, { 43, 9 }, { 44, 9 }, { 45, 9 }, { 46, 9 }, + { 47, 9 }, { 48, 9 }, { 49, 9 }, { 50, 9 }, { 51, 9 }, { 52, 9 }, + { 53, 9 }, { 54, 9 }, { 55, 9 }, { 56, 9 }, +}; + +static const uint8_t atrac3p_sf_huff2[64][2] = { + { 0, 2 }, { 1, 3 }, { 2, 3 }, { 62, 3 }, { 63, 3 }, { 3, 4 }, + { 61, 4 }, { 4, 8 }, { 5, 8 }, { 6, 8 }, { 57, 8 }, { 58, 8 }, + { 59, 8 }, { 60, 8 }, { 7, 9 }, { 8, 9 }, { 9, 9 }, { 10, 9 }, + { 11, 9 }, { 12, 9 }, { 13, 9 }, { 14, 9 }, { 15, 9 }, { 16, 9 }, + { 17, 9 }, { 18, 9 }, { 19, 9 }, { 20, 9 }, { 21, 9 }, { 22, 9 }, + { 23, 9 }, { 24, 9 }, { 25, 9 }, { 26, 9 }, { 27, 9 }, { 28, 9 }, + { 29, 9 }, { 30, 9 }, { 31, 9 }, { 32, 9 }, { 33, 9 }, { 34, 9 }, + { 35, 9 }, { 36, 9 }, { 37, 9 }, { 38, 9 }, { 39, 9 }, { 40, 9 }, + { 41, 9 }, { 42, 9 }, { 43, 9 }, { 44, 9 }, { 45, 9 }, { 46, 9 }, + { 47, 9 }, { 48, 9 }, { 49, 9 }, { 50, 9 }, { 51, 9 }, { 52, 9 }, + { 53, 9 }, { 54, 9 }, { 55, 9 }, { 56, 9 }, +}; + +static const uint8_t atrac3p_sf_huff3[64][2] = { + { 0, 1 }, { 1, 3 }, { 63, 3 }, { 2, 5 }, { 3, 5 }, { 61, 5 }, + { 62, 5 }, { 4, 7 }, { 60, 7 }, { 59, 8 }, { 5, 9 }, { 6, 9 }, + { 7, 9 }, { 8, 9 }, { 9, 9 }, { 10, 9 }, { 11, 9 }, { 12, 9 }, + { 13, 9 }, { 14, 9 }, { 15, 9 }, { 16, 9 }, { 17, 9 }, { 18, 9 }, + { 19, 9 }, { 20, 9 }, { 21, 9 }, { 22, 9 }, { 23, 9 }, { 24, 9 }, + { 25, 9 }, { 26, 9 }, { 27, 9 }, { 28, 9 }, { 29, 9 }, { 30, 9 }, + { 31, 9 }, { 32, 9 }, { 33, 9 }, { 34, 9 }, { 35, 9 }, { 36, 9 }, + { 37, 9 }, { 38, 9 }, { 39, 9 }, { 40, 9 }, { 41, 9 }, { 42, 9 }, + { 43, 9 }, { 44, 9 }, { 45, 9 }, { 46, 9 }, { 47, 9 }, { 48, 9 }, + { 49, 9 }, { 50, 9 }, { 51, 9 }, { 52, 9 }, { 53, 9 }, { 54, 9 }, + { 55, 9 }, { 56, 9 }, { 57, 9 }, { 58, 9 }, +}; + +static const uint8_t atrac3p_sf_huff4[64][2] = { + { 0, 2 }, { 1, 3 }, { 2, 3 }, { 62, 3 }, { 63, 3 }, { 3, 5 }, + { 4, 5 }, { 60, 5 }, { 61, 5 }, { 5, 7 }, { 58, 7 }, { 59, 7 }, + { 6, 9 }, { 7, 9 }, { 8, 9 }, { 9, 9 }, { 10, 9 }, { 11, 9 }, + { 12, 9 }, { 13, 9 }, { 14, 9 }, { 15, 9 }, { 16, 9 }, { 17, 9 }, + { 18, 9 }, { 19, 9 }, { 20, 9 }, { 21, 9 }, { 22, 9 }, { 23, 9 }, + { 24, 9 }, { 25, 9 }, { 26, 9 }, { 27, 9 }, { 28, 9 }, { 29, 9 }, + { 30, 9 }, { 31, 9 }, { 32, 9 }, { 33, 9 }, { 34, 9 }, { 35, 9 }, + { 36, 9 }, { 37, 9 }, { 38, 9 }, { 39, 9 }, { 40, 9 }, { 41, 9 }, + { 42, 9 }, { 43, 9 }, { 44, 9 }, { 45, 9 }, { 46, 9 }, { 47, 9 }, + { 48, 9 }, { 49, 9 }, { 50, 9 }, { 51, 9 }, { 52, 9 }, { 53, 9 }, + { 54, 9 }, { 55, 9 }, { 56, 9 }, { 57, 9 }, +}; + +static const uint8_t atrac3p_sf_huff5[15][2] = { + { 0, 2 }, { 1, 3 }, { 13, 3 }, { 14, 3 }, { 15, 3 }, { 2, 4 }, + { 12, 4 }, { 3, 6 }, { 4, 6 }, { 5, 6 }, { 6, 6 }, { 7, 6 }, + { 9, 6 }, { 10, 6 }, { 11, 6 }, +}; + +static const uint8_t atrac3p_sf_huff6[15][2] = { + { 0, 2 }, { 1, 3 }, { 2, 3 }, { 14, 3 }, { 15, 3 }, { 3, 4 }, + { 13, 4 }, { 4, 6 }, { 5, 6 }, { 6, 6 }, { 7, 6 }, { 9, 6 }, + { 10, 6 }, { 11, 6 }, { 12, 6 }, +}; + +static const uint8_t atrac3p_sf_huff7[15][2] = { + { 0, 1 }, { 1, 3 }, { 15, 3 }, { 2, 4 }, { 14, 4 }, { 3, 5 }, + { 13, 5 }, { 4, 7 }, { 5, 7 }, { 6, 7 }, { 7, 7 }, { 9, 7 }, + { 10, 7 }, { 11, 7 }, { 12, 7 }, +}; + +static const uint8_t atrac3p_sf_huff8[15][2] = { + { 0, 2 }, { 1, 3 }, { 2, 3 }, { 14, 3 }, { 15, 3 }, { 3, 4 }, + { 13, 4 }, { 4, 5 }, { 12, 5 }, { 5, 6 }, { 11, 6 }, { 6, 7 }, + { 7, 7 }, { 9, 7 }, { 10, 7 }, }; -static const uint8_t atrac3p_sf_huff_bits5[16] = { - 1, 3, 4, 5, 7, 7, 7, 7, 0, 7, 7, 7, 7, 5, 4, 3 +/** VLC tables for code table indexes */ +static const uint8_t atrac3p_ct_huff1[4][2] = { + { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 3 }, }; -static const uint16_t atrac3p_sf_huff_code6[16] = { - 0, 2, 3, 0xC, 0x1C, 0x3C, 0x7C, 0x7D, 0, 0x7E, 0x7F, 0x3D, 0x1D, 0xD, 4, 5 +static const uint8_t atrac3p_ct_huff2[8][2] = { + { 0, 2 }, { 1, 3 }, { 2, 3 }, { 3, 3 }, { 4, 3 }, { 5, 3 }, { 6, 4 }, + { 7, 4 }, }; -static const uint8_t atrac3p_sf_huff_bits6[16] = { - 2, 3, 3, 4, 5, 6, 7, 7, 0, 7, 7, 6, 5, 4, 3, 3 +static const uint8_t atrac3p_ct_huff3[8][2] = { + { 0, 2 }, { 1, 3 }, { 2, 3 }, { 3, 3 }, { 6, 3 }, { 7, 3 }, { 4, 4 }, + { 5, 4 }, }; -/** VLC tables for code table indexes */ -static const uint8_t atrac3p_ct_huff_code1[4] = { 0, 2, 6, 7 }; - -static const uint8_t atrac3p_ct_huff_bits1[4] = { 1, 2, 3, 3 }; - -static const uint8_t atrac3p_ct_huff_code2[8] = { 0, 2, 3, 4, 5, 6, 0xE, 0xF }; - -static const uint8_t atrac3p_ct_huff_bits2[8] = { 2, 3, 3, 3, 3, 3, 4, 4 }; - -static const uint8_t atrac3p_ct_huff_xlat1[8] = { 0, 1, 2, 3, 6, 7, 4, 5 }; - -static const uint8_t atrac3p_ct_huff_code3[8] = { - 0, 4, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF +static const uint8_t atrac3p_ct_huff4[8][2] = { + { 0, 1 }, { 1, 3 }, { 2, 4 }, { 3, 4 }, { 4, 4 }, { 5, 4 }, { 6, 4 }, + { 7, 4 }, }; -static const uint8_t atrac3p_ct_huff_bits3[8] = { 1, 3, 4, 4, 4, 4, 4, 4 }; - /* weights for quantized word lengths */ static const int8_t atrac3p_wl_weights[6][32] = { { 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, From patchwork Fri Nov 20 07:20:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23845 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 49FD14492D7 for ; Fri, 20 Nov 2020 09:41:16 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9E0CE68BC26; Fri, 20 Nov 2020 09:26:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D6D0E68803B for ; Fri, 20 Nov 2020 09:25:42 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id i19so11474045ejx.9 for ; Thu, 19 Nov 2020 23:25:42 -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=0e5BTq51kVmS57TSmDOrXUvcFN5/wtqAkCFoF3vzLfY=; b=hIwElKiMPDPi2TAsRzvRgbK8+p9Uas6Qy0PDGqQKVHQGFCf8WX0iM030qM1Ymkee5k ultXEae0iy3euoT0L6nYLUV7kJHq9CCTINbdRTQ6KdkQmTUu78F7B2oUgOYqvV9MUZ6G fivneku6sUEeCB+JzdRYXlJv3ShnU4REQstTVX79ZZYLYvYRbe2Gt/IryZDdlJs5w03O dSDN4eygfRLVqm+BLyBVyM2G2iEazh3XxwHpMWt+tp6A2JNO4+GB8aEcPxSDV+FWC7Ke o6bHXhaUYans7XeeOGu/HRWL6/6y254Piulrq0b2QaF4O2siLY/OtKWUd+qYe4Ev4S7e ezNA== 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=0e5BTq51kVmS57TSmDOrXUvcFN5/wtqAkCFoF3vzLfY=; b=MG51Re+bZMykAJLsybFfUKLnakoPBkf/i/FytzfxD3w176Wh987i1b50o+9WPaS8pm Lg+0sVgzs5MV9Qotx4hLI+oZduD9QYqE4g7HH5ptFZOxofp3corhoPlyxIlNeqwJwidh wUbjexPlqq5hZ6/JyYDUj58VnE94yFSjem9kX1EIsDS6ydzqrwgYn5jzVCYalhZkoX4v Yq+FP3krjFlM9NRCCpgy4PGLZ5P2tdAgkWM3bdhRi+fZcQhApvFh/qs5X/m1a8GeZuJ6 unjcj6cKntAaAg+jaqdO03bYVxhG0P3513kmwHaQBDoAoKkaB3vvi+J5dT/xz2QWZeDm rdEQ== X-Gm-Message-State: AOAM530ycCVhtAhV+Ycc6iUYS6hjDfObnvd04/6MLLCLqcb2HWd4HFt1 fbSTlQUz3+Dx5RHZD7PBOUG3Ri/FlVoheQ== X-Google-Smtp-Source: ABdhPJya1Lj3dRfLH9+f3CtUaZBzj/X+Fnin4yVjsbS6WVhE8z5tDPK5MpkJjCWosjHoJEIrVCFdDw== X-Received: by 2002:a17:906:2f87:: with SMTP id w7mr34149876eji.83.1605857142085; Thu, 19 Nov 2020 23:25:42 -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.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:41 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:05 +0100 Message-Id: <20201120072116.818090-93-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 092/162] avcodec/atrac3plus: Simplify getting offset of VLC in VLC_TYPE buf 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 earlier code used several different offset parameters that were initialized to magic values. This is unnecessary. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac3plus.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c index c93d42ab39..b22e773e8e 100644 --- a/libavcodec/atrac3plus.c +++ b/libavcodec/atrac3plus.c @@ -75,7 +75,7 @@ static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t *xlat, av_cold void ff_atrac3p_init_vlcs(void) { - int i, wl_vlc_offs, ct_vlc_offs, sf_vlc_offs, tab_offset; + int i, tab_offset = 0; static const uint8_t wl_nb_bits[4] = { 2, 3, 5, 5 }; static const uint8_t wl_nb_codes[4] = { 3, 5, 8, 8 }; @@ -127,39 +127,34 @@ av_cold void ff_atrac3p_init_vlcs(void) atrac3p_huff_freq_xlat }; - for (i = 0, wl_vlc_offs = 0, ct_vlc_offs = 2508; i < 4; i++) { - wl_vlc_tabs[i].table = &tables_data[wl_vlc_offs]; + for (int i = 0; i < 4; i++) { + wl_vlc_tabs[i].table = &tables_data[tab_offset]; wl_vlc_tabs[i].table_allocated = 1 << wl_nb_bits[i]; - ct_vlc_tabs[i].table = &tables_data[ct_vlc_offs]; - ct_vlc_tabs[i].table_allocated = 1 << ct_nb_bits[i]; - + tab_offset += 1 << wl_nb_bits[i]; ff_init_vlc_from_lengths(&wl_vlc_tabs[i], wl_nb_bits[i], wl_nb_codes[i], &wl_huffs[i][0][1], 2, &wl_huffs[i][0][0], 2, 1, 0, INIT_VLC_USE_NEW_STATIC, NULL); + ct_vlc_tabs[i].table = &tables_data[tab_offset]; + ct_vlc_tabs[i].table_allocated = 1 << ct_nb_bits[i]; + tab_offset += 1 << ct_nb_bits[i]; ff_init_vlc_from_lengths(&ct_vlc_tabs[i], ct_nb_bits[i], ct_nb_codes[i], &ct_huffs[i][0][1], 2, &ct_huffs[i][0][0], 2, 1, 0, INIT_VLC_USE_NEW_STATIC, NULL); - - wl_vlc_offs += wl_vlc_tabs[i].table_allocated; - ct_vlc_offs += ct_vlc_tabs[i].table_allocated; } - for (i = 0, sf_vlc_offs = 76; i < 8; i++) { - sf_vlc_tabs[i].table = &tables_data[sf_vlc_offs]; + for (int i = 0; i < 8; i++) { + sf_vlc_tabs[i].table = &tables_data[tab_offset]; sf_vlc_tabs[i].table_allocated = 1 << sf_nb_bits[i]; - + tab_offset += 1 << sf_nb_bits[i]; ff_init_vlc_from_lengths(&sf_vlc_tabs[i], sf_nb_bits[i], sf_nb_codes[i], &sf_huffs[i][0][1], 2, &sf_huffs[i][0][0], 2, 1, 0, INIT_VLC_USE_NEW_STATIC, NULL); - sf_vlc_offs += sf_vlc_tabs[i].table_allocated; } - tab_offset = 2564; - /* build huffman tables for spectrum decoding */ for (i = 0; i < 112; i++) { if (atrac3p_spectra_tabs[i].redirect < 0) From patchwork Fri Nov 20 07:20:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23847 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 52AB54492D7 for ; Fri, 20 Nov 2020 09:41:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CA65768BA2D; Fri, 20 Nov 2020 09:26:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 121FD68BC1B for ; Fri, 20 Nov 2020 09:25:47 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id i19so11474255ejx.9 for ; Thu, 19 Nov 2020 23:25:47 -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=6jL9l45W9T1EMGDQ+qYCWvEFvjRYgI/8Stqq1BGwHUM=; b=S3IbnO4etGpEoPKCbHetQ91Q8NvZVotaEVay0oGJfwnkcjllnvLxyqIkI0s9HgGcJL p8UX9L6WMqNPKfGf+Nf8CWTayRsBiJwtwD5PfznHXvK7Ieva2Q2gppmKhaJJcz+Ny5Ar L6OB4q1tlkzXaMwJv+AVGZRPoHmJ7AhC7lj7kB5M557ppnztzxi9EFfX4Vbd5OaOFuYc +WHI7ns3fbujVTkKk8mDqd8bICwm8b4uK0fResAwAo9hNRCLWs6hpSauHeStS2DhYCJL 2Z66C7rfUpfcpwzWE8j/rl54LeSzVcLbeClcwGDmFfh19J9WaMtDXAA6dePBINwrzdzu mllg== 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=6jL9l45W9T1EMGDQ+qYCWvEFvjRYgI/8Stqq1BGwHUM=; b=eYBy7oOI5fq6kH1v1OvK858p0s3fotVWW2WKgZNz8Fw/FkPzBxAW9rgIjnRlvDends zmnYi5ScT22skevXPFzBfReCbU7V2bWqoewCWespOP1C2G6CRlTKRUiq79M0X1igvVbx +3CkrQBEgk8JxcLAH6Mj7BQ7QwKU34mI6Sm6fKRA0+7yIcW9Y18JjD8i+sV/fhrKVwde lxo+AqcfgsjZKdnaX/IoWjq5it6vqg8FMyG5C+Rh/6ge6L1gVW29ZjXaRU+ffa0f56cD t44gl3tgtdfqla+VbNTcprOAAWPOjaZc6LWKJ727dzvEi0QgnzItWzo+b7ttTKiEAaWv ou/w== X-Gm-Message-State: AOAM530dFhlFf0x6UKDPTGbcbMTFKEaGb2VAFwnCjSv/epvapxuIMgE4 yausba+CUqrgoEy3ZCejEFF9Zruj2Bto4w== X-Google-Smtp-Source: ABdhPJzobqxjvL8Lu4CQlWVVtC93WiEP0rzJEj6fHO6FUIm3qXGG9/BpNg5WyIE/3T5Vgkox0xuynA== X-Received: by 2002:a17:906:b291:: with SMTP id q17mr31043157ejz.455.1605857143418; Thu, 19 Nov 2020 23:25:43 -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.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:42 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:06 +0100 Message-Id: <20201120072116.818090-94-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 093/162] avcodec/atrac3plus: Combine symbols tables 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" This allows to remove lots of pointers (130) to small symbol tables; it has the downside that some of the default tables must now be coded explicitly, but this costs only 6 + 4 + 8 + 16 + 8 bytes and is therefore dwarfed by the gains. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac3plus.c | 30 +- libavcodec/atrac3plus_data.h | 1542 +++++++++++++++++----------------- 2 files changed, 763 insertions(+), 809 deletions(-) diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c index b22e773e8e..81799f72cb 100644 --- a/libavcodec/atrac3plus.c +++ b/libavcodec/atrac3plus.c @@ -43,11 +43,11 @@ static VLC tone_vlc_tabs[7]; * Generate canonical VLC table from given descriptor. * * @param[in] cb ptr to codebook descriptor - * @param[in] xlat ptr to translation table or NULL + * @param[in,out] xlat ptr to ptr to translation table * @param[in,out] tab_offset starting offset to the generated vlc table * @param[out] out_vlc ptr to vlc table to be generated */ -static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t *xlat, +static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t **xlat, int *tab_offset, VLC *out_vlc) { int i, b; @@ -68,14 +68,16 @@ static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t *xlat, out_vlc->table_allocated = 1 << max_len; ff_init_vlc_from_lengths(out_vlc, max_len, index, bits, 1, - xlat, 1, 1, 0, INIT_VLC_USE_NEW_STATIC, NULL); + *xlat, 1, 1, 0, INIT_VLC_USE_NEW_STATIC, NULL); *tab_offset += 1 << max_len; + *xlat += index; } av_cold void ff_atrac3p_init_vlcs(void) { int i, tab_offset = 0; + const uint8_t *xlats; static const uint8_t wl_nb_bits[4] = { 2, 3, 5, 5 }; static const uint8_t wl_nb_codes[4] = { 3, 5, 8, 8 }; @@ -107,13 +109,6 @@ av_cold void ff_atrac3p_init_vlcs(void) atrac3p_huff_gain_loc4_cb, atrac3p_huff_gain_loc2_cb, atrac3p_huff_gain_loc5_cb }; - static const uint8_t * const gain_xlats[11] = { - NULL, atrac3p_huff_gain_npoints2_xlat, atrac3p_huff_gain_lev1_xlat, - atrac3p_huff_gain_lev2_xlat, atrac3p_huff_gain_lev3_xlat, - atrac3p_huff_gain_lev4_xlat, atrac3p_huff_gain_loc3_xlat, - atrac3p_huff_gain_loc1_xlat, atrac3p_huff_gain_loc4_xlat, - atrac3p_huff_gain_loc2_xlat, atrac3p_huff_gain_loc5_xlat - }; static const uint8_t * const tone_cbs[7] = { atrac3p_huff_tonebands_cb, atrac3p_huff_numwavs1_cb, @@ -121,11 +116,6 @@ av_cold void ff_atrac3p_init_vlcs(void) atrac3p_huff_wav_ampsf2_cb, atrac3p_huff_wav_ampsf3_cb, atrac3p_huff_freq_cb }; - static const uint8_t * const tone_xlats[7] = { - NULL, NULL, atrac3p_huff_numwavs2_xlat, atrac3p_huff_wav_ampsf1_xlat, - atrac3p_huff_wav_ampsf2_xlat, atrac3p_huff_wav_ampsf3_xlat, - atrac3p_huff_freq_xlat - }; for (int i = 0; i < 4; i++) { wl_vlc_tabs[i].table = &tables_data[tab_offset]; @@ -156,22 +146,24 @@ av_cold void ff_atrac3p_init_vlcs(void) } /* build huffman tables for spectrum decoding */ + xlats = atrac3p_spectra_xlats; for (i = 0; i < 112; i++) { if (atrac3p_spectra_tabs[i].redirect < 0) build_canonical_huff(atrac3p_spectra_tabs[i].cb, - atrac3p_spectra_tabs[i].xlat, - &tab_offset, &spec_vlc_tabs[i]); + &xlats, &tab_offset, &spec_vlc_tabs[i]); else /* Reuse already initialized VLC table */ spec_vlc_tabs[i] = spec_vlc_tabs[atrac3p_spectra_tabs[i].redirect]; } /* build huffman tables for gain data decoding */ + xlats = atrac3p_gain_xlats; for (i = 0; i < 11; i++) - build_canonical_huff(gain_cbs[i], gain_xlats[i], &tab_offset, &gain_vlc_tabs[i]); + build_canonical_huff(gain_cbs[i], &xlats, &tab_offset, &gain_vlc_tabs[i]); /* build huffman tables for tone decoding */ + xlats = atrac3p_tone_xlats; for (i = 0; i < 7; i++) - build_canonical_huff(tone_cbs[i], tone_xlats[i], &tab_offset, &tone_vlc_tabs[i]); + build_canonical_huff(tone_cbs[i], &xlats, &tab_offset, &tone_vlc_tabs[i]); } /** diff --git a/libavcodec/atrac3plus_data.h b/libavcodec/atrac3plus_data.h index 418735abc5..61f4b0a038 100644 --- a/libavcodec/atrac3plus_data.h +++ b/libavcodec/atrac3plus_data.h @@ -417,48 +417,278 @@ static const uint8_t huff_a01_cb[14] = { 1, 12, 1, 0, 0, 1, 7, 0, 19, 5, 13, 21, 6, 8 }; -static const uint8_t huff_a01_xlat[81] = { +static const uint8_t huff_a02_cb[13] = { + 2, 12, 1, 0, 4, 11, 0, 1, 29, 6, 20, 7, 2 +}; + +static const uint8_t huff_a03_cb[9] = { 3, 9, 1, 8, 0, 13, 18, 7, 2 }; + +static const uint8_t huff_a04_cb[4] = { 2, 3, 2, 4 }; + +static const uint8_t huff_a05_cb[12] = { + 3, 12, 1, 3, 5, 8, 12, 23, 72, 68, 31, 2 +}; + +static const uint8_t huff_a06_cb[7] = { + 2, 6, 1, 3, 2, 6, 4 +}; + +static const uint8_t huff_a07_cb[11] = { + 2, 10, 1, 2, 2, 2, 6, 14, 21, 13, 2 +}; + +static const uint8_t huff_a11_cb[13] = { + 1, 11, 1, 0, 0, 0, 8, 1, 18, 9, 22, 10, 12 +}; + +static const uint8_t huff_a12_cb[8] = { 5, 10, 16, 11, 32, 19, 1, 2 }; + +static const uint8_t huff_a13_cb[12] = { + 1, 10, 1, 0, 0, 4, 2, 2, 9, 15, 12, 4 +}; + +static const uint8_t huff_a14_cb[12] = { + 2, 11, 1, 0, 4, 3, 5, 16, 28, 34, 26, 4 +}; + +static const uint8_t huff_a15_cb[9] = { 5, 11, 9, 12, 16, 44, 98, 42, 4 }; + +static const uint8_t huff_a16_cb[13] = { + 2, 12, 1, 1, 2, 2, 5, 7, 21, 54, 85, 62, 16 +}; + +static const uint8_t huff_a17_cb[9] = { 3, 9, 3, 2, 5, 7, 17, 23, 6 }; + +static const uint8_t huff_a21_cb[14] = { + 1, 12, 1, 0, 0, 2, 6, 0, 7, 21, 15, 17, 8, 4 +}; + +static const uint8_t huff_a22_cb[10] = { 2, 9, 1, 4, 0, 4, 3, 8, 3, 2 }; + +static const uint8_t huff_a23_cb[9] = { 3, 9, 5, 0, 4, 6, 10, 16, 8 }; + +static const uint8_t huff_a24_cb[5] = { 2, 4, 3, 1, 2 }; + +static const uint8_t huff_a25_cb[5] = { 2, 4, 1, 5, 2 }; + +static const uint8_t huff_a26_cb[10] = { 4, 11, 3, 4, 12, 15, 34, 83, 75, 30 }; + +static const uint8_t huff_a27_cb[7] = { 4, 8, 3, 14, 10, 20, 16 }; + +static const uint8_t huff_a31_cb[8] = { 1, 6, 1, 0, 3, 1, 0, 4 }; + +static const uint8_t huff_a32_cb[13] = { + 1, 11, 1, 0, 0, 2, 2, 6, 12, 18, 19, 15, 6 +}; + +static const uint8_t huff_a33_cb[12] = { + 3, 12, 1, 1, 13, 1, 14, 28, 33, 81, 32, 52 +}; + +static const uint8_t huff_a34_cb[7] = { 1, 5, 1, 1, 1, 1, 2 }; + +static const uint8_t huff_a35_cb[11] = { 2, 10, 1, 0, 2, 3, 6, 19, 9, 75, 110 }; + +static const uint8_t huff_a36_cb[12] = { + 3, 12, 1, 3, 5, 5, 13, 27, 69, 96, 35, 2 +}; + +static const uint8_t huff_a37_cb[7] = { 4, 8, 7, 6, 8, 22, 20 }; + +static const uint8_t huff_a41_cb[14] = { + 1, 12, 1, 0, 0, 6, 2, 0, 0, 0, 19, 9, 24, 20 +}; + +static const uint8_t huff_a42_cb[10] = { 3, 10, 1, 2, 13, 1, 31, 13, 16, 4 }; + +static const uint8_t huff_a43_cb[5] = { 2, 4, 2, 3, 2 }; + +static const uint8_t huff_a44_cb[9] = { 4, 10, 5, 4, 12, 17, 47, 24, 12 }; + +static const uint8_t huff_a45_cb[5] = { 2, 4, 2, 2, 4 }; + +static const uint8_t huff_a46_cb[7] = { 5, 9, 1, 16, 31, 36, 172 }; + +static const uint8_t huff_a47_cb[8] = { 4, 9, 5, 12, 9, 12, 15, 10 }; + +static const uint8_t huff_a51_cb[12] = { + 2, 11, 1, 0, 6, 2, 6, 18, 4, 26, 6, 12 +}; + +static const uint8_t huff_a52_cb[12] = { 1, 10, 1, 0, 2, 2, 0, 4, 3, 8, 3, 2 }; + +static const uint8_t huff_a54_cb[8] = { 4, 9, 4, 7, 12, 19, 21, 58 }; + +static const uint8_t huff_a55_cb[8] = { 1, 6, 1, 1, 1, 0, 3, 2 }; + +static const uint8_t huff_a56_cb[7] = { 3, 7, 1, 8, 6, 8, 8 }; + +static const uint8_t huff_a57_cb[9] = { 3, 9, 1, 5, 7, 8, 16, 22, 4 }; + +static const uint8_t huff_a61_cb[12] = { + 2, 11, 1, 0, 8, 0, 1, 16, 10, 29, 12, 4 +}; + +static const uint8_t huff_a62_cb[8] = { 3, 8, 5, 2, 2, 9, 5, 2 }; + +static const uint8_t huff_a63_cb[11] = { + 3, 11, 1, 1, 10, 4, 16, 29, 46, 75, 74 +}; + +static const uint8_t huff_a64_cb[8] = { 4, 9, 1, 7, 12, 36, 63, 2 }; + +static const uint8_t huff_a65_cb[8] = { 2, 7, 3, 0, 1, 3, 4, 4 }; + +static const uint8_t huff_a66_cb[11] = { 2, 10, 1, 2, 2, 6, 8, 6, 3, 1, 2 }; + +static const uint8_t huff_a67_cb[10] = { 2, 9, 1, 1, 3, 4, 6, 13, 25, 10 }; + +static const uint8_t huff_a71_cb[5] = { 1, 3, 1, 1, 2 }; + +static const uint8_t huff_a72_cb[12] = { + 2, 11, 1, 0, 4, 8, 3, 8, 24, 17, 12, 4 +}; + +static const uint8_t huff_a73_cb[11] = { 2, 10, 1, 1, 5, 2, 8, 7, 13, 8, 4 }; + +static const uint8_t huff_a74_cb[14] = { + 1, 12, 1, 0, 0, 4, 0, 4, 5, 9, 30, 45, 21, 2 +}; + +static const uint8_t huff_a75_cb[7] = { 2, 6, 1, 3, 3, 4, 4 }; + +static const uint8_t huff_a76_cb[12] = { + 3, 12, 1, 3, 4, 8, 10, 36, 60, 78, 48, 8 +}; + +static const uint8_t huff_b01_cb[14] = { + 1, 12, 1, 0, 0, 2, 6, 0, 11, 13, 12, 24, 4, 8 +}; + +static const uint8_t huff_b02_cb[14] = { + 1, 12, 1, 0, 0, 4, 0, 8, 4, 9, 19, 13, 13, 10 +}; + +static const uint8_t huff_b03_cb[11] = { 1, 9, 1, 0, 0, 4, 0, 5, 12, 13, 14 }; + +static const uint8_t huff_b04_cb[12] = { + 2, 11, 1, 0, 4, 4, 5, 9, 30, 45, 21, 2 +}; + +static const uint8_t huff_b05_cb[11] = { + 3, 11, 1, 4, 4, 4, 12, 30, 73, 75, 22 +}; + +static const uint8_t huff_b07_cb[9] = { 3, 9, 3, 2, 4, 8, 23, 13, 10 }; + +static const uint8_t huff_b12_cb[10] = { 3, 10, 1, 3, 12, 0, 30, 9, 18, 8 }; + +static const uint8_t huff_b14_cb[14] = { + 1, 12, 1, 0, 0, 4, 0, 3, 5, 16, 28, 34, 26, 4 +}; + +static const uint8_t huff_b16_cb[11] = { + 4, 12, 4, 4, 9, 13, 37, 76, 72, 39, 2 +}; + +static const uint8_t huff_b26_cb[12] = { + 3, 12, 2, 2, 4, 5, 11, 26, 67, 78, 51, 10 +}; + +static const uint8_t huff_b32_cb[12] = { + 2, 11, 1, 0, 4, 6, 7, 10, 22, 11, 16, 4 +}; + +static const uint8_t huff_b33_cb[13] = { + 2, 12, 1, 0, 0, 4, 11, 8, 28, 92, 97, 13, 2 +}; + +static const uint8_t huff_b35_cb[14] = { + 1, 12, 1, 0, 0, 0, 4, 6, 6, 14, 42, 63, 59, 30 +}; + +static const uint8_t huff_b37_cb[13] = { + 1, 11, 1, 0, 2, 0, 2, 2, 6, 17, 14, 13, 6 +}; + +static const uint8_t huff_b41_cb[14] = { + 1, 12, 1, 0, 0, 1, 7, 0, 20, 4, 10, 24, 2, 12 +}; + +static const uint8_t huff_b42_cb[11] = { 1, 9, 1, 0, 1, 3, 2, 3, 7, 4, 4 }; + +static const uint8_t huff_b43_cb[10] = { 2, 9, 1, 1, 3, 4, 9, 15, 12, 4 }; + +static const uint8_t huff_b47_cb[10] = { 2, 9, 1, 1, 3, 4, 6, 14, 22, 12 }; + +static const uint8_t huff_b52_cb[11] = { 1, 9, 1, 0, 1, 3, 2, 3, 7, 4, 4 }; + +static const uint8_t huff_b53_cb[7] = { 1, 5, 1, 1, 1, 0, 4 }; // same as b63!!! + +static const uint8_t huff_b56_cb[11] = { 1, 9, 1, 0, 2, 0, 2, 4, 11, 9, 2 }; + +static const uint8_t huff_b62_cb[14] = { + 1, 12, 1, 0, 0, 2, 3, 5, 12, 14, 18, 15, 9, 2 +}; + +static const uint8_t huff_b63_cb[7] = { 1, 5, 1, 1, 1, 0, 4 }; + +static const uint8_t huff_b64_cb[7] = { 1, 5, 1, 1, 1, 1, 2 }; + +static const uint8_t huff_b65_cb[14] = { + 1, 12, 1, 0, 0, 2, 2, 2, 6, 12, 34, 92, 54, 20 +}; + +static const uint8_t huff_b66_cb[14] = { + 1, 12, 1, 0, 0, 3, 0, 3, 3, 10, 40, 85, 61, 50 +}; + +static const uint8_t huff_b67_cb[10] = { 2, 9, 1, 2, 1, 4, 7, 10, 26, 12 }; + +static const uint8_t huff_b71_cb[14] = { + 1, 12, 1, 0, 0, 1, 7, 0, 19, 5, 13, 23, 0, 12 +}; + +static const uint8_t huff_b73_cb[13] = { + 1, 11, 1, 0, 0, 0, 1, 4, 9, 4, 103, 110, 24 +}; + +static const uint8_t huff_b74_cb[8] = { 1, 6, 1, 0, 2, 2, 2, 4 }; + +static const uint8_t huff_b75_cb[13] = { + 2, 12, 1, 4, 0, 0, 0, 8, 11, 24, 53, 64, 60 +}; + +static const uint8_t huff_b77_cb[12] = { + 2, 11, 1, 0, 4, 6, 10, 12, 7, 15, 4, 4 +}; + +static const uint8_t atrac3p_spectra_xlats[] = { + /* Table set A, code table 0, wordlen 1 - 81 entries */ 0x00, 0x03, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x50, 0xD0, 0x70, 0xF0, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0x41, 0xC1, 0x31, 0x05, 0x0D, 0xC3, 0x13, 0x07, 0x0F, 0x44, 0xCC, 0x11, 0x43, 0x33, 0x54, 0x74, 0xDC, 0xFC, 0x71, 0x15, 0x4D, 0xCD, 0x1D, 0xD3, 0xC7, 0x37, 0x3F, 0xD4, 0xF4, 0x5C, 0x7C, 0x51, 0xD1, 0xF1, 0x45, 0xC5, 0x35, 0xDD, 0x3D, 0x53, 0x73, 0xF3, 0x47, 0x17, 0x77, 0x4F, 0xCF, 0x1F, 0x55, 0xF5, 0x7D, 0xD7, 0x5F, - 0xFF, 0xD5, 0x75, 0x5D, 0xFD, 0x57, 0xF7, 0xDF, 0x7F -}; - -static const uint8_t huff_a02_cb[13] = { - 2, 12, 1, 0, 4, 11, 0, 1, 29, 6, 20, 7, 2 -}; - -static const uint8_t huff_a02_xlat[81] = { + 0xFF, 0xD5, 0x75, 0x5D, 0xFD, 0x57, 0xF7, 0xDF, 0x7F, + /* Table set A, code table 0, wordlen 2 - 81 entries */ 0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51, 0x05, 0x45, 0x15, 0x55, 0x90, 0x80, 0x20, 0x60, 0x84, 0x94, 0x24, 0x64, 0x08, 0x48, 0x18, 0x58, 0x81, 0x91, 0x21, 0x85, 0x95, 0x65, 0x09, 0x49, 0x19, 0x59, 0x02, 0x42, 0x12, 0x52, 0x06, 0x46, 0x16, 0x56, 0x88, 0x61, 0x25, 0x29, 0x69, 0x5A, 0xA0, 0xA4, 0x98, 0x28, 0x68, 0xA1, 0xA5, 0x89, 0x99, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x96, 0x26, 0x66, 0x0A, 0x4A, 0x1A, - 0xA8, 0x86, 0xA6, 0x8A, 0x9A, 0x2A, 0x6A, 0xA2, 0xAA -}; - -static const uint8_t huff_a03_cb[9] = { 3, 9, 1, 8, 0, 13, 18, 7, 2 }; - -static const uint8_t huff_a03_xlat[49] = { + 0xA8, 0x86, 0xA6, 0x8A, 0x9A, 0x2A, 0x6A, 0xA2, 0xAA, + /* Table set A, code table 0, wordlen 3 - 49 entries */ 0x00, 0x08, 0x38, 0x01, 0x09, 0x39, 0x07, 0x0F, 0x3F, 0x10, 0x30, 0x11, 0x31, 0x02, 0x0A, 0x3A, 0x05, 0x06, 0x0E, 0x3E, 0x17, 0x37, 0x18, 0x28, 0x19, 0x29, 0x2A, 0x32, 0x03, 0x0B, 0x33, 0x3B, 0x0D, 0x15, 0x3D, 0x16, 0x1E, 0x36, 0x1F, 0x2F, 0x12, 0x1A, 0x13, 0x2B, 0x1D, 0x35, 0x2E, 0x1B, - 0x2D -}; - -static const uint8_t huff_a04_cb[4] = { 2, 3, 2, 4 }; -static const uint8_t huff_a04_xlat[6] = { 1, 2, 0, 3, 4, 5 }; - -static const uint8_t huff_a05_cb[12] = { - 3, 12, 1, 3, 5, 8, 12, 23, 72, 68, 31, 2 -}; - -static const uint8_t huff_a05_xlat[225] = { + 0x2D, + /* Table set A, code table 0, wordlen 4 - 6 entries */ + 0x01, 0x02, 0x00, 0x03, 0x04, 0x05, + /* Table set A, code table 0, wordlen 5 - 225 entries */ 0x00, 0x10, 0xF0, 0x01, 0x11, 0xF1, 0x0F, 0x1F, 0xFF, 0x20, 0xE0, 0xE1, 0x02, 0xF2, 0x0E, 0x1E, 0x2F, 0x30, 0xD0, 0x21, 0x12, 0x22, 0xE2, 0x03, 0x0D, 0x2E, 0xEE, 0xFE, 0xEF, 0x40, 0xC0, 0x31, 0xC1, 0xD1, 0x32, 0xD2, @@ -477,71 +707,40 @@ static const uint8_t huff_a05_xlat[225] = { 0x9C, 0xAC, 0xCC, 0x5D, 0x6D, 0x7D, 0x9D, 0xAD, 0xBD, 0x5E, 0x9E, 0xBE, 0x54, 0x45, 0x55, 0x65, 0x75, 0x95, 0xB5, 0x56, 0x66, 0x76, 0x96, 0xA6, 0x57, 0x67, 0x97, 0xA7, 0x69, 0x79, 0xA9, 0xB9, 0x6A, 0x7A, 0x9A, 0xAA, - 0xBA, 0x5B, 0x9B, 0xAB, 0xBB, 0xCB, 0xBC, 0x77, 0x99 -}; - -static const uint8_t huff_a06_cb[7] = { - 2, 6, 1, 3, 2, 6, 4 -}; - -static const uint8_t huff_a06_xlat[16] = { - 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 10, 11, 12, 15 -}; - -static const uint8_t huff_a07_cb[11] = { - 2, 10, 1, 2, 2, 2, 6, 14, 21, 13, 2 -}; - -static const uint8_t huff_a07_xlat[63] = { - 0, 1, 63, 2, 62, 3, 61, 4, 5, 6, 58, 59, 60, 7, 8, 9, - 10, 26, 27, 28, 36, 37, 38, 54, 55, 56, 57, 11, 12, 13, 14, 15, - 16, 25, 29, 30, 31, 33, 34, 35, 39, 47, 48, 49, 50, 51, 52, 53, - 17, 18, 19, 20, 21, 22, 23, 41, 42, 43, 44, 45, 46, 24, 40 -}; - -static const uint8_t huff_a11_cb[13] = { - 1, 11, 1, 0, 0, 0, 8, 1, 18, 9, 22, 10, 12 -}; - -static const uint8_t huff_a11_xlat[81] = { + 0xBA, 0x5B, 0x9B, 0xAB, 0xBB, 0xCB, 0xBC, 0x77, 0x99, + /* Table set A, code table 0, wordlen 6 - 16 entries */ + 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0D, 0x0E, + 0x0A, 0x0B, 0x0C, 0x0F, + /* Table set A, code table 0, wordlen 7 - 63 entries */ + 0x00, 0x01, 0x3F, 0x02, 0x3E, 0x03, 0x3D, 0x04, 0x05, 0x06, 0x3A, 0x3B, + 0x3C, 0x07, 0x08, 0x09, 0x0A, 0x1A, 0x1B, 0x1C, 0x24, 0x25, 0x26, 0x36, + 0x37, 0x38, 0x39, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x19, 0x1D, 0x1E, + 0x1F, 0x21, 0x22, 0x23, 0x27, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, + 0x2E, 0x18, 0x28, + /* Table set A, code table 1, wordlen 1 - 81 entries */ 0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0xD0, 0x50, 0x70, 0xF0, 0xC4, 0x34, 0x4C, 0xCC, 0x1C, 0x41, 0xC1, 0x31, 0x05, 0x0D, 0x43, 0xC3, 0x13, 0x07, 0x0F, 0x44, 0x14, 0x74, 0xDC, 0x3C, 0x11, 0x1D, 0x33, 0x37, 0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0xFC, 0xD1, 0x71, 0xF1, 0x15, 0x35, 0x4D, 0xCD, 0xDD, 0x3D, 0xD3, 0x73, 0x47, 0xC7, 0x17, 0x77, 0x3F, 0x51, 0x45, 0xC5, 0x55, 0x53, 0xF3, 0x4F, 0xCF, 0x1F, 0xFF, 0xD5, 0x75, 0xF5, - 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F -}; - -static const uint8_t huff_a12_cb[8] = { 5, 10, 16, 11, 32, 19, 1, 2 }; - -static const uint8_t huff_a12_xlat[81] = { + 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F, + /* Table set A, code table 1, wordlen 2 - 81 entries */ 0x00, 0x40, 0x10, 0x50, 0x04, 0x44, 0x14, 0x54, 0x01, 0x41, 0x11, 0x51, 0x05, 0x45, 0x15, 0x55, 0x90, 0x94, 0x58, 0x91, 0x95, 0x19, 0x59, 0x06, 0x46, 0x16, 0x56, 0x80, 0x60, 0x84, 0x24, 0x64, 0xA4, 0x08, 0x48, 0x18, 0x68, 0x81, 0x21, 0x61, 0xA1, 0x85, 0x25, 0x65, 0xA5, 0x09, 0x49, 0x99, 0x69, 0xA9, 0x02, 0x42, 0x12, 0x52, 0x96, 0x26, 0x66, 0x1A, 0x5A, 0x20, 0xA0, 0x88, 0x98, 0x28, 0xA8, 0x89, 0x29, 0x82, 0x92, 0x22, 0x62, 0x86, - 0xA6, 0x0A, 0x4A, 0x9A, 0x6A, 0xAA, 0xA2, 0x8A, 0x2A -}; - -static const uint8_t huff_a13_cb[12] = { - 1, 10, 1, 0, 0, 4, 2, 2, 9, 15, 12, 4 -}; - -static const uint8_t huff_a13_xlat[49] = { + 0xA6, 0x0A, 0x4A, 0x9A, 0x6A, 0xAA, 0xA2, 0x8A, 0x2A, + /* Table set A, code table 1, wordlen 3 - 49 entries */ 0x00, 0x08, 0x38, 0x01, 0x07, 0x39, 0x0F, 0x09, 0x3F, 0x10, 0x30, 0x31, 0x02, 0x3A, 0x06, 0x0E, 0x3E, 0x17, 0x18, 0x28, 0x11, 0x29, 0x0A, 0x32, 0x03, 0x0B, 0x3B, 0x05, 0x0D, 0x3D, 0x16, 0x1F, 0x37, 0x19, 0x12, 0x1A, 0x2A, 0x13, 0x33, 0x15, 0x35, 0x1E, 0x2E, 0x36, 0x2F, 0x1B, 0x2B, 0x1D, - 0x2D -}; - -static const uint8_t huff_a14_cb[12] = { - 2, 11, 1, 0, 4, 3, 5, 16, 28, 34, 26, 4 -}; - -static const uint8_t huff_a14_xlat[121] = { + 0x2D, + /* Table set A, code table 1, wordlen 4 - 121 entries */ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x11, 0x02, 0x0E, 0x30, 0x50, 0xB0, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x05, 0x0B, 0x0D, 0x1E, 0xFE, 0x2F, 0xEF, 0x40, 0xC0, 0x31, 0x51, 0xB1, 0xC1, 0xD1, @@ -552,12 +751,8 @@ static const uint8_t huff_a14_xlat[121] = { 0xED, 0x3E, 0x4E, 0xBE, 0xDE, 0x4F, 0xCF, 0xC2, 0x33, 0x43, 0xC3, 0xD3, 0x34, 0x44, 0x54, 0xB4, 0xD4, 0x45, 0x55, 0xC5, 0x4B, 0xCB, 0x3C, 0x4C, 0x5C, 0xCC, 0xDC, 0x3D, 0x4D, 0x5D, 0xCD, 0xDD, 0xCE, 0xC4, 0xB5, 0x5B, - 0xBB -}; - -static const uint8_t huff_a15_cb[9] = { 5, 11, 9, 12, 16, 44, 98, 42, 4 }; - -static const uint8_t huff_a15_xlat[225] = { + 0xBB, + /* Table set A, code table 1, wordlen 5 - 225 entries */ 0x00, 0x10, 0xF0, 0x01, 0x11, 0xF1, 0x0F, 0x1F, 0xFF, 0x20, 0xE0, 0x21, 0xE1, 0x02, 0x12, 0xF2, 0x0E, 0x1E, 0xFE, 0x2F, 0xEF, 0x30, 0xD0, 0x31, 0xD1, 0x22, 0xE2, 0x03, 0x13, 0xF3, 0x0D, 0x1D, 0xFD, 0x2E, 0xEE, 0x3F, @@ -576,14 +771,8 @@ static const uint8_t huff_a15_xlat[225] = { 0x54, 0x74, 0x94, 0xB4, 0x45, 0x55, 0x65, 0x75, 0x95, 0xA5, 0xB5, 0xC5, 0x56, 0x66, 0x76, 0x96, 0xA6, 0xB6, 0x47, 0x57, 0x67, 0xA7, 0xB7, 0x49, 0x59, 0x69, 0xA9, 0xB9, 0x6A, 0x7A, 0x9A, 0xAA, 0xBA, 0x4B, 0x5B, 0x6B, - 0x7B, 0x9B, 0xAB, 0xBB, 0x5C, 0x77, 0x97, 0x79, 0x99 -}; - -static const uint8_t huff_a16_cb[13] = { - 2, 12, 1, 1, 2, 2, 5, 7, 21, 54, 85, 62, 16 -}; - -static const uint8_t huff_a16_xlat[256] = { + 0x7B, 0x9B, 0xAB, 0xBB, 0x5C, 0x77, 0x97, 0x79, 0x99, + /* Table set A, code table 1, wordlen 6 - 256 entries */ 0x00, 0x01, 0x10, 0x11, 0x21, 0x12, 0x20, 0x31, 0x02, 0x22, 0x13, 0x30, 0x41, 0x32, 0x03, 0x23, 0x14, 0x24, 0x40, 0x51, 0x61, 0xD1, 0xE1, 0x42, 0x52, 0xD2, 0x33, 0x43, 0xD3, 0x04, 0x34, 0x05, 0x15, 0x25, 0x16, 0x1D, @@ -605,59 +794,37 @@ static const uint8_t huff_a16_xlat[256] = { 0x6B, 0xCB, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xFC, 0xDD, 0xED, 0xFD, 0xDE, 0xEE, 0xFE, 0x9F, 0xBF, 0xCF, 0xDF, 0xEF, 0xFF, 0xB0, 0xA7, 0xB7, 0xA8, 0xB8, 0xA9, 0xB9, 0x8A, 0x9A, 0xAA, 0xBA, 0x7B, - 0x8B, 0x9B, 0xAB, 0xBB -}; - -static const uint8_t huff_a17_cb[9] = { 3, 9, 3, 2, 5, 7, 17, 23, 6 }; - -static const uint8_t huff_a17_xlat[63] = { - 0, 1, 63, 2, 62, 3, 4, 59, 60, 61, 5, 6, 7, 8, 56, 57, - 58, 9, 10, 11, 12, 13, 14, 26, 27, 36, 37, 38, 50, 51, 52, 53, - 54, 55, 15, 16, 17, 18, 19, 20, 21, 25, 28, 29, 30, 31, 33, 34, - 35, 39, 43, 44, 45, 46, 47, 48, 49, 22, 23, 24, 40, 41, 42 -}; - -static const uint8_t huff_a21_cb[14] = { - 1, 12, 1, 0, 0, 2, 6, 0, 7, 21, 15, 17, 8, 4 -}; - -static const uint8_t huff_a21_xlat[81] = { + 0x8B, 0x9B, 0xAB, 0xBB, + /* Table set A, code table 1, wordlen 7 - 63 entries */ + 0x00, 0x01, 0x3F, 0x02, 0x3E, 0x03, 0x04, 0x3B, 0x3C, 0x3D, 0x05, 0x06, + 0x07, 0x08, 0x38, 0x39, 0x3A, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x1A, + 0x1B, 0x24, 0x25, 0x26, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x0F, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x19, 0x1C, 0x1D, 0x1E, 0x1F, 0x21, 0x22, + 0x23, 0x27, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x16, 0x17, 0x18, + 0x28, 0x29, 0x2A, + /* Table set A, code table 2, wordlen 1 - 81 entries */ 0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0xD0, 0x70, 0x34, 0x1C, 0x0D, 0x13, 0x07, 0x50, 0xF0, 0x44, 0xC4, 0x14, 0x74, 0x4C, 0xCC, 0xDC, 0x3C, 0x41, 0xC1, 0x11, 0x31, 0x05, 0x1D, 0x43, 0xC3, 0x33, 0x37, 0x0F, 0x54, 0xF4, 0xFC, 0xD1, 0x71, 0x15, 0x4D, 0xCD, 0xDD, 0xD3, 0x73, 0x47, 0xC7, 0x77, 0x3F, 0xD4, 0x5C, 0x7C, 0x51, 0xF1, 0x45, 0xC5, 0x55, 0x35, 0x3D, 0x53, 0xF3, 0x17, 0x4F, 0xCF, 0x1F, 0xFF, 0x75, 0xF5, 0x5D, - 0x7D, 0xD7, 0xF7, 0x5F, 0xDF, 0xD5, 0xFD, 0x57, 0x7F -}; - -static const uint8_t huff_a22_cb[10] = { 2, 9, 1, 4, 0, 4, 3, 8, 3, 2 }; - -static const uint8_t huff_a22_xlat[25] = { + 0x7D, 0xD7, 0xF7, 0x5F, 0xDF, 0xD5, 0xFD, 0x57, 0x7F, + /* Table set A, code table 2, wordlen 2 - 25 entries */ 0x00, 0x08, 0x38, 0x01, 0x07, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x02, 0x06, 0x30, 0x11, 0x31, 0x0A, 0x3A, 0x0E, 0x17, 0x37, 0x32, 0x16, 0x3E, 0x12, - 0x36 -}; - -static const uint8_t huff_a23_cb[9] = { 3, 9, 5, 0, 4, 6, 10, 16, 8 }; - -static const uint8_t huff_a23_xlat[49] = { + 0x36, + /* Table set A, code table 2, wordlen 3 - 49 entries */ 0x00, 0x08, 0x38, 0x01, 0x07, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x30, 0x02, 0x3A, 0x06, 0x0E, 0x18, 0x28, 0x11, 0x31, 0x0A, 0x03, 0x05, 0x3E, 0x17, 0x37, 0x19, 0x29, 0x12, 0x2A, 0x32, 0x0B, 0x33, 0x3B, 0x0D, 0x15, 0x3D, 0x16, 0x1E, 0x36, 0x1F, 0x2F, 0x1A, 0x13, 0x1B, 0x2B, 0x1D, 0x2D, 0x35, - 0x2E -}; - -static const uint8_t huff_a24_cb[5] = { 2, 4, 3, 1, 2 }; - -static const uint8_t huff_a25_cb[5] = { 2, 4, 1, 5, 2 }; - -static const uint8_t huff_a25_xlat[8] = { 1, 0, 2, 3, 4, 5, 6, 7 }; - -static const uint8_t huff_a26_cb[10] = { 4, 11, 3, 4, 12, 15, 34, 83, 75, 30 }; - -static const uint8_t huff_a26_xlat[256] = { + 0x2E, + /* Table set A, code table 2, wordlen 4 - 6 entries */ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, + /* Table set A, code table 2, wordlen 5 - 8 entries */ + 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + /* Table set A, code table 2, wordlen 6 - 256 entries */ 0x00, 0x01, 0x11, 0x10, 0x21, 0x12, 0x22, 0x20, 0x30, 0x31, 0x41, 0x02, 0x32, 0x03, 0x13, 0x23, 0x33, 0x14, 0x24, 0x40, 0x51, 0x61, 0x42, 0x52, 0x43, 0x53, 0x04, 0x34, 0x44, 0x15, 0x25, 0x35, 0x16, 0x26, 0x50, 0x60, @@ -679,43 +846,25 @@ static const uint8_t huff_a26_xlat[256] = { 0x8E, 0x9E, 0xAE, 0xBE, 0x0F, 0x6F, 0x7F, 0x8F, 0x9F, 0xAF, 0xB8, 0xA9, 0xB9, 0x9A, 0xAA, 0xBA, 0xCA, 0x9B, 0xAB, 0xBB, 0xCB, 0xEB, 0xFB, 0xAC, 0xBC, 0xCC, 0xEC, 0xFC, 0xDD, 0xED, 0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xBF, - 0xCF, 0xDF, 0xEF, 0xFF -}; - -static const uint8_t huff_a27_cb[7] = { 4, 8, 3, 14, 10, 20, 16 }; - -static const uint8_t huff_a27_xlat[63] = { - 0, 2, 3, 1, 5, 6, 7, 9, 54, 55, 56, 58, 59, 60, 61, 62, - 63, 4, 8, 10, 11, 12, 14, 49, 52, 53, 57, 13, 15, 16, 17, 18, - 19, 22, 23, 25, 26, 30, 39, 43, 44, 45, 46, 47, 48, 50, 51, 20, - 21, 24, 27, 28, 29, 31, 33, 34, 35, 36, 37, 38, 40, 41, 42 -}; - -static const uint8_t huff_a31_cb[8] = { 1, 6, 1, 0, 3, 1, 0, 4 }; - -static const uint8_t huff_a31_xlat[9] = { - 0x00, 0x04, 0x0C, 0x01, 0x03, 0x05, 0x0D, 0x07, 0x0F -}; - -static const uint8_t huff_a32_cb[13] = { - 1, 11, 1, 0, 0, 2, 2, 6, 12, 18, 19, 15, 6 -}; - -static const uint8_t huff_a32_xlat[81] = { + 0xCF, 0xDF, 0xEF, 0xFF, + /* Table set A, code table 2, wordlen 7 - 63 entries */ + 0x00, 0x02, 0x03, 0x01, 0x05, 0x06, 0x07, 0x09, 0x36, 0x37, 0x38, 0x3A, + 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x04, 0x08, 0x0A, 0x0B, 0x0C, 0x0E, 0x31, + 0x34, 0x35, 0x39, 0x0D, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x16, 0x17, 0x19, + 0x1A, 0x1E, 0x27, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x32, 0x33, 0x14, + 0x15, 0x18, 0x1B, 0x1C, 0x1D, 0x1F, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, + 0x28, 0x29, 0x2A, + /* Table set A, code table 3, wordlen 1 - 9 entries */ + 0x00, 0x04, 0x0C, 0x01, 0x03, 0x05, 0x0D, 0x07, 0x0F, + /* Table set A, code table 3, wordlen 2 - 81 entries */ 0x00, 0x40, 0x01, 0x10, 0x04, 0x80, 0x50, 0x20, 0x14, 0x05, 0x02, 0x90, 0x60, 0x44, 0x54, 0x24, 0x08, 0x18, 0x41, 0x11, 0x15, 0x09, 0x06, 0xA0, 0x84, 0x94, 0x64, 0xA4, 0x48, 0x58, 0x28, 0x51, 0x21, 0x45, 0x55, 0x25, 0x19, 0x12, 0x16, 0x0A, 0x1A, 0x68, 0xA8, 0x81, 0x91, 0x61, 0xA1, 0x85, 0x95, 0x65, 0xA5, 0x49, 0x59, 0x29, 0x69, 0x42, 0x52, 0x46, 0x56, 0x2A, 0x88, 0x98, 0x89, 0x99, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x86, 0x26, 0x66, - 0x4A, 0x5A, 0x6A, 0xA2, 0x96, 0xA6, 0x8A, 0x9A, 0xAA -}; - -static const uint8_t huff_a33_cb[12] = { - 3, 12, 1, 1, 13, 1, 14, 28, 33, 81, 32, 52 -}; - -static const uint8_t huff_a33_xlat[256] = { + 0x4A, 0x5A, 0x6A, 0xA2, 0x96, 0xA6, 0x8A, 0x9A, 0xAA, + /* Table set A, code table 3, wordlen 3 - 256 entries */ 0x00, 0x10, 0x40, 0x50, 0x04, 0x44, 0x14, 0x54, 0x01, 0x41, 0x11, 0x51, 0x05, 0x45, 0x15, 0x55, 0x90, 0x20, 0x94, 0x64, 0x18, 0x21, 0x95, 0x19, 0x69, 0x02, 0x52, 0x06, 0x46, 0x16, 0x80, 0x60, 0x84, 0xD4, 0x24, 0x08, @@ -737,16 +886,10 @@ static const uint8_t huff_a33_xlat[256] = { 0xF6, 0xCA, 0x3A, 0x7A, 0xCE, 0xDE, 0xAE, 0x3E, 0x7E, 0xBE, 0xFE, 0xD3, 0xA3, 0xE3, 0x33, 0x73, 0xF3, 0x87, 0xC7, 0xD7, 0x27, 0x67, 0xE7, 0x77, 0xF7, 0xCB, 0xDB, 0x2B, 0xAB, 0x3B, 0xBB, 0xFB, 0x8F, 0xCF, 0xDF, 0x6F, - 0xAF, 0xEF, 0x7F, 0xFF -}; - -static const uint8_t huff_a34_cb[7] = { 1, 5, 1, 1, 1, 1, 2 }; - -static const uint8_t huff_a34_xlat[6] = { 1, 0, 2, 3, 4, 5 }; - -static const uint8_t huff_a35_cb[11] = { 2, 10, 1, 0, 2, 3, 6, 19, 9, 75, 110 }; - -static const uint8_t huff_a35_xlat[225] = { + 0xAF, 0xEF, 0x7F, 0xFF, + /* Table set A, code table 3, wordlen 4 - 6 entries */ + 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, + /* Table set A, code table 3, wordlen 5 - 225 entries */ 0x00, 0xF0, 0x0F, 0x10, 0x01, 0xFF, 0x20, 0xE0, 0x11, 0xF1, 0x0E, 0x1F, 0x30, 0x40, 0xD0, 0x21, 0xE1, 0x02, 0x12, 0x22, 0xE2, 0xF2, 0x03, 0x13, 0x1E, 0x2E, 0x3E, 0xEE, 0xFE, 0x2F, 0xEF, 0xD2, 0x43, 0xF3, 0x04, 0x0D, @@ -765,14 +908,8 @@ static const uint8_t huff_a35_xlat[225] = { 0xB9, 0xC9, 0xD9, 0xE9, 0x1A, 0x5A, 0x6A, 0x7A, 0x9A, 0xAA, 0xBA, 0xCA, 0x1B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0x9B, 0xBB, 0xCB, 0xDB, 0x6C, 0x7C, 0x9C, 0xAC, 0xBC, 0xEC, 0x5D, 0x7D, 0x9D, 0xAD, 0xDD, 0x5E, 0x7E, 0x9E, - 0xAE, 0xBE, 0x4F, 0x5F, 0x6F, 0x9F, 0xAF, 0xBF, 0xCF -}; - -static const uint8_t huff_a36_cb[12] = { - 3, 12, 1, 3, 5, 5, 13, 27, 69, 96, 35, 2 -}; - -static const uint8_t huff_a36_xlat[256] = { + 0xAE, 0xBE, 0x4F, 0x5F, 0x6F, 0x9F, 0xAF, 0xBF, 0xCF, + /* Table set A, code table 3, wordlen 6 - 256 entries */ 0x00, 0x10, 0x01, 0x11, 0x20, 0x21, 0x02, 0x12, 0x22, 0x31, 0x41, 0x32, 0x13, 0x23, 0x30, 0x40, 0x51, 0x42, 0x03, 0x33, 0x43, 0x04, 0x14, 0x24, 0x34, 0x15, 0x25, 0x50, 0x61, 0x71, 0xD1, 0x52, 0x62, 0x72, 0xD2, 0x53, @@ -794,51 +931,33 @@ static const uint8_t huff_a36_xlat[256] = { 0x8F, 0x9F, 0xAF, 0xB0, 0xB6, 0xB7, 0xA8, 0xB8, 0x99, 0xA9, 0xB9, 0xC9, 0x7A, 0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0x0B, 0x6B, 0x7B, 0x8B, 0x9B, 0xCB, 0xAC, 0xBC, 0xCC, 0xFC, 0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xBF, 0xCF, 0xDF, - 0xEF, 0xFF, 0xAB, 0xBB -}; - -static const uint8_t huff_a37_cb[7] = { 4, 8, 7, 6, 8, 22, 20 }; - -static const uint8_t huff_a37_xlat[63] = { - 0, 1, 2, 3, 61, 62, 63, 4, 5, 6, 58, 59, 60, 7, 8, 9, - 10, 54, 55, 56, 57, 11, 12, 13, 14, 15, 16, 25, 26, 27, 28, 29, - 30, 35, 36, 37, 38, 48, 49, 50, 51, 52, 53, 17, 18, 19, 20, 21, - 22, 23, 24, 31, 33, 34, 39, 40, 41, 42, 43, 44, 45, 46, 47 -}; - -static const uint8_t huff_a41_cb[14] = { - 1, 12, 1, 0, 0, 6, 2, 0, 0, 0, 19, 9, 24, 20 -}; - -static const uint8_t huff_a41_xlat[81] = { + 0xEF, 0xFF, 0xAB, 0xBB, + /* Table set A, code table 3, wordlen 7 - 63 entries */ + 0x00, 0x01, 0x02, 0x03, 0x3D, 0x3E, 0x3F, 0x04, 0x05, 0x06, 0x3A, 0x3B, + 0x3C, 0x07, 0x08, 0x09, 0x0A, 0x36, 0x37, 0x38, 0x39, 0x0B, 0x0C, 0x0D, + 0x0E, 0x0F, 0x10, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x23, 0x24, 0x25, + 0x26, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x11, 0x12, 0x13, 0x14, 0x15, + 0x16, 0x17, 0x18, 0x1F, 0x21, 0x22, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, + 0x2D, 0x2E, 0x2F, + /* Table set A, code table 4, wordlen 1 - 81 entries */ 0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0x50, 0xD0, 0x70, 0xF0, 0xC4, 0x34, 0x4C, 0xCC, 0x1C, 0x41, 0xC1, 0x31, 0x05, 0x0D, 0x43, 0xC3, 0x13, 0x07, 0x0F, 0x44, 0x14, 0x74, 0xDC, 0x3C, 0x11, 0x1D, 0x33, 0x37, 0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0xFC, 0xD1, 0x71, 0xF1, 0xC5, 0x15, 0x35, 0x4D, 0xCD, 0xDD, 0x3D, 0xD3, 0x73, 0x47, 0xC7, 0x17, 0x77, 0x1F, 0x3F, 0x51, 0x45, 0x55, 0xD5, 0x75, 0xF5, 0x5D, 0x7D, 0xFD, 0x53, 0xF3, - 0x57, 0xD7, 0xF7, 0x4F, 0xCF, 0x5F, 0xDF, 0x7F, 0xFF -}; - -static const uint8_t huff_a42_cb[10] = { 3, 10, 1, 2, 13, 1, 31, 13, 16, 4 }; - -static const uint8_t huff_a42_xlat[81] = { + 0x57, 0xD7, 0xF7, 0x4F, 0xCF, 0x5F, 0xDF, 0x7F, 0xFF, + /* Table set A, code table 4, wordlen 2 - 81 entries */ 0x00, 0x40, 0x01, 0x10, 0x50, 0x04, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51, 0x05, 0x45, 0x15, 0x55, 0x59, 0x80, 0x90, 0x20, 0x60, 0x84, 0x94, 0x24, 0x64, 0x08, 0x48, 0x18, 0x58, 0x81, 0x91, 0x21, 0x61, 0x85, 0x95, 0x25, 0x65, 0x09, 0x49, 0x19, 0x02, 0x42, 0x12, 0x52, 0x06, 0x46, 0x16, 0x56, 0xA0, 0xA4, 0x68, 0xA1, 0xA5, 0x99, 0x29, 0x69, 0x96, 0x66, 0x4A, 0x1A, 0x5A, 0x88, 0x98, 0x28, 0x89, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x86, 0x26, - 0xA6, 0x0A, 0x9A, 0x2A, 0x6A, 0xA8, 0xA2, 0x8A, 0xAA -}; - -static const uint8_t huff_a43_cb[5] = { 2, 4, 2, 3, 2 }; - -static const uint8_t huff_a43_xlat[7] = { 0, 7, 1, 2, 6, 3, 5 }; - -static const uint8_t huff_a44_cb[9] = { 4, 10, 5, 4, 12, 17, 47, 24, 12 }; - -static const uint8_t huff_a44_xlat[121] = { + 0xA6, 0x0A, 0x9A, 0x2A, 0x6A, 0xA8, 0xA2, 0x8A, 0xAA, + /* Table set A, code table 4, wordlen 3 - 7 entries */ + 0x00, 0x07, 0x01, 0x02, 0x06, 0x03, 0x05, + /* Table set A, code table 4, wordlen 4 - 121 entries */ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x21, 0xE1, 0x02, 0x12, 0xF2, 0x0E, 0x1E, 0xFE, 0x2F, 0xEF, 0x30, 0x50, 0xD0, 0xD1, 0x22, 0xE2, 0x03, 0x13, 0xF3, 0x0D, 0x1D, 0x2D, 0xFD, 0x2E, 0xEE, @@ -849,16 +968,10 @@ static const uint8_t huff_a44_xlat[121] = { 0xCF, 0x42, 0x52, 0x33, 0x53, 0xC3, 0x24, 0xB4, 0xD4, 0x25, 0x35, 0xC5, 0x4B, 0xCB, 0xDB, 0x3C, 0x4C, 0x5C, 0xDC, 0xEC, 0x4D, 0xBD, 0xCD, 0xDD, 0xCE, 0x43, 0x34, 0x44, 0x54, 0xC4, 0x45, 0x55, 0xB5, 0x5B, 0xBB, 0xBC, - 0xCC -}; - -static const uint8_t huff_a45_cb[5] = { 2, 4, 2, 2, 4 }; - -static const uint8_t huff_a45_xlat[8] = { 1, 2, 0, 3, 4, 5, 6, 7 }; - -static const uint8_t huff_a46_cb[7] = { 5, 9, 1, 16, 31, 36, 172 }; - -static const uint8_t huff_a46_xlat[256] = { + 0xCC, + /* Table set A, code table 4, wordlen 5 - 8 entries */ + 0x01, 0x02, 0x00, 0x03, 0x04, 0x05, 0x06, 0x07, + /* Table set A, code table 4, wordlen 6 - 256 entries */ 0x02, 0x00, 0x30, 0x21, 0x31, 0x41, 0x61, 0x12, 0x22, 0x42, 0x62, 0x43, 0x53, 0x24, 0x45, 0x26, 0x27, 0x10, 0x40, 0xB0, 0x01, 0x11, 0x81, 0x32, 0x52, 0x72, 0x92, 0x03, 0x13, 0x33, 0x63, 0x14, 0x34, 0x54, 0x64, 0x74, @@ -880,45 +993,29 @@ static const uint8_t huff_a46_xlat[256] = { 0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0xDD, 0xED, 0xFD, 0x0E, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E, 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0xDE, 0xEE, 0xFE, 0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F, 0x8F, 0x9F, 0xAF, 0xBF, - 0xCF, 0xDF, 0xEF, 0xFF -}; - -static const uint8_t huff_a47_cb[8] = { 4, 9, 5, 12, 9, 12, 15, 10 }; - -static const uint8_t huff_a47_xlat[63] = { - 0, 1, 2, 62, 63, 3, 4, 5, 6, 8, 54, 56, 57, 58, 59, 60, - 61, 7, 9, 10, 11, 12, 13, 14, 53, 55, 15, 16, 17, 18, 19, 20, - 21, 36, 37, 39, 42, 52, 22, 25, 28, 35, 38, 40, 41, 43, 45, 46, - 47, 48, 49, 50, 51, 23, 24, 26, 27, 29, 30, 31, 33, 34, 44 -}; - -static const uint8_t huff_a51_cb[12] = { - 2, 11, 1, 0, 6, 2, 6, 18, 4, 26, 6, 12 -}; - -static const uint8_t huff_a51_xlat[81] = { + 0xCF, 0xDF, 0xEF, 0xFF, + /* Table set A, code table 4, wordlen 7 - 63 entries */ + 0x00, 0x01, 0x02, 0x3E, 0x3F, 0x03, 0x04, 0x05, 0x06, 0x08, 0x36, 0x38, + 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x07, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, + 0x35, 0x37, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x24, 0x25, 0x27, + 0x2A, 0x34, 0x16, 0x19, 0x1C, 0x23, 0x26, 0x28, 0x29, 0x2B, 0x2D, 0x2E, + 0x2F, 0x30, 0x31, 0x32, 0x33, 0x17, 0x18, 0x1A, 0x1B, 0x1D, 0x1E, 0x1F, + 0x21, 0x22, 0x2C, + /* Table set A, code table 5, wordlen 1 - 81 entries */ 0x00, 0x40, 0xC0, 0x30, 0x04, 0x01, 0x03, 0x10, 0x0C, 0xD0, 0x70, 0x34, 0x1C, 0x0D, 0x07, 0x50, 0xF0, 0x44, 0xC4, 0x14, 0x4C, 0xCC, 0x3C, 0x41, 0xC1, 0x11, 0x31, 0x05, 0x43, 0xC3, 0x13, 0x33, 0x0F, 0x74, 0xDC, 0x1D, 0x37, 0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0xFC, 0xD1, 0x71, 0xF1, 0xC5, 0x15, - 0x35, 0x4D, 0xCD, 0xDD, 0x3D, 0x53, 0xD3, 0x73, 0x47, 0xC7, 0x17, 0x77, - 0x4F, 0x1F, 0x3F, 0x51, 0x45, 0x55, 0xF3, 0xCF, 0xFF, 0xD5, 0x75, 0xF5, - 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F -}; - -static const uint8_t huff_a52_cb[12] = { 1, 10, 1, 0, 2, 2, 0, 4, 3, 8, 3, 2 }; - -static const uint8_t huff_a52_xlat[25] = { - 0x00, 0x08, 0x38, 0x01, 0x07, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x02, 0x06, - 0x30, 0x11, 0x31, 0x0A, 0x3A, 0x0E, 0x17, 0x37, 0x32, 0x16, 0x3E, 0x12, - 0x36 -}; - -static const uint8_t huff_a53_xlat[7] = { 0, 1, 2, 6, 7, 3, 5 }; - -static const uint8_t huff_a54_cb[8] = { 4, 9, 4, 7, 12, 19, 21, 58 }; - -static const uint8_t huff_a54_xlat[121] = { + 0x35, 0x4D, 0xCD, 0xDD, 0x3D, 0x53, 0xD3, 0x73, 0x47, 0xC7, 0x17, 0x77, + 0x4F, 0x1F, 0x3F, 0x51, 0x45, 0x55, 0xF3, 0xCF, 0xFF, 0xD5, 0x75, 0xF5, + 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F, + /* Table set A, code table 5, wordlen 2 - 25 entries */ + 0x00, 0x08, 0x38, 0x01, 0x07, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x02, 0x06, + 0x30, 0x11, 0x31, 0x0A, 0x3A, 0x0E, 0x17, 0x37, 0x32, 0x16, 0x3E, 0x12, + 0x36, + /* Table set A, code table 5, wordlen 3 - 7 entries */ + 0x00, 0x01, 0x02, 0x06, 0x07, 0x03, 0x05, + /* Table set A, code table 5, wordlen 4 - 121 entries */ 0x00, 0x01, 0x0F, 0x1F, 0x10, 0xE0, 0xF0, 0x11, 0xF1, 0x2F, 0xFF, 0x20, 0x21, 0xE1, 0x02, 0x12, 0xF2, 0x03, 0xF3, 0x0E, 0x2E, 0xFE, 0x3F, 0x30, 0x40, 0xD0, 0xC1, 0xD1, 0x22, 0xC2, 0x33, 0xE3, 0x0C, 0xCC, 0x0D, 0x1D, @@ -929,58 +1026,33 @@ static const uint8_t huff_a54_xlat[121] = { 0xE4, 0xF4, 0x05, 0x15, 0x25, 0x35, 0x55, 0xB5, 0xC5, 0xD5, 0xE5, 0x0B, 0x1B, 0x2B, 0x3B, 0xBB, 0xCB, 0xDB, 0xEB, 0x2C, 0x3C, 0x4C, 0x5C, 0xBC, 0xDC, 0xEC, 0xFC, 0x4D, 0x5D, 0xCD, 0xED, 0x4E, 0xBE, 0xCE, 0xDE, 0x4F, - 0x5F -}; - -static const uint8_t huff_a55_cb[8] = { 1, 6, 1, 1, 1, 0, 3, 2 }; - -static const uint8_t huff_a55_xlat[8] = { 0, 1, 2, 3, 6, 7, 4, 5 }; - -static const uint8_t huff_a56_cb[7] = { 3, 7, 1, 8, 6, 8, 8 }; - -static const uint8_t huff_a56_xlat[31] = { - 4, 0, 1, 2, 3, 28, 29, 30, 31, 5, 6, 7, 24, 25, 27, 8, - 9, 14, 19, 21, 22, 23, 26, 10, 11, 12, 13, 15, 17, 18, 20 -}; - -static const uint8_t huff_a57_cb[9] = { 3, 9, 1, 5, 7, 8, 16, 22, 4 }; - -static const uint8_t huff_a57_xlat[63] = { - 0, 1, 2, 61, 62, 63, 3, 4, 5, 6, 58, 59, - 60, 7, 8, 9, 10, 54, 55, 56, 57, 11, 12, 13, - 14, 15, 26, 27, 28, 36, 37, 38, 49, 50, 51, 52, - 53, 16, 17, 18, 19, 20, 21, 23, 24, 25, 29, 30, - 31, 33, 34, 35, 39, 43, 44, 45, 46, 47, 48, 22, - 40, 41, 42 -}; - -static const uint8_t huff_a61_cb[12] = { - 2, 11, 1, 0, 8, 0, 1, 16, 10, 29, 12, 4 -}; - -static const uint8_t huff_a61_xlat[81] = { + 0x5F, + /* Table set A, code table 5, wordlen 5 - 8 entries */ + 0x00, 0x01, 0x02, 0x03, 0x06, 0x07, 0x04, 0x05, + /* Table set A, code table 5, wordlen 6 - 31 entries */ + 0x04, 0x00, 0x01, 0x02, 0x03, 0x1C, 0x1D, 0x1E, 0x1F, 0x05, 0x06, 0x07, + 0x18, 0x19, 0x1B, 0x08, 0x09, 0x0E, 0x13, 0x15, 0x16, 0x17, 0x1A, 0x0A, + 0x0B, 0x0C, 0x0D, 0x0F, 0x11, 0x12, 0x14, + /* Table set A, code table 5, wordlen 7 - 63 entries */ + 0x00, 0x01, 0x02, 0x3D, 0x3E, 0x3F, 0x03, 0x04, 0x05, 0x06, 0x3A, 0x3B, + 0x3C, 0x07, 0x08, 0x09, 0x0A, 0x36, 0x37, 0x38, 0x39, 0x0B, 0x0C, 0x0D, + 0x0E, 0x0F, 0x1A, 0x1B, 0x1C, 0x24, 0x25, 0x26, 0x31, 0x32, 0x33, 0x34, + 0x35, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x17, 0x18, 0x19, 0x1D, 0x1E, + 0x1F, 0x21, 0x22, 0x23, 0x27, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x16, + 0x28, 0x29, 0x2A, + /* Table set A, code table 6, wordlen 1 - 81 entries */ 0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0x70, 0x50, 0xD0, 0xF0, 0x44, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0x31, 0x05, 0x0D, 0x13, 0x07, 0x0F, 0x74, 0xCC, 0xDC, 0xFC, 0x41, 0xC1, 0x11, 0x43, 0xC3, 0x33, 0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0x51, 0xD1, 0x71, 0xF1, 0x45, 0xC5, 0x15, 0x35, 0x4D, 0xCD, 0x1D, 0x3D, 0x53, 0xD3, 0x73, 0xF3, 0x47, 0xC7, 0x17, 0x37, 0x4F, 0xCF, 0x1F, 0x3F, 0x55, 0xD5, 0x75, 0xF5, 0x5D, 0xDD, 0xFD, - 0x57, 0xD7, 0x77, 0xF7, 0xFF, 0x7D, 0x5F, 0xDF, 0x7F -}; - -static const uint8_t huff_a62_cb[8] = { 3, 8, 5, 2, 2, 9, 5, 2 }; - -static const uint8_t huff_a62_xlat[25] = { + 0x57, 0xD7, 0x77, 0xF7, 0xFF, 0x7D, 0x5F, 0xDF, 0x7F, + /* Table set A, code table 6, wordlen 2 - 25 entries */ 0x00, 0x08, 0x38, 0x01, 0x07, 0x39, 0x0F, 0x09, 0x3F, 0x10, 0x30, 0x31, 0x02, 0x3A, 0x06, 0x0E, 0x17, 0x37, 0x11, 0x0A, 0x32, 0x16, 0x3E, 0x12, - 0x36 -}; - -static const uint8_t huff_a63_cb[11] = { - 3, 11, 1, 1, 10, 4, 16, 29, 46, 75, 74 -}; - -static const uint8_t huff_a63_xlat[256] = { + 0x36, + /* Table set A, code table 6, wordlen 3 - 256 entries */ 0x00, 0x40, 0x10, 0x50, 0x04, 0x44, 0x14, 0x01, 0x41, 0x05, 0x45, 0x55, 0x54, 0x11, 0x51, 0x15, 0x80, 0x90, 0x60, 0x24, 0x64, 0xA4, 0x48, 0x61, 0x95, 0x25, 0xA5, 0x02, 0x42, 0x52, 0x16, 0x56, 0x20, 0x84, 0x94, 0x18, @@ -1002,12 +1074,8 @@ static const uint8_t huff_a63_xlat[256] = { 0xBA, 0x8E, 0xCE, 0x1E, 0x5E, 0x9E, 0xAE, 0xEE, 0x3E, 0xC3, 0x93, 0xD3, 0xE3, 0x33, 0x73, 0xF3, 0xC7, 0x67, 0xA7, 0xE7, 0x37, 0xB7, 0xF7, 0xCB, 0xDB, 0xEB, 0x3B, 0x7B, 0xBB, 0xFB, 0x0F, 0x4F, 0x8F, 0x5F, 0xDF, 0x6F, - 0xAF, 0xEF, 0x3F, 0xFF -}; - -static const uint8_t huff_a64_cb[8] = { 4, 9, 1, 7, 12, 36, 63, 2 }; - -static const uint8_t huff_a64_xlat[121] = { + 0xAF, 0xEF, 0x3F, 0xFF, + /* Table set A, code table 6, wordlen 4 - 121 entries */ 0x00, 0x10, 0x20, 0xE0, 0xF0, 0x02, 0x0E, 0xEF, 0x30, 0x01, 0x11, 0x21, 0x31, 0xF1, 0x12, 0xF2, 0x1E, 0xEE, 0xDF, 0xFF, 0x40, 0xC0, 0xD0, 0xD1, 0xE1, 0x22, 0x32, 0x42, 0xD2, 0xE2, 0x03, 0x13, 0x23, 0xB3, 0xC3, 0xE3, @@ -1018,62 +1086,38 @@ static const uint8_t huff_a64_xlat[121] = { 0xB5, 0xC5, 0xD5, 0xE5, 0x0B, 0x1B, 0x3B, 0x4B, 0x5B, 0xBB, 0xCB, 0xDB, 0xEB, 0xFB, 0x1C, 0x2C, 0x3C, 0x4C, 0x5C, 0xBC, 0xCC, 0xDC, 0xEC, 0x0D, 0x3D, 0x4D, 0x5D, 0xCD, 0xED, 0x3E, 0x5E, 0xBE, 0xCE, 0x4F, 0xCF, 0x5F, - 0xBF -}; - -static const uint8_t huff_a65_cb[8] = { 2, 7, 3, 0, 1, 3, 4, 4 }; - -static const uint8_t huff_a65_xlat[15] = { - 0, 1, 15, 14, 2, 3, 13, 4, 6, 10, 12, 5, 7, 9, 11 -}; - -static const uint8_t huff_a66_cb[11] = { 2, 10, 1, 2, 2, 6, 8, 6, 3, 1, 2 }; - -static const uint8_t huff_a66_xlat[31] = { - 0, 1, 31, 2, 30, 3, 4, 15, 17, 28, 29, 5, 6, 7, 8, 24, - 25, 26, 27, 9, 10, 11, 21, 22, 23, 12, 19, 20, 13, 14, 18 -}; - -static const uint8_t huff_a67_cb[10] = { 2, 9, 1, 1, 3, 4, 6, 13, 25, 10 }; - -static const uint8_t huff_a67_xlat[63] = { - 0, 1, 2, 62, 63, 3, 4, 60, 61, 5, 6, 7, 57, 58, 59, 8, - 9, 10, 11, 12, 13, 26, 38, 52, 53, 54, 55, 56, 14, 15, 16, 17, - 18, 19, 25, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 39, 45, 46, - 47, 48, 49, 50, 51, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44 -}; - -static const uint8_t huff_a71_cb[5] = { 1, 3, 1, 1, 2 }; - -static const uint8_t huff_a72_cb[12] = { - 2, 11, 1, 0, 4, 8, 3, 8, 24, 17, 12, 4 -}; - -static const uint8_t huff_a72_xlat[81] = { + 0xBF, + /* Table set A, code table 6, wordlen 5 - 15 entries */ + 0x00, 0x01, 0x0F, 0x0E, 0x02, 0x03, 0x0D, 0x04, 0x06, 0x0A, 0x0C, 0x05, + 0x07, 0x09, 0x0B, + /* Table set A, code table 6, wordlen 6 - 31 entries */ + 0x00, 0x01, 0x1F, 0x02, 0x1E, 0x03, 0x04, 0x0F, 0x11, 0x1C, 0x1D, 0x05, + 0x06, 0x07, 0x08, 0x18, 0x19, 0x1A, 0x1B, 0x09, 0x0A, 0x0B, 0x15, 0x16, + 0x17, 0x0C, 0x13, 0x14, 0x0D, 0x0E, 0x12, + /* Table set A, code table 6, wordlen 7 - 63 entries */ + 0x00, 0x01, 0x02, 0x3E, 0x3F, 0x03, 0x04, 0x3C, 0x3D, 0x05, 0x06, 0x07, + 0x39, 0x3A, 0x3B, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x1A, 0x26, 0x34, + 0x35, 0x36, 0x37, 0x38, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x19, 0x1B, + 0x1C, 0x1D, 0x1E, 0x1F, 0x21, 0x22, 0x23, 0x24, 0x25, 0x27, 0x2D, 0x2E, + 0x2F, 0x30, 0x31, 0x32, 0x33, 0x14, 0x15, 0x16, 0x17, 0x18, 0x28, 0x29, + 0x2A, 0x2B, 0x2C, + /* Table set A, code table 7, wordlen 1 - 4 entries */ + 0x00, 0x01, 0x02, 0x03, + /* Table set A, code table 7, wordlen 2 - 81 entries */ 0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x05, 0x15, 0x51, 0x45, 0x55, 0x80, 0x90, 0x20, 0x64, 0x08, 0x19, 0x02, 0x06, 0x60, 0x84, 0x94, 0x24, 0x48, 0x18, 0x58, 0x81, 0x91, 0x21, 0x61, 0x85, 0x95, 0x25, 0x65, 0x09, 0x49, 0x59, 0x42, 0x12, 0x52, 0x46, 0x16, 0x56, 0xA0, 0xA4, 0x98, 0x28, 0x68, 0xA1, 0xA5, 0x99, 0x29, 0x69, 0x96, 0x26, 0x66, 0x0A, 0x4A, 0x1A, 0x5A, 0x88, 0xA8, 0x89, 0xA9, 0x82, 0x92, 0x22, - 0x62, 0x86, 0xA6, 0x2A, 0x6A, 0xA2, 0x8A, 0x9A, 0xAA -}; - -static const uint8_t huff_a73_cb[11] = { 2, 10, 1, 1, 5, 2, 8, 7, 13, 8, 4 }; - -static const uint8_t huff_a73_xlat[49] = { + 0x62, 0x86, 0xA6, 0x2A, 0x6A, 0xA2, 0x8A, 0x9A, 0xAA, + /* Table set A, code table 7, wordlen 3 - 49 entries */ 0x00, 0x08, 0x38, 0x01, 0x39, 0x07, 0x0F, 0x09, 0x3F, 0x10, 0x30, 0x31, 0x02, 0x3A, 0x06, 0x0E, 0x17, 0x11, 0x0A, 0x32, 0x0D, 0x16, 0x3E, 0x37, 0x18, 0x28, 0x19, 0x29, 0x12, 0x2A, 0x03, 0x3B, 0x05, 0x15, 0x1E, 0x1F, 0x2F, 0x1A, 0x0B, 0x2B, 0x33, 0x35, 0x3D, 0x2E, 0x36, 0x13, 0x1B, 0x1D, - 0x2D -}; - -static const uint8_t huff_a74_cb[14] = { - 1, 12, 1, 0, 0, 4, 0, 4, 5, 9, 30, 45, 21, 2 -}; - -static const uint8_t huff_a74_xlat[121] = { + 0x2D, + /* Table set A, code table 7, wordlen 4 - 121 entries */ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x02, 0xF2, 0x0E, 0x21, 0xE1, 0x12, 0xE2, 0x1E, 0x2E, 0xFE, 0x2F, 0xEF, 0x30, 0x50, 0xB0, 0xC0, 0xD0, 0x31, 0xB1, 0xD1, 0x22, 0xD2, 0x03, 0x13, 0xE3, @@ -1084,20 +1128,11 @@ static const uint8_t huff_a74_xlat[121] = { 0xEC, 0xFC, 0x3D, 0x5D, 0xDD, 0xED, 0x4E, 0x5E, 0xBE, 0xCE, 0xDE, 0x4F, 0xBF, 0xCF, 0x43, 0x53, 0x34, 0x54, 0xB4, 0xC4, 0x35, 0x45, 0x55, 0xB5, 0x4B, 0x5B, 0xCB, 0xDB, 0x4C, 0xBC, 0xCC, 0xDC, 0x4D, 0xBD, 0xCD, 0x44, - 0xBB -}; - -static const uint8_t huff_a75_cb[7] = { 2, 6, 1, 3, 3, 4, 4 }; - -static const uint8_t huff_a75_xlat[15] = { - 0, 1, 14, 15, 2, 3, 13, 4, 6, 10, 12, 5, 7, 9, 11 -}; - -static const uint8_t huff_a76_cb[12] = { - 3, 12, 1, 3, 4, 8, 10, 36, 60, 78, 48, 8 -}; - -static const uint8_t huff_a76_xlat[256] = { + 0xBB, + /* Table set A, code table 7, wordlen 5 - 15 entries */ + 0x00, 0x01, 0x0E, 0x0F, 0x02, 0x03, 0x0D, 0x04, 0x06, 0x0A, 0x0C, 0x05, + 0x07, 0x09, 0x0B, + /* Table set A, code table 7, wordlen 6 - 256 entries */ 0x00, 0x10, 0x01, 0x11, 0x20, 0x21, 0x02, 0x12, 0x30, 0x31, 0x41, 0x22, 0x03, 0x13, 0x23, 0x14, 0x40, 0x51, 0x61, 0x32, 0x42, 0x33, 0x04, 0x24, 0x15, 0x16, 0x50, 0x60, 0xD0, 0x71, 0x81, 0xD1, 0xE1, 0xF1, 0x52, 0x62, @@ -1119,52 +1154,30 @@ static const uint8_t huff_a76_xlat[256] = { 0xC9, 0x6A, 0x7A, 0x8A, 0x9A, 0xAA, 0xCA, 0xFA, 0x5B, 0x6B, 0x7B, 0x8B, 0xCB, 0xEB, 0xFB, 0x7C, 0x8C, 0x9C, 0xAC, 0xBC, 0xEC, 0xFC, 0xDD, 0xED, 0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xBF, 0xCF, 0xDF, 0xB7, 0xBA, 0x9B, 0xAB, - 0xBB, 0xCC, 0xEF, 0xFF -}; - -static const uint8_t huff_b01_cb[14] = { - 1, 12, 1, 0, 0, 2, 6, 0, 11, 13, 12, 24, 4, 8 -}; - -static const uint8_t huff_b01_xlat[81] = { + 0xBB, 0xCC, 0xEF, 0xFF, + /* Table set B, code table 0, wordlen 1 - 81 entries */ 0x00, 0x01, 0x03, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x50, 0xD0, 0x70, 0xF0, 0x34, 0x1C, 0x05, 0x0D, 0x13, 0x07, 0x0F, 0x44, 0xC4, 0x14, 0x4C, 0xCC, 0x3C, 0x41, 0xC1, 0x11, 0x31, 0x43, 0xC3, 0x33, 0x54, 0x74, 0xDC, 0xFC, 0x71, 0x15, 0x4D, 0x1D, 0xD3, 0xC7, 0x37, 0x3F, 0xD4, 0xF4, 0x5C, 0x7C, 0x51, 0xD1, 0xF1, 0x45, 0xC5, 0x55, 0x35, 0xCD, 0xDD, 0x3D, 0x53, 0x73, 0xF3, 0x47, 0x17, 0x77, 0x4F, 0xCF, 0x1F, 0xFF, 0xF5, 0x7D, 0xD7, - 0x5F, 0xD5, 0x75, 0x5D, 0xFD, 0x57, 0xF7, 0xDF, 0x7F -}; - -static const uint8_t huff_b02_cb[14] = { - 1, 12, 1, 0, 0, 4, 0, 8, 4, 9, 19, 13, 13, 10 -}; - -static const uint8_t huff_b02_xlat[81] = { + 0x5F, 0xD5, 0x75, 0x5D, 0xFD, 0x57, 0xF7, 0xDF, 0x7F, + /* Table set B, code table 0, wordlen 2 - 81 entries */ 0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x05, 0x15, 0x80, 0x51, 0x45, 0x55, 0x90, 0x20, 0x60, 0x24, 0x08, 0x18, 0x09, 0x02, 0x06, 0x84, 0x94, 0x64, 0x48, 0x58, 0x81, 0x91, 0x21, 0x61, 0x95, 0x25, 0x65, 0x19, 0x59, 0x42, 0x12, 0x46, 0x16, 0x56, 0xA0, 0xA4, 0x28, 0x68, 0x85, 0xA5, 0x49, 0x29, 0x69, 0x52, 0x0A, 0x1A, 0x5A, 0x88, 0x98, 0xA1, 0x89, 0x99, 0xA9, 0x22, 0x62, 0x96, 0x26, 0x66, 0x4A, 0x6A, 0xA8, - 0x82, 0x92, 0xA2, 0x86, 0xA6, 0x8A, 0x9A, 0x2A, 0xAA -}; - -static const uint8_t huff_b03_cb[11] = { 1, 9, 1, 0, 0, 4, 0, 5, 12, 13, 14 }; - -static const uint8_t huff_b03_xlat[49] = { + 0x82, 0x92, 0xA2, 0x86, 0xA6, 0x8A, 0x9A, 0x2A, 0xAA, + /* Table set B, code table 0, wordlen 3 - 49 entries */ 0x00, 0x08, 0x38, 0x01, 0x07, 0x30, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x18, 0x28, 0x31, 0x02, 0x3A, 0x03, 0x05, 0x06, 0x0E, 0x17, 0x37, 0x11, 0x19, 0x29, 0x0A, 0x32, 0x0B, 0x3B, 0x0D, 0x15, 0x3D, 0x3E, 0x1F, 0x2F, 0x12, 0x1A, 0x2A, 0x13, 0x1B, 0x2B, 0x33, 0x1D, 0x2D, 0x35, 0x16, 0x1E, 0x2E, - 0x36 -}; - -static const uint8_t huff_b04_cb[12] = { - 2, 11, 1, 0, 4, 4, 5, 9, 30, 45, 21, 2 -}; - -static const uint8_t huff_b04_xlat[121] = { + 0x36, + /* Table set B, code table 0, wordlen 4 - 121 entries */ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x02, 0xF2, 0x0E, 0x21, 0xE1, 0x12, 0xE2, 0x1E, 0x2E, 0xFE, 0x2F, 0xEF, 0x30, 0x50, 0xB0, 0xC0, 0xD0, 0x31, 0xB1, 0xD1, 0x22, 0xD2, 0x03, 0x13, 0xE3, @@ -1175,14 +1188,8 @@ static const uint8_t huff_b04_xlat[121] = { 0xEC, 0xFC, 0x3D, 0x5D, 0xDD, 0xED, 0x4E, 0x5E, 0xBE, 0xCE, 0xDE, 0x4F, 0xBF, 0xCF, 0x43, 0x53, 0x34, 0x54, 0xB4, 0xC4, 0x35, 0x45, 0x55, 0xB5, 0x4B, 0x5B, 0xCB, 0xDB, 0x4C, 0xBC, 0xCC, 0xDC, 0x4D, 0xBD, 0xCD, 0x44, - 0xBB -}; - -static const uint8_t huff_b05_cb[11] = { - 3, 11, 1, 4, 4, 4, 12, 30, 73, 75, 22 -}; - -static const uint8_t huff_b05_xlat[225] = { + 0xBB, + /* Table set B, code table 0, wordlen 5 - 225 entries */ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x02, 0x0E, 0x30, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x0D, 0x1E, 0xFE, 0x2F, 0xEF, 0x40, 0x60, 0x70, 0x90, 0xA0, 0xC0, 0x31, 0xD1, 0x22, 0x32, 0xD2, @@ -1201,35 +1208,23 @@ static const uint8_t huff_b05_xlat[225] = { 0x3B, 0x6B, 0x7B, 0x9B, 0xAB, 0xDB, 0xEB, 0x3C, 0x4C, 0x6C, 0x7C, 0x9C, 0xAC, 0xCC, 0xDC, 0x4D, 0x5D, 0x6D, 0xAD, 0xBD, 0xCD, 0x5E, 0xBE, 0x54, 0x45, 0x55, 0xB5, 0xC5, 0x76, 0x96, 0x67, 0x77, 0x97, 0xA7, 0x79, 0x99, - 0xA9, 0x7A, 0x9A, 0x4B, 0x5B, 0xBB, 0xCB, 0x5C, 0xBC -}; - -static const uint8_t huff_b07_cb[9] = { 3, 9, 3, 2, 4, 8, 23, 13, 10 }; - -static const uint8_t huff_b07_xlat[63] = { - 0, 1, 63, 2, 62, 3, 4, 60, 61, 5, 6, 7, 8, 56, 57, 58, - 59, 9, 10, 11, 12, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, - 37, 38, 39, 51, 52, 53, 54, 55, 13, 14, 15, 16, 17, 18, 19, 45, - 46, 47, 48, 49, 50, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44 -}; - -static const uint8_t huff_b12_cb[10] = { 3, 10, 1, 3, 12, 0, 30, 9, 18, 8 }; - -static const uint8_t huff_b12_xlat[81] = { + 0xA9, 0x7A, 0x9A, 0x4B, 0x5B, 0xBB, 0xCB, 0x5C, 0xBC, + /* Table set B, code table 0, wordlen 7 - 63 entries */ + 0x00, 0x01, 0x3F, 0x02, 0x3E, 0x03, 0x04, 0x3C, 0x3D, 0x05, 0x06, 0x07, + 0x08, 0x38, 0x39, 0x3A, 0x3B, 0x09, 0x0A, 0x0B, 0x0C, 0x19, 0x1A, 0x1B, + 0x1C, 0x1D, 0x1E, 0x1F, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x33, + 0x34, 0x35, 0x36, 0x37, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x2D, + 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x14, 0x15, 0x16, 0x17, 0x18, 0x28, 0x29, + 0x2A, 0x2B, 0x2C, + /* Table set B, code table 1, wordlen 2 - 81 entries */ 0x00, 0x40, 0x04, 0x01, 0x10, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51, 0x05, 0x45, 0x15, 0x55, 0x80, 0x90, 0x20, 0x60, 0x84, 0x94, 0x24, 0x64, 0x08, 0x48, 0x18, 0x81, 0x91, 0x61, 0x85, 0x95, 0x25, 0x65, 0x09, 0x49, 0x19, 0x59, 0x02, 0x42, 0x12, 0x52, 0x06, 0x46, 0x16, 0x56, 0xA4, 0x58, 0x68, 0x21, 0xA5, 0x29, 0x69, 0x1A, 0x5A, 0xA0, 0x88, 0x98, 0x28, 0xA1, 0x89, 0x99, 0xA9, 0x92, 0x22, 0x62, 0x86, 0x96, 0x26, 0x66, 0x0A, 0x4A, - 0x6A, 0xA8, 0x82, 0xA2, 0xA6, 0x8A, 0x9A, 0x2A, 0xAA -}; - -static const uint8_t huff_b14_cb[14] = { - 1, 12, 1, 0, 0, 4, 0, 3, 5, 16, 28, 34, 26, 4 -}; - -static const uint8_t huff_b14_xlat[121] = { + 0x6A, 0xA8, 0x82, 0xA2, 0xA6, 0x8A, 0x9A, 0x2A, 0xAA, + /* Table set B, code table 1, wordlen 4 - 121 entries */ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x11, 0x02, 0x0E, 0x30, 0x50, 0xB0, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x05, 0x0B, 0x0D, 0x1E, 0xFE, 0x2F, 0xEF, 0x40, 0xC0, 0x31, 0x51, 0xB1, 0xC1, 0xD1, @@ -1240,14 +1235,8 @@ static const uint8_t huff_b14_xlat[121] = { 0xED, 0x3E, 0x4E, 0xBE, 0xDE, 0x4F, 0xCF, 0xC2, 0x33, 0x43, 0xC3, 0xD3, 0x34, 0x44, 0x54, 0xB4, 0xD4, 0x45, 0x55, 0xC5, 0x4B, 0xCB, 0x3C, 0x4C, 0x5C, 0xCC, 0xDC, 0x3D, 0x4D, 0x5D, 0xCD, 0xDD, 0xCE, 0xC4, 0xB5, 0x5B, - 0xBB -}; - -static const uint8_t huff_b16_cb[11] = { - 4, 12, 4, 4, 9, 13, 37, 76, 72, 39, 2 -}; - -static const uint8_t huff_b16_xlat[256] = { + 0xBB, + /* Table set B, code table 1, wordlen 6 - 256 entries */ 0x00, 0x10, 0x01, 0x11, 0x20, 0x21, 0x02, 0x12, 0x30, 0x31, 0x41, 0x22, 0x32, 0x03, 0x13, 0x23, 0x14, 0x40, 0x51, 0x61, 0x42, 0x52, 0x33, 0x43, 0x04, 0x24, 0x34, 0x15, 0x25, 0x16, 0x50, 0x60, 0x70, 0x71, 0x81, 0xD1, @@ -1269,14 +1258,8 @@ static const uint8_t huff_b16_xlat[256] = { 0xA8, 0xB8, 0xC8, 0x99, 0xA9, 0xB9, 0xC9, 0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0xFA, 0x6B, 0x7B, 0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0xFB, 0x9C, 0xAC, 0xBC, 0xCC, 0xEC, 0xFC, 0xDD, 0xED, 0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xAF, 0xBF, - 0xCF, 0xDF, 0xEF, 0xFF -}; - -static const uint8_t huff_b26_cb[12] = { - 3, 12, 2, 2, 4, 5, 11, 26, 67, 78, 51, 10 -}; - -static const uint8_t huff_b26_xlat[256] = { + 0xCF, 0xDF, 0xEF, 0xFF, + /* Table set B, code table 2, wordlen 6 - 256 entries */ 0x00, 0x01, 0x10, 0x11, 0x20, 0x21, 0x02, 0x12, 0x30, 0x31, 0x22, 0x03, 0x13, 0x40, 0x41, 0x51, 0x32, 0x42, 0x23, 0x33, 0x04, 0x14, 0x24, 0x15, 0x50, 0x61, 0x71, 0xD1, 0xE1, 0x52, 0x62, 0xD2, 0x43, 0x53, 0xD3, 0x34, @@ -1298,28 +1281,16 @@ static const uint8_t huff_b26_xlat[256] = { 0x5A, 0x6A, 0x7A, 0x9A, 0xCA, 0xFA, 0x4B, 0x5B, 0x6B, 0x7B, 0xCB, 0xFB, 0x7C, 0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xEC, 0xFC, 0xDD, 0xED, 0xFD, 0xDE, 0xEE, 0xFE, 0xBF, 0xCF, 0xDF, 0xEF, 0xB8, 0xB9, 0x8A, 0xAA, 0xBA, 0x8B, - 0x9B, 0xAB, 0xBB, 0xFF -}; - -static const uint8_t huff_b32_cb[12] = { - 2, 11, 1, 0, 4, 6, 7, 10, 22, 11, 16, 4 -}; - -static const uint8_t huff_b32_xlat[81] = { + 0x9B, 0xAB, 0xBB, 0xFF, + /* Table set B, code table 3, wordlen 2 - 81 entries */ 0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x41, 0x11, 0x05, 0x80, 0x54, 0x51, 0x45, 0x15, 0x55, 0x02, 0x90, 0x20, 0x60, 0x84, 0x24, 0x08, 0x18, 0x09, 0x12, 0x06, 0xA0, 0x94, 0x64, 0x48, 0x58, 0x81, 0x91, 0x21, 0x61, 0x85, 0x95, 0x25, 0x65, 0x49, 0x19, 0x59, 0x42, 0x52, 0x46, 0x16, 0x56, 0x0A, 0xA4, 0x28, 0x68, 0xA1, 0xA5, 0x29, 0x69, 0x26, 0x4A, 0x1A, 0x5A, 0x88, 0x98, 0xA8, 0x89, 0x99, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x86, - 0x96, 0x66, 0x9A, 0x2A, 0x6A, 0xA2, 0xA6, 0x8A, 0xAA -}; - -static const uint8_t huff_b33_cb[13] = { - 2, 12, 1, 0, 0, 4, 11, 8, 28, 92, 97, 13, 2 -}; - -static const uint8_t huff_b33_xlat[256] = { + 0x96, 0x66, 0x9A, 0x2A, 0x6A, 0xA2, 0xA6, 0x8A, 0xAA, + /* Table set B, code table 3, wordlen 3 - 256 entries */ 0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51, 0x05, 0x45, 0x15, 0x55, 0x20, 0x95, 0x65, 0x49, 0x59, 0x52, 0x46, 0x16, 0x80, 0x90, 0x60, 0x84, 0x94, 0x24, 0x64, 0xA4, 0x08, 0x48, 0x18, 0x58, @@ -1341,14 +1312,8 @@ static const uint8_t huff_b33_xlat[256] = { 0x93, 0xD3, 0x23, 0x63, 0xA3, 0xE3, 0x73, 0xB3, 0xF3, 0x07, 0x47, 0x87, 0xC7, 0x27, 0x37, 0x4B, 0x8B, 0xCB, 0x1B, 0x2B, 0x3B, 0x4F, 0x8F, 0xCF, 0x1F, 0x70, 0xB0, 0xF0, 0x8C, 0xCC, 0x2C, 0x3C, 0xC2, 0x32, 0xC3, 0x0F, - 0x2F, 0x3F, 0x33, 0x0B -}; - -static const uint8_t huff_b35_cb[14] = { - 1, 12, 1, 0, 0, 0, 4, 6, 6, 14, 42, 63, 59, 30 -}; - -static const uint8_t huff_b35_xlat[225] = { + 0x2F, 0x3F, 0x33, 0x0B, + /* Table set B, code table 3, wordlen 5 - 225 entries */ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x02, 0x0E, 0x1F, 0xFF, 0x20, 0xE0, 0x21, 0xF2, 0xFE, 0xEF, 0x30, 0xD0, 0xE1, 0x12, 0x22, 0xE2, 0x03, 0x0D, 0x1D, 0x1E, 0x2E, 0xEE, 0x2F, 0xDF, 0x40, 0x60, 0x70, 0x90, 0xA0, @@ -1367,107 +1332,62 @@ static const uint8_t huff_b35_xlat[225] = { 0xDB, 0xEB, 0x3C, 0x6C, 0x9C, 0xAC, 0xCC, 0xDC, 0x5D, 0x9D, 0xAD, 0xBD, 0xCD, 0xBE, 0xBF, 0x53, 0x54, 0xB4, 0xC4, 0x45, 0x55, 0xB5, 0xC5, 0xD5, 0x56, 0x67, 0x77, 0x97, 0x49, 0x69, 0x79, 0x99, 0x5A, 0x7A, 0x9A, 0xAA, - 0xBA, 0x4B, 0x5B, 0x7B, 0xBB, 0xCB, 0x4C, 0x5C, 0xBC -}; - -static const uint8_t huff_b37_cb[13] = { - 1, 11, 1, 0, 2, 0, 2, 2, 6, 17, 14, 13, 6 -}; - -static const uint8_t huff_b37_xlat[63] = { - 0, 1, 63, 2, 62, 3, 61, 4, 5, 6, 58, 59, 60, 7, 8, 9, - 10, 25, 26, 27, 28, 29, 34, 35, 37, 38, 39, 55, 56, 57, 11, 13, - 14, 15, 30, 31, 33, 36, 49, 50, 51, 52, 53, 54, 12, 16, 17, 18, - 19, 21, 41, 43, 44, 45, 46, 47, 48, 20, 22, 23, 24, 40, 42 -}; - -static const uint8_t huff_b41_cb[14] = { - 1, 12, 1, 0, 0, 1, 7, 0, 20, 4, 10, 24, 2, 12 -}; - -static const uint8_t huff_b41_xlat[81] = { + 0xBA, 0x4B, 0x5B, 0x7B, 0xBB, 0xCB, 0x4C, 0x5C, 0xBC, + /* Table set B, code table 3, wordlen 7 - 63 entries */ + 0x00, 0x01, 0x3F, 0x02, 0x3E, 0x03, 0x3D, 0x04, 0x05, 0x06, 0x3A, 0x3B, + 0x3C, 0x07, 0x08, 0x09, 0x0A, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x22, 0x23, + 0x25, 0x26, 0x27, 0x37, 0x38, 0x39, 0x0B, 0x0D, 0x0E, 0x0F, 0x1E, 0x1F, + 0x21, 0x24, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x0C, 0x10, 0x11, 0x12, + 0x13, 0x15, 0x29, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x14, 0x16, 0x17, + 0x18, 0x28, 0x2A, + /* Table set B, code table 4, wordlen 1 - 81 entries */ 0x00, 0x01, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x03, 0x50, 0xD0, 0x70, 0xF0, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0xC1, 0x11, 0x31, 0x05, 0x0D, 0xC3, 0x13, 0x33, 0x07, 0x0F, 0x44, 0xCC, 0x41, 0x43, 0x54, 0x74, 0xDC, 0xFC, 0x71, 0x15, 0x4D, 0x1D, 0x37, 0x3F, 0xD4, 0xF4, 0x5C, 0x7C, 0x51, 0xD1, 0xF1, 0x45, 0xC5, 0x35, 0xCD, 0xDD, 0x3D, 0x53, 0xD3, 0x73, 0xF3, 0x47, 0xC7, 0x17, 0x77, 0x4F, 0xCF, 0x1F, 0x55, 0xFF, 0xD5, 0x75, 0xF5, - 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F -}; - -static const uint8_t huff_b42_cb[11] = { 1, 9, 1, 0, 1, 3, 2, 3, 7, 4, 4 }; - -static const uint8_t huff_b42_xlat[25] = { + 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F, + /* Table set B, code table 4, wordlen 2 - 25 entries */ 0x00, 0x07, 0x08, 0x38, 0x01, 0x39, 0x0F, 0x10, 0x09, 0x3F, 0x30, 0x31, 0x02, 0x3A, 0x06, 0x0E, 0x17, 0x11, 0x0A, 0x3E, 0x37, 0x12, 0x32, 0x16, - 0x36 -}; - -static const uint8_t huff_b43_cb[10] = { 2, 9, 1, 1, 3, 4, 9, 15, 12, 4 }; - -static const uint8_t huff_b43_xlat[49] = { + 0x36, + /* Table set B, code table 4, wordlen 3 - 49 entries */ 0x00, 0x07, 0x08, 0x38, 0x01, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x30, 0x31, 0x02, 0x3A, 0x06, 0x0E, 0x17, 0x37, 0x18, 0x28, 0x11, 0x19, 0x29, 0x0A, 0x03, 0x0B, 0x3B, 0x05, 0x0D, 0x3D, 0x3E, 0x1F, 0x2F, 0x12, 0x1A, 0x2A, 0x32, 0x13, 0x33, 0x15, 0x35, 0x16, 0x1E, 0x2E, 0x36, 0x1B, 0x2B, 0x1D, - 0x2D -}; - -static const uint8_t huff_b47_cb[10] = { 2, 9, 1, 1, 3, 4, 6, 14, 22, 12 }; - -static const uint8_t huff_b47_xlat[63] = { - 0, 1, 2, 62, 63, 3, 4, 60, 61, 5, 6, 7, 57, 58, 59, 8, - 9, 10, 11, 12, 26, 27, 37, 38, 52, 53, 54, 55, 56, 13, 14, 15, - 16, 17, 18, 25, 28, 29, 30, 31, 33, 34, 35, 36, 39, 46, 47, 48, - 49, 50, 51, 19, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44, 45 -}; - -static const uint8_t huff_b52_cb[11] = { 1, 9, 1, 0, 1, 3, 2, 3, 7, 4, 4 }; - -static const uint8_t huff_b52_xlat[25] = { + 0x2D, + /* Table set B, code table 4, wordlen 7 - 63 entries */ + 0x00, 0x01, 0x02, 0x3E, 0x3F, 0x03, 0x04, 0x3C, 0x3D, 0x05, 0x06, 0x07, + 0x39, 0x3A, 0x3B, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x1A, 0x1B, 0x25, 0x26, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x19, + 0x1C, 0x1D, 0x1E, 0x1F, 0x21, 0x22, 0x23, 0x24, 0x27, 0x2E, 0x2F, 0x30, + 0x31, 0x32, 0x33, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x28, 0x29, 0x2A, + 0x2B, 0x2C, 0x2D, + /* Table set B, code table 5, wordlen 2 - 25 entries */ 0x00, 0x01, 0x08, 0x38, 0x07, 0x39, 0x0F, 0x30, 0x09, 0x3F, 0x10, 0x31, 0x02, 0x3A, 0x06, 0x0E, 0x17, 0x11, 0x0A, 0x3E, 0x37, 0x12, 0x32, 0x16, - 0x36 -}; - -static const uint8_t huff_b53_cb[7] = { 1, 5, 1, 1, 1, 0, 4 }; // same as b63!!! - -static const uint8_t huff_b53_xlat[7] = { 0, 7, 1, 2, 3, 5, 6 }; - -static const uint8_t huff_b56_cb[11] = { 1, 9, 1, 0, 2, 0, 2, 4, 11, 9, 2 }; - -static const uint8_t huff_b56_xlat[31] = { - 0, 1, 31, 2, 30, 3, 4, 13, 29, 5, 6, 7, 14, 15, 17, 18, - 19, 26, 27, 28, 8, 9, 12, 20, 21, 22, 23, 24, 25, 10, 11 -}; - -static const uint8_t huff_b62_cb[14] = { - 1, 12, 1, 0, 0, 2, 3, 5, 12, 14, 18, 15, 9, 2 -}; - -static const uint8_t huff_b62_xlat[81] = { + 0x36, + /* Table set B, code table 5, wordlen 3 - 7 entries */ + 0x00, 0x07, 0x01, 0x02, 0x03, 0x05, 0x06, + /* Table set B, code table 5, wordlen 6 - 31 entries */ + 0x00, 0x01, 0x1F, 0x02, 0x1E, 0x03, 0x04, 0x0D, 0x1D, 0x05, 0x06, 0x07, + 0x0E, 0x0F, 0x11, 0x12, 0x13, 0x1A, 0x1B, 0x1C, 0x08, 0x09, 0x0C, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x0A, 0x0B, + /* Table set B, code table 6, wordlen 2 - 81 entries */ 0x00, 0x40, 0x01, 0x10, 0x04, 0x02, 0x80, 0x50, 0x90, 0x05, 0x06, 0x20, 0x60, 0x44, 0x14, 0x54, 0x24, 0x08, 0x18, 0x41, 0x11, 0x15, 0x09, 0xA0, 0x84, 0x94, 0x64, 0xA4, 0x28, 0x51, 0x45, 0x55, 0x19, 0x12, 0x16, 0x0A, 0x1A, 0x48, 0x58, 0x68, 0x81, 0x91, 0x21, 0x61, 0x85, 0x95, 0x25, 0x65, 0x49, 0x59, 0x29, 0x69, 0x42, 0x46, 0x56, 0x88, 0x98, 0xA8, 0xA1, 0xA5, 0x99, 0xA9, 0x52, 0x22, 0x26, 0x66, 0x4A, 0x5A, 0x2A, 0x6A, 0x89, 0x82, - 0x92, 0x62, 0x86, 0x96, 0xA6, 0x8A, 0xAA, 0xA2, 0x9A -}; - -static const uint8_t huff_b63_cb[7] = { 1, 5, 1, 1, 1, 0, 4 }; - -static const uint8_t huff_b63_xlat[7] = { 0, 1, 7, 2, 3, 5, 6 }; - -static const uint8_t huff_b64_cb[7] = { 1, 5, 1, 1, 1, 1, 2 }; - -static const uint8_t huff_b64_xlat[6] = { 1, 0, 2, 5, 3, 4 }; - -static const uint8_t huff_b65_cb[14] = { - 1, 12, 1, 0, 0, 2, 2, 2, 6, 12, 34, 92, 54, 20 -}; - -static const uint8_t huff_b65_xlat[225] = { + 0x92, 0x62, 0x86, 0x96, 0xA6, 0x8A, 0xAA, 0xA2, 0x9A, + /* Table set B, code table 6, wordlen 3 - 7 entries */ + 0x00, 0x01, 0x07, 0x02, 0x03, 0x05, 0x06, + /* Table set B, code table 6, wordlen 4 - 6 entries */ + 0x01, 0x00, 0x02, 0x05, 0x03, 0x04, + /* Table set B, code table 6, wordlen 5 - 225 entries */ 0x00, 0xF0, 0x01, 0x10, 0x0F, 0x11, 0xF1, 0x20, 0xE0, 0x02, 0x0E, 0x1F, 0xFF, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x07, 0x0A, 0x0D, 0x1E, 0xFE, 0x2F, 0xEF, 0x30, 0x70, 0x90, 0xA0, 0xC0, 0x71, 0x91, 0xC1, 0xD1, 0x32, 0x92, @@ -1486,14 +1406,8 @@ static const uint8_t huff_b65_xlat[225] = { 0xAA, 0xBA, 0x2B, 0x4B, 0x7B, 0x9B, 0xAB, 0xDB, 0x3C, 0x4C, 0x7C, 0x9C, 0xAC, 0xBC, 0xCC, 0x3D, 0x5D, 0x7D, 0xBD, 0xCD, 0x5E, 0xBE, 0xDE, 0xBF, 0xCF, 0x53, 0x64, 0xB4, 0xC4, 0x35, 0x55, 0xC5, 0xD5, 0x97, 0xB7, 0xC7, - 0x79, 0x99, 0x5B, 0xBB, 0xCB, 0x5C, 0xDC, 0x7F, 0xAF -}; - -static const uint8_t huff_b66_cb[14] = { - 1, 12, 1, 0, 0, 3, 0, 3, 3, 10, 40, 85, 61, 50 -}; - -static const uint8_t huff_b66_xlat[256] = { + 0x79, 0x99, 0x5B, 0xBB, 0xCB, 0x5C, 0xDC, 0x7F, 0xAF, + /* Table set B, code table 6, wordlen 6 - 256 entries */ 0x00, 0x10, 0x01, 0x11, 0x21, 0x02, 0x12, 0x20, 0x22, 0x13, 0x30, 0x31, 0x41, 0xD1, 0xE1, 0x32, 0x52, 0x03, 0x23, 0x2D, 0x40, 0x50, 0x60, 0x80, 0xD0, 0xE0, 0x51, 0x61, 0xF1, 0x42, 0x62, 0xD2, 0xE2, 0xF2, 0x33, 0x43, @@ -1515,37 +1429,23 @@ static const uint8_t huff_b66_xlat[256] = { 0x47, 0x87, 0xB7, 0xC7, 0x58, 0x68, 0x78, 0xA8, 0xB8, 0xC8, 0x39, 0x69, 0x89, 0xA9, 0xB9, 0xC9, 0xD9, 0x2A, 0x5A, 0x6A, 0x7A, 0x9A, 0xAA, 0x3B, 0x4B, 0x5B, 0x6B, 0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0x6C, 0x9C, 0xDC, 0xFC, - 0xCD, 0xED, 0xAE, 0xDE -}; - -static const uint8_t huff_b67_cb[10] = { 2, 9, 1, 2, 1, 4, 7, 10, 26, 12 }; - -static const uint8_t huff_b67_xlat[63] = { - 0, 1, 63, 62, 2, 3, 60, 61, 4, 5, 6, 7, 57, 58, 59, 8, - 9, 10, 11, 12, 52, 53, 54, 55, 56, 13, 14, 15, 16, 17, 18, 25, - 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 46, 47, 48, - 49, 50, 51, 19, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44, 45 -}; - -static const uint8_t huff_b71_cb[14] = { - 1, 12, 1, 0, 0, 1, 7, 0, 19, 5, 13, 23, 0, 12 -}; - -static const uint8_t huff_b71_xlat[81] = { + 0xCD, 0xED, 0xAE, 0xDE, + /* Table set B, code table 6, wordlen 7 - 63 entries */ + 0x00, 0x01, 0x3F, 0x3E, 0x02, 0x03, 0x3C, 0x3D, 0x04, 0x05, 0x06, 0x07, + 0x39, 0x3A, 0x3B, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, + 0x1E, 0x1F, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x2E, 0x2F, 0x30, + 0x31, 0x32, 0x33, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x28, 0x29, 0x2A, + 0x2B, 0x2C, 0x2D, + /* Table set B, code table 7, wordlen 1 - 81 entries */ 0x00, 0x03, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x50, 0xD0, 0x70, 0xF0, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0xC1, 0x11, 0x31, 0x05, 0x0D, 0x13, 0x33, 0x07, 0x0F, 0x44, 0xCC, 0x41, 0x43, 0xC3, 0x54, 0x74, 0xDC, 0xFC, 0xF1, 0xC5, 0x15, 0x1D, 0x53, 0xC7, 0x37, 0x4F, 0x3F, 0xD4, 0xF4, 0x5C, 0x7C, 0x51, 0xD1, 0x71, 0x45, 0x55, 0x35, 0x4D, 0xCD, 0xDD, 0x3D, 0xD3, 0x73, 0xF3, 0x47, 0x17, 0x77, 0xCF, 0x1F, 0xFF, 0xD5, 0x75, 0xF5, - 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F -}; - -static const uint8_t huff_b73_cb[13] = { - 1, 11, 1, 0, 0, 0, 1, 4, 9, 4, 103, 110, 24 -}; - -static const uint8_t huff_b73_xlat[256] = { + 0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F, + /* Table set B, code table 7, wordlen 3 - 256 entries */ 0x00, 0x40, 0x10, 0x04, 0x01, 0x05, 0x50, 0x14, 0x54, 0x41, 0x11, 0x51, 0x45, 0x15, 0x55, 0x44, 0x95, 0x6A, 0x03, 0x80, 0xC0, 0x90, 0xD0, 0x94, 0xD4, 0x24, 0x64, 0x58, 0x91, 0xA1, 0x85, 0xD5, 0x25, 0x65, 0xA5, 0xE5, @@ -1567,20 +1467,10 @@ static const uint8_t huff_b73_xlat[256] = { 0x27, 0x37, 0x0B, 0x4B, 0x8B, 0xCB, 0x1B, 0x2B, 0x3B, 0x0F, 0x4F, 0x8F, 0xCF, 0x1F, 0x2F, 0x3F, 0xA0, 0xE0, 0x30, 0x34, 0x48, 0xC8, 0x28, 0x38, 0x0C, 0x4C, 0x8C, 0xCC, 0x2C, 0xC1, 0x31, 0x82, 0xC2, 0x12, 0x32, 0x43, - 0x83, 0xC3, 0x23, 0x33 -}; - -static const uint8_t huff_b74_cb[8] = { 1, 6, 1, 0, 2, 2, 2, 4 }; - -static const uint8_t huff_b74_xlat[11] = { - 0, 1, 15, 2, 14, 5, 13, 3, 4, 11, 12 -}; - -static const uint8_t huff_b75_cb[13] = { - 2, 12, 1, 4, 0, 0, 0, 8, 11, 24, 53, 64, 60 -}; - -static const uint8_t huff_b75_xlat[225] = { + 0x83, 0xC3, 0x23, 0x33, + /* Table set B, code table 7, wordlen 4 - 11 entries */ + 0x00, 0x01, 0x0F, 0x02, 0x0E, 0x05, 0x0D, 0x03, 0x04, 0x0B, 0x0C, + /* Table set B, code table 7, wordlen 5 - 225 entries */ 0x00, 0x10, 0xF0, 0x01, 0x0F, 0x20, 0xE0, 0x11, 0xF1, 0x02, 0x0E, 0x1F, 0xFF, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x0D, 0x1E, 0xFE, 0x2F, 0xEF, 0x30, 0x40, 0x60, 0x70, 0x90, 0xA0, 0xC0, 0x31, 0xD1, 0x22, 0xE2, 0x13, @@ -1599,18 +1489,92 @@ static const uint8_t huff_b75_xlat[225] = { 0xD5, 0x46, 0x56, 0x66, 0x76, 0x96, 0xA6, 0xB6, 0xC6, 0x57, 0x67, 0x77, 0x97, 0xA7, 0xB7, 0x49, 0x69, 0x79, 0x99, 0xA9, 0x4A, 0x5A, 0x7A, 0x9A, 0xAA, 0xBA, 0xCA, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0xBB, 0xCB, 0xDB, 0x3C, - 0x4C, 0x5C, 0xBC, 0xCC, 0xDC, 0x5D, 0xCD, 0xBE, 0xBF -}; - -static const uint8_t huff_b77_cb[12] = { - 2, 11, 1, 0, 4, 6, 10, 12, 7, 15, 4, 4 -}; - -static const uint8_t huff_b77_xlat[63] = { - 0, 1, 2, 62, 63, 3, 4, 5, 59, 60, 61, 6, 7, 8, 9, 10, - 54, 55, 56, 57, 58, 11, 12, 13, 14, 15, 16, 47, 49, 50, 51, 52, - 53, 17, 18, 19, 20, 45, 46, 48, 21, 22, 23, 24, 25, 26, 27, 37, - 38, 39, 40, 41, 42, 43, 44, 28, 29, 30, 35, 31, 33, 34, 36 + 0x4C, 0x5C, 0xBC, 0xCC, 0xDC, 0x5D, 0xCD, 0xBE, 0xBF, + /* Table set B, code table 7, wordlen 7 - 63 entries */ + 0x00, 0x01, 0x02, 0x3E, 0x3F, 0x03, 0x04, 0x05, 0x3B, 0x3C, 0x3D, 0x06, + 0x07, 0x08, 0x09, 0x0A, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x0B, 0x0C, 0x0D, + 0x0E, 0x0F, 0x10, 0x2F, 0x31, 0x32, 0x33, 0x34, 0x35, 0x11, 0x12, 0x13, + 0x14, 0x2D, 0x2E, 0x30, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x25, + 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x1C, 0x1D, 0x1E, 0x23, 0x1F, + 0x21, 0x22, 0x24, + /* Table set B, code table 7, wordlen 7 - 8 entries */ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + /* Table set B, code table 7, wordlen 7 - 8 entries */ + 0x00, 0x01, 0x07, 0x02, 0x06, 0x03, 0x04, 0x05, + /* Table set B, code table 7, wordlen 7 - 16 entries */ + 0x07, 0x05, 0x08, 0x06, 0x09, 0x04, 0x0A, 0x0B, 0x00, 0x01, 0x02, 0x03, + 0x0C, 0x0D, 0x0E, 0x0F, + /* Table set B, code table 7, wordlen 7 - 15 entries */ + 0x0F, 0x0E, 0x01, 0x0D, 0x02, 0x03, 0x0C, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0A, 0x0B, + /* Table set B, code table 7, wordlen 7 - 16 entries */ + 0x00, 0x01, 0x0E, 0x0F, 0x02, 0x0D, 0x03, 0x0C, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, + /* Table set B, code table 7, wordlen 7 - 16 entries */ + 0x00, 0x01, 0x0F, 0x0E, 0x02, 0x0D, 0x03, 0x0C, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, + /* Table set B, code table 7, wordlen 7 - 32 entries */ + 0x00, 0x01, 0x1F, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x1A, 0x1B, 0x1C, + 0x1D, 0x1E, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, + 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, + /* Table set B, code table 7, wordlen 7 - 31 entries */ + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, + 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + /* Table set B, code table 7, wordlen 7 - 32 entries */ + 0x00, 0x1C, 0x1D, 0x01, 0x02, 0x03, 0x04, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, + 0x1E, 0x1F, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, + /* Table set B, code table 7, wordlen 7 - 31 entries */ + 0x02, 0x03, 0x04, 0x05, 0x06, 0x01, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, + 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + /* Table set B, code table 7, wordlen 7 - 32 entries */ + 0x00, 0x01, 0x02, 0x1F, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x1D, 0x1E, + 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, + /* Table set B, code table 7, wordlen 7 - 16 entries */ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, + 0x0C, 0x0D, 0x0E, 0x0F, + /* Table set B, code table 7, wordlen 7 - 8 entries */ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + /* Table set B, code table 7, wordlen 7 - 8 entries */ + 0x00, 0x01, 0x07, 0x02, 0x03, 0x04, 0x05, 0x06, + /* Table set B, code table 7, wordlen 7 - 32 entries */ + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x05, 0x06, + 0x07, 0x12, 0x13, 0x14, 0x15, 0x16, 0x04, 0x17, 0x18, 0x19, 0x1A, 0x1B, + 0x00, 0x01, 0x02, 0x03, 0x1C, 0x1D, 0x1E, 0x1F, + /* Table set B, code table 7, wordlen 7 - 32 entries */ + 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x0E, + 0x0F, 0x10, 0x11, 0x1D, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x1E, 0x04, 0x05, + 0x06, 0x07, 0x08, 0x1F, 0x00, 0x01, 0x02, 0x03, + /* Table set B, code table 7, wordlen 7 - 32 entries */ + 0x00, 0x01, 0x02, 0x1F, 0x03, 0x1D, 0x1E, 0x04, 0x05, 0x06, 0x1B, 0x1C, + 0x07, 0x18, 0x19, 0x1A, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + /* Table set B, code table 7, wordlen 7 - 256 entries */ + 0x00, 0x01, 0xFF, 0x02, 0xFE, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0xFB, + 0xFC, 0xFD, 0x09, 0x0A, 0x0B, 0x0C, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0x0D, + 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, + 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, + 0x26, 0xF3, 0xF4, 0xF5, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, + 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, + 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, + 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, + 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0xC2, + 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, + 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, + 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, + 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, + 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, + 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0x80, 0x81, + 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, + 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, + 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, + 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, + 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, + 0xBE, 0xBF, 0xC0, 0xC1, }; /** Tables for spectrum coding. */ @@ -1622,155 +1586,154 @@ typedef struct Atrac3pSpecCodeTab { int redirect; ///< if >= 0: tells which huffman table must be reused const uint8_t *cb; ///< pointer to the codebook descriptor - const uint8_t *xlat; ///< pointer to the translation table or NULL if none } Atrac3pSpecCodeTab; static const Atrac3pSpecCodeTab atrac3p_spectra_tabs[112] = { /* table set = A */ /* code table = 0 */ - { 1, 4, 2, 1, -1, huff_a01_cb, huff_a01_xlat }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_a02_cb, huff_a02_xlat }, // wordlen = 2 - { 1, 2, 3, 1, -1, huff_a03_cb, huff_a03_xlat }, // wordlen = 3 - { 1, 1, 3, 0, -1, huff_a04_cb, huff_a04_xlat }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_a05_cb, huff_a05_xlat }, // wordlen = 5 - { 1, 1, 4, 0, -1, huff_a06_cb, huff_a06_xlat }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a07_cb, huff_a07_xlat }, // wordlen = 7 + { 1, 4, 2, 1, -1, huff_a01_cb }, // wordlen = 1 + { 1, 4, 2, 0, -1, huff_a02_cb }, // wordlen = 2 + { 1, 2, 3, 1, -1, huff_a03_cb }, // wordlen = 3 + { 1, 1, 3, 0, -1, huff_a04_cb }, // wordlen = 4 + { 1, 2, 4, 1, -1, huff_a05_cb }, // wordlen = 5 + { 1, 1, 4, 0, -1, huff_a06_cb }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_a07_cb }, // wordlen = 7 /* code table = 1 */ - { 4, 4, 2, 1, -1, huff_a11_cb, huff_a11_xlat }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_a12_cb, huff_a12_xlat }, // wordlen = 2 - { 1, 2, 3, 1, -1, huff_a13_cb, huff_a13_xlat }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_a14_cb, huff_a14_xlat }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_a15_cb, huff_a15_xlat }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_a16_cb, huff_a16_xlat }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a17_cb, huff_a17_xlat }, // wordlen = 7 + { 4, 4, 2, 1, -1, huff_a11_cb }, // wordlen = 1 + { 1, 4, 2, 0, -1, huff_a12_cb }, // wordlen = 2 + { 1, 2, 3, 1, -1, huff_a13_cb }, // wordlen = 3 + { 1, 2, 4, 1, -1, huff_a14_cb }, // wordlen = 4 + { 1, 2, 4, 1, -1, huff_a15_cb }, // wordlen = 5 + { 1, 2, 4, 0, -1, huff_a16_cb }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_a17_cb }, // wordlen = 7 /* code table = 2 */ - { 1, 4, 2, 1, -1, huff_a21_cb, huff_a21_xlat }, // wordlen = 1 - { 1, 2, 3, 1, -1, huff_a22_cb, huff_a22_xlat }, // wordlen = 2 - { 1, 2, 3, 1, -1, huff_a23_cb, huff_a23_xlat }, // wordlen = 3 - { 1, 1, 3, 0, -1, huff_a24_cb, NULL }, // wordlen = 4 - { 1, 1, 3, 0, -1, huff_a25_cb, huff_a25_xlat }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_a26_cb, huff_a26_xlat }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a27_cb, huff_a27_xlat }, // wordlen = 7 + { 1, 4, 2, 1, -1, huff_a21_cb }, // wordlen = 1 + { 1, 2, 3, 1, -1, huff_a22_cb }, // wordlen = 2 + { 1, 2, 3, 1, -1, huff_a23_cb }, // wordlen = 3 + { 1, 1, 3, 0, -1, huff_a24_cb }, // wordlen = 4 + { 1, 1, 3, 0, -1, huff_a25_cb }, // wordlen = 5 + { 1, 2, 4, 0, -1, huff_a26_cb }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_a27_cb }, // wordlen = 7 /* code table = 3 */ - { 1, 2, 2, 1, -1, huff_a31_cb, huff_a31_xlat }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_a32_cb, huff_a32_xlat }, // wordlen = 2 - { 1, 4, 2, 0, -1, huff_a33_cb, huff_a33_xlat }, // wordlen = 3 - { 1, 1, 3, 0, -1, huff_a34_cb, huff_a34_xlat }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_a35_cb, huff_a35_xlat }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_a36_cb, huff_a36_xlat }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a37_cb, huff_a37_xlat }, // wordlen = 7 + { 1, 2, 2, 1, -1, huff_a31_cb }, // wordlen = 1 + { 1, 4, 2, 0, -1, huff_a32_cb }, // wordlen = 2 + { 1, 4, 2, 0, -1, huff_a33_cb }, // wordlen = 3 + { 1, 1, 3, 0, -1, huff_a34_cb }, // wordlen = 4 + { 1, 2, 4, 1, -1, huff_a35_cb }, // wordlen = 5 + { 1, 2, 4, 0, -1, huff_a36_cb }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_a37_cb }, // wordlen = 7 /* code table = 4 */ - { 1, 4, 2, 1, -1, huff_a41_cb, huff_a41_xlat }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_a42_cb, huff_a42_xlat }, // wordlen = 2 - { 1, 1, 3, 1, -1, huff_a43_cb, huff_a43_xlat }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_a44_cb, huff_a44_xlat }, // wordlen = 4 - { 1, 1, 3, 0, -1, huff_a45_cb, huff_a45_xlat }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_a46_cb, huff_a46_xlat }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a47_cb, huff_a47_xlat }, // wordlen = 7 + { 1, 4, 2, 1, -1, huff_a41_cb }, // wordlen = 1 + { 1, 4, 2, 0, -1, huff_a42_cb }, // wordlen = 2 + { 1, 1, 3, 1, -1, huff_a43_cb }, // wordlen = 3 + { 1, 2, 4, 1, -1, huff_a44_cb }, // wordlen = 4 + { 1, 1, 3, 0, -1, huff_a45_cb }, // wordlen = 5 + { 1, 2, 4, 0, -1, huff_a46_cb }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_a47_cb }, // wordlen = 7 /* code table = 5 */ - { 1, 4, 2, 1, -1, huff_a51_cb, huff_a51_xlat }, // wordlen = 1 - { 1, 2, 3, 1, -1, huff_a52_cb, huff_a52_xlat }, // wordlen = 2 - { 1, 1, 3, 1, -1, huff_a43_cb, huff_a53_xlat }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_a54_cb, huff_a54_xlat }, // wordlen = 4 - { 1, 1, 3, 0, -1, huff_a55_cb, huff_a55_xlat }, // wordlen = 5 - { 1, 1, 5, 1, -1, huff_a56_cb, huff_a56_xlat }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a57_cb, huff_a57_xlat }, // wordlen = 7 + { 1, 4, 2, 1, -1, huff_a51_cb }, // wordlen = 1 + { 1, 2, 3, 1, -1, huff_a52_cb }, // wordlen = 2 + { 1, 1, 3, 1, -1, huff_a43_cb }, // wordlen = 3 + { 1, 2, 4, 1, -1, huff_a54_cb }, // wordlen = 4 + { 1, 1, 3, 0, -1, huff_a55_cb }, // wordlen = 5 + { 1, 1, 5, 1, -1, huff_a56_cb }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_a57_cb }, // wordlen = 7 /* code table = 6 */ - { 2, 4, 2, 1, -1, huff_a61_cb, huff_a61_xlat }, // wordlen = 1 - { 1, 2, 3, 1, -1, huff_a62_cb, huff_a62_xlat }, // wordlen = 2 - { 1, 4, 2, 0, -1, huff_a63_cb, huff_a63_xlat }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_a64_cb, huff_a64_xlat }, // wordlen = 4 - { 1, 1, 4, 1, -1, huff_a65_cb, huff_a65_xlat }, // wordlen = 5 - { 1, 1, 5, 1, -1, huff_a66_cb, huff_a66_xlat }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a67_cb, huff_a67_xlat }, // wordlen = 7 + { 2, 4, 2, 1, -1, huff_a61_cb }, // wordlen = 1 + { 1, 2, 3, 1, -1, huff_a62_cb }, // wordlen = 2 + { 1, 4, 2, 0, -1, huff_a63_cb }, // wordlen = 3 + { 1, 2, 4, 1, -1, huff_a64_cb }, // wordlen = 4 + { 1, 1, 4, 1, -1, huff_a65_cb }, // wordlen = 5 + { 1, 1, 5, 1, -1, huff_a66_cb }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_a67_cb }, // wordlen = 7 /* code table = 7 */ - { 1, 2, 1, 0, -1, huff_a71_cb, NULL }, // wordlen = 1 - { 2, 4, 2, 0, -1, huff_a72_cb, huff_a72_xlat }, // wordlen = 2 - { 1, 2, 3, 1, -1, huff_a73_cb, huff_a73_xlat }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_a74_cb, huff_a74_xlat }, // wordlen = 4 - { 1, 1, 4, 1, -1, huff_a75_cb, huff_a75_xlat }, // wordlen = 5 - { 2, 2, 4, 0, -1, huff_a76_cb, huff_a76_xlat }, // wordlen = 6 - { 4, 1, 6, 1, 6, NULL, NULL }, // wordlen = 7 + { 1, 2, 1, 0, -1, huff_a71_cb }, // wordlen = 1 + { 2, 4, 2, 0, -1, huff_a72_cb }, // wordlen = 2 + { 1, 2, 3, 1, -1, huff_a73_cb }, // wordlen = 3 + { 1, 2, 4, 1, -1, huff_a74_cb }, // wordlen = 4 + { 1, 1, 4, 1, -1, huff_a75_cb }, // wordlen = 5 + { 2, 2, 4, 0, -1, huff_a76_cb }, // wordlen = 6 + { 4, 1, 6, 1, 6, NULL }, // wordlen = 7 /* table set = B */ /* code table = 0 */ - { 4, 4, 2, 1, -1, huff_b01_cb, huff_b01_xlat }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_b02_cb, huff_b02_xlat }, // wordlen = 2 - { 4, 2, 3, 1, -1, huff_b03_cb, huff_b03_xlat }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_b04_cb, huff_b04_xlat }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_b05_cb, huff_b05_xlat }, // wordlen = 5 - { 1, 1, 4, 0, 5, NULL, NULL }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_b07_cb, huff_b07_xlat }, // wordlen = 7 + { 4, 4, 2, 1, -1, huff_b01_cb }, // wordlen = 1 + { 1, 4, 2, 0, -1, huff_b02_cb }, // wordlen = 2 + { 4, 2, 3, 1, -1, huff_b03_cb }, // wordlen = 3 + { 1, 2, 4, 1, -1, huff_b04_cb }, // wordlen = 4 + { 1, 2, 4, 1, -1, huff_b05_cb }, // wordlen = 5 + { 1, 1, 4, 0, 5, NULL }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_b07_cb }, // wordlen = 7 /* code table = 1 */ - { 1, 4, 2, 1, 14, NULL, NULL }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_b12_cb, huff_b12_xlat }, // wordlen = 2 - { 1, 2, 3, 1, 9, NULL, NULL }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_b14_cb, huff_b14_xlat }, // wordlen = 4 - { 1, 2, 4, 1, 11, NULL, NULL }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_b16_cb, huff_b16_xlat }, // wordlen = 6 - { 1, 1, 6, 1, 6, NULL, NULL }, // wordlen = 7 + { 1, 4, 2, 1, 14, NULL }, // wordlen = 1 + { 1, 4, 2, 0, -1, huff_b12_cb }, // wordlen = 2 + { 1, 2, 3, 1, 9, NULL }, // wordlen = 3 + { 1, 2, 4, 1, -1, huff_b14_cb }, // wordlen = 4 + { 1, 2, 4, 1, 11, NULL }, // wordlen = 5 + { 1, 2, 4, 0, -1, huff_b16_cb }, // wordlen = 6 + { 1, 1, 6, 1, 6, NULL }, // wordlen = 7 /* code table = 2 */ - { 4, 4, 2, 1, 28, NULL, NULL }, // wordlen = 1 - { 4, 4, 2, 0, 22, NULL, NULL }, // wordlen = 2 - { 1, 2, 3, 1, 2, NULL, NULL }, // wordlen = 3 - { 1, 2, 4, 1, 31, NULL, NULL }, // wordlen = 4 - { 2, 2, 4, 1, 60, NULL, NULL }, // wordlen = 5 - { 2, 2, 4, 0, -1, huff_b26_cb, huff_b26_xlat }, // wordlen = 6 - { 4, 1, 6, 1, 6, NULL, NULL }, // wordlen = 7 + { 4, 4, 2, 1, 28, NULL }, // wordlen = 1 + { 4, 4, 2, 0, 22, NULL }, // wordlen = 2 + { 1, 2, 3, 1, 2, NULL }, // wordlen = 3 + { 1, 2, 4, 1, 31, NULL }, // wordlen = 4 + { 2, 2, 4, 1, 60, NULL }, // wordlen = 5 + { 2, 2, 4, 0, -1, huff_b26_cb }, // wordlen = 6 + { 4, 1, 6, 1, 6, NULL }, // wordlen = 7 /* code table = 3 */ - { 1, 4, 2, 1, 35, NULL, NULL }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_b32_cb, huff_b32_xlat }, // wordlen = 2 - { 1, 4, 2, 0, -1, huff_b33_cb, huff_b33_xlat }, // wordlen = 3 - { 2, 2, 4, 1, 59, NULL, NULL }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_b35_cb, huff_b35_xlat }, // wordlen = 5 - { 1, 2, 4, 0, 75, NULL, NULL }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_b37_cb, huff_b37_xlat }, // wordlen = 7 + { 1, 4, 2, 1, 35, NULL }, // wordlen = 1 + { 1, 4, 2, 0, -1, huff_b32_cb }, // wordlen = 2 + { 1, 4, 2, 0, -1, huff_b33_cb }, // wordlen = 3 + { 2, 2, 4, 1, 59, NULL }, // wordlen = 4 + { 1, 2, 4, 1, -1, huff_b35_cb }, // wordlen = 5 + { 1, 2, 4, 0, 75, NULL }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_b37_cb }, // wordlen = 7 /* code table = 4 */ - { 1, 4, 2, 1, -1, huff_b41_cb, huff_b41_xlat }, // wordlen = 1 - { 4, 2, 3, 1, -1, huff_b42_cb, huff_b42_xlat }, // wordlen = 2 - { 1, 2, 3, 1, -1, huff_b43_cb, huff_b43_xlat }, // wordlen = 3 - { 4, 2, 4, 1, 66, NULL, NULL }, // wordlen = 4 - { 1, 1, 3, 0, 32, NULL, NULL }, // wordlen = 5 - { 1, 2, 4, 0, 12, NULL, NULL }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_b47_cb, huff_b47_xlat }, // wordlen = 7 + { 1, 4, 2, 1, -1, huff_b41_cb }, // wordlen = 1 + { 4, 2, 3, 1, -1, huff_b42_cb }, // wordlen = 2 + { 1, 2, 3, 1, -1, huff_b43_cb }, // wordlen = 3 + { 4, 2, 4, 1, 66, NULL }, // wordlen = 4 + { 1, 1, 3, 0, 32, NULL }, // wordlen = 5 + { 1, 2, 4, 0, 12, NULL }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_b47_cb }, // wordlen = 7 /* code table = 5 */ - { 2, 4, 2, 1, 42, NULL, NULL }, // wordlen = 1 - { 1, 2, 3, 1, -1, huff_b52_cb, huff_b52_xlat }, // wordlen = 2 - { 4, 1, 3, 1, -1, huff_b53_cb, huff_b53_xlat }, // wordlen = 3 - { 1, 1, 3, 0, 17, NULL, NULL }, // wordlen = 4 - { 1, 1, 3, 0, 39, NULL, NULL }, // wordlen = 5 - { 1, 1, 5, 1, -1, huff_b56_cb, huff_b56_xlat }, // wordlen = 6 - { 2, 1, 6, 1, 62, NULL, NULL }, // wordlen = 7 + { 2, 4, 2, 1, 42, NULL }, // wordlen = 1 + { 1, 2, 3, 1, -1, huff_b52_cb }, // wordlen = 2 + { 4, 1, 3, 1, -1, huff_b53_cb }, // wordlen = 3 + { 1, 1, 3, 0, 17, NULL }, // wordlen = 4 + { 1, 1, 3, 0, 39, NULL }, // wordlen = 5 + { 1, 1, 5, 1, -1, huff_b56_cb }, // wordlen = 6 + { 2, 1, 6, 1, 62, NULL }, // wordlen = 7 /* code table = 6 */ - { 1, 4, 2, 1, 28, NULL, NULL }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_b62_cb, huff_b62_xlat }, // wordlen = 2 - { 1, 1, 3, 1, -1, huff_b63_cb, huff_b63_xlat }, // wordlen = 3 - { 1, 1, 3, 0, -1, huff_b64_cb, huff_b64_xlat }, // wordlen = 4 - { 4, 2, 4, 1, -1, huff_b65_cb, huff_b65_xlat }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_b66_cb, huff_b66_xlat }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_b67_cb, huff_b67_xlat }, // wordlen = 7 + { 1, 4, 2, 1, 28, NULL }, // wordlen = 1 + { 1, 4, 2, 0, -1, huff_b62_cb }, // wordlen = 2 + { 1, 1, 3, 1, -1, huff_b63_cb }, // wordlen = 3 + { 1, 1, 3, 0, -1, huff_b64_cb }, // wordlen = 4 + { 4, 2, 4, 1, -1, huff_b65_cb }, // wordlen = 5 + { 1, 2, 4, 0, -1, huff_b66_cb }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_b67_cb }, // wordlen = 7 /* code table = 7 */ - { 1, 4, 2, 1, -1, huff_b71_cb, huff_b71_xlat }, // wordlen = 1 - { 4, 4, 2, 0, 78, NULL, NULL }, // wordlen = 2 - { 4, 4, 2, 0, -1, huff_b73_cb, huff_b73_xlat }, // wordlen = 3 - { 1, 1, 4, 1, -1, huff_b74_cb, huff_b74_xlat }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_b75_cb, huff_b75_xlat }, // wordlen = 5 - { 1, 1, 5, 1, 47, NULL, NULL }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_b77_cb, huff_b77_xlat }, // wordlen = 7 + { 1, 4, 2, 1, -1, huff_b71_cb }, // wordlen = 1 + { 4, 4, 2, 0, 78, NULL }, // wordlen = 2 + { 4, 4, 2, 0, -1, huff_b73_cb }, // wordlen = 3 + { 1, 1, 4, 1, -1, huff_b74_cb }, // wordlen = 4 + { 1, 2, 4, 1, -1, huff_b75_cb }, // wordlen = 5 + { 1, 1, 5, 1, 47, NULL }, // wordlen = 6 + { 1, 1, 6, 1, -1, huff_b77_cb }, // wordlen = 7 }; /* Huffman tables for gain control data. */ @@ -1778,113 +1741,112 @@ static const uint8_t atrac3p_huff_gain_npoints1_cb[9] = { 1, 7, 1, 1, 1, 1, 1, 1, 2 }; -static const uint8_t atrac3p_huff_gain_npoints2_xlat[8] = { - 0, 1, 7, 2, 6, 3, 4, 5 -}; - static const uint8_t atrac3p_huff_gain_lev1_cb[9] = { 1, 7, 1, 0, 2, 2, 1, 2, 8 }; -static const uint8_t atrac3p_huff_gain_lev1_xlat[16] = { - 7, 5, 8, 6, 9, 4, 10, 11, 0, 1, 2, 3, 12, 13, 14, 15 -}; - static const uint8_t atrac3p_huff_gain_lev2_cb[11] = { 1, 9, 1, 1, 1, 1, 1, 0, 2, 0, 8 }; -static const uint8_t atrac3p_huff_gain_lev2_xlat[15] = { - 15, 14, 1, 13, 2, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11 -}; - static const uint8_t atrac3p_huff_gain_lev3_cb[11] = { 1, 9, 1, 0, 3, 1, 1, 0, 2, 0, 8 }; -static const uint8_t atrac3p_huff_gain_lev3_xlat[16] = { - 0, 1, 14, 15, 2, 13, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11 -}; - static const uint8_t atrac3p_huff_gain_lev4_cb[11] = { 1, 9, 1, 1, 1, 1, 1, 0, 1, 2, 8 }; -static const uint8_t atrac3p_huff_gain_lev4_xlat[16] = { - 0, 1, 15, 14, 2, 13, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11 -}; - static const uint8_t atrac3p_huff_gain_loc1_cb[9] = { 2, 8, 1, 2, 4, 4, 4, 0, 16 }; -static const uint8_t atrac3p_huff_gain_loc1_xlat[31] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 -}; static const uint8_t atrac3p_huff_gain_loc2_cb[8] = { 3, 8, 5, 3, 2, 3, 2, 16 }; -static const uint8_t atrac3p_huff_gain_loc2_xlat[31] = { - 2, 3, 4, 5, 6, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 -}; static const uint8_t atrac3p_huff_gain_loc3_cb[7] = { 2, 6, 1, 0, 2, 11, 18 }; -static const uint8_t atrac3p_huff_gain_loc3_xlat[32] = { - 0, 1, 31, 2, 3, 4, 5, 6, 7, 26, 27, 28, 29, 30, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 -}; static const uint8_t atrac3p_huff_gain_loc4_cb[5] = { 4, 6, 3, 23, 6 }; -static const uint8_t atrac3p_huff_gain_loc4_xlat[32] = { - 0, 28, 29, 1, 2, 3, 4, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 5, 6, 7, 8, 9, 10 -}; static const uint8_t atrac3p_huff_gain_loc5_cb[9] = { 1, 7, 1, 0, 0, 3, 2, 6, 20 }; -static const uint8_t atrac3p_huff_gain_loc5_xlat[32] = { - 0, 1, 2, 31, 3, 4, 5, 6, 7, 8, 29, 30, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 + +static const uint8_t atrac3p_gain_xlats[] = { + /* Number of gain control points 1 - 8 entries */ + 0, 1, 2, 3, 4, 5, 6, 7, + /* Number of gain control points 2 - 8 entries */ + 0, 1, 7, 2, 6, 3, 4, 5, + /* Gain compensation level 1 - 16 entries */ + 7, 5, 8, 6, 9, 4, 10, 11, 0, 1, 2, 3, 12, 13, 14, 15, + /* Gain compensation level 2 - 15 entries */ + 15, 14, 1, 13, 2, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11, + /* Gain compensation level 3 - 16 entries */ + 0, 1, 14, 15, 2, 13, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11, + /* Gain compensation level 4 - 16 entries */ + 0, 1, 15, 14, 2, 13, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11, + /* Gain compensation location 3 - 32 entries */ + 0, 1, 31, 2, 3, 4, 5, 6, 7, 26, 27, 28, 29, 30, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + /* Gain compensation location 1 - 31 entries */ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + /* Gain compensation location 4 - 32 entries */ + 0, 28, 29, 1, 2, 3, 4, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 30, 31, 5, 6, 7, 8, 9, 10, + /* Gain compensation location 2 - 31 entries */ + 2, 3, 4, 5, 6, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + /* Gain compensation location 5 - 32 entries */ + 0, 1, 2, 31, 3, 4, 5, 6, 7, 8, 29, 30, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, }; /* Huffman tables for GHA waves data. */ static const uint8_t atrac3p_huff_tonebands_cb[8] = { 1, 6, 1, 0, 1, 2, 4, 8 }; static const uint8_t atrac3p_huff_numwavs1_cb[9] = { 1, 7, 1, 1, 1, 1, 1, 1, 2 }; static const uint8_t atrac3p_huff_numwavs2_cb[8] = { 1, 6, 1, 1, 1, 1, 0, 4 }; -static const uint8_t atrac3p_huff_numwavs2_xlat[8] = { 0, 1, 7, 2, 3, 4, 5, 6 }; static const uint8_t atrac3p_huff_wav_ampsf1_cb[7] = { 4, 8, 10, 8, 6, 0, 8 }; -static const uint8_t atrac3p_huff_wav_ampsf1_xlat[32] = { - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 5, 6, 7, 18, 19, 20, - 21, 22, 4, 23, 24, 25, 26, 27, 0, 1, 2, 3, 28, 29, 30, 31 -}; static const uint8_t atrac3p_huff_wav_ampsf2_cb[7] = { 4, 8, 11, 5, 6, 6, 4 }; -static const uint8_t atrac3p_huff_wav_ampsf2_xlat[32] = { - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 14, 15, 16, 17, 29, - 9, 10, 11, 12, 13, 30, 4, 5, 6, 7, 8, 31, 0, 1, 2, 3 -}; static const uint8_t atrac3p_huff_wav_ampsf3_cb[9] = { 2, 8, 1, 3, 3, 1, 4, 4, 16 }; -static const uint8_t atrac3p_huff_wav_ampsf3_xlat[32] = { - 0, 1, 2, 31, 3, 29, 30, 4, 5, 6, 27, 28, 7, 24, 25, 26, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 -}; static const uint8_t atrac3p_huff_freq_cb[13] = { 1, 11, 1, 0, 0, 2, 2, 0, 9, 9, 29, 104, 100 }; -static const uint8_t atrac3p_huff_freq_xlat[256] = { - 0, 1, 255, 2, 254, 3, 4, 5, 6, 7, 8, 251, 252, 253, 9, 10, - 11, 12, 246, 247, 248, 249, 250, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 243, 244, 245, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193 +static const uint8_t atrac3p_tone_xlats[] = { + /* Number of tone bands - 16 entries */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, + /* Number of tones 1 - 8 entries */ + 0, 1, 2, 3, 4, 5, 6, 7, + /* Number of tones 2 - 8 entries */ + 0, 1, 7, 2, 3, 4, 5, 6, + /* Amplitude information 1 - 32 entries */ + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 5, 6, 7, 18, 19, + 20, 21, 22, 4, 23, 24, 25, 26, 27, 0, 1, 2, 3, 28, 29, + 30, 31, + /* Amplitude information 2 - 32 entries */ + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 14, 15, 16, 17, + 29, 9, 10, 11, 12, 13, 30, 4, 5, 6, 7, 8, 31, 0, 1, + 2, 3, + /* Amplitude information 3 - 32 entries */ + 0, 1, 2, 31, 3, 29, 30, 4, 5, 6, 27, 28, 7, 24, 25, + 26, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, + /* Frequencies - 256 entries */ + 0, 1, 255, 2, 254, 3, 4, 5, 6, 7, 8, 251, 252, 253, 9, + 10, 11, 12, 246, 247, 248, 249, 250, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 243, 244, 245, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, }; #endif /* AVCODEC_ATRAC3PLUS_DATA_H */ From patchwork Fri Nov 20 07:20:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23765 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 DEF5044AFE3 for ; Fri, 20 Nov 2020 09:26:06 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BC79768BBE4; Fri, 20 Nov 2020 09:26:06 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 265BF68BC0E for ; Fri, 20 Nov 2020 09:25:46 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id y4so8479211edy.5 for ; Thu, 19 Nov 2020 23:25:46 -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=oH8hYppm64DGNm3vSZRJ1vnZ4nFcxvBnzcHvMkU1BCA=; b=pb/R1dYkMJ4ryPQDIgfOwXppnozBUQHsa6TIuTEUvS6pE8cwwDz0YVSOZm/wXEocU6 wh5lQ0+CLdpTCtQF/9x3g/Kzxi0IjomvKgfka7FMcMURdhQ1nZxupdgYH2kLoli7NU9r eMbAJ/hGMc/onGaRK1XZFLacmog5E1FtuWj8U2XXAOY1kIH6DHjWZtQA4tZCXxHxGP0l ZKHW++u6K39NhAl8E//yp/1KpYLQiQGyrjN7W9LDaGbPJLq0GFUwV2S/7P+hyCIJ14l3 hwNFadEL1zZrItJzCOWEjr5EIavxzpKp3vR7/LXPjNTuV3zkq5FwWeQAIuUZdz7Yds63 eYgA== 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=oH8hYppm64DGNm3vSZRJ1vnZ4nFcxvBnzcHvMkU1BCA=; b=BzFxvX2n7ewTBD+gDaQ0U/KOD/X/GVNUNeQwdY3QxuZPk/fNV6Pgzlnsen07bCJzAj bzPxWl019tOrSWNwPTDHAKMJxSQ6pH54JUo75tt6H7QoN8iEXNAeXmdBdsv44PQsesYo j/2rSg+VUHkgiHGswGXL46OVyCoHIvxKjAew2hZ8/WDTVIFSbyltiIcIyK74zJmEyqf1 c4gyROZ9iVPDBggMwMLA6OuXsMazITOEkvRs4Ad+2EjS9WRMS4v5ERxGwAWJBrjF2XU3 PL8T/xSu6/fZ4UBxhZWtAVrxjsi4qcaAW9XeZjF3uhbs2xYT+WtJBfWJHv0aVBY+qfzI kAAw== X-Gm-Message-State: AOAM53381cnxJyDPPkdproQMGr/uaxTRikuHHtsWDRDOww39+W7OZl2s V13nX6IR1l57g9mhCTfQJSqPiL+IrMRhgg== X-Google-Smtp-Source: ABdhPJyvD7w/cvkKdRdS0sFhpoYru5U7r9cMBXirn/xg6ybv8rd174LTexuxf4jFezAt0qDN7UXf6A== X-Received: by 2002:aa7:d601:: with SMTP id c1mr33606207edr.323.1605857144422; Thu, 19 Nov 2020 23:25:44 -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.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:43 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:07 +0100 Message-Id: <20201120072116.818090-95-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 094/162] avcodec/atrac3plus: Combine codebooks into one array 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" ATRAC3+ uses VLCs whose code lengths are ascending from left to right in the tree; ergo it is possible (and done) to run-length encode the lengths into so-called codebooks. These codebooks were variable-sized: The first byte contained the minimum length of a code, the second the maximum length; this was followed by max - min + 1 bytes containing the actual numbers. The minimal min was 1, the maximal max 12. While one saves a few bytes by only containing the range that is actually used, this is more than offset by the fact that there needs to be a pointer to each of these codebooks. Furthermore, since 5f8de7b74147e2a347481d7bc900ebecba6f340f the content of the Atrac3pSpecCodeTab structure (containing data for spectrum decoding) can be cleanly separated into fields that are only used during initialization and fields used during actual decoding: The pointers to the codebooks and the field indicating whether an earlier codebook should be reused constitute the former category. Therefore the new codebooks are not placed into the Atrac3pSpecCodeTab (which is now unused during init), but in an array of its own. The information whether an earlier codebook should be reused is encoded in the first number of each spectrum codebook: If it is negative, an earlier codebook (given by the number) should be reused. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac3plus.c | 35 +- libavcodec/atrac3plus_data.h | 645 ++++++++++++++--------------------- 2 files changed, 257 insertions(+), 423 deletions(-) diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c index 81799f72cb..984b06fbe4 100644 --- a/libavcodec/atrac3plus.c +++ b/libavcodec/atrac3plus.c @@ -50,19 +50,18 @@ static VLC tone_vlc_tabs[7]; static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t **xlat, int *tab_offset, VLC *out_vlc) { - int i, b; + int i, max_len; uint8_t bits[256]; int index = 0; - int min_len = *cb++; // get shortest codeword length - int max_len = *cb++; // get longest codeword length - for (b = min_len; b <= max_len; b++) { + for (int b = 1; b <= 12; b++) { for (i = *cb++; i > 0; i--) { av_assert0(index < 256); bits[index] = b; index++; } } + max_len = bits[index - 1]; out_vlc->table = &tables_data[*tab_offset]; out_vlc->table_allocated = 1 << max_len; @@ -101,22 +100,6 @@ av_cold void ff_atrac3p_init_vlcs(void) atrac3p_sf_huff7, atrac3p_sf_huff8 }; - static const uint8_t * const gain_cbs[11] = { - atrac3p_huff_gain_npoints1_cb, atrac3p_huff_gain_npoints1_cb, - atrac3p_huff_gain_lev1_cb, atrac3p_huff_gain_lev2_cb, - atrac3p_huff_gain_lev3_cb, atrac3p_huff_gain_lev4_cb, - atrac3p_huff_gain_loc3_cb, atrac3p_huff_gain_loc1_cb, - atrac3p_huff_gain_loc4_cb, atrac3p_huff_gain_loc2_cb, - atrac3p_huff_gain_loc5_cb - }; - - static const uint8_t * const tone_cbs[7] = { - atrac3p_huff_tonebands_cb, atrac3p_huff_numwavs1_cb, - atrac3p_huff_numwavs2_cb, atrac3p_huff_wav_ampsf1_cb, - atrac3p_huff_wav_ampsf2_cb, atrac3p_huff_wav_ampsf3_cb, - atrac3p_huff_freq_cb - }; - for (int i = 0; i < 4; i++) { wl_vlc_tabs[i].table = &tables_data[tab_offset]; wl_vlc_tabs[i].table_allocated = 1 << wl_nb_bits[i]; @@ -148,22 +131,24 @@ av_cold void ff_atrac3p_init_vlcs(void) /* build huffman tables for spectrum decoding */ xlats = atrac3p_spectra_xlats; for (i = 0; i < 112; i++) { - if (atrac3p_spectra_tabs[i].redirect < 0) - build_canonical_huff(atrac3p_spectra_tabs[i].cb, + if (atrac3p_spectra_cbs[i][0] >= 0) + build_canonical_huff(atrac3p_spectra_cbs[i], &xlats, &tab_offset, &spec_vlc_tabs[i]); else /* Reuse already initialized VLC table */ - spec_vlc_tabs[i] = spec_vlc_tabs[atrac3p_spectra_tabs[i].redirect]; + spec_vlc_tabs[i] = spec_vlc_tabs[-atrac3p_spectra_cbs[i][0]]; } /* build huffman tables for gain data decoding */ xlats = atrac3p_gain_xlats; for (i = 0; i < 11; i++) - build_canonical_huff(gain_cbs[i], &xlats, &tab_offset, &gain_vlc_tabs[i]); + build_canonical_huff(atrac3p_gain_cbs[i], &xlats, + &tab_offset, &gain_vlc_tabs[i]); /* build huffman tables for tone decoding */ xlats = atrac3p_tone_xlats; for (i = 0; i < 7; i++) - build_canonical_huff(tone_cbs[i], &xlats, &tab_offset, &tone_vlc_tabs[i]); + build_canonical_huff(atrac3p_tone_cbs[i], &xlats, + &tab_offset, &tone_vlc_tabs[i]); } /** diff --git a/libavcodec/atrac3plus_data.h b/libavcodec/atrac3plus_data.h index 61f4b0a038..6b9109cb70 100644 --- a/libavcodec/atrac3plus_data.h +++ b/libavcodec/atrac3plus_data.h @@ -413,254 +413,122 @@ static const uint8_t atrac3p_ct_restricted_to_full[2][7][4] = { }; /** Tables for spectrum coding */ -static const uint8_t huff_a01_cb[14] = { - 1, 12, 1, 0, 0, 1, 7, 0, 19, 5, 13, 21, 6, 8 -}; - -static const uint8_t huff_a02_cb[13] = { - 2, 12, 1, 0, 4, 11, 0, 1, 29, 6, 20, 7, 2 -}; - -static const uint8_t huff_a03_cb[9] = { 3, 9, 1, 8, 0, 13, 18, 7, 2 }; - -static const uint8_t huff_a04_cb[4] = { 2, 3, 2, 4 }; - -static const uint8_t huff_a05_cb[12] = { - 3, 12, 1, 3, 5, 8, 12, 23, 72, 68, 31, 2 -}; - -static const uint8_t huff_a06_cb[7] = { - 2, 6, 1, 3, 2, 6, 4 -}; -static const uint8_t huff_a07_cb[11] = { - 2, 10, 1, 2, 2, 2, 6, 14, 21, 13, 2 -}; - -static const uint8_t huff_a11_cb[13] = { - 1, 11, 1, 0, 0, 0, 8, 1, 18, 9, 22, 10, 12 -}; - -static const uint8_t huff_a12_cb[8] = { 5, 10, 16, 11, 32, 19, 1, 2 }; - -static const uint8_t huff_a13_cb[12] = { - 1, 10, 1, 0, 0, 4, 2, 2, 9, 15, 12, 4 -}; - -static const uint8_t huff_a14_cb[12] = { - 2, 11, 1, 0, 4, 3, 5, 16, 28, 34, 26, 4 -}; - -static const uint8_t huff_a15_cb[9] = { 5, 11, 9, 12, 16, 44, 98, 42, 4 }; - -static const uint8_t huff_a16_cb[13] = { - 2, 12, 1, 1, 2, 2, 5, 7, 21, 54, 85, 62, 16 -}; - -static const uint8_t huff_a17_cb[9] = { 3, 9, 3, 2, 5, 7, 17, 23, 6 }; - -static const uint8_t huff_a21_cb[14] = { - 1, 12, 1, 0, 0, 2, 6, 0, 7, 21, 15, 17, 8, 4 -}; - -static const uint8_t huff_a22_cb[10] = { 2, 9, 1, 4, 0, 4, 3, 8, 3, 2 }; - -static const uint8_t huff_a23_cb[9] = { 3, 9, 5, 0, 4, 6, 10, 16, 8 }; - -static const uint8_t huff_a24_cb[5] = { 2, 4, 3, 1, 2 }; - -static const uint8_t huff_a25_cb[5] = { 2, 4, 1, 5, 2 }; - -static const uint8_t huff_a26_cb[10] = { 4, 11, 3, 4, 12, 15, 34, 83, 75, 30 }; - -static const uint8_t huff_a27_cb[7] = { 4, 8, 3, 14, 10, 20, 16 }; - -static const uint8_t huff_a31_cb[8] = { 1, 6, 1, 0, 3, 1, 0, 4 }; - -static const uint8_t huff_a32_cb[13] = { - 1, 11, 1, 0, 0, 2, 2, 6, 12, 18, 19, 15, 6 -}; - -static const uint8_t huff_a33_cb[12] = { - 3, 12, 1, 1, 13, 1, 14, 28, 33, 81, 32, 52 -}; - -static const uint8_t huff_a34_cb[7] = { 1, 5, 1, 1, 1, 1, 2 }; - -static const uint8_t huff_a35_cb[11] = { 2, 10, 1, 0, 2, 3, 6, 19, 9, 75, 110 }; - -static const uint8_t huff_a36_cb[12] = { - 3, 12, 1, 3, 5, 5, 13, 27, 69, 96, 35, 2 -}; - -static const uint8_t huff_a37_cb[7] = { 4, 8, 7, 6, 8, 22, 20 }; - -static const uint8_t huff_a41_cb[14] = { - 1, 12, 1, 0, 0, 6, 2, 0, 0, 0, 19, 9, 24, 20 -}; - -static const uint8_t huff_a42_cb[10] = { 3, 10, 1, 2, 13, 1, 31, 13, 16, 4 }; - -static const uint8_t huff_a43_cb[5] = { 2, 4, 2, 3, 2 }; - -static const uint8_t huff_a44_cb[9] = { 4, 10, 5, 4, 12, 17, 47, 24, 12 }; - -static const uint8_t huff_a45_cb[5] = { 2, 4, 2, 2, 4 }; - -static const uint8_t huff_a46_cb[7] = { 5, 9, 1, 16, 31, 36, 172 }; - -static const uint8_t huff_a47_cb[8] = { 4, 9, 5, 12, 9, 12, 15, 10 }; - -static const uint8_t huff_a51_cb[12] = { - 2, 11, 1, 0, 6, 2, 6, 18, 4, 26, 6, 12 -}; - -static const uint8_t huff_a52_cb[12] = { 1, 10, 1, 0, 2, 2, 0, 4, 3, 8, 3, 2 }; - -static const uint8_t huff_a54_cb[8] = { 4, 9, 4, 7, 12, 19, 21, 58 }; - -static const uint8_t huff_a55_cb[8] = { 1, 6, 1, 1, 1, 0, 3, 2 }; - -static const uint8_t huff_a56_cb[7] = { 3, 7, 1, 8, 6, 8, 8 }; - -static const uint8_t huff_a57_cb[9] = { 3, 9, 1, 5, 7, 8, 16, 22, 4 }; - -static const uint8_t huff_a61_cb[12] = { - 2, 11, 1, 0, 8, 0, 1, 16, 10, 29, 12, 4 -}; - -static const uint8_t huff_a62_cb[8] = { 3, 8, 5, 2, 2, 9, 5, 2 }; - -static const uint8_t huff_a63_cb[11] = { - 3, 11, 1, 1, 10, 4, 16, 29, 46, 75, 74 -}; - -static const uint8_t huff_a64_cb[8] = { 4, 9, 1, 7, 12, 36, 63, 2 }; - -static const uint8_t huff_a65_cb[8] = { 2, 7, 3, 0, 1, 3, 4, 4 }; - -static const uint8_t huff_a66_cb[11] = { 2, 10, 1, 2, 2, 6, 8, 6, 3, 1, 2 }; - -static const uint8_t huff_a67_cb[10] = { 2, 9, 1, 1, 3, 4, 6, 13, 25, 10 }; - -static const uint8_t huff_a71_cb[5] = { 1, 3, 1, 1, 2 }; - -static const uint8_t huff_a72_cb[12] = { - 2, 11, 1, 0, 4, 8, 3, 8, 24, 17, 12, 4 -}; - -static const uint8_t huff_a73_cb[11] = { 2, 10, 1, 1, 5, 2, 8, 7, 13, 8, 4 }; - -static const uint8_t huff_a74_cb[14] = { - 1, 12, 1, 0, 0, 4, 0, 4, 5, 9, 30, 45, 21, 2 -}; - -static const uint8_t huff_a75_cb[7] = { 2, 6, 1, 3, 3, 4, 4 }; - -static const uint8_t huff_a76_cb[12] = { - 3, 12, 1, 3, 4, 8, 10, 36, 60, 78, 48, 8 -}; - -static const uint8_t huff_b01_cb[14] = { - 1, 12, 1, 0, 0, 2, 6, 0, 11, 13, 12, 24, 4, 8 -}; - -static const uint8_t huff_b02_cb[14] = { - 1, 12, 1, 0, 0, 4, 0, 8, 4, 9, 19, 13, 13, 10 -}; - -static const uint8_t huff_b03_cb[11] = { 1, 9, 1, 0, 0, 4, 0, 5, 12, 13, 14 }; - -static const uint8_t huff_b04_cb[12] = { - 2, 11, 1, 0, 4, 4, 5, 9, 30, 45, 21, 2 -}; - -static const uint8_t huff_b05_cb[11] = { - 3, 11, 1, 4, 4, 4, 12, 30, 73, 75, 22 -}; - -static const uint8_t huff_b07_cb[9] = { 3, 9, 3, 2, 4, 8, 23, 13, 10 }; - -static const uint8_t huff_b12_cb[10] = { 3, 10, 1, 3, 12, 0, 30, 9, 18, 8 }; - -static const uint8_t huff_b14_cb[14] = { - 1, 12, 1, 0, 0, 4, 0, 3, 5, 16, 28, 34, 26, 4 -}; - -static const uint8_t huff_b16_cb[11] = { - 4, 12, 4, 4, 9, 13, 37, 76, 72, 39, 2 -}; - -static const uint8_t huff_b26_cb[12] = { - 3, 12, 2, 2, 4, 5, 11, 26, 67, 78, 51, 10 -}; - -static const uint8_t huff_b32_cb[12] = { - 2, 11, 1, 0, 4, 6, 7, 10, 22, 11, 16, 4 -}; - -static const uint8_t huff_b33_cb[13] = { - 2, 12, 1, 0, 0, 4, 11, 8, 28, 92, 97, 13, 2 -}; - -static const uint8_t huff_b35_cb[14] = { - 1, 12, 1, 0, 0, 0, 4, 6, 6, 14, 42, 63, 59, 30 -}; - -static const uint8_t huff_b37_cb[13] = { - 1, 11, 1, 0, 2, 0, 2, 2, 6, 17, 14, 13, 6 -}; - -static const uint8_t huff_b41_cb[14] = { - 1, 12, 1, 0, 0, 1, 7, 0, 20, 4, 10, 24, 2, 12 -}; - -static const uint8_t huff_b42_cb[11] = { 1, 9, 1, 0, 1, 3, 2, 3, 7, 4, 4 }; - -static const uint8_t huff_b43_cb[10] = { 2, 9, 1, 1, 3, 4, 9, 15, 12, 4 }; - -static const uint8_t huff_b47_cb[10] = { 2, 9, 1, 1, 3, 4, 6, 14, 22, 12 }; - -static const uint8_t huff_b52_cb[11] = { 1, 9, 1, 0, 1, 3, 2, 3, 7, 4, 4 }; - -static const uint8_t huff_b53_cb[7] = { 1, 5, 1, 1, 1, 0, 4 }; // same as b63!!! - -static const uint8_t huff_b56_cb[11] = { 1, 9, 1, 0, 2, 0, 2, 4, 11, 9, 2 }; - -static const uint8_t huff_b62_cb[14] = { - 1, 12, 1, 0, 0, 2, 3, 5, 12, 14, 18, 15, 9, 2 -}; - -static const uint8_t huff_b63_cb[7] = { 1, 5, 1, 1, 1, 0, 4 }; - -static const uint8_t huff_b64_cb[7] = { 1, 5, 1, 1, 1, 1, 2 }; - -static const uint8_t huff_b65_cb[14] = { - 1, 12, 1, 0, 0, 2, 2, 2, 6, 12, 34, 92, 54, 20 -}; - -static const uint8_t huff_b66_cb[14] = { - 1, 12, 1, 0, 0, 3, 0, 3, 3, 10, 40, 85, 61, 50 -}; - -static const uint8_t huff_b67_cb[10] = { 2, 9, 1, 2, 1, 4, 7, 10, 26, 12 }; - -static const uint8_t huff_b71_cb[14] = { - 1, 12, 1, 0, 0, 1, 7, 0, 19, 5, 13, 23, 0, 12 -}; - -static const uint8_t huff_b73_cb[13] = { - 1, 11, 1, 0, 0, 0, 1, 4, 9, 4, 103, 110, 24 -}; - -static const uint8_t huff_b74_cb[8] = { 1, 6, 1, 0, 2, 2, 2, 4 }; - -static const uint8_t huff_b75_cb[13] = { - 2, 12, 1, 4, 0, 0, 0, 8, 11, 24, 53, 64, 60 -}; - -static const uint8_t huff_b77_cb[12] = { - 2, 11, 1, 0, 4, 6, 10, 12, 7, 15, 4, 4 +/* If the first entry of a subtable is negative, it means + * that another VLC is to be reused. */ +static int8_t atrac3p_spectra_cbs[][12] = { + { 1, 0, 0, 1, 7, 0, 19, 5, 13, 21, 6, 8 }, + { 0, 1, 0, 4, 11, 0, 1, 29, 6, 20, 7, 2 }, + { 0, 0, 1, 8, 0, 13, 18, 7, 2, 0, 0, 0 }, + { 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, 3, 5, 8, 12, 23, 72, 68, 31, 2 }, + { 0, 1, 3, 2, 6, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 2, 2, 2, 6, 14, 21, 13, 2, 0, 0 }, + { 1, 0, 0, 0, 8, 1, 18, 9, 22, 10, 12, 0 }, + { 0, 0, 0, 0, 16, 11, 32, 19, 1, 2, 0, 0 }, + { 1, 0, 0, 4, 2, 2, 9, 15, 12, 4, 0, 0 }, + { 0, 1, 0, 4, 3, 5, 16, 28, 34, 26, 4, 0 }, + { 0, 0, 0, 0, 9, 12, 16, 44, 98, 42, 4, 0 }, + { 0, 1, 1, 2, 2, 5, 7, 21, 54, 85, 62, 16 }, + { 0, 0, 3, 2, 5, 7, 17, 23, 6, 0, 0, 0 }, + { 1, 0, 0, 2, 6, 0, 7, 21, 15, 17, 8, 4 }, + { 0, 1, 4, 0, 4, 3, 8, 3, 2, 0, 0, 0 }, + { 0, 0, 5, 0, 4, 6, 10, 16, 8, 0, 0, 0 }, + { 0, 3, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 3, 4, 12, 15, 34, 83, 75, 30, 0 }, + { 0, 0, 0, 3, 14, 10, 20, 16, 0, 0, 0, 0 }, + { 1, 0, 3, 1, 0, 4, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, 2, 2, 6, 12, 18, 19, 15, 6, 0 }, + { 0, 0, 1, 1, 13, 1, 14, 28, 33, 81, 32, 52 }, + { 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 0, 2, 3, 6, 19, 9, 75, 110, 0, 0 }, + { 0, 0, 1, 3, 5, 5, 13, 27, 69, 96, 35, 2 }, + { 0, 0, 0, 7, 6, 8, 22, 20, 0, 0, 0, 0 }, + { 1, 0, 0, 6, 2, 0, 0, 0, 19, 9, 24, 20 }, + { 0, 0, 1, 2, 13, 1, 31, 13, 16, 4, 0, 0 }, + { 0, 2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 5, 4, 12, 17, 47, 24, 12, 0, 0 }, + { 0, 2, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 16, 31, 36, 172, 0, 0, 0 }, + { 0, 0, 0, 5, 12, 9, 12, 15, 10, 0, 0, 0 }, + { 0, 1, 0, 6, 2, 6, 18, 4, 26, 6, 12, 0 }, + { 1, 0, 2, 2, 0, 4, 3, 8, 3, 2, 0, 0 }, + { 0, 2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 4, 7, 12, 19, 21, 58, 0, 0, 0 }, + { 1, 1, 1, 0, 3, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, 8, 6, 8, 8, 0, 0, 0, 0, 0 }, + { 0, 0, 1, 5, 7, 8, 16, 22, 4, 0, 0, 0 }, + { 0, 1, 0, 8, 0, 1, 16, 10, 29, 12, 4, 0 }, + { 0, 0, 5, 2, 2, 9, 5, 2, 0, 0, 0, 0 }, + { 0, 0, 1, 1, 10, 4, 16, 29, 46, 75, 74, 0 }, + { 0, 0, 0, 1, 7, 12, 36, 63, 2, 0, 0, 0 }, + { 0, 3, 0, 1, 3, 4, 4, 0, 0, 0, 0, 0 }, + { 0, 1, 2, 2, 6, 8, 6, 3, 1, 2, 0, 0 }, + { 0, 1, 1, 3, 4, 6, 13, 25, 10, 0, 0, 0 }, + { 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 0, 4, 8, 3, 8, 24, 17, 12, 4, 0 }, + { 0, 1, 1, 5, 2, 8, 7, 13, 8, 4, 0, 0 }, + { 1, 0, 0, 4, 0, 4, 5, 9, 30, 45, 21, 2 }, + { 0, 1, 3, 3, 4, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, 3, 4, 8, 10, 36, 60, 78, 48, 8 }, + { -6 }, + { 1, 0, 0, 2, 6, 0, 11, 13, 12, 24, 4, 8 }, + { 1, 0, 0, 4, 0, 8, 4, 9, 19, 13, 13, 10 }, + { 1, 0, 0, 4, 0, 5, 12, 13, 14, 0, 0, 0 }, + { 0, 1, 0, 4, 4, 5, 9, 30, 45, 21, 2, 0 }, + { 0, 0, 1, 4, 4, 4, 12, 30, 73, 75, 22, 0 }, + { -5 }, + { 0, 0, 3, 2, 4, 8, 23, 13, 10, 0, 0, 0 }, + { -14 }, + { 0, 0, 1, 3, 12, 0, 30, 9, 18, 8, 0, 0 }, + { -9 }, + { 1, 0, 0, 4, 0, 3, 5, 16, 28, 34, 26, 4 }, + { -11 }, + { 0, 0, 0, 4, 4, 9, 13, 37, 76, 72, 39, 2 }, + { -6 }, + { -28 }, + { -22 }, + { -2 }, + { -31 }, + { -60 }, + { 0, 0, 2, 2, 4, 5, 11, 26, 67, 78, 51, 10 }, + { -6 }, + { -35 }, + { 0, 1, 0, 4, 6, 7, 10, 22, 11, 16, 4, 0 }, + { 0, 1, 0, 0, 4, 11, 8, 28, 92, 97, 13, 2 }, + { -59 }, + { 1, 0, 0, 0, 4, 6, 6, 14, 42, 63, 59, 30 }, + { -75 }, + { 1, 0, 2, 0, 2, 2, 6, 17, 14, 13, 6, 0 }, + { 1, 0, 0, 1, 7, 0, 20, 4, 10, 24, 2, 12 }, + { 1, 0, 1, 3, 2, 3, 7, 4, 4, 0, 0, 0 }, + { 0, 1, 1, 3, 4, 9, 15, 12, 4, 0, 0, 0 }, + { -66 }, + { -32 }, + { -12 }, + { 0, 1, 1, 3, 4, 6, 14, 22, 12, 0, 0, 0 }, + { -42 }, + { 1, 0, 1, 3, 2, 3, 7, 4, 4, 0, 0, 0 }, + { 1, 1, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0 }, + { -17 }, + { -39 }, + { 1, 0, 2, 0, 2, 4, 11, 9, 2, 0, 0, 0 }, + { -62 }, + { -28 }, + { 1, 0, 0, 2, 3, 5, 12, 14, 18, 15, 9, 2 }, + { 1, 1, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, 2, 2, 2, 6, 12, 34, 92, 54, 20 }, + { 1, 0, 0, 3, 0, 3, 3, 10, 40, 85, 61, 50 }, + { 0, 1, 2, 1, 4, 7, 10, 26, 12, 0, 0, 0 }, + { 1, 0, 0, 1, 7, 0, 19, 5, 13, 23, 0, 12 }, + { -78 }, + { 1, 0, 0, 0, 1, 4, 9, 4, 103, 110, 24, 0 }, + { 1, 0, 2, 2, 2, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 4, 0, 0, 0, 8, 11, 24, 53, 64, 60 }, + { -47 }, + { 0, 1, 0, 4, 6, 10, 12, 7, 15, 4, 4, 0 }, }; static const uint8_t atrac3p_spectra_xlats[] = { @@ -1583,187 +1451,171 @@ typedef struct Atrac3pSpecCodeTab { uint8_t num_coeffs; ///< 1 - map index to a single value, > 1 - map index to a vector of values uint8_t bits; ///< number of bits a single coefficient occupy uint8_t is_signed; ///< 1 - values in that table are signed ones, otherwise - absolute ones - - int redirect; ///< if >= 0: tells which huffman table must be reused - const uint8_t *cb; ///< pointer to the codebook descriptor } Atrac3pSpecCodeTab; static const Atrac3pSpecCodeTab atrac3p_spectra_tabs[112] = { /* table set = A */ /* code table = 0 */ - { 1, 4, 2, 1, -1, huff_a01_cb }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_a02_cb }, // wordlen = 2 - { 1, 2, 3, 1, -1, huff_a03_cb }, // wordlen = 3 - { 1, 1, 3, 0, -1, huff_a04_cb }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_a05_cb }, // wordlen = 5 - { 1, 1, 4, 0, -1, huff_a06_cb }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a07_cb }, // wordlen = 7 + { 1, 4, 2, 1 }, // wordlen = 1 + { 1, 4, 2, 0 }, // wordlen = 2 + { 1, 2, 3, 1 }, // wordlen = 3 + { 1, 1, 3, 0 }, // wordlen = 4 + { 1, 2, 4, 1 }, // wordlen = 5 + { 1, 1, 4, 0 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 1 */ - { 4, 4, 2, 1, -1, huff_a11_cb }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_a12_cb }, // wordlen = 2 - { 1, 2, 3, 1, -1, huff_a13_cb }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_a14_cb }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_a15_cb }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_a16_cb }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a17_cb }, // wordlen = 7 + { 4, 4, 2, 1 }, // wordlen = 1 + { 1, 4, 2, 0 }, // wordlen = 2 + { 1, 2, 3, 1 }, // wordlen = 3 + { 1, 2, 4, 1 }, // wordlen = 4 + { 1, 2, 4, 1 }, // wordlen = 5 + { 1, 2, 4, 0 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 2 */ - { 1, 4, 2, 1, -1, huff_a21_cb }, // wordlen = 1 - { 1, 2, 3, 1, -1, huff_a22_cb }, // wordlen = 2 - { 1, 2, 3, 1, -1, huff_a23_cb }, // wordlen = 3 - { 1, 1, 3, 0, -1, huff_a24_cb }, // wordlen = 4 - { 1, 1, 3, 0, -1, huff_a25_cb }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_a26_cb }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a27_cb }, // wordlen = 7 + { 1, 4, 2, 1 }, // wordlen = 1 + { 1, 2, 3, 1 }, // wordlen = 2 + { 1, 2, 3, 1 }, // wordlen = 3 + { 1, 1, 3, 0 }, // wordlen = 4 + { 1, 1, 3, 0 }, // wordlen = 5 + { 1, 2, 4, 0 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 3 */ - { 1, 2, 2, 1, -1, huff_a31_cb }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_a32_cb }, // wordlen = 2 - { 1, 4, 2, 0, -1, huff_a33_cb }, // wordlen = 3 - { 1, 1, 3, 0, -1, huff_a34_cb }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_a35_cb }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_a36_cb }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a37_cb }, // wordlen = 7 + { 1, 2, 2, 1 }, // wordlen = 1 + { 1, 4, 2, 0 }, // wordlen = 2 + { 1, 4, 2, 0 }, // wordlen = 3 + { 1, 1, 3, 0 }, // wordlen = 4 + { 1, 2, 4, 1 }, // wordlen = 5 + { 1, 2, 4, 0 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 4 */ - { 1, 4, 2, 1, -1, huff_a41_cb }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_a42_cb }, // wordlen = 2 - { 1, 1, 3, 1, -1, huff_a43_cb }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_a44_cb }, // wordlen = 4 - { 1, 1, 3, 0, -1, huff_a45_cb }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_a46_cb }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a47_cb }, // wordlen = 7 + { 1, 4, 2, 1 }, // wordlen = 1 + { 1, 4, 2, 0 }, // wordlen = 2 + { 1, 1, 3, 1 }, // wordlen = 3 + { 1, 2, 4, 1 }, // wordlen = 4 + { 1, 1, 3, 0 }, // wordlen = 5 + { 1, 2, 4, 0 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 5 */ - { 1, 4, 2, 1, -1, huff_a51_cb }, // wordlen = 1 - { 1, 2, 3, 1, -1, huff_a52_cb }, // wordlen = 2 - { 1, 1, 3, 1, -1, huff_a43_cb }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_a54_cb }, // wordlen = 4 - { 1, 1, 3, 0, -1, huff_a55_cb }, // wordlen = 5 - { 1, 1, 5, 1, -1, huff_a56_cb }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a57_cb }, // wordlen = 7 + { 1, 4, 2, 1 }, // wordlen = 1 + { 1, 2, 3, 1 }, // wordlen = 2 + { 1, 1, 3, 1 }, // wordlen = 3 + { 1, 2, 4, 1 }, // wordlen = 4 + { 1, 1, 3, 0 }, // wordlen = 5 + { 1, 1, 5, 1 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 6 */ - { 2, 4, 2, 1, -1, huff_a61_cb }, // wordlen = 1 - { 1, 2, 3, 1, -1, huff_a62_cb }, // wordlen = 2 - { 1, 4, 2, 0, -1, huff_a63_cb }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_a64_cb }, // wordlen = 4 - { 1, 1, 4, 1, -1, huff_a65_cb }, // wordlen = 5 - { 1, 1, 5, 1, -1, huff_a66_cb }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_a67_cb }, // wordlen = 7 + { 2, 4, 2, 1 }, // wordlen = 1 + { 1, 2, 3, 1 }, // wordlen = 2 + { 1, 4, 2, 0 }, // wordlen = 3 + { 1, 2, 4, 1 }, // wordlen = 4 + { 1, 1, 4, 1 }, // wordlen = 5 + { 1, 1, 5, 1 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 7 */ - { 1, 2, 1, 0, -1, huff_a71_cb }, // wordlen = 1 - { 2, 4, 2, 0, -1, huff_a72_cb }, // wordlen = 2 - { 1, 2, 3, 1, -1, huff_a73_cb }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_a74_cb }, // wordlen = 4 - { 1, 1, 4, 1, -1, huff_a75_cb }, // wordlen = 5 - { 2, 2, 4, 0, -1, huff_a76_cb }, // wordlen = 6 - { 4, 1, 6, 1, 6, NULL }, // wordlen = 7 + { 1, 2, 1, 0 }, // wordlen = 1 + { 2, 4, 2, 0 }, // wordlen = 2 + { 1, 2, 3, 1 }, // wordlen = 3 + { 1, 2, 4, 1 }, // wordlen = 4 + { 1, 1, 4, 1 }, // wordlen = 5 + { 2, 2, 4, 0 }, // wordlen = 6 + { 4, 1, 6, 1 }, // wordlen = 7 /* table set = B */ /* code table = 0 */ - { 4, 4, 2, 1, -1, huff_b01_cb }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_b02_cb }, // wordlen = 2 - { 4, 2, 3, 1, -1, huff_b03_cb }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_b04_cb }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_b05_cb }, // wordlen = 5 - { 1, 1, 4, 0, 5, NULL }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_b07_cb }, // wordlen = 7 + { 4, 4, 2, 1 }, // wordlen = 1 + { 1, 4, 2, 0 }, // wordlen = 2 + { 4, 2, 3, 1 }, // wordlen = 3 + { 1, 2, 4, 1 }, // wordlen = 4 + { 1, 2, 4, 1 }, // wordlen = 5 + { 1, 1, 4, 0 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 1 */ - { 1, 4, 2, 1, 14, NULL }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_b12_cb }, // wordlen = 2 - { 1, 2, 3, 1, 9, NULL }, // wordlen = 3 - { 1, 2, 4, 1, -1, huff_b14_cb }, // wordlen = 4 - { 1, 2, 4, 1, 11, NULL }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_b16_cb }, // wordlen = 6 - { 1, 1, 6, 1, 6, NULL }, // wordlen = 7 + { 1, 4, 2, 1 }, // wordlen = 1 + { 1, 4, 2, 0 }, // wordlen = 2 + { 1, 2, 3, 1 }, // wordlen = 3 + { 1, 2, 4, 1 }, // wordlen = 4 + { 1, 2, 4, 1 }, // wordlen = 5 + { 1, 2, 4, 0 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 2 */ - { 4, 4, 2, 1, 28, NULL }, // wordlen = 1 - { 4, 4, 2, 0, 22, NULL }, // wordlen = 2 - { 1, 2, 3, 1, 2, NULL }, // wordlen = 3 - { 1, 2, 4, 1, 31, NULL }, // wordlen = 4 - { 2, 2, 4, 1, 60, NULL }, // wordlen = 5 - { 2, 2, 4, 0, -1, huff_b26_cb }, // wordlen = 6 - { 4, 1, 6, 1, 6, NULL }, // wordlen = 7 + { 4, 4, 2, 1 }, // wordlen = 1 + { 4, 4, 2, 0 }, // wordlen = 2 + { 1, 2, 3, 1 }, // wordlen = 3 + { 1, 2, 4, 1 }, // wordlen = 4 + { 2, 2, 4, 1 }, // wordlen = 5 + { 2, 2, 4, 0 }, // wordlen = 6 + { 4, 1, 6, 1 }, // wordlen = 7 /* code table = 3 */ - { 1, 4, 2, 1, 35, NULL }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_b32_cb }, // wordlen = 2 - { 1, 4, 2, 0, -1, huff_b33_cb }, // wordlen = 3 - { 2, 2, 4, 1, 59, NULL }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_b35_cb }, // wordlen = 5 - { 1, 2, 4, 0, 75, NULL }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_b37_cb }, // wordlen = 7 + { 1, 4, 2, 1 }, // wordlen = 1 + { 1, 4, 2, 0 }, // wordlen = 2 + { 1, 4, 2, 0 }, // wordlen = 3 + { 2, 2, 4, 1 }, // wordlen = 4 + { 1, 2, 4, 1 }, // wordlen = 5 + { 1, 2, 4, 0 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 4 */ - { 1, 4, 2, 1, -1, huff_b41_cb }, // wordlen = 1 - { 4, 2, 3, 1, -1, huff_b42_cb }, // wordlen = 2 - { 1, 2, 3, 1, -1, huff_b43_cb }, // wordlen = 3 - { 4, 2, 4, 1, 66, NULL }, // wordlen = 4 - { 1, 1, 3, 0, 32, NULL }, // wordlen = 5 - { 1, 2, 4, 0, 12, NULL }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_b47_cb }, // wordlen = 7 + { 1, 4, 2, 1 }, // wordlen = 1 + { 4, 2, 3, 1 }, // wordlen = 2 + { 1, 2, 3, 1 }, // wordlen = 3 + { 4, 2, 4, 1 }, // wordlen = 4 + { 1, 1, 3, 0 }, // wordlen = 5 + { 1, 2, 4, 0 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 5 */ - { 2, 4, 2, 1, 42, NULL }, // wordlen = 1 - { 1, 2, 3, 1, -1, huff_b52_cb }, // wordlen = 2 - { 4, 1, 3, 1, -1, huff_b53_cb }, // wordlen = 3 - { 1, 1, 3, 0, 17, NULL }, // wordlen = 4 - { 1, 1, 3, 0, 39, NULL }, // wordlen = 5 - { 1, 1, 5, 1, -1, huff_b56_cb }, // wordlen = 6 - { 2, 1, 6, 1, 62, NULL }, // wordlen = 7 + { 2, 4, 2, 1 }, // wordlen = 1 + { 1, 2, 3, 1 }, // wordlen = 2 + { 4, 1, 3, 1 }, // wordlen = 3 + { 1, 1, 3, 0 }, // wordlen = 4 + { 1, 1, 3, 0 }, // wordlen = 5 + { 1, 1, 5, 1 }, // wordlen = 6 + { 2, 1, 6, 1 }, // wordlen = 7 /* code table = 6 */ - { 1, 4, 2, 1, 28, NULL }, // wordlen = 1 - { 1, 4, 2, 0, -1, huff_b62_cb }, // wordlen = 2 - { 1, 1, 3, 1, -1, huff_b63_cb }, // wordlen = 3 - { 1, 1, 3, 0, -1, huff_b64_cb }, // wordlen = 4 - { 4, 2, 4, 1, -1, huff_b65_cb }, // wordlen = 5 - { 1, 2, 4, 0, -1, huff_b66_cb }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_b67_cb }, // wordlen = 7 + { 1, 4, 2, 1 }, // wordlen = 1 + { 1, 4, 2, 0 }, // wordlen = 2 + { 1, 1, 3, 1 }, // wordlen = 3 + { 1, 1, 3, 0 }, // wordlen = 4 + { 4, 2, 4, 1 }, // wordlen = 5 + { 1, 2, 4, 0 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 /* code table = 7 */ - { 1, 4, 2, 1, -1, huff_b71_cb }, // wordlen = 1 - { 4, 4, 2, 0, 78, NULL }, // wordlen = 2 - { 4, 4, 2, 0, -1, huff_b73_cb }, // wordlen = 3 - { 1, 1, 4, 1, -1, huff_b74_cb }, // wordlen = 4 - { 1, 2, 4, 1, -1, huff_b75_cb }, // wordlen = 5 - { 1, 1, 5, 1, 47, NULL }, // wordlen = 6 - { 1, 1, 6, 1, -1, huff_b77_cb }, // wordlen = 7 + { 1, 4, 2, 1 }, // wordlen = 1 + { 4, 4, 2, 0 }, // wordlen = 2 + { 4, 4, 2, 0 }, // wordlen = 3 + { 1, 1, 4, 1 }, // wordlen = 4 + { 1, 2, 4, 1 }, // wordlen = 5 + { 1, 1, 5, 1 }, // wordlen = 6 + { 1, 1, 6, 1 }, // wordlen = 7 }; /* Huffman tables for gain control data. */ -static const uint8_t atrac3p_huff_gain_npoints1_cb[9] = { - 1, 7, 1, 1, 1, 1, 1, 1, 2 -}; - -static const uint8_t atrac3p_huff_gain_lev1_cb[9] = { 1, 7, 1, 0, 2, 2, 1, 2, 8 }; -static const uint8_t atrac3p_huff_gain_lev2_cb[11] = { - 1, 9, 1, 1, 1, 1, 1, 0, 2, 0, 8 -}; - -static const uint8_t atrac3p_huff_gain_lev3_cb[11] = { - 1, 9, 1, 0, 3, 1, 1, 0, 2, 0, 8 -}; - -static const uint8_t atrac3p_huff_gain_lev4_cb[11] = { - 1, 9, 1, 1, 1, 1, 1, 0, 1, 2, 8 +static const uint8_t atrac3p_gain_cbs[][12] = { + { 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0 }, + { 1, 0, 2, 2, 1, 2, 8, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 0, 2, 0, 8, 0, 0, 0 }, + { 1, 0, 3, 1, 1, 0, 2, 0, 8, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 0, 1, 2, 8, 0, 0, 0 }, + { 0, 1, 0, 2, 11, 18, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 2, 4, 4, 4, 0, 16, 0, 0, 0, 0 }, + { 0, 0, 0, 3, 23, 6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 5, 3, 2, 3, 2, 16, 0, 0, 0, 0 }, + { 1, 0, 0, 3, 2, 6, 20, 0, 0, 0, 0, 0 }, }; -static const uint8_t atrac3p_huff_gain_loc1_cb[9] = { 2, 8, 1, 2, 4, 4, 4, 0, 16 }; - -static const uint8_t atrac3p_huff_gain_loc2_cb[8] = { 3, 8, 5, 3, 2, 3, 2, 16 }; - -static const uint8_t atrac3p_huff_gain_loc3_cb[7] = { 2, 6, 1, 0, 2, 11, 18 }; - -static const uint8_t atrac3p_huff_gain_loc4_cb[5] = { 4, 6, 3, 23, 6 }; - -static const uint8_t atrac3p_huff_gain_loc5_cb[9] = { 1, 7, 1, 0, 0, 3, 2, 6, 20 }; - static const uint8_t atrac3p_gain_xlats[] = { /* Number of gain control points 1 - 8 entries */ 0, 1, 2, 3, 4, 5, 6, 7, @@ -1795,17 +1647,14 @@ static const uint8_t atrac3p_gain_xlats[] = { }; /* Huffman tables for GHA waves data. */ -static const uint8_t atrac3p_huff_tonebands_cb[8] = { 1, 6, 1, 0, 1, 2, 4, 8 }; -static const uint8_t atrac3p_huff_numwavs1_cb[9] = { 1, 7, 1, 1, 1, 1, 1, 1, 2 }; -static const uint8_t atrac3p_huff_numwavs2_cb[8] = { 1, 6, 1, 1, 1, 1, 0, 4 }; -static const uint8_t atrac3p_huff_wav_ampsf1_cb[7] = { 4, 8, 10, 8, 6, 0, 8 }; - -static const uint8_t atrac3p_huff_wav_ampsf2_cb[7] = { 4, 8, 11, 5, 6, 6, 4 }; - -static const uint8_t atrac3p_huff_wav_ampsf3_cb[9] = { 2, 8, 1, 3, 3, 1, 4, 4, 16 }; - -static const uint8_t atrac3p_huff_freq_cb[13] = { - 1, 11, 1, 0, 0, 2, 2, 0, 9, 9, 29, 104, 100 +static const uint8_t atrac3p_tone_cbs[][12] = { + { 1, 0, 1, 2, 4, 8, 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 0, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 10, 8, 6, 0, 8, 0, 0, 0, 0 }, + { 0, 0, 0, 11, 5, 6, 6, 4, 0, 0, 0, 0 }, + { 0, 1, 3, 3, 1, 4, 4, 16, 0, 0, 0, 0 }, + { 1, 0, 0, 2, 2, 0, 9, 9, 29,104, 100, 0 }, }; static const uint8_t atrac3p_tone_xlats[] = { From patchwork Fri Nov 20 07:20:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23846 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 DB7ED4492D7 for ; Fri, 20 Nov 2020 09:41:39 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AE00668BC7E; Fri, 20 Nov 2020 09:26:07 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5664E68BC11 for ; Fri, 20 Nov 2020 09:25:46 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id i19so11474206ejx.9 for ; Thu, 19 Nov 2020 23:25:46 -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=5PMeuqZ2ypZO0P8/HOROdeTkh8NnEtLUsES3rOIaxa8=; b=YYHd1Nm7tWuAF1k6Xqa5wISGIgBwB4KWIiaZ4B+OkMof+wB8vfje1ZV82xNYiEzyJg Gl+RBcZCiPU6kqLraWr0nqXFQfXIhtXlpcwCghib/nwV4LYgNl5V9tbhdtJAf6uQd6R9 rGBKNoUDmKgBsTZ4/XK6axd/xOZXrwfdw39KZU/LMexPuneWNw5Fh+DyFIqo3meLh3Hu 9wR1u4zCDcAc/t7nV54/gSNR74/Z3EkEFGNUKskWxtcp2HYZ0AQXLJWvRyJewfEHl/XM J+l8CFhmG87u4xJTZkwgyOv8gHNc1H5J69cDF/DOCOTKEAc43RfQWcz8/cEI+vN0QAvt ZFfA== 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=5PMeuqZ2ypZO0P8/HOROdeTkh8NnEtLUsES3rOIaxa8=; b=Iaslsv6VeK9AEGv4nDNoM5wJaWMqG/PVi/Z3FNwdvC9ZQo3rk/YxTVBQtmz091SwhE B60BUNfj+wUXDSyaixZ7XO01meBxntKlRWs1WGBSV+QumCdZ8q9RIH0NCYQ8kY/GzJ02 qJB95iFGy7c7QzH+7PP2GBzWyssA7LCkNPSOUNpU11xXZUU8fueEn1gpyQHcUwkokEuX VcilZGRVrrMFygB4DVFG9rKnQZIta1wh4bcyDpKLuyUrUmZ0u+x3KwTSeIB5fR4heGmI oP17jV+oSjw2W5LpQOZfnXGqGt7/9/PL6W9iDh6ThKWGaCsYsHwEGpd0pwaUIXU1Waot y8aA== X-Gm-Message-State: AOAM532H6n+LSD4XVlcEjTQ/GU7CvXQYoaTuXijFRKrN5CNs0E0aSEEM vyPsXsxfz0MJZyb+pgF9xPisj+CN4/uViA== X-Google-Smtp-Source: ABdhPJyGM15PPfpeiP5E72CpcHB2t7Q0sSExENV520OsrgvrmhxK3wDGIQAT5G2thp30q/WqzltL1g== X-Received: by 2002:a17:906:13cd:: with SMTP id g13mr33376869ejc.394.1605857145287; Thu, 19 Nov 2020 23:25:45 -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.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:44 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:08 +0100 Message-Id: <20201120072116.818090-96-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 095/162] avcodec/atrac3plus: Run-length encode length tables to make them 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" This is very beneficial for the scale factor tables where 4*64+4*15 bytes of length information can be replaced by eight codebooks of 12 bytes each; furthermore the number of codes as well as the maximum length of a code can be easily derived from said codebooks, making tables containing said information superfluous. This and combining the symbols into one big array also made an array of pointers to the tables redundant. For the wordlen and code table tables the benefits are not that big (given these tables don't contain that many elements), but all in all using codebooks is also advantageouos for them. Therefore it has been done. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac3plus.c | 55 ++---------- libavcodec/atrac3plus_data.h | 157 +++++++++++++++-------------------- 2 files changed, 76 insertions(+), 136 deletions(-) diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c index 984b06fbe4..3a0a0d5f36 100644 --- a/libavcodec/atrac3plus.c +++ b/libavcodec/atrac3plus.c @@ -78,55 +78,18 @@ av_cold void ff_atrac3p_init_vlcs(void) int i, tab_offset = 0; const uint8_t *xlats; - static const uint8_t wl_nb_bits[4] = { 2, 3, 5, 5 }; - static const uint8_t wl_nb_codes[4] = { 3, 5, 8, 8 }; - static const uint8_t (*const wl_huffs[4])[2] = { - atrac3p_wl_huff1, atrac3p_wl_huff2, - atrac3p_wl_huff3, atrac3p_wl_huff4 - }; - - static const uint8_t ct_nb_bits[4] = { 3, 4, 4, 4 }; - static const uint8_t ct_nb_codes[4] = { 4, 8, 8, 8 }; - static const uint8_t (*const ct_huffs[4])[2] = { - atrac3p_ct_huff1, atrac3p_ct_huff2, - atrac3p_ct_huff3, atrac3p_ct_huff4 - }; - - static const uint8_t sf_nb_bits[8] = { 9, 9, 9, 9, 6, 6, 7, 7 }; - static const uint8_t sf_nb_codes[8] = { 64, 64, 64, 64, 15, 15, 15, 15 }; - static const uint8_t (*const sf_huffs[8])[2] = { - atrac3p_sf_huff1, atrac3p_sf_huff2, atrac3p_sf_huff3, - atrac3p_sf_huff4, atrac3p_sf_huff5, atrac3p_sf_huff6, - atrac3p_sf_huff7, atrac3p_sf_huff8 - }; - + xlats = atrac3p_wl_ct_xlats; for (int i = 0; i < 4; i++) { - wl_vlc_tabs[i].table = &tables_data[tab_offset]; - wl_vlc_tabs[i].table_allocated = 1 << wl_nb_bits[i]; - tab_offset += 1 << wl_nb_bits[i]; - ff_init_vlc_from_lengths(&wl_vlc_tabs[i], wl_nb_bits[i], wl_nb_codes[i], - &wl_huffs[i][0][1], 2, - &wl_huffs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); - - ct_vlc_tabs[i].table = &tables_data[tab_offset]; - ct_vlc_tabs[i].table_allocated = 1 << ct_nb_bits[i]; - tab_offset += 1 << ct_nb_bits[i]; - ff_init_vlc_from_lengths(&ct_vlc_tabs[i], ct_nb_bits[i], ct_nb_codes[i], - &ct_huffs[i][0][1], 2, - &ct_huffs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + build_canonical_huff(atrac3p_wl_cbs[i], &xlats, + &tab_offset, &wl_vlc_tabs[i]); + build_canonical_huff(atrac3p_ct_cbs[i], &xlats, + &tab_offset, &ct_vlc_tabs[i]); } - for (int i = 0; i < 8; i++) { - sf_vlc_tabs[i].table = &tables_data[tab_offset]; - sf_vlc_tabs[i].table_allocated = 1 << sf_nb_bits[i]; - tab_offset += 1 << sf_nb_bits[i]; - ff_init_vlc_from_lengths(&sf_vlc_tabs[i], sf_nb_bits[i], sf_nb_codes[i], - &sf_huffs[i][0][1], 2, - &sf_huffs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); - } + xlats = atrac3p_sf_xlats; + for (int i = 0; i < 8; i++) + build_canonical_huff(atrac3p_sf_cbs[i], &xlats, + &tab_offset, &sf_vlc_tabs[i]); /* build huffman tables for spectrum decoding */ xlats = atrac3p_spectra_xlats; diff --git a/libavcodec/atrac3plus_data.h b/libavcodec/atrac3plus_data.h index 6b9109cb70..7039936ba3 100644 --- a/libavcodec/atrac3plus_data.h +++ b/libavcodec/atrac3plus_data.h @@ -27,106 +27,83 @@ #include /** VLC tables for wordlen */ -static const uint8_t atrac3p_wl_huff1[3][2] = { - { 0, 1 }, { 1, 2 }, { 7, 2 }, +static const uint8_t atrac3p_wl_cbs[][12] = { + { 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 2, 3, 2, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 2, 3, 2, 0, 0, 0, 0, 0, 0, 0 }, }; -static const uint8_t atrac3p_wl_huff2[5][2] = { - { 0, 1 }, { 1, 3 }, { 2, 3 }, { 6, 3 }, { 7, 3 }, -}; - -static const uint8_t atrac3p_wl_huff3[8][2] = { - { 0, 1 }, { 1, 3 }, { 7, 3 }, { 2, 4 }, { 5, 4 }, { 6, 4 }, { 3, 5 }, - { 4, 5 }, +/** VLC tables for code table indexes */ +static const uint8_t atrac3p_ct_cbs[][12] = { + { 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0 }, }; - -static const uint8_t atrac3p_wl_huff4[8][2] = { - { 0, 1 }, { 1, 3 }, { 7, 3 }, { 2, 4 }, { 3, 4 }, { 6, 4 }, { 4, 5 }, - { 5, 5 }, +/* Symbols for wordlen interleaved with symbols for code table */ +static const uint8_t atrac3p_wl_ct_xlats[] = { + /* wordlen table 1 - 3 entries */ + 0, 1, 7, + /* code table 1 - 4 entries */ + 0, 1, 2, 3, + /* wordlen table 2 - 5 entries */ + 0, 1, 2, 6, 7, + /* code table 2 - 8 entries */ + 0, 1, 2, 3, 4, 5, 6, 7, + /* wordlen table 3 - 8 entries */ + 0, 1, 7, 2, 5, 6, 3, 4, + /* code table 3 - 8 entries */ + 0, 1, 2, 3, 6, 7, 4, 5, + /* wordlen table 4 - 8 entries */ + 0, 1, 7, 2, 3, 6, 4, 5, + /* code table 4 - 8 entries */ + 0, 1, 2, 3, 4, 5, 6, 7, }; /** VLC tables for scale factor indexes */ -static const uint8_t atrac3p_sf_huff1[64][2] = { - { 0, 2 }, { 1, 3 }, { 61, 3 }, { 62, 3 }, { 63, 3 }, { 2, 4 }, - { 60, 4 }, { 3, 8 }, { 4, 8 }, { 5, 8 }, { 6, 8 }, { 57, 8 }, - { 58, 8 }, { 59, 8 }, { 7, 9 }, { 8, 9 }, { 9, 9 }, { 10, 9 }, - { 11, 9 }, { 12, 9 }, { 13, 9 }, { 14, 9 }, { 15, 9 }, { 16, 9 }, - { 17, 9 }, { 18, 9 }, { 19, 9 }, { 20, 9 }, { 21, 9 }, { 22, 9 }, - { 23, 9 }, { 24, 9 }, { 25, 9 }, { 26, 9 }, { 27, 9 }, { 28, 9 }, - { 29, 9 }, { 30, 9 }, { 31, 9 }, { 32, 9 }, { 33, 9 }, { 34, 9 }, - { 35, 9 }, { 36, 9 }, { 37, 9 }, { 38, 9 }, { 39, 9 }, { 40, 9 }, - { 41, 9 }, { 42, 9 }, { 43, 9 }, { 44, 9 }, { 45, 9 }, { 46, 9 }, - { 47, 9 }, { 48, 9 }, { 49, 9 }, { 50, 9 }, { 51, 9 }, { 52, 9 }, - { 53, 9 }, { 54, 9 }, { 55, 9 }, { 56, 9 }, -}; - -static const uint8_t atrac3p_sf_huff2[64][2] = { - { 0, 2 }, { 1, 3 }, { 2, 3 }, { 62, 3 }, { 63, 3 }, { 3, 4 }, - { 61, 4 }, { 4, 8 }, { 5, 8 }, { 6, 8 }, { 57, 8 }, { 58, 8 }, - { 59, 8 }, { 60, 8 }, { 7, 9 }, { 8, 9 }, { 9, 9 }, { 10, 9 }, - { 11, 9 }, { 12, 9 }, { 13, 9 }, { 14, 9 }, { 15, 9 }, { 16, 9 }, - { 17, 9 }, { 18, 9 }, { 19, 9 }, { 20, 9 }, { 21, 9 }, { 22, 9 }, - { 23, 9 }, { 24, 9 }, { 25, 9 }, { 26, 9 }, { 27, 9 }, { 28, 9 }, - { 29, 9 }, { 30, 9 }, { 31, 9 }, { 32, 9 }, { 33, 9 }, { 34, 9 }, - { 35, 9 }, { 36, 9 }, { 37, 9 }, { 38, 9 }, { 39, 9 }, { 40, 9 }, - { 41, 9 }, { 42, 9 }, { 43, 9 }, { 44, 9 }, { 45, 9 }, { 46, 9 }, - { 47, 9 }, { 48, 9 }, { 49, 9 }, { 50, 9 }, { 51, 9 }, { 52, 9 }, - { 53, 9 }, { 54, 9 }, { 55, 9 }, { 56, 9 }, -}; - -static const uint8_t atrac3p_sf_huff3[64][2] = { - { 0, 1 }, { 1, 3 }, { 63, 3 }, { 2, 5 }, { 3, 5 }, { 61, 5 }, - { 62, 5 }, { 4, 7 }, { 60, 7 }, { 59, 8 }, { 5, 9 }, { 6, 9 }, - { 7, 9 }, { 8, 9 }, { 9, 9 }, { 10, 9 }, { 11, 9 }, { 12, 9 }, - { 13, 9 }, { 14, 9 }, { 15, 9 }, { 16, 9 }, { 17, 9 }, { 18, 9 }, - { 19, 9 }, { 20, 9 }, { 21, 9 }, { 22, 9 }, { 23, 9 }, { 24, 9 }, - { 25, 9 }, { 26, 9 }, { 27, 9 }, { 28, 9 }, { 29, 9 }, { 30, 9 }, - { 31, 9 }, { 32, 9 }, { 33, 9 }, { 34, 9 }, { 35, 9 }, { 36, 9 }, - { 37, 9 }, { 38, 9 }, { 39, 9 }, { 40, 9 }, { 41, 9 }, { 42, 9 }, - { 43, 9 }, { 44, 9 }, { 45, 9 }, { 46, 9 }, { 47, 9 }, { 48, 9 }, - { 49, 9 }, { 50, 9 }, { 51, 9 }, { 52, 9 }, { 53, 9 }, { 54, 9 }, - { 55, 9 }, { 56, 9 }, { 57, 9 }, { 58, 9 }, -}; - -static const uint8_t atrac3p_sf_huff4[64][2] = { - { 0, 2 }, { 1, 3 }, { 2, 3 }, { 62, 3 }, { 63, 3 }, { 3, 5 }, - { 4, 5 }, { 60, 5 }, { 61, 5 }, { 5, 7 }, { 58, 7 }, { 59, 7 }, - { 6, 9 }, { 7, 9 }, { 8, 9 }, { 9, 9 }, { 10, 9 }, { 11, 9 }, - { 12, 9 }, { 13, 9 }, { 14, 9 }, { 15, 9 }, { 16, 9 }, { 17, 9 }, - { 18, 9 }, { 19, 9 }, { 20, 9 }, { 21, 9 }, { 22, 9 }, { 23, 9 }, - { 24, 9 }, { 25, 9 }, { 26, 9 }, { 27, 9 }, { 28, 9 }, { 29, 9 }, - { 30, 9 }, { 31, 9 }, { 32, 9 }, { 33, 9 }, { 34, 9 }, { 35, 9 }, - { 36, 9 }, { 37, 9 }, { 38, 9 }, { 39, 9 }, { 40, 9 }, { 41, 9 }, - { 42, 9 }, { 43, 9 }, { 44, 9 }, { 45, 9 }, { 46, 9 }, { 47, 9 }, - { 48, 9 }, { 49, 9 }, { 50, 9 }, { 51, 9 }, { 52, 9 }, { 53, 9 }, - { 54, 9 }, { 55, 9 }, { 56, 9 }, { 57, 9 }, -}; - -static const uint8_t atrac3p_sf_huff5[15][2] = { - { 0, 2 }, { 1, 3 }, { 13, 3 }, { 14, 3 }, { 15, 3 }, { 2, 4 }, - { 12, 4 }, { 3, 6 }, { 4, 6 }, { 5, 6 }, { 6, 6 }, { 7, 6 }, - { 9, 6 }, { 10, 6 }, { 11, 6 }, +static const uint8_t atrac3p_sf_cbs[][12] = { + { 0, 1, 4, 2, 0, 0, 0, 7, 50, 0, 0, 0 }, + { 0, 1, 4, 2, 0, 0, 0, 7, 50, 0, 0, 0 }, + { 1, 0, 2, 0, 4, 0, 2, 1, 54, 0, 0, 0 }, + { 0, 1, 4, 0, 4, 0, 3, 0, 52, 0, 0, 0 }, + { 0, 1, 4, 2, 0, 8, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 4, 2, 0, 8, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 2, 2, 2, 0, 8, 0, 0, 0, 0, 0 }, + { 0, 1, 4, 2, 2, 2, 4, 0, 0, 0, 0, 0 }, }; -static const uint8_t atrac3p_sf_huff6[15][2] = { - { 0, 2 }, { 1, 3 }, { 2, 3 }, { 14, 3 }, { 15, 3 }, { 3, 4 }, - { 13, 4 }, { 4, 6 }, { 5, 6 }, { 6, 6 }, { 7, 6 }, { 9, 6 }, - { 10, 6 }, { 11, 6 }, { 12, 6 }, +static const uint8_t atrac3p_sf_xlats[] = { + /* Scale factor index 1 - 64 entries */ + 0, 1, 61, 62, 63, 2, 60, 3, 4, 5, 6, 57, 58, 59, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + /* Scale factor index 2 - 64 entries */ + 0, 1, 2, 62, 63, 3, 61, 4, 5, 6, 57, 58, 59, 60, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + /* Scale factor index 3 - 64 entries */ + 0, 1, 63, 2, 3, 61, 62, 4, 60, 59, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + /* Scale factor index 4 - 64 entries */ + 0, 1, 2, 62, 63, 3, 4, 60, 61, 5, 58, 59, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + /* Scale factor index 5 - 15 entries */ + 0, 1, 13, 14, 15, 2, 12, 3, 4, 5, 6, 7, 9, 10, 11, + /* Scale factor index 6 - 15 entries */ + 0, 1, 2, 14, 15, 3, 13, 4, 5, 6, 7, 9, 10, 11, 12, + /* Scale factor index 7 - 15 entries */ + 0, 1, 15, 2, 14, 3, 13, 4, 5, 6, 7, 9, 10, 11, 12, + /* Scale factor index 8 - 15 entries */ + 0, 1, 2, 14, 15, 3, 13, 4, 12, 5, 11, 6, 7, 9, 10, }; -static const uint8_t atrac3p_sf_huff7[15][2] = { - { 0, 1 }, { 1, 3 }, { 15, 3 }, { 2, 4 }, { 14, 4 }, { 3, 5 }, - { 13, 5 }, { 4, 7 }, { 5, 7 }, { 6, 7 }, { 7, 7 }, { 9, 7 }, - { 10, 7 }, { 11, 7 }, { 12, 7 }, -}; - -static const uint8_t atrac3p_sf_huff8[15][2] = { - { 0, 2 }, { 1, 3 }, { 2, 3 }, { 14, 3 }, { 15, 3 }, { 3, 4 }, - { 13, 4 }, { 4, 5 }, { 12, 5 }, { 5, 6 }, { 11, 6 }, { 6, 7 }, - { 7, 7 }, { 9, 7 }, { 10, 7 }, -}; - -/** VLC tables for code table indexes */ static const uint8_t atrac3p_ct_huff1[4][2] = { { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 3 }, }; From patchwork Fri Nov 20 07:20:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23766 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 5F92E44AFE3 for ; Fri, 20 Nov 2020 09:26:10 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2DCE068BC2B; Fri, 20 Nov 2020 09:26:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4B1E1688179 for ; Fri, 20 Nov 2020 09:25:47 +0200 (EET) Received: by mail-ed1-f66.google.com with SMTP id d18so8471343edt.7 for ; Thu, 19 Nov 2020 23:25:47 -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=DF+doVDKWd1MdcWarRBke1HDah0mKctBxq4bfq+rOI8=; b=TPq+yaJ/2tyiv9y5hNv77DHQZMLduG747y4IiMqRF/kLiSPLr8q07JF3qu5NIr1Qx5 AtY8HyI6HOEAl4BHQRFwgwVW3MGqLdWCN6Ux8BLw6bdC8HuuDdJ+v2lEqdn7lu5BrMSl ZdfE39E2u28yFk7rZ9zSGt6N24NFApGbTyGR5/2h/Goi/sEgFPApSDYwpxNAW/w4Isea wm2yhHeqGh9GftEJ5bkE2RpIaGWtA5nia8nuev3EkA4ey+k0D6MG4ArYhls9Q9vPabd2 cx8vbYKcKOMC62S7quefQsc1U4iMv892UaYr9mWgXwgr0K433tcpk1Cg6THZSRRWMS4+ AVEQ== 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=DF+doVDKWd1MdcWarRBke1HDah0mKctBxq4bfq+rOI8=; b=pyFdxtJekCnF81BKlXnuRIvmbbc02IK6KMBzAD5bkDY4MlwnIf3xSGjyVblRX/SEJv hUD6JRlCBx+nR7wUSPQcAsz1xi/dBz3jOL8v7EwzqXpabjGhot45UsD1Bfrds7PE29i2 Z61R18wbqN1ObbMtWm0rplIcPyI9blE063EX9OmSd4nn7Ah0M5qnc0QA22VqC0jDzUgv mqFTNwoKUCS+coUyjBID6AznOMt3Wu4gi2zobarQvceZfnu4Ao16wx4vM1ZDqiCBwljl 8vOYrBPPbcKGwVm+al4A3ydxARwQFxy9gBsUTHHuSNrKgeXhIi8piblmvWcH5AsndqJr nbow== X-Gm-Message-State: AOAM533eFIaGPygxfNnSyH07DUW3SvU9s8OEvlBy37z7VDhUHzxM+Dw1 g0lkei6Kl/l8Jp9oB5tVXiI8O3XIXMOUGA== X-Google-Smtp-Source: ABdhPJwsdQBdT+FzXcQUf+7s/lXrw6m2Vxp6z/Z6/I4NRZpPX2n59k4em/35PE1bryTSA7qMsdAiQw== X-Received: by 2002:a05:6402:1350:: with SMTP id y16mr1634143edw.360.1605857146419; Thu, 19 Nov 2020 23:25:46 -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.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:45 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:09 +0100 Message-Id: <20201120072116.818090-97-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 096/162] avcodec/vc1: Already offset subblock VLC tables during init 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" Offseting by +1 is possible without adding dummy elements to the beginning of the codes and lengths tables by switching to ff_init_vlc_from_lengths() as this allows one to set the symbols arbitrarily without incurring any penalty. Signed-off-by: Andreas Rheinhardt --- All the VC1 patches have improved documentation on what the symbols actually contain. libavcodec/vc1.c | 7 ++++--- libavcodec/vc1_block.c | 2 +- libavcodec/vc1data.c | 27 +++++++++++++++++---------- libavcodec/vc1data.h | 6 +++--- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index 9df778bcab..d973fd6c57 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1616,9 +1616,10 @@ av_cold int ff_vc1_init_common(VC1Context *v) ff_vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); ff_vc1_subblkpat_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 2]]; ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2]; - init_vlc(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, - ff_vc1_subblkpat_bits[i], 1, 1, - ff_vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, + &ff_vc1_subblkpat_tabs[i][0][1], 2, + &ff_vc1_subblkpat_tabs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); } for (i = 0; i < 4; i++) { ff_vc1_4mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 9]]; diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index 5c33170933..b8987b0015 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -1143,7 +1143,7 @@ static int vc1_decode_p_block(VC1Context *v, int16_t block[64], int n, ttblk = ff_vc1_ttblk_to_tt[v->tt_index][get_vlc2(gb, ff_vc1_ttblk_vlc[v->tt_index].table, VC1_TTBLK_VLC_BITS, 1)]; } if (ttblk == TT_4X4) { - subblkpat = ~(get_vlc2(gb, ff_vc1_subblkpat_vlc[v->tt_index].table, VC1_SUBBLKPAT_VLC_BITS, 1) + 1); + subblkpat = ~get_vlc2(gb, ff_vc1_subblkpat_vlc[v->tt_index].table, VC1_SUBBLKPAT_VLC_BITS, 1); } if ((ttblk != TT_8X8 && ttblk != TT_4X4) && ((v->ttmbf || (ttmb != -1 && (ttmb & 8) && !first_block)) diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c index 19f1cad45f..e92d9b7310 100644 --- a/libavcodec/vc1data.c +++ b/libavcodec/vc1data.c @@ -921,16 +921,23 @@ const uint8_t ff_vc1_ttblk_bits[3][8] = { { 2, 3, 3, 3, 3, 3, 4, 4 } }; -/* SUBBLKPAT tables, p93-94, reordered */ -const uint8_t ff_vc1_subblkpat_codes[3][15] = { - { 14, 12, 7, 11, 9, 26, 2, 10, 27, 8, 0, 6, 1, 15, 1 }, - { 14, 0, 8, 15, 10, 4, 23, 13, 5, 9, 25, 3, 24, 22, 1 }, - { 5, 6, 2, 2, 8, 0, 28, 3, 1, 3, 29, 1, 19, 18, 15 } -}; -const uint8_t ff_vc1_subblkpat_bits[3][15] = { - { 5, 5, 5, 5, 5, 6, 4, 5, 6, 5, 4, 5, 4, 5, 1}, - { 4, 3, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 2}, - { 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4} +/* SUBBLKPAT tables, p93-94, reordered and offset by 1 */ +const uint8_t ff_vc1_subblkpat_tabs[3][15][2] = { + { + { 0x0B, 4 }, { 0x0D, 4 }, { 0x07, 4 }, { 0x0C, 5 }, { 0x03, 5 }, + { 0x0A, 5 }, { 0x05, 5 }, { 0x08, 5 }, { 0x04, 5 }, { 0x02, 5 }, + { 0x06, 6 }, { 0x09, 6 }, { 0x01, 5 }, { 0x0E, 5 }, { 0x0F, 1 }, + }, + { + { 0x02, 3 }, { 0x06, 5 }, { 0x09, 5 }, { 0x0C, 4 }, { 0x0F, 2 }, + { 0x03, 4 }, { 0x0A, 4 }, { 0x05, 4 }, { 0x0E, 5 }, { 0x07, 5 }, + { 0x0D, 5 }, { 0x0B, 5 }, { 0x08, 4 }, { 0x01, 4 }, { 0x04, 4 }, + }, + { + { 0x06, 5 }, { 0x09, 5 }, { 0x0C, 4 }, { 0x03, 4 }, { 0x0A, 4 }, + { 0x04, 3 }, { 0x08, 3 }, { 0x05, 4 }, { 0x0E, 5 }, { 0x0D, 5 }, + { 0x01, 3 }, { 0x02, 3 }, { 0x07, 5 }, { 0x0B, 5 }, { 0x0F, 4 }, + } }; /* MV differential tables, p265 */ diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h index 90dd8baf61..02603ca9bc 100644 --- a/libavcodec/vc1data.h +++ b/libavcodec/vc1data.h @@ -152,9 +152,9 @@ extern const uint8_t ff_vc1_ttmb_bits[3][16]; extern const uint8_t ff_vc1_ttblk_codes[3][8]; extern const uint8_t ff_vc1_ttblk_bits[3][8]; -/* SUBBLKPAT tables, p93-94, reordered */ -extern const uint8_t ff_vc1_subblkpat_codes[3][15]; -extern const uint8_t ff_vc1_subblkpat_bits[3][15]; +/* SUBBLKPAT tables (tables #65-#67). + * The symbols contain the Subblock Pattern. */ +extern const uint8_t ff_vc1_subblkpat_tabs[3][15][2]; /* MV differential tables, p265 */ extern const uint16_t ff_vc1_mv_diff_codes[4][73]; From patchwork Fri Nov 20 07:20:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23848 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 389EC449F1B for ; Fri, 20 Nov 2020 09:42:18 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3496568BBB3; Fri, 20 Nov 2020 09:26:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3DF4C68BC34 for ; Fri, 20 Nov 2020 09:25:48 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id bo9so5750526ejb.13 for ; Thu, 19 Nov 2020 23:25:48 -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=lpH1DBv7L8aoR5yJPPHP6/iVFFI1D2qDHPoCd7K29eo=; b=oY0Jqq0UnVd0ejxPPB/wWGCQMHqz3pZGBjNoKeTsq6eV+BeW5QWuW+QtYx/kmWQga9 oKeaP63i0ZuY2UpBKJpotnUCESVOEaA2ZnYtiOCBuXIAVg7smelnyvIkolEIwDiYXAx3 F8CeFe1yAROTSwu4Y6yALN5N5PcJL4KxNZ+qbTfEMjEmASVeBgNQd7aACrMdVHu1gsk9 fZo+p2rKEgMpJN3kmONK2hsBf3CqtYPQHQKK0NwInuk+6cuZVxzDjXB/DUEhqmQEYMRB IJEPBWrKBAcpOXss+IB8H9pHScs7PKvGDSMYJKin66MU1vEG7KApquwph7Ydj5apPqXy mFuA== 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=lpH1DBv7L8aoR5yJPPHP6/iVFFI1D2qDHPoCd7K29eo=; b=QZqgUHxPTnrzKiNTLMZILhMS9VdZAwEO+sCbKobmeHtc3Ll20RJYr6eiMc4dWXM7T2 FKSByQXPyIqKeHHotWZqKkh0alB+yFPGs+tBhRrty91sgsxINsF5GGJQ17l+r8tc/GXa 426E1YCZuljYRnVYW5z23uj8/O0E/pRPLl4VJagGdS1MvWlwzl5SxD/zeBuH4CAPiHyc hehN5AcPsFdW8vX3iSKJ2NW8IrXAZfUbuoTtxhd4fMEI05EUCgUI9hv5HU1o8Ry/M+NM y1zgZniKh5ZaOsQJfv/BlOuq9gXoN3xxahZ0oBiikXDaybq2UiwLsaWlccD342kRxfuG hGXA== X-Gm-Message-State: AOAM5328BdH3rLhuQ1iWEkmPPcdw8VElNiI1GA6Wo3dz9jTeaYR3vZoR r4NLxURHHSqyqHUcp1/5XKQvh+TRHiw4qw== X-Google-Smtp-Source: ABdhPJz/pTYxkQqCm2Iv3wvCab5qCBXlNshzhkxP14OF/ThGRDyPVriYAkZeLLbgXdNTIoNj357KbA== X-Received: by 2002:a17:906:f0c3:: with SMTP id dk3mr21769549ejb.366.1605857147414; Thu, 19 Nov 2020 23:25:47 -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.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:46 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:10 +0100 Message-Id: <20201120072116.818090-98-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 097/162] avcodec/vc1: Use symbols table for VLC for Block-level Transform Type 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" Expressions like array[get_vlc2()] can be optimized by using a symbols table if the array is always the same for a given VLC. This requirement is fulfilled for the VLC for the Block-level Transform Type and therefore this commit implements this; switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() means that we can also remove the codes table in the process which had the same size as the new symbols table; the array used to translate the get_vlc2() values to the desired form has also been removed, saving space. Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1.c | 7 ++++--- libavcodec/vc1_block.c | 2 +- libavcodec/vc1data.c | 30 +++++++++++++----------------- libavcodec/vc1data.h | 9 +++------ 4 files changed, 21 insertions(+), 27 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index d973fd6c57..8c8387b7fb 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1611,9 +1611,10 @@ av_cold int ff_vc1_init_common(VC1Context *v) ff_vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); ff_vc1_ttblk_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 1]]; ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1]; - init_vlc(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, - ff_vc1_ttblk_bits[i], 1, 1, - ff_vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, + &ff_vc1_ttblk_tabs[i][0][1], 2, + &ff_vc1_ttblk_tabs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); ff_vc1_subblkpat_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 2]]; ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2]; ff_init_vlc_from_lengths(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index b8987b0015..da58a0738f 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -1140,7 +1140,7 @@ static int vc1_decode_p_block(VC1Context *v, int16_t block[64], int n, s->bdsp.clear_block(block); if (ttmb == -1) { - ttblk = ff_vc1_ttblk_to_tt[v->tt_index][get_vlc2(gb, ff_vc1_ttblk_vlc[v->tt_index].table, VC1_TTBLK_VLC_BITS, 1)]; + ttblk = get_vlc2(gb, ff_vc1_ttblk_vlc[v->tt_index].table, VC1_TTBLK_VLC_BITS, 1); } if (ttblk == TT_4X4) { subblkpat = ~get_vlc2(gb, ff_vc1_subblkpat_vlc[v->tt_index].table, VC1_SUBBLKPAT_VLC_BITS, 1); diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c index e92d9b7310..ed5e680527 100644 --- a/libavcodec/vc1data.c +++ b/libavcodec/vc1data.c @@ -30,13 +30,6 @@ #include "vc1.h" #include "vc1data.h" -/** Table for conversion between TTBLK and TTMB */ -const int ff_vc1_ttblk_to_tt[3][8] = { - { TT_8X4, TT_4X8, TT_8X8, TT_4X4, TT_8X4_TOP, TT_8X4_BOTTOM, TT_4X8_RIGHT, TT_4X8_LEFT }, - { TT_8X8, TT_4X8_RIGHT, TT_4X8_LEFT, TT_4X4, TT_8X4, TT_4X8, TT_8X4_BOTTOM, TT_8X4_TOP }, - { TT_8X8, TT_4X8, TT_4X4, TT_8X4_BOTTOM, TT_4X8_RIGHT, TT_4X8_LEFT, TT_8X4, TT_8X4_TOP } -}; - const int ff_vc1_ttfrm_to_tt[4] = { TT_8X8, TT_8X4, TT_4X8, TT_4X4 }; /** MV P mode - the 5th element is only used for mode 1 */ @@ -908,17 +901,20 @@ const uint8_t ff_vc1_ttmb_bits[3][16] = { 11 } }; - /* TTBLK (Transform Type per Block) tables */ -const uint8_t ff_vc1_ttblk_codes[3][8] = { - { 0, 1, 3, 5, 16, 17, 18, 19 }, - { 3, 0, 1, 2, 3, 5, 8, 9 }, - { 1, 0, 1, 4, 6, 7, 10, 11 } -}; -const uint8_t ff_vc1_ttblk_bits[3][8] = { - { 2, 2, 2, 3, 5, 5, 5, 5 }, - { 2, 3, 3, 3, 3, 3, 4, 4 }, - { 2, 3, 3, 3, 3, 3, 4, 4 } +const uint8_t ff_vc1_ttblk_tabs[3][8][2] = { + { + { TT_8X4, 2 }, { TT_4X8, 2 }, { TT_8X4_TOP, 5 }, { TT_8X4_BOTTOM, 5 }, + { TT_4X8_RIGHT, 5 }, { TT_4X8_LEFT, 5 }, { TT_4X4, 3 }, { TT_8X8, 2 }, + }, + { + { TT_4X8_RIGHT, 3 }, { TT_4X8_LEFT, 3 }, { TT_4X4, 3 }, { TT_8X4, 3 }, + { TT_8X4_BOTTOM, 4 }, { TT_8X4_TOP, 4 }, { TT_4X8, 3 }, { TT_8X8, 2 }, + }, + { + { TT_4X8, 3 }, { TT_4X4, 3 }, { TT_8X8, 2 }, { TT_8X4_BOTTOM, 3 }, + { TT_8X4, 4 }, { TT_8X4_TOP, 4 }, { TT_4X8_RIGHT, 3 }, { TT_4X8_LEFT, 3 }, + }, }; /* SUBBLKPAT tables, p93-94, reordered and offset by 1 */ diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h index 02603ca9bc..9c6ac7370b 100644 --- a/libavcodec/vc1data.h +++ b/libavcodec/vc1data.h @@ -34,9 +34,6 @@ #include "vlc.h" -/** Table for conversion between TTBLK and TTMB */ -extern const int ff_vc1_ttblk_to_tt[3][8]; - extern const int ff_vc1_ttfrm_to_tt[4]; /** MV P mode - the 5th element is only used for mode 1 */ @@ -148,9 +145,9 @@ extern const uint16_t ff_vc1_ttmb_codes[3][16]; extern const uint8_t ff_vc1_ttmb_bits[3][16]; -/* TTBLK (Transform Type per Block) tables */ -extern const uint8_t ff_vc1_ttblk_codes[3][8]; -extern const uint8_t ff_vc1_ttblk_bits[3][8]; +/* TTBLK (Transform Type per Block) tables (tables #62-#64). + * The symbols contain enum TransformTypes (TT_*) values. */ +extern const uint8_t ff_vc1_ttblk_tabs[3][8][2]; /* SUBBLKPAT tables (tables #65-#67). * The symbols contain the Subblock Pattern. */ From patchwork Fri Nov 20 07:20:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23849 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 8DDBA449F1B for ; Fri, 20 Nov 2020 09:42:29 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8310B68BBE0; Fri, 20 Nov 2020 09:26:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 313E868B9AF for ; Fri, 20 Nov 2020 09:25:50 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id a16so11515639ejj.5 for ; Thu, 19 Nov 2020 23:25:50 -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=+vvr++vHNCt9G0kYnDFhAOU8w+8anIJJob2SVTGD7IM=; b=dx+2pHHrZTDqFTHINtxI9qpV0Wiz3ML7kXtcYvFv2S5VRn24GEEFphSJH4vgxvlPGN Xv7vSo4t2xwI+x12DSlmitYF8SIqNCuohzRJdYUHWR07lWZ1+N8yElZQTPPaiy4yPgiD tsDizMQFiOXvcvoVI2PNmtMdXF3w189NTFX56x1AFrm1nYakjtLhVX68wEs6SrxpU2vS buQI+Uo0WaoO1kpCnnlzQ8nZrAWL5iSX4Ec1jQFTBg3R69H/kEmBRr79Ml5pllPyeNP7 Hm7jC8z7mRcAgl8Mvh92R5XBDIJlHMbh/ghJARyQyWymT/5ytcPhU8flJ9AA0cp7JOGs wM8Q== 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=+vvr++vHNCt9G0kYnDFhAOU8w+8anIJJob2SVTGD7IM=; b=WVoJY4eVx06mree7qVzVVbTDWes1n3phXSRV4COLGxLR2fpRjXGiTi06OYs3/AwQ1b uvVSZuYsi3qUnkGkoiBpy8AciQyYxxeRmp9Y3ZG4lTGsBpT72zZEmb4Qa/QLqjUsM4wr jwK62A3canQ1t8PABr/IPz2MjLqd4ufFriRlv77MDi3GhyFawYixcPhcB/CRdgA2W511 IHdRoamzjWql3e+fZrxVJfe0LXHOQjg3UendNJUMgN8C+kEvQi48EHm8vCdx5io9YUx7 Y/MzjTAcIvb8KuyjU1bCkF3H8UTDALi/ke8cyeDJ/l/IntpSPSG+dPGDliutjLTAnt1E BSqw== X-Gm-Message-State: AOAM531/B3prvWKkZbhrCPH4CJkh811HDrf4mkpmTMy2L2ZeiZSah6e5 OFFL7XQWcXNGNTBk3dyPxyxd5U3Lqzvg3w== X-Google-Smtp-Source: ABdhPJxS5ZZ9JisTCsKl1+GChyN6Ybv9L6sYTcSKUIXYZrawqfiIQ95Wlzrx8VH3jmi3/9Vuvx0dzg== X-Received: by 2002:a17:906:b14e:: with SMTP id bt14mr745262ejb.226.1605857148480; Thu, 19 Nov 2020 23:25:48 -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.25.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:47 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:11 +0100 Message-Id: <20201120072116.818090-99-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 098/162] avcodec/vc1: Use a symbols table to decode interlaced MV vector 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" The VC1 decoder currently follows the spec very closely when decoding interlaced MV vector variable-length codes: The spec uses tables with contiguous indexes. The last of these is an escape code, for every other two values are encoded via (index + 1) / 9 and (index + 1) % 9. The decoder did exactly this. This necessitated a branch to find out what the current escape code was as well as the actual division/modulo. This commit changes this by using an explicit symbols table for the VLCs. The symbols are chosen so that the escape code always has the value 0 (obviating the branch) and so that for every other code the low nibble of the corresponding symbol contains (index + 1) % 9 whereas the high nibble contains (index + 1) / 9. Furthermore, the VLCs are now initialized with ff_init_vlc_from_lengths(); this allows to replace the uint32_t tables of codes by uint8_t tables of symbols, thereby saving space on top of all the other improvements. Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1.c | 14 +- libavcodec/vc1_block.c | 16 +- libavcodec/vc1data.c | 594 ++++++++++++++++++++--------------------- libavcodec/vc1data.h | 16 +- 4 files changed, 315 insertions(+), 325 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index 8c8387b7fb..1def1fceae 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1648,9 +1648,10 @@ av_cold int ff_vc1_init_common(VC1Context *v) /* initialize interlaced MVDATA tables (2-Ref) */ ff_vc1_2ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 2 + 22]]; ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22]; - init_vlc(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, - ff_vc1_2ref_mvdata_bits[i], 1, 1, - ff_vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, + &ff_vc1_2ref_mvdata_tabs[i][0][1], 2, + &ff_vc1_2ref_mvdata_tabs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); } for (i = 0; i < 4; i++) { /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */ @@ -1668,9 +1669,10 @@ av_cold int ff_vc1_init_common(VC1Context *v) /* initialize interlaced MVDATA tables (1-Ref) */ ff_vc1_1ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 39]]; ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39]; - init_vlc(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72, - ff_vc1_1ref_mvdata_bits[i], 1, 1, - ff_vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72, + &ff_vc1_1ref_mvdata_tabs[i][0][1], 2, + &ff_vc1_1ref_mvdata_tabs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); } for (i = 0; i < 4; i++) { /* Initialize 2MV Block pattern VLC tables */ diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index da58a0738f..ed6df541cf 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -265,20 +265,13 @@ static av_always_inline void get_mvdata_interlaced(VC1Context *v, int *dmv_x, int index, index1; int extend_x, extend_y; GetBitContext *gb = &v->s.gb; - int bits, esc; + int bits = v->numref ? VC1_2REF_MVDATA_VLC_BITS : VC1_1REF_MVDATA_VLC_BITS; int val, sign; - if (v->numref) { - bits = VC1_2REF_MVDATA_VLC_BITS; - esc = 125; - } else { - bits = VC1_1REF_MVDATA_VLC_BITS; - esc = 71; - } extend_x = v->dmvrange & 1; extend_y = (v->dmvrange >> 1) & 1; index = get_vlc2(gb, v->imv_vlc->table, bits, 3); - if (index == esc) { + if (!index) { *dmv_x = get_bits(gb, v->k_x); *dmv_y = get_bits(gb, v->k_y); if (v->numref) { @@ -288,15 +281,14 @@ static av_always_inline void get_mvdata_interlaced(VC1Context *v, int *dmv_x, } } else { - av_assert0(index < esc); - index1 = (index + 1) % 9; + index1 = index & 0xF; if (index1 != 0) { val = get_bits(gb, index1 + extend_x); sign = 0 - (val & 1); *dmv_x = (sign ^ ((val >> 1) + offset_table[extend_x][index1])) - sign; } else *dmv_x = 0; - index1 = (index + 1) / 9; + index1 = index >> 4; if (index1 > v->numref) { val = get_bits(gb, (index1 >> v->numref) + extend_y); sign = 0 - (val & 1); diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c index ed5e680527..0050b959ed 100644 --- a/libavcodec/vc1data.c +++ b/libavcodec/vc1data.c @@ -333,309 +333,303 @@ const uint8_t ff_vc1_if_1mv_mbmode_bits[8][6] = { /* Interlaced frame/field picture MVDATA VLC tables */ /* 1-reference tables */ -const uint32_t ff_vc1_1ref_mvdata_codes[4][72] = { /* uint32_t may be too big */ - { - 0x00005, 0x0000C, 0x0001E, 0x00012, 0x0000C, 0x00034, 0x00075, 0x00070, - 0x00000, 0x00008, 0x0001B, 0x00008, 0x0001D, 0x0007C, 0x000D6, 0x001DE, - 0x001AF, 0x00005, 0x0001B, 0x00026, 0x0001E, 0x00012, 0x00076, 0x0004D, - 0x001F6, 0x001F4, 0x00039, 0x0007F, 0x00027, 0x0006A, 0x00071, 0x00035, - 0x00071, 0x00068, 0x001DC, 0x00027, 0x00073, 0x000FF, 0x000E8, 0x000E9, - 0x0007E, 0x001F9, 0x001F5, 0x001FD, 0x0003E, 0x001CA, 0x003F9, 0x0004C, - 0x00069, 0x001FA, 0x001DF, 0x001F7, 0x00070, 0x001DD, 0x00E4D, 0x00727, - 0x00392, 0x001C8, 0x001CB, 0x003F8, 0x001AE, 0x001F8, 0x001FB, 0x0E4CE, - 0x0E4CF, 0x07260, 0x07261, 0x07262, 0x07263, 0x07264, 0x07265, 0x07266 - }, - { - 0x00007, 0x00001, 0x00007, 0x00016, 0x00001, 0x00045, 0x00018, 0x002B6, - 0x00006, 0x00004, 0x00017, 0x00010, 0x00029, 0x0002C, 0x0015A, 0x00066, - 0x0019E, 0x00009, 0x00028, 0x00017, 0x00000, 0x0002A, 0x00004, 0x0005B, - 0x000B5, 0x000CE, 0x00006, 0x00044, 0x0000F, 0x00046, 0x0000E, 0x000AC, - 0x00032, 0x00037, 0x011EB, 0x0000A, 0x0001A, 0x0011F, 0x00016, 0x00014, - 0x0002B, 0x00168, 0x00055, 0x023D5, 0x00057, 0x0002F, 0x00036, 0x0002E, - 0x00169, 0x00054, 0x0047B, 0x0019F, 0x02B7D, 0x0008E, 0x00ADE, 0x00479, - 0x0056E, 0x008F4, 0x015BF, 0x00478, 0x023D4, 0x0ADF1, 0x056F9, 0xADF0E, - 0xADF0F, 0x56F80, 0x56F81, 0x56F82, 0x56F83, 0x56F84, 0x56F85, 0x56F86 - }, - { - 0x00002, 0x00006, 0x00007, 0x0000D, 0x00007, 0x00030, 0x000FF, 0x001F0, - 0x00002, 0x00000, 0x00005, 0x00019, 0x0001E, 0x00007, 0x00063, 0x000FD, - 0x00023, 0x0000E, 0x0001B, 0x0001A, 0x00006, 0x00009, 0x00018, 0x000C5, - 0x00033, 0x001F1, 0x00002, 0x003FB, 0x001F3, 0x00022, 0x001FC, 0x00042, - 0x00623, 0x00083, 0x00620, 0x0007D, 0x00040, 0x00043, 0x003E4, 0x003E5, - 0x00191, 0x00FE9, 0x00105, 0x00208, 0x000FC, 0x00624, 0x00622, 0x00190, - 0x00626, 0x007F5, 0x00C4B, 0x01FD0, 0x0104D, 0x00065, 0x00C42, 0x000C9, - 0x00627, 0x00C43, 0x00C4A, 0x0104E, 0x01FD1, 0x0104F, 0x00412, 0x104CE, - 0x104CF, 0x08260, 0x08261, 0x08262, 0x08263, 0x08264, 0x08265, 0x08266 - }, - { - 0x0000D, 0x00001, 0x00004, 0x00000, 0x00017, 0x00005, 0x0007F, 0x0004D, - 0x00003, 0x00011, 0x0003E, 0x0003B, 0x00017, 0x00067, 0x0004A, 0x000C3, - 0x000F2, 0x0000A, 0x0002C, 0x00032, 0x0003D, 0x00015, 0x00028, 0x00093, - 0x000CC, 0x00096, 0x00003, 0x00075, 0x00020, 0x0002D, 0x00021, 0x00029, - 0x00090, 0x001D0, 0x001FB, 0x0001C, 0x0004C, 0x00060, 0x00009, 0x00008, - 0x0002D, 0x0009F, 0x001FA, 0x0013D, 0x00031, 0x000FC, 0x00058, 0x00092, - 0x000F0, 0x000F1, 0x000CD, 0x00185, 0x00165, 0x0004E, 0x00091, 0x000E9, - 0x00184, 0x001D1, 0x001E6, 0x00097, 0x001E7, 0x000B3, 0x0013C, 0x0164E, - 0x0164F, 0x00B20, 0x00B21, 0x00B22, 0x00B23, 0x00B24, 0x00B25, 0x00B26 - } -}; - -const uint8_t ff_vc1_1ref_mvdata_bits[4][72] = { - { - 3, 4, 5, 5, 5, 6, 7, 7, 2, 4, 5, 5, 6, 7, 8, 9, 9, 4, - 6, 6, 6, 6, 7, 8, 9, 9, 6, 8, 7, 7, 7, 7, 8, 8, 9, 6, - 8, 8, 8, 8, 8, 9, 9, 9, 7, 10, 10, 8, 8, 9, 9, 9, 8, 9, - 13, 12, 11, 10, 10, 10, 9, 9, 9, 17, 17, 16, 16, 16, 16, 16, 16, 16 - }, - { - 3, 3, 4, 5, 5, 7, 8, 10, 3, 4, 5, 5, 6, 7, 9, 10, 12, 4, - 6, 6, 5, 6, 6, 8, 9, 11, 4, 7, 7, 7, 7, 8, 9, 9, 13, 5, - 8, 9, 8, 8, 9, 10, 10, 14, 7, 9, 9, 9, 10, 10, 11, 12, 14, 8, - 12, 11, 11, 12, 13, 11, 14, 16, 15, 20, 20, 19, 19, 19, 19, 19, 19, 19 - }, - { - 3, 4, 4, 4, 5, 6, 8, 9, 2, 4, 5, 5, 5, 6, 7, 8, 8, 4, - 7, 7, 6, 6, 7, 8, 8, 9, 5, 10, 9, 8, 9, 9, 11, 10, 11, 7, - 9, 9, 10, 10, 11, 12, 11, 12, 8, 11, 11, 11, 11, 11, 12, 13, 15, 9, - 12, 10, 11, 12, 12, 15, 13, 15, 13, 19, 19, 18, 18, 18, 18, 18, 18, 18 - }, - { - 4, 4, 4, 4, 5, 5, 7, 7, 3, 5, 6, 6, 6, 7, 7, 8, 8, 4, - 6, 6, 6, 6, 7, 8, 8, 8, 4, 7, 6, 6, 6, 7, 8, 9, 9, 5, - 7, 7, 6, 6, 7, 8, 9, 9, 6, 8, 8, 8, 8, 8, 8, 9, 10, 7, - 8, 8, 9, 9, 9, 8, 9, 9, 9, 14, 14, 13, 13, 13, 13, 13, 13, 13 - } +const uint8_t ff_vc1_1ref_mvdata_tabs[4][72][2] = { + { /* Table #140 */ + { 0x10, 2 }, { 0x13, 5 }, { 0x24, 6 }, { 0x53, 8 }, { 0x26, 8 }, + { 0x32, 7 }, { 0x20, 4 }, { 0x05, 5 }, { 0x37, 8 }, { 0x54, 8 }, + { 0x35, 7 }, { 0x21, 6 }, { 0x58, 8 }, { 0x36, 8 }, { 0x64, 10 }, + { 0x63, 11 }, { 0x73, 16 }, { 0x74, 16 }, { 0x75, 16 }, { 0x76, 16 }, + { 0x77, 16 }, { 0x78, 16 }, { 0, 16 }, { 0x71, 17 }, { 0x72, 17 }, + { 0x61, 13 }, { 0x62, 12 }, { 0x51, 10 }, { 0x65, 10 }, { 0x41, 8 }, + { 0x14, 6 }, { 0x23, 6 }, { 0x50, 7 }, { 0x45, 8 }, { 0x31, 8 }, + { 0x11, 4 }, { 0x04, 5 }, { 0x22, 6 }, { 0x40, 6 }, { 0x01, 3 }, + { 0x02, 4 }, { 0x06, 6 }, { 0x33, 7 }, { 0x16, 8 }, { 0x67, 9 }, + { 0x18, 9 }, { 0x12, 5 }, { 0x08, 7 }, { 0x34, 7 }, { 0x30, 6 }, + { 0x43, 8 }, { 0x44, 8 }, { 0x07, 7 }, { 0x25, 7 }, { 0x38, 9 }, + { 0x60, 9 }, { 0x17, 9 }, { 0x56, 9 }, { 0x03, 5 }, { 0x15, 7 }, + { 0x28, 9 }, { 0x47, 9 }, { 0x27, 9 }, { 0x57, 9 }, { 0x68, 9 }, + { 0x46, 9 }, { 0x55, 9 }, { 0x70, 9 }, { 0x66, 10 }, { 0x52, 10 }, + { 0x48, 9 }, { 0x42, 8 }, + }, + { /* Table #141 */ + { 0x23, 5 }, { 0x05, 5 }, { 0x25, 6 }, { 0x44, 8 }, { 0x55, 10 }, + { 0x47, 10 }, { 0x45, 9 }, { 0x43, 8 }, { 0x53, 9 }, { 0x51, 9 }, + { 0x07, 8 }, { 0x36, 9 }, { 0x17, 10 }, { 0x28, 11 }, { 0x18, 12 }, + { 0x57, 12 }, { 0x41, 8 }, { 0x52, 9 }, { 0x37, 9 }, { 0x34, 7 }, + { 0x32, 7 }, { 0x02, 3 }, { 0x11, 4 }, { 0x40, 5 }, { 0x15, 7 }, + { 0x46, 10 }, { 0x54, 10 }, { 0x27, 9 }, { 0x26, 8 }, { 0x22, 6 }, + { 0x30, 4 }, { 0x03, 4 }, { 0x13, 5 }, { 0x31, 7 }, { 0x06, 7 }, + { 0x33, 7 }, { 0x60, 8 }, { 0x66, 11 }, { 0x62, 11 }, { 0x64, 12 }, + { 0x67, 14 }, { 0x48, 14 }, { 0x38, 13 }, { 0x56, 11 }, { 0x42, 9 }, + { 0x20, 4 }, { 0x21, 6 }, { 0x14, 6 }, { 0x24, 6 }, { 0x35, 8 }, + { 0x16, 9 }, { 0x08, 10 }, { 0x63, 11 }, { 0x61, 12 }, { 0x73, 19 }, + { 0x74, 19 }, { 0x75, 19 }, { 0x76, 19 }, { 0x77, 19 }, { 0x78, 19 }, + { 0, 19 }, { 0x71, 20 }, { 0x72, 20 }, { 0x68, 16 }, { 0x70, 15 }, + { 0x58, 14 }, { 0x65, 13 }, { 0x50, 7 }, { 0x04, 5 }, { 0x12, 5 }, + { 0x10, 3 }, { 0x01, 3 }, + }, + { /* Table #142 */ + { 0x11, 4 }, { 0x30, 5 }, { 0x23, 6 }, { 0x15, 6 }, { 0x41, 9 }, + { 0x48, 12 }, { 0x70, 13 }, { 0x73, 18 }, { 0x74, 18 }, { 0x75, 18 }, + { 0x76, 18 }, { 0x77, 18 }, { 0x78, 18 }, { 0, 18 }, { 0x71, 19 }, + { 0x72, 19 }, { 0x58, 15 }, { 0x66, 15 }, { 0x68, 15 }, { 0x47, 11 }, + { 0x37, 10 }, { 0x35, 9 }, { 0x42, 9 }, { 0x33, 8 }, { 0x18, 8 }, + { 0x24, 6 }, { 0x12, 5 }, { 0x25, 7 }, { 0x53, 11 }, { 0x45, 11 }, + { 0x62, 10 }, { 0x60, 9 }, { 0x27, 8 }, { 0x22, 7 }, { 0x21, 7 }, + { 0x05, 5 }, { 0x01, 3 }, { 0x02, 4 }, { 0x03, 4 }, { 0x10, 2 }, + { 0x06, 6 }, { 0x38, 11 }, { 0x61, 12 }, { 0x64, 12 }, { 0x52, 11 }, + { 0x36, 11 }, { 0x51, 11 }, { 0x65, 12 }, { 0x56, 12 }, { 0x54, 11 }, + { 0x63, 11 }, { 0x26, 8 }, { 0x16, 7 }, { 0x13, 5 }, { 0x04, 4 }, + { 0x20, 4 }, { 0x14, 5 }, { 0x08, 9 }, { 0x28, 9 }, { 0x43, 10 }, + { 0x44, 10 }, { 0x32, 9 }, { 0x40, 7 }, { 0x50, 8 }, { 0x17, 8 }, + { 0x34, 9 }, { 0x57, 13 }, { 0x67, 13 }, { 0x46, 12 }, { 0x55, 11 }, + { 0x31, 10 }, { 0x07, 8 }, + }, + { /* Table #143 */ + { 0x04, 4 }, { 0x02, 4 }, { 0x44, 6 }, { 0x43, 6 }, { 0x06, 5 }, + { 0x30, 4 }, { 0x03, 4 }, { 0x25, 7 }, { 0x35, 7 }, { 0x24, 6 }, + { 0x52, 8 }, { 0x73, 13 }, { 0x74, 13 }, { 0x75, 13 }, { 0x76, 13 }, + { 0x77, 13 }, { 0x78, 13 }, { 0, 13 }, { 0x71, 14 }, { 0x72, 14 }, + { 0x58, 10 }, { 0x68, 9 }, { 0x45, 7 }, { 0x14, 6 }, { 0x10, 3 }, + { 0x32, 6 }, { 0x34, 6 }, { 0x11, 5 }, { 0x36, 8 }, { 0x61, 8 }, + { 0x53, 8 }, { 0x26, 8 }, { 0x16, 7 }, { 0x28, 8 }, { 0x66, 8 }, + { 0x41, 7 }, { 0x08, 7 }, { 0x60, 7 }, { 0x70, 9 }, { 0x48, 9 }, + { 0x46, 8 }, { 0x20, 4 }, { 0x21, 6 }, { 0x33, 6 }, { 0x05, 5 }, + { 0x42, 7 }, { 0x63, 9 }, { 0x57, 9 }, { 0x17, 8 }, { 0x50, 6 }, + { 0x22, 6 }, { 0x27, 8 }, { 0x56, 8 }, { 0x15, 7 }, { 0x01, 4 }, + { 0x40, 5 }, { 0x37, 9 }, { 0x64, 9 }, { 0x62, 8 }, { 0x31, 7 }, + { 0x13, 6 }, { 0x54, 8 }, { 0x55, 8 }, { 0x18, 8 }, { 0x65, 9 }, + { 0x67, 9 }, { 0x23, 6 }, { 0x12, 6 }, { 0x51, 8 }, { 0x47, 9 }, + { 0x38, 9 }, { 0x07, 7 }, + }, }; /* 2-reference tables */ -const uint32_t ff_vc1_2ref_mvdata_codes[8][126] = { /* table 132 - table 139 */ - { - 0x0000C, 0x0001C, 0x0000B, 0x00000, 0x0000E, 0x0002A, 0x00050, 0x00368, - 0x00002, 0x0001A, 0x00004, 0x0003A, 0x0001D, 0x0006C, 0x000EF, 0x001BC, - 0x0015F, 0x0000F, 0x00003, 0x0001C, 0x0000D, 0x0000B, 0x0003E, 0x000A7, - 0x00146, 0x00199, 0x00006, 0x0001F, 0x00004, 0x0003C, 0x00007, 0x001BE, - 0x0008B, 0x0002C, 0x007B3, 0x00005, 0x000DB, 0x00056, 0x000EC, 0x00052, - 0x001BD, 0x00078, 0x000CF, 0x00573, 0x00009, 0x00023, 0x000ED, 0x00018, - 0x00006, 0x00044, 0x000F5, 0x00079, 0x006D2, 0x0006E, 0x0002B, 0x0015D, - 0x00017, 0x0037F, 0x00144, 0x000CE, 0x00028, 0x000AB, 0x00010, 0x001B5, - 0x000F7, 0x000A6, 0x0007B, 0x00028, 0x001ED, 0x001E9, 0x006FD, 0x00004, - 0x000F5, 0x00029, 0x0028A, 0x0028B, 0x0028F, 0x00DF9, 0x00335, 0x01E85, - 0x000EE, 0x002BD, 0x0002B, 0x003D8, 0x003D1, 0x00198, 0x001E9, 0x0051D, - 0x000B4, 0x0003F, 0x00455, 0x0022B, 0x00229, 0x00451, 0x00578, 0x007B2, - 0x00570, 0x00155, 0x00032, 0x003D0, 0x00054, 0x006D3, 0x00571, 0x00454, - 0x00334, 0x01BF1, 0x000B7, 0x00029, 0x01E84, 0x0016C, 0x0019B, 0x01BF0, - 0x00579, 0x00F43, 0x000B5, 0x008A1, 0x0002A, 0x0016D, 0x008A0, 0x007A0, - 0x003D1, 0x00AE5, 0x00154, 0x00AE4, 0x00A39, 0x00A38 - }, - { - 0x00003, 0x00009, 0x00016, 0x00010, 0x000D7, 0x00335, 0x00574, 0x00555, - 0x00000, 0x0001D, 0x00009, 0x00017, 0x0002C, 0x000AD, 0x00374, 0x006B3, - 0x00577, 0x0000F, 0x00018, 0x0000A, 0x0002E, 0x00022, 0x0017C, 0x00E7B, - 0x01B89, 0x015D8, 0x00008, 0x00034, 0x0006D, 0x00023, 0x001C2, 0x00376, - 0x002D3, 0x01C4A, 0x0330A, 0x00014, 0x0006A, 0x00072, 0x0006C, 0x000E3, - 0x0019B, 0x0073F, 0x01CF0, 0x00B41, 0x00032, 0x000E6, 0x000E0, 0x000CF, - 0x000AB, 0x0019C, 0x002AB, 0x00E2B, 0x015D9, 0x0006F, 0x001C3, 0x000AF, - 0x000BF, 0x000AC, 0x0017D, 0x006E3, 0x00E29, 0x01984, 0x00054, 0x000B5, - 0x0017A, 0x001AD, 0x00199, 0x00178, 0x00358, 0x002D2, 0x01C4B, 0x0005B, - 0x002A8, 0x00331, 0x00388, 0x0038B, 0x00370, 0x00713, 0x00CC3, 0x01CF1, - 0x001B9, 0x005EF, 0x00738, 0x002F2, 0x0033B, 0x002B9, 0x006EB, 0x00570, - 0x00E24, 0x0039D, 0x005A2, 0x005A3, 0x00E7D, 0x005EE, 0x00739, 0x00554, - 0x00AA5, 0x00AA4, 0x00377, 0x01CF5, 0x00BCE, 0x00E79, 0x00660, 0x00674, - 0x006EA, 0x00E7C, 0x00D65, 0x002F6, 0x015DA, 0x01B88, 0x005A1, 0x01CF4, - 0x005E6, 0x00E28, 0x00575, 0x00D64, 0x00334, 0x0330B, 0x015DB, 0x00B40, - 0x00BCF, 0x00DC5, 0x00E2A, 0x00675, 0x00571, 0x00553 - }, - { - 0x00004, 0x00002, 0x00010, 0x00003, 0x00017, 0x00045, 0x0003E, 0x0007E, - 0x00003, 0x00002, 0x00028, 0x0001E, 0x00015, 0x00047, 0x00002, 0x0014D, - 0x00060, 0x0000B, 0x00026, 0x00024, 0x00014, 0x00032, 0x0006F, 0x000C3, - 0x00531, 0x006E5, 0x00015, 0x0003F, 0x0002D, 0x00001, 0x0013E, 0x000DD, - 0x000F6, 0x00305, 0x00331, 0x0000E, 0x00003, 0x00034, 0x00033, 0x0001A, - 0x0014A, 0x000C5, 0x000F4, 0x006E4, 0x00001, 0x0003C, 0x0007D, 0x0008D, - 0x0009D, 0x00031, 0x0006E, 0x00296, 0x000CD, 0x00025, 0x00149, 0x00032, - 0x00089, 0x00036, 0x00088, 0x0006F, 0x00003, 0x0031D, 0x0000E, 0x001AA, - 0x0027E, 0x00061, 0x0014E, 0x0014F, 0x00067, 0x000FF, 0x00183, 0x00036, - 0x00357, 0x000F5, 0x000C6, 0x000C2, 0x00299, 0x00119, 0x00231, 0x00350, - 0x0002C, 0x0018F, 0x00530, 0x00297, 0x00004, 0x001B8, 0x000C0, 0x0027A, - 0x00311, 0x0009C, 0x00621, 0x00199, 0x0031C, 0x000F7, 0x003E3, 0x00356, - 0x00189, 0x00005, 0x0006B, 0x008C2, 0x00330, 0x004FF, 0x004F0, 0x00351, - 0x004F2, 0x001F2, 0x00373, 0x00000, 0x00C41, 0x008C3, 0x009EC, 0x003E2, - 0x00304, 0x004F7, 0x004F1, 0x001F0, 0x00148, 0x00C40, 0x009ED, 0x008C0, - 0x008C1, 0x004F3, 0x004FE, 0x000FE, 0x001F3, 0x001A9 - }, - { - 0x00000, 0x00004, 0x0002F, 0x00052, 0x00010, 0x000AD, 0x0050B, 0x00190, - 0x00003, 0x00016, 0x00007, 0x0000D, 0x000BB, 0x00173, 0x000C9, 0x0050F, - 0x0172C, 0x00003, 0x00011, 0x00005, 0x00043, 0x00023, 0x0004B, 0x0032E, - 0x02E5B, 0x00482, 0x00009, 0x0002A, 0x00014, 0x0002A, 0x00108, 0x005CA, - 0x0065A, 0x02136, 0x02132, 0x0000B, 0x00013, 0x00041, 0x000B8, 0x00174, - 0x00100, 0x014DA, 0x0404E, 0x01437, 0x0002B, 0x00085, 0x000A7, 0x000A0, - 0x0014C, 0x0029A, 0x0032C, 0x02133, 0x0142A, 0x00051, 0x00284, 0x000AC, - 0x00102, 0x00045, 0x00044, 0x0081B, 0x0065E, 0x00CB7, 0x00018, 0x0050C, - 0x00212, 0x002E4, 0x00203, 0x00094, 0x00122, 0x0081A, 0x00655, 0x00033, - 0x002BA, 0x00246, 0x00242, 0x00A6E, 0x0040C, 0x00808, 0x02134, 0x0404F, - 0x00175, 0x00405, 0x00247, 0x0012A, 0x00A14, 0x002BB, 0x00191, 0x0084F, - 0x01438, 0x000AF, 0x00B97, 0x00483, 0x0143B, 0x0032B, 0x00243, 0x0142B, - 0x00958, 0x029BF, 0x00049, 0x00A6C, 0x014DB, 0x004AD, 0x014DE, 0x0084E, - 0x01434, 0x00257, 0x02E5A, 0x00207, 0x01435, 0x01439, 0x00CB6, 0x0143A, - 0x00194, 0x00654, 0x02135, 0x0537C, 0x0015C, 0x00240, 0x01012, 0x0537D, - 0x00959, 0x01098, 0x01436, 0x0065F, 0x02026, 0x02137 - }, - { - 0x00005, 0x00019, 0x00016, 0x00011, 0x0003E, 0x0005E, 0x000EF, 0x000E2, - 0x00000, 0x00039, 0x0002B, 0x00026, 0x00028, 0x00012, 0x000C2, 0x000ED, - 0x0011D, 0x0000D, 0x00031, 0x0002A, 0x00025, 0x00020, 0x0005C, 0x001ED, - 0x0024D, 0x00770, 0x00006, 0x0007A, 0x00060, 0x0004F, 0x00048, 0x00039, - 0x00186, 0x00213, 0x00EC6, 0x0000F, 0x00026, 0x0005F, 0x00075, 0x00070, - 0x00027, 0x001DB, 0x003C6, 0x0078F, 0x0003F, 0x000A6, 0x000F0, 0x0003A, - 0x00052, 0x0004E, 0x000E3, 0x001D9, 0x0030F, 0x00010, 0x001DD, 0x000A7, - 0x000F7, 0x00022, 0x00092, 0x003C4, 0x002EF, 0x00762, 0x00079, 0x0008F, - 0x001DA, 0x00087, 0x000E8, 0x000BA, 0x00176, 0x000EE, 0x003B0, 0x00085, - 0x00119, 0x0030E, 0x00108, 0x001D2, 0x0010C, 0x00773, 0x00424, 0x00434, - 0x00071, 0x005DD, 0x001C1, 0x003A7, 0x00127, 0x0008D, 0x0021B, 0x007B2, - 0x001DF, 0x003D8, 0x00764, 0x00EE4, 0x003B3, 0x0074D, 0x001D8, 0x005DC, - 0x0084A, 0x00499, 0x003C5, 0x01D8E, 0x00765, 0x00435, 0x00771, 0x001C2, - 0x00118, 0x003BC, 0x00381, 0x00387, 0x07B33, 0x01097, 0x01096, 0x01ECD, - 0x00E99, 0x00F1C, 0x00F1D, 0x00EE5, 0x0011C, 0x07B32, 0x03D98, 0x01D8F, - 0x00E98, 0x00F67, 0x003BD, 0x00380, 0x00498, 0x00386 - }, - { - 0x0000D, 0x00010, 0x0002E, 0x00039, 0x0000D, 0x00074, 0x000ED, 0x000B6, - 0x00001, 0x00002, 0x00000, 0x00030, 0x00029, 0x00070, 0x000F3, 0x0008C, - 0x00166, 0x00009, 0x00033, 0x00078, 0x00006, 0x000C4, 0x0000B, 0x00163, - 0x000CC, 0x005BE, 0x0001F, 0x0002F, 0x00064, 0x00018, 0x000C6, 0x0000A, - 0x00162, 0x002C0, 0x00EF3, 0x00007, 0x0000F, 0x000E3, 0x000CA, 0x000B2, - 0x0018F, 0x003AE, 0x0075F, 0x00C51, 0x00015, 0x00047, 0x000EE, 0x000E2, - 0x000EA, 0x00009, 0x0016A, 0x002C3, 0x0059D, 0x0003D, 0x00008, 0x001D9, - 0x00032, 0x0000E, 0x0016E, 0x0032C, 0x0065B, 0x0196B, 0x00002, 0x0000F, - 0x001D8, 0x0008D, 0x000B4, 0x001E4, 0x00067, 0x00317, 0x00794, 0x00022, - 0x003BE, 0x00315, 0x00034, 0x00037, 0x002DE, 0x0006C, 0x00EFE, 0x0066C, - 0x00028, 0x003CB, 0x003AC, 0x00035, 0x0016B, 0x003BD, 0x002C1, 0x0062C, - 0x01DFE, 0x0000E, 0x0059E, 0x005BF, 0x000DA, 0x00629, 0x00584, 0x00EB7, - 0x00B0A, 0x0066D, 0x0000C, 0x0077E, 0x0059C, 0x00778, 0x0075E, 0x0075A, - 0x0062D, 0x00337, 0x00334, 0x00197, 0x01E57, 0x01DE4, 0x0196A, 0x01E56, - 0x00C50, 0x00B3F, 0x01E54, 0x00B0B, 0x0018E, 0x001B6, 0x01E55, 0x00CB4, - 0x00B3E, 0x00EB6, 0x01DE5, 0x01DFF, 0x00335, 0x001B7 - }, - { - 0x00001, 0x0000B, 0x00019, 0x0006F, 0x0002A, 0x00075, 0x007EB, 0x00163, - 0x00001, 0x0000E, 0x0001A, 0x0003E, 0x0001C, 0x0002D, 0x00164, 0x007EC, - 0x00165, 0x00004, 0x00006, 0x00036, 0x0007F, 0x000AE, 0x00158, 0x0015C, - 0x0056D, 0xFD510, 0x00000, 0x00004, 0x0007B, 0x000F3, 0x0003B, 0x007ED, - 0x002B3, 0x002CC, 0x0056E, 0x00018, 0x0003E, 0x00017, 0x0001E, 0x000AF, - 0x003F7, 0x0056F, 0x002CD, 0xFD511, 0x00014, 0x000AD, 0x000AA, 0x00014, - 0x000A8, 0x00153, 0x000E8, 0x001FE, 0x00DCF, 0x00078, 0x001B8, 0x00152, - 0x000FE, 0x002B1, 0x0015D, 0x00160, 0xFD512, 0xFD513, 0x0007A, 0x002B0, - 0x001E5, 0x000E9, 0x000FC, 0x006E6, 0x00DC8, 0x00584, 0xFD514, 0x000AB, - 0x00DDE, 0x00159, 0x003F4, 0x00DC9, 0x00DCA, 0x001FA, 0xFD515, 0xFD516, - 0x000FC, 0x001FF, 0x001E4, 0x000AF, 0x0015A, 0x00167, 0x00DCB, 0x00585, - 0xFD517, 0x003F7, 0x03F55, 0xFD518, 0x00DDC, 0x00586, 0x03F56, 0xFD519, - 0x03F57, 0xFD51A, 0x001BA, 0x00587, 0x00588, 0x00DDF, 0x002B2, 0xFD51B, - 0x00DCE, 0x003F6, 0xFD51C, 0x00FD4, 0xFD51D, 0xFD51E, 0xFD51F, 0x7EA80, - 0x7EA81, 0x0056C, 0x7EA82, 0x7EA83, 0x00376, 0x00589, 0x0058A, 0x7EA84, - 0x7EA85, 0x00DDD, 0x7EA86, 0x7EA87, 0x0058B, 0x07EA9 - }, - { - 0x00003, 0x0000E, 0x0000F, 0x0007E, 0x00062, 0x000C6, 0x00CD9, 0x0063E, - 0x00002, 0x00002, 0x00000, 0x00018, 0x0000C, 0x00069, 0x00039, 0x00707, - 0x00C7E, 0x00002, 0x0000D, 0x0001B, 0x0000F, 0x0019A, 0x00647, 0x01A37, - 0x346C4, 0x0346D, 0x00001, 0x0001E, 0x0007F, 0x0000A, 0x000E1, 0x00661, - 0x00CE4, 0x346C5, 0x346C6, 0x0001D, 0x00030, 0x0000D, 0x000CB, 0x00199, - 0x00320, 0x0008E, 0x0652E, 0x346C7, 0x0003E, 0x00039, 0x00035, 0x00033, - 0x0019F, 0x001C0, 0x00CDA, 0x346C8, 0x346C9, 0x0000B, 0x000D0, 0x0019E, - 0x00022, 0x00038, 0x0018E, 0x0031E, 0x03294, 0x0023C, 0x00032, 0x00012, - 0x00013, 0x00071, 0x0019D, 0x00020, 0x00C87, 0x00CC0, 0x346CA, 0x00338, - 0x00653, 0x001A2, 0x0032A, 0x00322, 0x00CE7, 0x00084, 0x0011F, 0x346CB, - 0x00325, 0x00649, 0x0032B, 0x00077, 0x00648, 0x00642, 0x00C86, 0x00C8C, - 0x346CC, 0x0003A, 0x019B7, 0x00043, 0x00327, 0x0008C, 0x0008D, 0x00C8D, - 0x346CD, 0x346CE, 0x00337, 0x00CE5, 0x00085, 0x00326, 0x00347, 0x00CA4, - 0x00C7F, 0x00D1A, 0x346CF, 0x00328, 0x1A360, 0x1A361, 0x00CD8, 0x0068C, - 0x03295, 0x03296, 0x0652F, 0x066D8, 0x00331, 0x00706, 0x0023D, 0x00076, - 0x00CC1, 0x00382, 0x00CE6, 0x066D9, 0x066DA, 0x066DB - } -}; - -const uint8_t ff_vc1_2ref_mvdata_bits[8][126] = { - { - 4, 5, 5, 5, 6, 7, 8, 10, 2, 5, 5, 6, 6, 7, 8, 9, - 10, 4, 5, 6, 6, 7, 8, 9, 10, 11, 4, 6, 6, 7, 7, 9, - 9, 10, 12, 5, 8, 8, 8, 8, 9, 9, 10, 12, 5, 7, 8, 7, - 7, 8, 9, 9, 11, 7, 9, 10, 9, 10, 10, 10, 10, 12, 6, 9, - 9, 9, 9, 9, 10, 10, 11, 7, 10, 10, 11, 11, 11, 12, 12, 14, - 8, 11, 10, 11, 11, 11, 11, 12, 12, 8, 12, 11, 11, 12, 12, 12, - 12, 13, 8, 12, 11, 11, 12, 12, 12, 13, 12, 9, 14, 13, 11, 13, - 12, 13, 12, 13, 9, 13, 13, 12, 12, 13, 13, 13, 13, 13 - }, - { - 3, 4, 5, 6, 8, 10, 11, 11, 2, 5, 5, 6, 7, 8, 10, 11, - 11, 4, 5, 5, 6, 7, 9, 12, 13, 13, 4, 6, 7, 7, 9, 10, - 11, 13, 14, 5, 7, 7, 7, 8, 9, 11, 13, 13, 6, 8, 8, 8, - 8, 9, 10, 12, 13, 7, 9, 8, 8, 8, 9, 11, 12, 13, 7, 9, - 9, 9, 9, 9, 10, 11, 13, 8, 10, 10, 10, 10, 10, 11, 12, 13, - 9, 11, 11, 10, 10, 10, 11, 11, 12, 10, 12, 12, 12, 11, 11, 11, - 12, 12, 10, 13, 12, 12, 11, 11, 11, 12, 12, 10, 13, 13, 12, 13, - 11, 12, 11, 12, 10, 14, 13, 13, 12, 12, 12, 11, 11, 11 - }, - { - 4, 4, 5, 5, 6, 7, 8, 9, 2, 5, 6, 6, 6, 7, 7, 9, - 9, 4, 6, 6, 6, 7, 8, 9, 11, 12, 5, 7, 7, 7, 9, 9, - 10, 11, 12, 5, 7, 7, 7, 7, 9, 9, 10, 12, 5, 8, 8, 8, - 8, 8, 9, 10, 10, 6, 9, 8, 8, 8, 8, 9, 9, 11, 6, 10, - 10, 9, 9, 9, 9, 10, 10, 7, 11, 10, 9, 9, 10, 9, 10, 11, - 7, 10, 11, 10, 10, 10, 9, 10, 11, 8, 12, 11, 11, 10, 11, 11, - 10, 10, 8, 12, 12, 11, 11, 11, 11, 10, 11, 8, 13, 12, 12, 11, - 11, 11, 11, 10, 9, 13, 12, 12, 12, 11, 11, 10, 10, 10 - }, - { - 3, 4, 6, 7, 7, 9, 11, 11, 2, 5, 5, 6, 8, 9, 10, 11, - 13, 3, 5, 5, 7, 8, 9, 12, 14, 13, 4, 6, 6, 7, 9, 11, - 13, 14, 14, 5, 7, 7, 8, 9, 9, 13, 15, 13, 6, 8, 8, 8, - 9, 10, 12, 14, 13, 7, 10, 9, 9, 9, 9, 12, 13, 14, 7, 11, - 10, 10, 10, 10, 11, 12, 13, 8, 11, 12, 12, 12, 11, 12, 14, 15, - 9, 11, 12, 11, 12, 11, 11, 12, 13, 9, 12, 13, 13, 12, 12, 13, - 14, 14, 9, 12, 13, 13, 13, 12, 13, 12, 14, 10, 13, 13, 14, 13, - 11, 13, 14, 15, 10, 12, 13, 15, 14, 13, 13, 13, 14, 14 - }, - { - 4, 5, 5, 5, 6, 7, 8, 8, 2, 6, 6, 6, 6, 6, 8, 9, - 10, 4, 6, 6, 6, 6, 7, 9, 10, 11, 4, 7, 7, 7, 7, 7, - 9, 10, 12, 5, 7, 7, 7, 7, 7, 9, 10, 11, 6, 8, 8, 7, - 7, 7, 8, 9, 10, 6, 9, 8, 8, 7, 8, 10, 10, 11, 7, 9, - 9, 8, 8, 8, 9, 9, 10, 8, 10, 10, 9, 9, 9, 11, 11, 11, - 8, 11, 10, 10, 9, 9, 10, 11, 10, 10, 12, 12, 11, 11, 10, 11, - 12, 11, 10, 13, 12, 11, 11, 10, 10, 11, 11, 11, 15, 13, 13, 13, - 12, 12, 12, 12, 10, 15, 14, 13, 12, 12, 11, 11, 11, 11 - }, - { - 4, 5, 6, 6, 6, 7, 8, 8, 2, 4, 5, 6, 6, 7, 8, 8, - 9, 4, 6, 7, 7, 8, 8, 9, 10, 11, 5, 6, 7, 7, 8, 8, - 9, 10, 12, 5, 7, 8, 8, 8, 9, 10, 11, 12, 5, 7, 8, 8, - 8, 8, 9, 10, 11, 6, 8, 9, 8, 8, 9, 10, 11, 13, 5, 8, - 9, 8, 8, 9, 9, 10, 11, 6, 10, 10, 9, 9, 10, 10, 12, 13, - 6, 10, 10, 9, 9, 10, 10, 11, 13, 7, 11, 11, 11, 11, 11, 12, - 12, 13, 7, 11, 11, 11, 11, 11, 11, 12, 12, 9, 13, 13, 13, 13, - 12, 12, 13, 12, 9, 12, 13, 12, 12, 12, 13, 13, 12, 12 - }, - { - 3, 5, 6, 8, 9, 10, 12, 12, 1, 5, 6, 7, 8, 9, 12, 12, - 12, 4, 6, 7, 8, 9, 12, 12, 14, 21, 4, 6, 8, 9, 9, 12, - 13, 13, 14, 6, 9, 8, 8, 9, 13, 14, 13, 21, 6, 9, 9, 8, - 9, 10, 11, 12, 13, 8, 10, 10, 11, 11, 12, 12, 21, 21, 8, 11, - 10, 11, 11, 12, 13, 14, 21, 9, 13, 10, 11, 13, 13, 12, 21, 21, - 9, 12, 10, 11, 12, 12, 13, 14, 21, 11, 15, 21, 13, 14, 15, 21, - 15, 21, 10, 14, 14, 13, 13, 21, 13, 13, 21, 13, 21, 21, 21, 20, - 20, 14, 20, 20, 11, 14, 14, 20, 20, 13, 20, 20, 14, 16 - }, - { - 2, 5, 6, 8, 9, 10, 13, 13, 2, 4, 5, 6, 8, 9, 10, 13, - 14, 3, 5, 7, 8, 10, 12, 15, 20, 16, 4, 6, 8, 8, 10, 12, - 13, 20, 20, 7, 8, 8, 9, 10, 11, 12, 16, 20, 7, 8, 8, 8, - 10, 11, 13, 20, 20, 8, 10, 10, 10, 10, 11, 12, 15, 14, 8, 9, - 9, 9, 10, 10, 13, 13, 20, 11, 12, 11, 11, 11, 13, 12, 13, 20, - 11, 12, 11, 11, 12, 12, 13, 13, 20, 10, 14, 11, 11, 12, 12, 13, - 20, 20, 11, 13, 12, 11, 12, 13, 14, 14, 20, 11, 19, 19, 13, 13, - 15, 15, 16, 16, 11, 13, 14, 11, 13, 12, 13, 16, 16, 16 - } +const uint8_t ff_vc1_2ref_mvdata_tabs[8][126][2] = { /* Tables 132 - 139 */ + { /* Table 132 */ + { 0x04, 5 }, { 0x80, 7 }, { 0x67, 10 }, { 0x82, 10 }, { 0xB2, 11 }, + { 0xD6, 13 }, { 0xA8, 13 }, { 0x68, 12 }, { 0x92, 10 }, { 0x37, 10 }, + { 0x98, 12 }, { 0xC7, 12 }, { 0xC2, 13 }, { 0xD1, 13 }, { 0xB8, 12 }, + { 0x63, 9 }, { 0x54, 7 }, { 0x34, 7 }, { 0x32, 6 }, { 0x75, 9 }, + { 0xC0, 9 }, { 0xD0, 9 }, { 0x61, 9 }, { 0x24, 7 }, { 0x21, 5 }, + { 0x12, 5 }, { 0x40, 5 }, { 0x53, 7 }, { 0xB0, 8 }, { 0x95, 11 }, + { 0x28, 11 }, { 0xB6, 12 }, { 0x87, 12 }, { 0xC3, 11 }, { 0x66, 10 }, + { 0x47, 10 }, { 0x23, 6 }, { 0x05, 6 }, { 0x46, 9 }, { 0x57, 9 }, + { 0xB1, 12 }, { 0xD4, 12 }, { 0x96, 11 }, { 0x81, 10 }, { 0x74, 9 }, + { 0x25, 8 }, { 0xA0, 8 }, { 0x70, 6 }, { 0x55, 8 }, { 0xD2, 13 }, + { 0xC8, 13 }, { 0xA4, 12 }, { 0xA3, 11 }, { 0xB5, 12 }, { 0xA1, 12 }, + { 0xA2, 11 }, { 0x36, 9 }, { 0x51, 7 }, { 0x50, 5 }, { 0x07, 8 }, + { 0x65, 10 }, { 0x83, 11 }, { 0x84, 11 }, { 0x27, 10 }, { 0, 13 }, + { 0xD8, 13 }, { 0x97, 12 }, { 0x85, 11 }, { 0x44, 8 }, { 0x73, 9 }, + { 0x26, 9 }, { 0x06, 7 }, { 0x42, 8 }, { 0xA7, 12 }, { 0xB4, 12 }, + { 0xD7, 13 }, { 0xD5, 13 }, { 0x48, 12 }, { 0x62, 10 }, { 0xA5, 12 }, + { 0xC5, 12 }, { 0x91, 11 }, { 0x18, 10 }, { 0x03, 5 }, { 0x30, 4 }, + { 0x22, 6 }, { 0x14, 6 }, { 0x33, 7 }, { 0xD3, 12 }, { 0xC1, 14 }, + { 0x88, 14 }, { 0xC6, 13 }, { 0x94, 11 }, { 0x77, 10 }, { 0x56, 9 }, + { 0x93, 11 }, { 0xA6, 12 }, { 0x38, 12 }, { 0x76, 10 }, { 0x72, 9 }, + { 0x31, 6 }, { 0x10, 2 }, { 0x01, 4 }, { 0x11, 5 }, { 0x15, 7 }, + { 0x08, 10 }, { 0x58, 11 }, { 0xB3, 11 }, { 0x71, 9 }, { 0x41, 8 }, + { 0x60, 7 }, { 0x17, 9 }, { 0x45, 9 }, { 0x35, 9 }, { 0xC4, 13 }, + { 0xB7, 13 }, { 0x86, 12 }, { 0x78, 11 }, { 0x64, 10 }, { 0x02, 5 }, + { 0x13, 6 }, { 0x43, 8 }, { 0x52, 8 }, { 0x90, 8 }, { 0x16, 8 }, + { 0x20, 4 }, + }, + { /* Table #133 */ + { 0x10, 2 }, { 0x04, 6 }, { 0x24, 7 }, { 0x33, 7 }, { 0x12, 5 }, + { 0x22, 5 }, { 0x14, 7 }, { 0xD3, 13 }, { 0x48, 13 }, { 0xC3, 12 }, + { 0xA1, 12 }, { 0xA2, 12 }, { 0x77, 11 }, { 0x36, 11 }, { 0x71, 9 }, + { 0x80, 8 }, { 0x13, 6 }, { 0x01, 3 }, { 0x30, 4 }, { 0x02, 4 }, + { 0x40, 5 }, { 0x70, 7 }, { 0x81, 10 }, { 0xA8, 12 }, { 0xA7, 12 }, + { 0, 11 }, { 0xA6, 11 }, { 0x08, 11 }, { 0x56, 10 }, { 0x54, 8 }, + { 0x64, 8 }, { 0x15, 8 }, { 0x97, 11 }, { 0xD8, 11 }, { 0x95, 10 }, + { 0x07, 11 }, { 0xC7, 11 }, { 0x28, 13 }, { 0x58, 13 }, { 0xC1, 13 }, + { 0xD2, 13 }, { 0x18, 11 }, { 0x62, 8 }, { 0x03, 5 }, { 0x23, 6 }, + { 0x75, 9 }, { 0x93, 10 }, { 0xC5, 11 }, { 0xB2, 12 }, { 0xD4, 12 }, + { 0x72, 9 }, { 0xC0, 10 }, { 0xA4, 11 }, { 0x91, 11 }, { 0x25, 9 }, + { 0x65, 9 }, { 0x63, 8 }, { 0x21, 5 }, { 0x50, 6 }, { 0xB4, 11 }, + { 0x68, 13 }, { 0x38, 14 }, { 0xD1, 14 }, { 0x87, 12 }, { 0x82, 10 }, + { 0x74, 9 }, { 0xD0, 10 }, { 0x06, 10 }, { 0x45, 9 }, { 0x55, 9 }, + { 0xB5, 11 }, { 0xD7, 11 }, { 0x94, 10 }, { 0x53, 8 }, { 0x31, 6 }, + { 0x41, 7 }, { 0x76, 10 }, { 0xC8, 12 }, { 0xB8, 12 }, { 0x17, 11 }, + { 0x73, 9 }, { 0x05, 8 }, { 0x43, 7 }, { 0x32, 7 }, { 0x85, 10 }, + { 0xC2, 13 }, { 0x27, 13 }, { 0xD5, 12 }, { 0x66, 11 }, { 0x90, 9 }, + { 0x16, 10 }, { 0xB6, 11 }, { 0x96, 11 }, { 0x35, 10 }, { 0xB0, 10 }, + { 0x60, 7 }, { 0x52, 8 }, { 0x34, 9 }, { 0x61, 9 }, { 0x83, 10 }, + { 0x98, 12 }, { 0x37, 13 }, { 0x78, 13 }, { 0x86, 11 }, { 0xC6, 12 }, + { 0x67, 12 }, { 0xD6, 12 }, { 0x57, 12 }, { 0x84, 10 }, { 0x44, 8 }, + { 0x42, 7 }, { 0x51, 8 }, { 0x92, 11 }, { 0xA5, 11 }, { 0xA0, 10 }, + { 0x47, 13 }, { 0x88, 13 }, { 0xB3, 12 }, { 0xC4, 13 }, { 0xB1, 13 }, + { 0x26, 12 }, { 0xB7, 12 }, { 0xA3, 12 }, { 0x46, 11 }, { 0x11, 5 }, + { 0x20, 4 }, + }, + { /* Table #134 */ + { 0xC0, 8 }, { 0x94, 10 }, { 0xA8, 10 }, { 0x67, 9 }, { 0x33, 7 }, + { 0x16, 7 }, { 0x41, 7 }, { 0x50, 5 }, { 0x11, 5 }, { 0x04, 5 }, + { 0x02, 4 }, { 0x18, 9 }, { 0x73, 9 }, { 0x55, 8 }, { 0x62, 8 }, + { 0xB2, 12 }, { 0x38, 12 }, { 0xA2, 11 }, { 0x58, 10 }, { 0x76, 9 }, + { 0x44, 7 }, { 0x64, 8 }, { 0x56, 9 }, { 0x66, 9 }, { 0x70, 6 }, + { 0x51, 8 }, { 0x47, 10 }, { 0x82, 10 }, { 0x36, 10 }, { 0xA4, 10 }, + { 0x07, 8 }, { 0x08, 9 }, { 0xD7, 10 }, { 0x77, 10 }, { 0x01, 4 }, + { 0x23, 6 }, { 0x14, 6 }, { 0x90, 7 }, { 0x32, 7 }, { 0x05, 6 }, + { 0x96, 9 }, { 0xC5, 11 }, { 0x37, 11 }, { 0x78, 10 }, { 0x84, 9 }, + { 0x26, 9 }, { 0xD1, 13 }, { 0xC1, 13 }, { 0xA1, 12 }, { 0x98, 11 }, + { 0xA7, 10 }, { 0x46, 9 }, { 0x83, 9 }, { 0xA3, 11 }, { 0x68, 11 }, + { 0x91, 10 }, { 0x24, 7 }, { 0x43, 7 }, { 0x42, 7 }, { 0x88, 11 }, + { 0xB5, 11 }, { 0, 10 }, { 0x71, 10 }, { 0xA6, 11 }, { 0x81, 11 }, + { 0xB0, 8 }, { 0x80, 7 }, { 0x95, 10 }, { 0x48, 12 }, { 0x28, 12 }, + { 0xB8, 11 }, { 0x35, 9 }, { 0x25, 8 }, { 0x40, 5 }, { 0x13, 6 }, + { 0xC8, 10 }, { 0xC4, 11 }, { 0xA5, 11 }, { 0xB7, 10 }, { 0xD8, 10 }, + { 0x52, 8 }, { 0x31, 7 }, { 0x03, 5 }, { 0x65, 8 }, { 0x63, 8 }, + { 0x06, 7 }, { 0xD3, 12 }, { 0xD4, 12 }, { 0xB1, 12 }, { 0xC2, 12 }, + { 0x87, 10 }, { 0x86, 9 }, { 0x53, 8 }, { 0x15, 7 }, { 0x22, 6 }, + { 0x60, 6 }, { 0x21, 6 }, { 0xA0, 8 }, { 0x54, 8 }, { 0xB4, 11 }, + { 0xC7, 11 }, { 0xB6, 11 }, { 0xD5, 11 }, { 0x97, 10 }, { 0xC3, 12 }, + { 0xD2, 12 }, { 0xC6, 11 }, { 0x34, 9 }, { 0x72, 10 }, { 0xD6, 11 }, + { 0xB3, 11 }, { 0x12, 6 }, { 0xD0, 9 }, { 0x61, 9 }, { 0x45, 9 }, + { 0x57, 10 }, { 0x93, 10 }, { 0x92, 11 }, { 0x27, 11 }, { 0x85, 10 }, + { 0x17, 9 }, { 0x74, 9 }, { 0x75, 9 }, { 0x30, 5 }, { 0x20, 4 }, + { 0x10, 2 }, + }, + { /* Table #135 */ + { 0x01, 3 }, { 0x05, 7 }, { 0x65, 9 }, { 0x64, 9 }, { 0x24, 8 }, + { 0xD1, 12 }, { 0x28, 13 }, { 0xA2, 13 }, { 0x83, 12 }, { 0xA5, 12 }, + { 0x76, 11 }, { 0x82, 12 }, { 0x92, 12 }, { 0xB0, 9 }, { 0x75, 10 }, + { 0x93, 11 }, { 0xA7, 14 }, { 0xD4, 14 }, { 0xB3, 13 }, { 0xB7, 12 }, + { 0x25, 9 }, { 0x41, 7 }, { 0x22, 5 }, { 0x70, 7 }, { 0x08, 11 }, + { 0x96, 11 }, { 0x16, 10 }, { 0xC5, 11 }, { 0xC6, 13 }, { 0x78, 13 }, + { 0xA4, 12 }, { 0x56, 12 }, { 0x36, 13 }, { 0xC3, 14 }, { 0x68, 14 }, + { 0x26, 12 }, { 0x67, 13 }, { 0xD7, 13 }, { 0x80, 8 }, { 0x13, 6 }, + { 0x12, 5 }, { 0x02, 4 }, { 0x32, 6 }, { 0x33, 7 }, { 0x62, 9 }, + { 0x06, 9 }, { 0xD0, 10 }, { 0x81, 11 }, { 0x95, 11 }, { 0xA0, 9 }, + { 0x40, 5 }, { 0x20, 3 }, { 0x45, 9 }, { 0x86, 12 }, { 0xD2, 13 }, + { 0xD8, 14 }, { 0x47, 15 }, { 0x88, 15 }, { 0x91, 11 }, { 0x74, 10 }, + { 0x63, 9 }, { 0x85, 11 }, { 0x77, 12 }, { 0x66, 12 }, { 0xC0, 10 }, + { 0x42, 7 }, { 0x34, 9 }, { 0x72, 10 }, { 0xD5, 13 }, { 0x38, 14 }, + { 0x57, 14 }, { 0x87, 14 }, { 0xC7, 14 }, { 0x37, 14 }, { 0, 14 }, + { 0xB5, 12 }, { 0x97, 12 }, { 0x51, 8 }, { 0x23, 7 }, { 0x21, 5 }, + { 0x30, 4 }, { 0x53, 8 }, { 0x61, 10 }, { 0x94, 12 }, { 0x58, 13 }, + { 0xA6, 13 }, { 0x07, 11 }, { 0x71, 11 }, { 0xB6, 13 }, { 0xC1, 13 }, + { 0xD6, 13 }, { 0x48, 13 }, { 0x98, 13 }, { 0xC2, 13 }, { 0xC4, 13 }, + { 0xA3, 13 }, { 0x17, 11 }, { 0x60, 7 }, { 0x04, 7 }, { 0x54, 9 }, + { 0x55, 10 }, { 0xB1, 12 }, { 0x46, 13 }, { 0xB2, 13 }, { 0x84, 12 }, + { 0xB4, 13 }, { 0xC8, 15 }, { 0xD3, 15 }, { 0xA8, 14 }, { 0x52, 8 }, + { 0x31, 6 }, { 0x50, 6 }, { 0x11, 5 }, { 0x43, 8 }, { 0x73, 10 }, + { 0x35, 11 }, { 0x18, 13 }, { 0xB8, 14 }, { 0x27, 14 }, { 0xA1, 12 }, + { 0x15, 9 }, { 0x44, 9 }, { 0x90, 9 }, { 0x14, 8 }, { 0x03, 6 }, + { 0x10, 2 }, + }, + { /* Table #136 */ + { 0x10, 2 }, { 0x60, 6 }, { 0x64, 7 }, { 0xB6, 10 }, { 0x81, 10 }, + { 0x95, 9 }, { 0xD0, 10 }, { 0x18, 10 }, { 0x71, 9 }, { 0x15, 6 }, + { 0x41, 7 }, { 0x45, 7 }, { 0x01, 4 }, { 0x30, 4 }, { 0xD7, 11 }, + { 0xB8, 11 }, { 0x92, 10 }, { 0xB5, 10 }, { 0, 11 }, { 0xC0, 11 }, + { 0x90, 8 }, { 0x35, 7 }, { 0x53, 7 }, { 0xA5, 10 }, { 0xA1, 12 }, + { 0xB2, 12 }, { 0xA3, 11 }, { 0x17, 9 }, { 0x77, 9 }, { 0xB7, 11 }, + { 0xD6, 11 }, { 0x98, 10 }, { 0x40, 5 }, { 0x24, 6 }, { 0x83, 9 }, + { 0x87, 11 }, { 0xA7, 12 }, { 0xC3, 13 }, { 0xC2, 13 }, { 0x37, 10 }, + { 0x80, 8 }, { 0x85, 9 }, { 0x88, 11 }, { 0xB3, 11 }, { 0x96, 10 }, + { 0x73, 8 }, { 0x04, 5 }, { 0x34, 7 }, { 0x65, 8 }, { 0xD8, 11 }, + { 0xA8, 11 }, { 0x27, 10 }, { 0x94, 9 }, { 0x23, 6 }, { 0x13, 6 }, + { 0x55, 7 }, { 0x33, 7 }, { 0x14, 6 }, { 0x54, 7 }, { 0x51, 8 }, + { 0x62, 8 }, { 0x22, 6 }, { 0x12, 6 }, { 0x03, 5 }, { 0x25, 7 }, + { 0x75, 8 }, { 0x76, 9 }, { 0xA6, 11 }, { 0x91, 11 }, { 0x67, 10 }, + { 0x06, 7 }, { 0x42, 7 }, { 0x32, 7 }, { 0x16, 8 }, { 0x36, 9 }, + { 0x82, 10 }, { 0x58, 10 }, { 0x21, 6 }, { 0x02, 5 }, { 0x20, 4 }, + { 0x44, 7 }, { 0x08, 8 }, { 0x56, 8 }, { 0x11, 6 }, { 0x74, 8 }, + { 0x84, 9 }, { 0xD4, 12 }, { 0xC5, 12 }, { 0xA4, 11 }, { 0x93, 10 }, + { 0x43, 7 }, { 0x78, 10 }, { 0x68, 11 }, { 0x38, 12 }, { 0xB1, 13 }, + { 0xD3, 13 }, { 0x57, 9 }, { 0x72, 9 }, { 0x46, 9 }, { 0x28, 11 }, + { 0xB4, 11 }, { 0xA2, 12 }, { 0xC8, 12 }, { 0x86, 11 }, { 0x61, 9 }, + { 0x07, 8 }, { 0x52, 8 }, { 0x66, 10 }, { 0xB0, 10 }, { 0x47, 10 }, + { 0xC6, 12 }, { 0xC7, 12 }, { 0x48, 11 }, { 0x70, 7 }, { 0x31, 7 }, + { 0xA0, 10 }, { 0x97, 11 }, { 0xD2, 14 }, { 0xD1, 15 }, { 0xC1, 15 }, + { 0xC4, 13 }, { 0xD5, 12 }, { 0x26, 9 }, { 0x63, 8 }, { 0x05, 6 }, + { 0x50, 6 }, + }, + { /* Table #137 */ + { 0x12, 5 }, { 0x61, 8 }, { 0x55, 8 }, { 0x35, 8 }, { 0x25, 8 }, + { 0x23, 7 }, { 0x64, 8 }, { 0x71, 8 }, { 0x70, 5 }, { 0xB0, 7 }, + { 0x83, 9 }, { 0x93, 9 }, { 0x86, 10 }, { 0xA3, 11 }, { 0xD1, 12 }, + { 0, 12 }, { 0x84, 9 }, { 0xA0, 7 }, { 0x41, 7 }, { 0x11, 4 }, + { 0x33, 7 }, { 0x63, 8 }, { 0x27, 10 }, { 0xB8, 12 }, { 0xD8, 12 }, + { 0x88, 13 }, { 0xA8, 13 }, { 0xB7, 12 }, { 0x76, 9 }, { 0x05, 6 }, + { 0x40, 5 }, { 0x10, 2 }, { 0x02, 5 }, { 0x80, 6 }, { 0x17, 8 }, + { 0x73, 8 }, { 0x51, 7 }, { 0x20, 4 }, { 0x90, 6 }, { 0x14, 6 }, + { 0x50, 5 }, { 0x37, 10 }, { 0x96, 10 }, { 0xA5, 11 }, { 0xA7, 12 }, + { 0xC8, 12 }, { 0x57, 10 }, { 0x36, 9 }, { 0x26, 9 }, { 0x44, 8 }, + { 0x18, 9 }, { 0xB2, 11 }, { 0x58, 11 }, { 0xA1, 11 }, { 0xD4, 12 }, + { 0xC6, 12 }, { 0x74, 8 }, { 0x56, 9 }, { 0x94, 9 }, { 0x08, 8 }, + { 0x65, 9 }, { 0x85, 10 }, { 0x28, 11 }, { 0xA2, 11 }, { 0x03, 6 }, + { 0x31, 6 }, { 0x13, 6 }, { 0x24, 8 }, { 0xC5, 12 }, { 0x48, 12 }, + { 0xA4, 11 }, { 0x82, 10 }, { 0x97, 11 }, { 0xB6, 11 }, { 0x77, 10 }, + { 0x34, 8 }, { 0xD0, 9 }, { 0x45, 9 }, { 0x32, 7 }, { 0x43, 8 }, + { 0x66, 10 }, { 0xD3, 12 }, { 0xC3, 13 }, { 0x68, 13 }, { 0x67, 11 }, + { 0xC0, 9 }, { 0x21, 6 }, { 0x01, 4 }, { 0x15, 7 }, { 0x53, 8 }, + { 0x42, 8 }, { 0x04, 6 }, { 0x06, 7 }, { 0x54, 8 }, { 0x92, 10 }, + { 0xB5, 11 }, { 0xD5, 12 }, { 0xA6, 12 }, { 0x46, 10 }, { 0xB4, 11 }, + { 0x47, 11 }, { 0x72, 9 }, { 0x62, 9 }, { 0x07, 8 }, { 0x52, 8 }, + { 0xB3, 11 }, { 0xC2, 13 }, { 0xD6, 13 }, { 0x38, 12 }, { 0x95, 10 }, + { 0x81, 10 }, { 0xB1, 11 }, { 0x87, 12 }, { 0x98, 13 }, { 0xD7, 13 }, + { 0x22, 7 }, { 0x75, 9 }, { 0x78, 11 }, { 0xC7, 13 }, { 0xD2, 13 }, + { 0xC4, 13 }, { 0xC1, 13 }, { 0x91, 10 }, { 0x16, 8 }, { 0x60, 6 }, + { 0x30, 5 }, + }, + { /* Table #138 */ + { 0x30, 4 }, { 0x31, 6 }, { 0x53, 8 }, { 0x05, 9 }, { 0x25, 12 }, + { 0xB4, 13 }, { 0x36, 13 }, { 0x94, 12 }, { 0xC6, 14 }, { 0x27, 14 }, + { 0x38, 14 }, { 0x46, 14 }, { 0x26, 12 }, { 0x65, 12 }, { 0x93, 11 }, + { 0x66, 12 }, { 0x77, 14 }, { 0x97, 14 }, { 0xA4, 14 }, { 0xB1, 14 }, + { 0xB2, 14 }, { 0xD1, 14 }, { 0xD2, 14 }, { 0xD8, 14 }, { 0x08, 12 }, + { 0x16, 12 }, { 0x18, 12 }, { 0x37, 13 }, { 0x47, 13 }, { 0x95, 12 }, + { 0x15, 9 }, { 0x42, 8 }, { 0x21, 6 }, { 0x14, 8 }, { 0x56, 11 }, + { 0x73, 11 }, { 0x06, 10 }, { 0x34, 9 }, { 0x43, 8 }, { 0x41, 9 }, + { 0x74, 11 }, { 0x86, 12 }, { 0xB7, 13 }, { 0x45, 13 }, { 0x63, 11 }, + { 0x57, 12 }, { 0x91, 12 }, { 0x01, 3 }, { 0x20, 4 }, { 0x50, 6 }, + { 0x54, 9 }, { 0x62, 10 }, { 0x55, 10 }, { 0x52, 9 }, { 0x80, 9 }, + { 0x71, 11 }, { 0x64, 11 }, { 0x82, 10 }, { 0x51, 9 }, { 0x24, 9 }, + { 0x44, 9 }, { 0x02, 5 }, { 0x40, 6 }, { 0x03, 6 }, { 0x12, 6 }, + { 0x22, 7 }, { 0x61, 10 }, { 0x76, 13 }, { 0x84, 13 }, { 0x85, 13 }, + { 0x96, 13 }, { 0x75, 12 }, { 0xB6, 13 }, { 0x58, 13 }, { 0xB0, 10 }, + { 0xD0, 11 }, { 0xA3, 13 }, { 0xD5, 13 }, { 0x81, 13 }, { 0xB3, 13 }, + { 0x04, 8 }, { 0x11, 5 }, { 0x60, 8 }, { 0x92, 10 }, { 0x72, 10 }, + { 0x33, 9 }, { 0x70, 8 }, { 0x32, 8 }, { 0x13, 7 }, { 0x90, 9 }, + { 0x83, 11 }, { 0xC0, 13 }, { 0xC4, 20 }, { 0xC5, 20 }, { 0xC7, 20 }, + { 0xC8, 20 }, { 0xD3, 20 }, { 0xD4, 20 }, { 0xD6, 20 }, { 0xD7, 20 }, + { 0x28, 21 }, { 0x48, 21 }, { 0x67, 21 }, { 0x68, 21 }, { 0x78, 21 }, + { 0x87, 21 }, { 0x88, 21 }, { 0x98, 21 }, { 0xA2, 21 }, { 0xA6, 21 }, + { 0xA8, 21 }, { 0xB5, 21 }, { 0xB8, 21 }, { 0xC1, 21 }, { 0xC2, 21 }, + { 0xC3, 21 }, { 0, 16 }, { 0xA1, 15 }, { 0xA5, 15 }, { 0xA7, 15 }, + { 0x07, 12 }, { 0x17, 12 }, { 0x35, 12 }, { 0xA0, 11 }, { 0x23, 8 }, + { 0x10, 1 }, + }, + { /* Table #139 */ + { 0x12, 5 }, { 0x75, 10 }, { 0x86, 12 }, { 0xB2, 12 }, { 0xA2, 11 }, + { 0x63, 10 }, { 0xA4, 12 }, { 0xA5, 12 }, { 0x46, 12 }, { 0x68, 14 }, + { 0xD2, 14 }, { 0x87, 13 }, { 0x71, 9 }, { 0x72, 9 }, { 0x33, 8 }, + { 0x60, 8 }, { 0x14, 8 }, { 0x42, 8 }, { 0x64, 10 }, { 0x16, 10 }, + { 0xA0, 10 }, { 0xD3, 11 }, { 0x93, 11 }, { 0x23, 8 }, { 0x30, 4 }, + { 0x11, 4 }, { 0x41, 8 }, { 0x05, 9 }, { 0x06, 10 }, { 0x65, 11 }, + { 0x66, 12 }, { 0x08, 13 }, { 0x18, 14 }, { 0xB6, 14 }, { 0x70, 8 }, + { 0x53, 8 }, { 0x61, 10 }, { 0x82, 11 }, { 0xC4, 13 }, { 0xB7, 14 }, + { 0xC1, 19 }, { 0xC2, 19 }, { 0x27, 20 }, { 0x37, 20 }, { 0x38, 20 }, + { 0x48, 20 }, { 0x57, 20 }, { 0x58, 20 }, { 0x78, 20 }, { 0x88, 20 }, + { 0x98, 20 }, { 0xA7, 20 }, { 0xA8, 20 }, { 0xB8, 20 }, { 0x28, 16 }, + { 0x26, 15 }, { 0xB4, 12 }, { 0x15, 9 }, { 0x52, 8 }, { 0x22, 7 }, + { 0x55, 11 }, { 0xD5, 12 }, { 0xD1, 13 }, { 0x17, 13 }, { 0x34, 10 }, + { 0x73, 9 }, { 0x51, 8 }, { 0x40, 7 }, { 0x03, 6 }, { 0x20, 3 }, + { 0x13, 6 }, { 0x45, 11 }, { 0x95, 12 }, { 0x96, 13 }, { 0x76, 13 }, + { 0x84, 11 }, { 0x97, 13 }, { 0xA6, 13 }, { 0x25, 12 }, { 0x94, 12 }, + { 0x91, 12 }, { 0x90, 11 }, { 0xB3, 11 }, { 0xA3, 11 }, { 0xC0, 11 }, + { 0xB5, 13 }, { 0x67, 15 }, { 0xC5, 15 }, { 0xC6, 15 }, { 0x47, 16 }, + { 0xC7, 16 }, { 0x81, 12 }, { 0x83, 11 }, { 0x92, 11 }, { 0x43, 9 }, + { 0x77, 13 }, { 0xD4, 13 }, { 0x35, 12 }, { 0xD0, 11 }, { 0x44, 10 }, + { 0x24, 10 }, { 0xC3, 13 }, { 0x07, 13 }, { 0x56, 13 }, { 0xC8, 16 }, + { 0xD7, 16 }, { 0xD8, 16 }, { 0, 16 }, { 0xA1, 14 }, { 0xB0, 11 }, + { 0x80, 11 }, { 0x36, 13 }, { 0xB1, 13 }, { 0xD6, 13 }, { 0x85, 13 }, + { 0x74, 10 }, { 0x62, 10 }, { 0x54, 10 }, { 0x21, 5 }, { 0x02, 5 }, + { 0x31, 6 }, { 0x50, 7 }, { 0x04, 8 }, { 0x32, 8 }, { 0x10, 2 }, + { 0x01, 2 }, + }, }; const uint8_t ff_wmv3_dc_scale_table[32] = { diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h index 9c6ac7370b..cc53c42a64 100644 --- a/libavcodec/vc1data.h +++ b/libavcodec/vc1data.h @@ -169,13 +169,15 @@ extern const uint8_t ff_vc1_if_mmv_mbmode_bits[8][8]; extern const uint8_t ff_vc1_if_1mv_mbmode_codes[8][6]; extern const uint8_t ff_vc1_if_1mv_mbmode_bits[8][6]; -/* Interlaced frame/field picture MVDATA VLC tables */ -/* 1-reference tables */ -extern const uint32_t ff_vc1_1ref_mvdata_codes[4][72]; -extern const uint8_t ff_vc1_1ref_mvdata_bits[4][72]; -/* 2-reference tables */ -extern const uint32_t ff_vc1_2ref_mvdata_codes[8][126]; -extern const uint8_t ff_vc1_2ref_mvdata_bits[8][126]; +/* Interlaced frame/field picture MVDATA VLC tables + * The escape value of each table has the symbol 0; + * for every other symbol the lower nibble contains + * (index + 1) % 9 and the higher nibble (index + 1) / 9 + * with index being the index in the spec's interlace MV tables. */ +/* 1-reference tables (tables #140-#143) */ +extern const uint8_t ff_vc1_1ref_mvdata_tabs[4][72][2]; +/* 2-reference tables (tables #132-#139) */ +extern const uint8_t ff_vc1_2ref_mvdata_tabs[8][126][2]; /* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */ From patchwork Fri Nov 20 07:20:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23850 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 8AA01449F1B for ; Fri, 20 Nov 2020 09:42:42 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8873268BC7D; Fri, 20 Nov 2020 09:26:13 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6CBC468BC4A for ; Fri, 20 Nov 2020 09:25:50 +0200 (EET) Received: by mail-ej1-f53.google.com with SMTP id lv15so5644196ejb.12 for ; Thu, 19 Nov 2020 23:25:50 -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=rjFoFSiLuAsyE6pDRkcQhCtKNkEN6dxcAwj11PJcvZc=; b=KgmywERUcSKA9JwX5fkLGt+RU0C9wFsMrWKS8kKM9uN679rQdiGhnh09WB22xTA6/C /Qluwcr/TEK3aUJeWm27/Y9MH/sPN5ifVc57nDwuJ5LsWLU1lFZKf5VLA4DLMq3Fve9R eLuDpLRnFdPnWtdS6fDXgU+Zm4s4dP0CiTlDyI6Lgc9kMyZqUyvREtHE7++/fQQcmbz/ NWHSU77sTzJ5ZuJQsor4wcQcPQ4cKuoZLg2iEELD9b2Z56uQcnyq3doYwD1hOhfHB7Dw PzJxzJykpV5dyb4RFP6a/Nwo3O9RCd2ECz+bz2qvIOgZmduXRscLyR72liTLJPREQBJD MxkA== 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=rjFoFSiLuAsyE6pDRkcQhCtKNkEN6dxcAwj11PJcvZc=; b=uI2uYGjL2kAHlvAQQUdtFBzZ9YX7eC0h+JF+QKQdE2ibNIbqnKLe0U782WFW4nuaeL K3tWl5ensLxLuAevcgeHQsShguumf2rFTVKZvRYgf4dSpCQaJUZZIyE++cjE1C8MksFR e0ylwsjCqcJzQXiXyPWlmYZ7Fw7RgSRAIBfdngUeuv4DBdUgGZkJfLZwxHAci2qca2UU FvUYCrMyhXdHzsmR2JZv1qVElJttJ2mgQQDncCkng0MPiWozWssf+xe4lH+GFVUbCDFi 8xJBB1kIKKFwd60ZMIl6kNcLLBTFkk3AHqMNefk+56M8aS09v5sKPHKsfcGTUqr9OeqR Ipdw== X-Gm-Message-State: AOAM533TurxomhQSEX/9mfkRkAkxFY0pz7GbQSBcWeXX9xvhPFbq/kFH +AyfmEDKAw8YaQL4MGozb+aXQyimVwo0jw== X-Google-Smtp-Source: ABdhPJx3fIvRtYIPwZDLl2lhip8MY4NaX101KlH/xgFQtYz4IApNYYMM+zsjG6gbPF9iFXOjWjK4RA== X-Received: by 2002:a17:906:a88:: with SMTP id y8mr33958717ejf.469.1605857149358; Thu, 19 Nov 2020 23:25:49 -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.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:25:48 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:20:12 +0100 Message-Id: <20201120072116.818090-100-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 099/162] avcodec/vc1_block, msmpeg4dec: Don't check for errors for complete 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/msmpeg4dec.c | 5 ----- libavcodec/vc1_block.c | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c index 49df06a9d7..b3964457d6 100644 --- a/libavcodec/msmpeg4dec.c +++ b/libavcodec/msmpeg4dec.c @@ -614,11 +614,6 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr) } else { level = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); } - if (level < 0){ - av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n"); - *dir_ptr = 0; - return -1; - } if (level == DC_MAX) { level = get_bits(&s->gb, 8); diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index ed6df541cf..714b3cdea0 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -584,10 +584,6 @@ static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n, } else { dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); } - if (dcdiff < 0) { - av_log(s->avctx, AV_LOG_ERROR, "Illegal DC VLC\n"); - return -1; - } if (dcdiff) { const int m = (v->pq == 1 || v->pq == 2) ? 3 - v->pq : 0; if (dcdiff == 119 /* ESC index value */) { @@ -732,10 +728,6 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, } else { dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); } - if (dcdiff < 0) { - av_log(s->avctx, AV_LOG_ERROR, "Illegal DC VLC\n"); - return -1; - } if (dcdiff) { const int m = (quant == 1 || quant == 2) ? 3 - quant : 0; if (dcdiff == 119 /* ESC index value */) { @@ -936,10 +928,6 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, } else { dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); } - if (dcdiff < 0) { - av_log(s->avctx, AV_LOG_ERROR, "Illegal DC VLC\n"); - return -1; - } if (dcdiff) { const int m = (quant == 1 || quant == 2) ? 3 - quant : 0; if (dcdiff == 119 /* ESC index value */) { From patchwork Fri Nov 20 07:32: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: 23803 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 B54AD44A644 for ; Fri, 20 Nov 2020 09:33:42 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A0CF068BAEC; Fri, 20 Nov 2020 09:33:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AE34568BAEB for ; Fri, 20 Nov 2020 09:33:41 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id o9so11565744ejg.1 for ; Thu, 19 Nov 2020 23:33: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=kCPJaBE6TMauY1J0BpG2lyY+d1Ppq9opJKWrP9ItLZQ=; b=QNCElfiyesW1Zkep+0XtANPaj+9hf8h0fVL3n7AVludTN0WA9ezNtxtcLaa8QhDUyH 8i8UQ5NgzNdu6L2GjTmXaok1fBNWJNEXqXDKTMmH2byvXeJrOXmc8XPKUWse+fv6tMZL xYlVMNRBNGWZOqZdp0JqKaprna07s4k3EBoKRqTw7i1Yce4/OJms7/lEimwDD+9dwTBb tSbGQ2ifv7s5rPncMqN2mJNVk0CoMDu9Tt43G21P1d54PcJkCW6xkrwuC31oHYkeyKil DGW4mwICA421m+XERpt1iBEooJBGx1krwRbkWEERDe9QmqXUa/FcSemqYT8J0CaWezHl OzNA== 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=kCPJaBE6TMauY1J0BpG2lyY+d1Ppq9opJKWrP9ItLZQ=; b=mtEKuH0bu2GJKiolq/H+SIr6EDBZTnyRiqXYDSafNo+8COe5zhwAYapfnk6KT4jq17 e3mT4etDuQ52RfLUAYC+bIIi3dgm4Ume9yrfIwHEFo9zHTv72FyLvMs13rGZOatZUX98 e1TULEVVN6SHgxwZ03O0NCUE7PQxy0WNnjksOnnIKMX3gHzU/Q9UAYiQFIvr9FcHWefQ K8iw9cXDhCGelkRYJYGInShbZHuuMmdnV2AMUT+gBW5pDZpC0GwovbgYSRTIytp1uax3 og3hJTfx+jj/b9McDRXLNFpJ3k+q8pKMI2ELldaCFNaWsrd4uk7nupOwZqi6o3R/1Qms RL8g== X-Gm-Message-State: AOAM5320Kz3l1llpQCFGPGBptUBvwnEPikbFCG37DYje5gecmFXWtbkA 03sX5qoU8TQe0JO18gvqz/uSs3TXVeBi7w== X-Google-Smtp-Source: ABdhPJwZ+Nyi9eWX2d2/jWUaB+hRuUtEVmGaU9/TO/7ZQ2HaVxajhZRatMzGqJHeqkfXcfiVOen0MQ== X-Received: by 2002:a17:906:77c5:: with SMTP id m5mr32234568ejn.424.1605857620946; Thu, 19 Nov 2020 23:33:40 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.33.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:33:40 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:25 +0100 Message-Id: <20201120073327.820745-1-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 100/162] avcodec/vc1_block: Don't use 0 for NULL 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/vc1_block.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index 714b3cdea0..3c9d1d4b8d 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -1633,7 +1633,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) for (i = 0; i < 4; i++) { dmv_x = dmv_y = 0; if (mvbp & (8 >> i)) - get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0); + get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); ff_vc1_pred_mv_intfr(v, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type[0], 0); ff_vc1_mc_4mv_luma(v, i, 0, 0); } @@ -1642,14 +1642,14 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) mvbp = v->twomvbp; dmv_x = dmv_y = 0; if (mvbp & 2) { - get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0); + get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); } ff_vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 2, v->range_x, v->range_y, v->mb_type[0], 0); ff_vc1_mc_4mv_luma(v, 0, 0, 0); ff_vc1_mc_4mv_luma(v, 1, 0, 0); dmv_x = dmv_y = 0; if (mvbp & 1) { - get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0); + get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); } ff_vc1_pred_mv_intfr(v, 2, dmv_x, dmv_y, 2, v->range_x, v->range_y, v->mb_type[0], 0); ff_vc1_mc_4mv_luma(v, 2, 0, 0); @@ -1659,7 +1659,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) mvbp = ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][2]; dmv_x = dmv_y = 0; if (mvbp) { - get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0); + get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); } ff_vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], 0); ff_vc1_mc_1mv(v, 0); @@ -2352,7 +2352,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) dmv_x = dmv_y = 0; val = ((mvbp >> (3 - i)) & 1); if (val) - get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0); + get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); j = i > 1 ? 2 : 0; ff_vc1_pred_mv_intfr(v, j, dmv_x, dmv_y, 2, v->range_x, v->range_y, v->mb_type[0], dir); ff_vc1_mc_4mv_luma(v, j, dir, dir); @@ -2365,14 +2365,14 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) mvbp = v->twomvbp; dmv_x = dmv_y = 0; if (mvbp & 2) - get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0); + get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); ff_vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], 0); ff_vc1_mc_1mv(v, 0); dmv_x = dmv_y = 0; if (mvbp & 1) - get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0); + get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); ff_vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], 1); ff_vc1_interp_mc(v); @@ -2384,12 +2384,12 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) mvbp = v->twomvbp; dmv_x = dmv_y = 0; if (mvbp & 2) - get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0); + get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); ff_vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 2, v->range_x, v->range_y, v->mb_type[0], dir); dmv_x = dmv_y = 0; if (mvbp & 1) - get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0); + get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); ff_vc1_pred_mv_intfr(v, 2, dmv_x, dmv_y, 2, v->range_x, v->range_y, v->mb_type[0], dir2); if (mvsw) { @@ -2415,7 +2415,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) mvbp = ff_vc1_mbmode_intfrp[0][idx_mbmode][2]; dmv_x = dmv_y = 0; if (mvbp) - get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0); + get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); ff_vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], dir); v->blk_mv_type[s->block_index[0]] = 1; From patchwork Fri Nov 20 07:32:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23806 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 D453B44A644 for ; Fri, 20 Nov 2020 09:33:59 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B7AC868BB8D; Fri, 20 Nov 2020 09:33:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 660AC68BACA for ; Fri, 20 Nov 2020 09:33:58 +0200 (EET) Received: by mail-ej1-f42.google.com with SMTP id o21so11520801ejb.3 for ; Thu, 19 Nov 2020 23:33:58 -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=d7z4p4zZNkXbPoH3DCjciMoFrWolxWUpnRe2H/QNz6g=; b=SoVU9ODG/xpSOCrpTlECZwfQK9eWnqPZ50oW/0iOj0ps2GbaFHO964YbLM4vR6+O8D hsQc/ogMt8kTitIH7WYWvG8tWeQrHHKggCjmrcIbXF1dzBcEwAMNV5jkjZ4FpsMyJGX7 CvMo1fU2gZbGBcGgCadAkrlwNlp1qCv8pOXo+Yv333+N5Xhx7tcLJy8HeaMHbFHgrA41 S0hoCG74AHRsJYddHJRYqnBW5DaEhWvA4SEA4DVxPnno7qLW4yZ226SQ9fKAShZUVF1w bp74YSgL+mxecbrZ0I2Fdz2K1wr+SMxsbE7hyawJSvNZKu4QfOD3qUelTkh9PttJU/bI LahQ== 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=d7z4p4zZNkXbPoH3DCjciMoFrWolxWUpnRe2H/QNz6g=; b=Zu+F3oxi9dyKXF/mnFIakqG9U9HVOw16BlkAgPmN2rsRfNgkqqRzV2FQ6a/z4wTWnX 4NeyCidQbOTDBCa0WnUhjOY0nVYuZzWvaSps4mlnpY4IKyJ02wGH41F55tJl229wGRkA fCwfBTeEXmANYJv41ami5rOGTiWrj2m+gQCV8WY3GJ6vSZDVrwQlb5vbkH8vGjIfXBRo FXnXT9tnP/8hW387K7E8K/33TX8Fe4Mu8dodZS82E/WztWBgATjqPOXbP2CE/4d2nn5z Og/xDbAscBM6RMY2f3GLFOQs0UeK52L/gZs4UhamY3sl3E6bPBryLEmr661D4dUKF54K nBUA== X-Gm-Message-State: AOAM533w00kJAE0LJLpLAGvuTwYfSVmpYX2vHUgek8EpmwSzbRw47QAQ DmLpaU+6F104ERtggkYOO8jCKD6sTdvNsQ== X-Google-Smtp-Source: ABdhPJwIVpDy7JxrFjkUjV7kpAbMUIQ6/OZ3Ap4zSxxqPPt/2+79uweQLoV3TE2z+veBVshNnyhIow== X-Received: by 2002:a17:906:7f95:: with SMTP id f21mr30694495ejr.340.1605857635882; Thu, 19 Nov 2020 23:33:55 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:33:55 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:26 +0100 Message-Id: <20201120073327.820745-2-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 101/162] avcodec/vc1: Use symbols table to decode AC coefficients 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 VC1 decoder currently follows the spec very closely when decoding AC coefficients: The spec uses tables with contiguous indexes. The last of each of these is an escape code; the other codes encode three other variables via tables: run, length and whether this is the last coefficient. This commit changes this: Given that both run and length fit into six bits each, all three of these fit into a VLC symbol (without touching the sign bit which is needed because some of the VLCs used here aren't complete). This already makes the tables for the conversion from index to run etc. superfluous; furthermore while just at it, this commit also switches to ff_init_vlc_from_lengths(), thereby making the codes tables superfluous, too (and said code tables were interleaved with the length tables, so that the latter were using an uint32_t just as the former, wasting lots of space). Moreover, the number of codes for each table differed and the old approach padded the shorter ones to the length of the longer ones; this is no longer done either. All in all, this saves about 11KB of tables. Finally, the symbol and length tables have been added to vc1data.c; the interleaved codes and lengths tables which they replace was directly in vc1.c since 3c715383ea7012ac69507e6b9189c98675c77461 in order to make the VC1 parser compilable without decoder, but the data for the other VLCs which are also only used in the decoder is in vc1data.c, so moving it improves consistency. Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1.c | 231 ++--------------------------------------- libavcodec/vc1_block.c | 28 ++--- libavcodec/vc1acdata.h | 174 ------------------------------- libavcodec/vc1data.c | 227 +++++++++++++++++++++++++++++++++++++++- libavcodec/vc1data.h | 9 +- 5 files changed, 254 insertions(+), 415 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index 1def1fceae..478fe7d66d 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1345,227 +1345,6 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) return 0; } -static const uint32_t vc1_ac_tables[AC_MODES][186][2] = { -{ -{ 0x0001, 2}, { 0x0005, 3}, { 0x000D, 4}, { 0x0012, 5}, { 0x000E, 6}, { 0x0015, 7}, -{ 0x0013, 8}, { 0x003F, 8}, { 0x004B, 9}, { 0x011F, 9}, { 0x00B8, 10}, { 0x03E3, 10}, -{ 0x0172, 11}, { 0x024D, 12}, { 0x03DA, 12}, { 0x02DD, 13}, { 0x1F55, 13}, { 0x05B9, 14}, -{ 0x3EAE, 14}, { 0x0000, 4}, { 0x0010, 5}, { 0x0008, 7}, { 0x0020, 8}, { 0x0029, 9}, -{ 0x01F4, 9}, { 0x0233, 10}, { 0x01E0, 11}, { 0x012A, 12}, { 0x03DD, 12}, { 0x050A, 13}, -{ 0x1F29, 13}, { 0x0A42, 14}, { 0x1272, 15}, { 0x1737, 15}, { 0x0003, 5}, { 0x0011, 7}, -{ 0x00C4, 8}, { 0x004B, 10}, { 0x00B4, 11}, { 0x07D4, 11}, { 0x0345, 12}, { 0x02D7, 13}, -{ 0x07BF, 13}, { 0x0938, 14}, { 0x0BBB, 14}, { 0x095E, 15}, { 0x0013, 5}, { 0x0078, 7}, -{ 0x0069, 9}, { 0x0232, 10}, { 0x0461, 11}, { 0x03EC, 12}, { 0x0520, 13}, { 0x1F2A, 13}, -{ 0x3E50, 14}, { 0x3E51, 14}, { 0x1486, 15}, { 0x000C, 6}, { 0x0024, 9}, { 0x0094, 11}, -{ 0x08C0, 12}, { 0x0F09, 14}, { 0x1EF0, 15}, { 0x003D, 6}, { 0x0053, 9}, { 0x01A0, 11}, -{ 0x02D6, 13}, { 0x0F08, 14}, { 0x0013, 7}, { 0x007C, 9}, { 0x07C1, 11}, { 0x04AC, 14}, -{ 0x001B, 7}, { 0x00A0, 10}, { 0x0344, 12}, { 0x0F79, 14}, { 0x0079, 7}, { 0x03E1, 10}, -{ 0x02D4, 13}, { 0x2306, 14}, { 0x0021, 8}, { 0x023C, 10}, { 0x0FAE, 12}, { 0x23DE, 14}, -{ 0x0035, 8}, { 0x0175, 11}, { 0x07B3, 13}, { 0x00C5, 8}, { 0x0174, 11}, { 0x0785, 13}, -{ 0x0048, 9}, { 0x01A3, 11}, { 0x049E, 13}, { 0x002C, 9}, { 0x00FA, 10}, { 0x07D6, 11}, -{ 0x0092, 10}, { 0x05CC, 13}, { 0x1EF1, 15}, { 0x00A3, 10}, { 0x03ED, 12}, { 0x093E, 14}, -{ 0x01E2, 11}, { 0x1273, 15}, { 0x07C4, 11}, { 0x1487, 15}, { 0x0291, 12}, { 0x0293, 12}, -{ 0x0F8A, 12}, { 0x0509, 13}, { 0x0508, 13}, { 0x078D, 13}, { 0x07BE, 13}, { 0x078C, 13}, -{ 0x04AE, 14}, { 0x0BBA, 14}, { 0x2307, 14}, { 0x0B9A, 14}, { 0x1736, 15}, { 0x000E, 4}, -{ 0x0045, 7}, { 0x01F3, 9}, { 0x047A, 11}, { 0x05DC, 13}, { 0x23DF, 14}, { 0x0019, 5}, -{ 0x0028, 9}, { 0x0176, 11}, { 0x049D, 13}, { 0x23DD, 14}, { 0x0030, 6}, { 0x00A2, 10}, -{ 0x02EF, 12}, { 0x05B8, 14}, { 0x003F, 6}, { 0x00A5, 10}, { 0x03DB, 12}, { 0x093F, 14}, -{ 0x0044, 7}, { 0x07CB, 11}, { 0x095F, 15}, { 0x0063, 7}, { 0x03C3, 12}, { 0x0015, 8}, -{ 0x08F6, 12}, { 0x0017, 8}, { 0x0498, 13}, { 0x002C, 8}, { 0x07B2, 13}, { 0x002F, 8}, -{ 0x1F54, 13}, { 0x008D, 8}, { 0x07BD, 13}, { 0x008E, 8}, { 0x1182, 13}, { 0x00FB, 8}, -{ 0x050B, 13}, { 0x002D, 8}, { 0x07C0, 11}, { 0x0079, 9}, { 0x1F5F, 13}, { 0x007A, 9}, -{ 0x1F56, 13}, { 0x0231, 10}, { 0x03E4, 10}, { 0x01A1, 11}, { 0x0143, 11}, { 0x01F7, 11}, -{ 0x016F, 12}, { 0x0292, 12}, { 0x02E7, 12}, { 0x016C, 12}, { 0x016D, 12}, { 0x03DC, 12}, -{ 0x0F8B, 12}, { 0x0499, 13}, { 0x03D8, 12}, { 0x078E, 13}, { 0x02D5, 13}, { 0x1F5E, 13}, -{ 0x1F2B, 13}, { 0x078F, 13}, { 0x04AD, 14}, { 0x3EAF, 14}, { 0x23DC, 14}, { 0x004A, 9} -}, -{ -{ 0x0000, 3}, { 0x0003, 4}, { 0x000B, 5}, { 0x0014, 6}, { 0x003F, 6}, { 0x005D, 7}, -{ 0x00A2, 8}, { 0x00AC, 9}, { 0x016E, 9}, { 0x020A, 10}, { 0x02E2, 10}, { 0x0432, 11}, -{ 0x05C9, 11}, { 0x0827, 12}, { 0x0B54, 12}, { 0x04E6, 13}, { 0x105F, 13}, { 0x172A, 13}, -{ 0x20B2, 14}, { 0x2D4E, 14}, { 0x39F0, 14}, { 0x4175, 15}, { 0x5A9E, 15}, { 0x0004, 4}, -{ 0x001E, 5}, { 0x0042, 7}, { 0x00B6, 8}, { 0x0173, 9}, { 0x0395, 10}, { 0x072E, 11}, -{ 0x0B94, 12}, { 0x16A4, 13}, { 0x20B3, 14}, { 0x2E45, 14}, { 0x0005, 5}, { 0x0040, 7}, -{ 0x0049, 9}, { 0x028F, 10}, { 0x05CB, 11}, { 0x048A, 13}, { 0x09DD, 14}, { 0x73E2, 15}, -{ 0x0018, 5}, { 0x0025, 8}, { 0x008A, 10}, { 0x051B, 11}, { 0x0E5F, 12}, { 0x09C9, 14}, -{ 0x139C, 15}, { 0x0029, 6}, { 0x004F, 9}, { 0x0412, 11}, { 0x048D, 13}, { 0x2E41, 14}, -{ 0x0038, 6}, { 0x010E, 9}, { 0x05A8, 11}, { 0x105C, 13}, { 0x39F2, 14}, { 0x0058, 7}, -{ 0x021F, 10}, { 0x0E7E, 12}, { 0x39FF, 14}, { 0x0023, 8}, { 0x02E3, 10}, { 0x04E5, 13}, -{ 0x2E40, 14}, { 0x00A1, 8}, { 0x05BE, 11}, { 0x09C8, 14}, { 0x0083, 8}, { 0x013A, 11}, -{ 0x1721, 13}, { 0x0044, 9}, { 0x0276, 12}, { 0x39F6, 14}, { 0x008B, 10}, { 0x04EF, 13}, -{ 0x5A9B, 15}, { 0x0208, 10}, { 0x1CFE, 13}, { 0x0399, 10}, { 0x1CB4, 13}, { 0x039E, 10}, -{ 0x39F3, 14}, { 0x05AB, 11}, { 0x73E3, 15}, { 0x0737, 11}, { 0x5A9F, 15}, { 0x082D, 12}, -{ 0x0E69, 12}, { 0x0E68, 12}, { 0x0433, 11}, { 0x0B7B, 12}, { 0x2DF8, 14}, { 0x2E56, 14}, -{ 0x2E57, 14}, { 0x39F7, 14}, { 0x51A5, 15}, { 0x0003, 3}, { 0x002A, 6}, { 0x00E4, 8}, -{ 0x028E, 10}, { 0x0735, 11}, { 0x1058, 13}, { 0x1CFA, 13}, { 0x2DF9, 14}, { 0x4174, 15}, -{ 0x0009, 4}, { 0x0054, 8}, { 0x0398, 10}, { 0x048B, 13}, { 0x139D, 15}, { 0x000D, 4}, -{ 0x00AD, 9}, { 0x0826, 12}, { 0x2D4C, 14}, { 0x0011, 5}, { 0x016B, 9}, { 0x0B7F, 12}, -{ 0x51A4, 15}, { 0x0019, 5}, { 0x021B, 10}, { 0x16FD, 13}, { 0x001D, 5}, { 0x0394, 10}, -{ 0x28D3, 14}, { 0x002B, 6}, { 0x05BC, 11}, { 0x5A9A, 15}, { 0x002F, 6}, { 0x0247, 12}, -{ 0x0010, 7}, { 0x0A35, 12}, { 0x003E, 6}, { 0x0B7A, 12}, { 0x0059, 7}, { 0x105E, 13}, -{ 0x0026, 8}, { 0x09CF, 14}, { 0x0055, 8}, { 0x1CB5, 13}, { 0x0057, 8}, { 0x0E5B, 12}, -{ 0x00A0, 8}, { 0x1468, 13}, { 0x0170, 9}, { 0x0090, 10}, { 0x01CE, 9}, { 0x021A, 10}, -{ 0x0218, 10}, { 0x0168, 9}, { 0x021E, 10}, { 0x0244, 12}, { 0x0736, 11}, { 0x0138, 11}, -{ 0x0519, 11}, { 0x0E5E, 12}, { 0x072C, 11}, { 0x0B55, 12}, { 0x09DC, 14}, { 0x20BB, 14}, -{ 0x048C, 13}, { 0x1723, 13}, { 0x2E44, 14}, { 0x16A5, 13}, { 0x0518, 11}, { 0x39FE, 14}, -{ 0x0169, 9} -}, -{ -{ 0x0001, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x0016, 5}, { 0x0020, 6}, { 0x0018, 7}, -{ 0x0008, 8}, { 0x009A, 8}, { 0x0056, 9}, { 0x013E, 9}, { 0x00F0, 10}, { 0x03A5, 10}, -{ 0x0077, 11}, { 0x01EF, 11}, { 0x009A, 12}, { 0x005D, 13}, { 0x0001, 4}, { 0x0011, 5}, -{ 0x0002, 7}, { 0x000B, 8}, { 0x0012, 9}, { 0x01D6, 9}, { 0x027E, 10}, { 0x0191, 11}, -{ 0x00EA, 12}, { 0x03DC, 12}, { 0x013B, 13}, { 0x0004, 5}, { 0x0014, 7}, { 0x009E, 8}, -{ 0x0009, 10}, { 0x01AC, 11}, { 0x01E2, 11}, { 0x03CA, 12}, { 0x005F, 13}, { 0x0017, 5}, -{ 0x004E, 7}, { 0x005E, 9}, { 0x00F3, 10}, { 0x01AD, 11}, { 0x00EC, 12}, { 0x05F0, 13}, -{ 0x000E, 6}, { 0x00E1, 8}, { 0x03A4, 10}, { 0x009C, 12}, { 0x013D, 13}, { 0x003B, 6}, -{ 0x001C, 9}, { 0x0014, 11}, { 0x09BE, 12}, { 0x0006, 7}, { 0x007A, 9}, { 0x0190, 11}, -{ 0x0137, 13}, { 0x001B, 7}, { 0x0008, 10}, { 0x075C, 11}, { 0x0071, 7}, { 0x00D7, 10}, -{ 0x09BF, 12}, { 0x0007, 8}, { 0x00AF, 10}, { 0x04CC, 11}, { 0x0034, 8}, { 0x0265, 10}, -{ 0x009F, 12}, { 0x00E0, 8}, { 0x0016, 11}, { 0x0327, 12}, { 0x0015, 9}, { 0x017D, 11}, -{ 0x0EBB, 12}, { 0x0014, 9}, { 0x00F6, 10}, { 0x01E4, 11}, { 0x00CB, 10}, { 0x099D, 12}, -{ 0x00CA, 10}, { 0x02FC, 12}, { 0x017F, 11}, { 0x04CD, 11}, { 0x02FD, 12}, { 0x04FE, 11}, -{ 0x013A, 13}, { 0x000A, 4}, { 0x0042, 7}, { 0x01D3, 9}, { 0x04DD, 11}, { 0x0012, 5}, -{ 0x00E8, 8}, { 0x004C, 11}, { 0x0136, 13}, { 0x0039, 6}, { 0x0264, 10}, { 0x0EBA, 12}, -{ 0x0000, 7}, { 0x00AE, 10}, { 0x099C, 12}, { 0x001F, 7}, { 0x04DE, 11}, { 0x0043, 7}, -{ 0x04DC, 11}, { 0x0003, 8}, { 0x03CB, 12}, { 0x0006, 8}, { 0x099E, 12}, { 0x002A, 8}, -{ 0x05F1, 13}, { 0x000F, 8}, { 0x09FE, 12}, { 0x0033, 8}, { 0x09FF, 12}, { 0x0098, 8}, -{ 0x099F, 12}, { 0x00EA, 8}, { 0x013C, 13}, { 0x002E, 8}, { 0x0192, 11}, { 0x0136, 9}, -{ 0x006A, 9}, { 0x0015, 11}, { 0x03AF, 10}, { 0x01E3, 11}, { 0x0074, 11}, { 0x00EB, 12}, -{ 0x02F9, 12}, { 0x005C, 13}, { 0x00ED, 12}, { 0x03DD, 12}, { 0x0326, 12}, { 0x005E, 13}, -{ 0x0016, 7} -}, -{ -{ 0x0004, 3}, { 0x0014, 5}, { 0x0017, 7}, { 0x007F, 8}, { 0x0154, 9}, { 0x01F2, 10}, -{ 0x00BF, 11}, { 0x0065, 12}, { 0x0AAA, 12}, { 0x0630, 13}, { 0x1597, 13}, { 0x03B7, 14}, -{ 0x2B22, 14}, { 0x0BE6, 15}, { 0x000B, 4}, { 0x0037, 7}, { 0x0062, 9}, { 0x0007, 11}, -{ 0x0166, 12}, { 0x00CE, 13}, { 0x1590, 13}, { 0x05F6, 14}, { 0x0BE7, 15}, { 0x0007, 5}, -{ 0x006D, 8}, { 0x0003, 11}, { 0x031F, 12}, { 0x05F2, 14}, { 0x0002, 6}, { 0x0061, 9}, -{ 0x0055, 12}, { 0x01DF, 14}, { 0x001A, 6}, { 0x001E, 10}, { 0x0AC9, 12}, { 0x2B23, 14}, -{ 0x001E, 6}, { 0x001F, 10}, { 0x0AC3, 12}, { 0x2B2B, 14}, { 0x0006, 7}, { 0x0004, 11}, -{ 0x02F8, 13}, { 0x0019, 7}, { 0x0006, 11}, { 0x063D, 13}, { 0x0057, 7}, { 0x0182, 11}, -{ 0x2AA2, 14}, { 0x0004, 8}, { 0x0180, 11}, { 0x059C, 14}, { 0x007D, 8}, { 0x0164, 12}, -{ 0x076D, 15}, { 0x0002, 9}, { 0x018D, 11}, { 0x1581, 13}, { 0x00AD, 8}, { 0x0060, 12}, -{ 0x0C67, 14}, { 0x001C, 9}, { 0x00EE, 13}, { 0x0003, 9}, { 0x02CF, 13}, { 0x00D9, 9}, -{ 0x1580, 13}, { 0x0002, 11}, { 0x0183, 11}, { 0x0057, 12}, { 0x0061, 12}, { 0x0031, 11}, -{ 0x0066, 12}, { 0x0631, 13}, { 0x0632, 13}, { 0x00AC, 13}, { 0x031D, 12}, { 0x0076, 12}, -{ 0x003A, 11}, { 0x0165, 12}, { 0x0C66, 14}, { 0x0003, 2}, { 0x0054, 7}, { 0x02AB, 10}, -{ 0x0016, 13}, { 0x05F7, 14}, { 0x0005, 4}, { 0x00F8, 9}, { 0x0AA9, 12}, { 0x005F, 15}, -{ 0x0004, 4}, { 0x001C, 10}, { 0x1550, 13}, { 0x0004, 5}, { 0x0077, 11}, { 0x076C, 15}, -{ 0x000E, 5}, { 0x000A, 12}, { 0x000C, 5}, { 0x0562, 11}, { 0x0004, 6}, { 0x031C, 12}, -{ 0x0006, 6}, { 0x00C8, 13}, { 0x000D, 6}, { 0x01DA, 13}, { 0x0007, 6}, { 0x00C9, 13}, -{ 0x0001, 7}, { 0x002E, 14}, { 0x0014, 7}, { 0x1596, 13}, { 0x000A, 7}, { 0x0AC2, 12}, -{ 0x0016, 7}, { 0x015B, 14}, { 0x0015, 7}, { 0x015A, 14}, { 0x000F, 8}, { 0x005E, 15}, -{ 0x007E, 8}, { 0x00AB, 8}, { 0x002D, 9}, { 0x00D8, 9}, { 0x000B, 9}, { 0x0014, 10}, -{ 0x02B3, 10}, { 0x01F3, 10}, { 0x003A, 10}, { 0x0000, 10}, { 0x0058, 10}, { 0x002E, 9}, -{ 0x005E, 10}, { 0x0563, 11}, { 0x00EC, 12}, { 0x0054, 12}, { 0x0AC1, 12}, { 0x1556, 13}, -{ 0x02FA, 13}, { 0x0181, 11}, { 0x1557, 13}, { 0x059D, 14}, { 0x2AA3, 14}, { 0x2B2A, 14}, -{ 0x01DE, 14}, { 0x063C, 13}, { 0x00CF, 13}, { 0x1594, 13}, { 0x000D, 9} -}, -{ -{ 0x0002, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x000D, 5}, { 0x000C, 5}, { 0x0015, 6}, -{ 0x0013, 6}, { 0x0012, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x001E, 8}, { 0x001D, 8}, -{ 0x0025, 9}, { 0x0024, 9}, { 0x0023, 9}, { 0x0021, 9}, { 0x0021, 10}, { 0x0020, 10}, -{ 0x000F, 10}, { 0x000E, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11}, { 0x0021, 11}, -{ 0x0050, 12}, { 0x0051, 12}, { 0x0052, 12}, { 0x000E, 4}, { 0x0014, 6}, { 0x0016, 7}, -{ 0x001C, 8}, { 0x0020, 9}, { 0x001F, 9}, { 0x000D, 10}, { 0x0022, 11}, { 0x0053, 12}, -{ 0x0055, 12}, { 0x000B, 5}, { 0x0015, 7}, { 0x001E, 9}, { 0x000C, 10}, { 0x0056, 12}, -{ 0x0011, 6}, { 0x001B, 8}, { 0x001D, 9}, { 0x000B, 10}, { 0x0010, 6}, { 0x0022, 9}, -{ 0x000A, 10}, { 0x000D, 6}, { 0x001C, 9}, { 0x0008, 10}, { 0x0012, 7}, { 0x001B, 9}, -{ 0x0054, 12}, { 0x0014, 7}, { 0x001A, 9}, { 0x0057, 12}, { 0x0019, 8}, { 0x0009, 10}, -{ 0x0018, 8}, { 0x0023, 11}, { 0x0017, 8}, { 0x0019, 9}, { 0x0018, 9}, { 0x0007, 10}, -{ 0x0058, 12}, { 0x0007, 4}, { 0x000C, 6}, { 0x0016, 8}, { 0x0017, 9}, { 0x0006, 10}, -{ 0x0005, 11}, { 0x0004, 11}, { 0x0059, 12}, { 0x000F, 6}, { 0x0016, 9}, { 0x0005, 10}, -{ 0x000E, 6}, { 0x0004, 10}, { 0x0011, 7}, { 0x0024, 11}, { 0x0010, 7}, { 0x0025, 11}, -{ 0x0013, 7}, { 0x005A, 12}, { 0x0015, 8}, { 0x005B, 12}, { 0x0014, 8}, { 0x0013, 8}, -{ 0x001A, 8}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9}, { 0x0012, 9}, { 0x0011, 9}, -{ 0x0026, 11}, { 0x0027, 11}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12}, -{ 0x0003, 7} -}, -{ -{ 0x0002, 2}, { 0x000F, 4}, { 0x0015, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x0025, 9}, -{ 0x0024, 9}, { 0x0021, 10}, { 0x0020, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11}, -{ 0x0006, 3}, { 0x0014, 6}, { 0x001E, 8}, { 0x000F, 10}, { 0x0021, 11}, { 0x0050, 12}, -{ 0x000E, 4}, { 0x001D, 8}, { 0x000E, 10}, { 0x0051, 12}, { 0x000D, 5}, { 0x0023, 9}, -{ 0x000D, 10}, { 0x000C, 5}, { 0x0022, 9}, { 0x0052, 12}, { 0x000B, 5}, { 0x000C, 10}, -{ 0x0053, 12}, { 0x0013, 6}, { 0x000B, 10}, { 0x0054, 12}, { 0x0012, 6}, { 0x000A, 10}, -{ 0x0011, 6}, { 0x0009, 10}, { 0x0010, 6}, { 0x0008, 10}, { 0x0016, 7}, { 0x0055, 12}, -{ 0x0015, 7}, { 0x0014, 7}, { 0x001C, 8}, { 0x001B, 8}, { 0x0021, 9}, { 0x0020, 9}, -{ 0x001F, 9}, { 0x001E, 9}, { 0x001D, 9}, { 0x001C, 9}, { 0x001B, 9}, { 0x001A, 9}, -{ 0x0022, 11}, { 0x0023, 11}, { 0x0056, 12}, { 0x0057, 12}, { 0x0007, 4}, { 0x0019, 9}, -{ 0x0005, 11}, { 0x000F, 6}, { 0x0004, 11}, { 0x000E, 6}, { 0x000D, 6}, { 0x000C, 6}, -{ 0x0013, 7}, { 0x0012, 7}, { 0x0011, 7}, { 0x0010, 7}, { 0x001A, 8}, { 0x0019, 8}, -{ 0x0018, 8}, { 0x0017, 8}, { 0x0016, 8}, { 0x0015, 8}, { 0x0014, 8}, { 0x0013, 8}, -{ 0x0018, 9}, { 0x0017, 9}, { 0x0016, 9}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9}, -{ 0x0012, 9}, { 0x0011, 9}, { 0x0007, 10}, { 0x0006, 10}, { 0x0005, 10}, { 0x0004, 10}, -{ 0x0024, 11}, { 0x0025, 11}, { 0x0026, 11}, { 0x0027, 11}, { 0x0058, 12}, { 0x0059, 12}, -{ 0x005A, 12}, { 0x005B, 12}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12}, -{ 0x0003, 7} -}, -{ -{ 0x0000, 2}, { 0x0003, 3}, { 0x000D, 4}, { 0x0005, 4}, { 0x001C, 5}, { 0x0016, 5}, -{ 0x003F, 6}, { 0x003A, 6}, { 0x002E, 6}, { 0x0022, 6}, { 0x007B, 7}, { 0x0067, 7}, -{ 0x005F, 7}, { 0x0047, 7}, { 0x0026, 7}, { 0x00EF, 8}, { 0x00CD, 8}, { 0x00C1, 8}, -{ 0x00A9, 8}, { 0x004F, 8}, { 0x01F2, 9}, { 0x01DD, 9}, { 0x0199, 9}, { 0x0185, 9}, -{ 0x015D, 9}, { 0x011B, 9}, { 0x03EF, 10}, { 0x03E1, 10}, { 0x03C8, 10}, { 0x0331, 10}, -{ 0x0303, 10}, { 0x02F1, 10}, { 0x02A0, 10}, { 0x0233, 10}, { 0x0126, 10}, { 0x07C0, 11}, -{ 0x076F, 11}, { 0x076C, 11}, { 0x0661, 11}, { 0x0604, 11}, { 0x0572, 11}, { 0x0551, 11}, -{ 0x046A, 11}, { 0x0274, 11}, { 0x0F27, 12}, { 0x0F24, 12}, { 0x0EDB, 12}, { 0x0C8E, 12}, -{ 0x0C0B, 12}, { 0x0C0A, 12}, { 0x0AE3, 12}, { 0x08D6, 12}, { 0x0490, 12}, { 0x0495, 12}, -{ 0x1F19, 13}, { 0x1DB5, 13}, { 0x0009, 4}, { 0x0010, 5}, { 0x0029, 6}, { 0x0062, 7}, -{ 0x00F3, 8}, { 0x00AD, 8}, { 0x01E5, 9}, { 0x0179, 9}, { 0x009C, 9}, { 0x03B1, 10}, -{ 0x02AE, 10}, { 0x0127, 10}, { 0x076E, 11}, { 0x0570, 11}, { 0x0275, 11}, { 0x0F25, 12}, -{ 0x0EC0, 12}, { 0x0AA0, 12}, { 0x08D7, 12}, { 0x1E4C, 13}, { 0x0008, 5}, { 0x0063, 7}, -{ 0x00AF, 8}, { 0x017B, 9}, { 0x03B3, 10}, { 0x07DD, 11}, { 0x0640, 11}, { 0x0F8D, 12}, -{ 0x0BC1, 12}, { 0x0491, 12}, { 0x0028, 6}, { 0x00C3, 8}, { 0x0151, 9}, { 0x02A1, 10}, -{ 0x0573, 11}, { 0x0EC3, 12}, { 0x1F35, 13}, { 0x0065, 7}, { 0x01DA, 9}, { 0x02AF, 10}, -{ 0x0277, 11}, { 0x08C9, 12}, { 0x1781, 13}, { 0x0025, 7}, { 0x0118, 9}, { 0x0646, 11}, -{ 0x0AA6, 12}, { 0x1780, 13}, { 0x00C9, 8}, { 0x0321, 10}, { 0x0F9B, 12}, { 0x191E, 13}, -{ 0x0048, 8}, { 0x07CC, 11}, { 0x0AA1, 12}, { 0x0180, 9}, { 0x0465, 11}, { 0x1905, 13}, -{ 0x03E2, 10}, { 0x0EC1, 12}, { 0x3C9B, 14}, { 0x02F4, 10}, { 0x08C8, 12}, { 0x07C1, 11}, -{ 0x0928, 13}, { 0x05E1, 11}, { 0x320D, 14}, { 0x0EC2, 12}, { 0x6418, 15}, { 0x1F34, 13}, -{ 0x0078, 7}, { 0x0155, 9}, { 0x0552, 11}, { 0x191F, 13}, { 0x00FA, 8}, { 0x07DC, 11}, -{ 0x1907, 13}, { 0x00AC, 8}, { 0x0249, 11}, { 0x13B1, 14}, { 0x01F6, 9}, { 0x0AE2, 12}, -{ 0x01DC, 9}, { 0x04ED, 12}, { 0x0184, 9}, { 0x1904, 13}, { 0x0156, 9}, { 0x09D9, 13}, -{ 0x03E7, 10}, { 0x0929, 13}, { 0x03B2, 10}, { 0x3B68, 14}, { 0x02F5, 10}, { 0x13B0, 14}, -{ 0x0322, 10}, { 0x3B69, 14}, { 0x0234, 10}, { 0x7935, 15}, { 0x07C7, 11}, { 0xC833, 16}, -{ 0x0660, 11}, { 0x7934, 15}, { 0x024B, 11}, { 0xC832, 16}, { 0x0AA7, 12}, { 0x1F18, 13}, -{ 0x007A, 7} -}, -{ -{ 0x0002, 2}, { 0x0000, 3}, { 0x001E, 5}, { 0x0004, 5}, { 0x0012, 6}, { 0x0070, 7}, -{ 0x001A, 7}, { 0x005F, 8}, { 0x0047, 8}, { 0x01D3, 9}, { 0x00B5, 9}, { 0x0057, 9}, -{ 0x03B5, 10}, { 0x016D, 10}, { 0x0162, 10}, { 0x07CE, 11}, { 0x0719, 11}, { 0x0691, 11}, -{ 0x02C6, 11}, { 0x0156, 11}, { 0x0F92, 12}, { 0x0D2E, 12}, { 0x0D20, 12}, { 0x059E, 12}, -{ 0x0468, 12}, { 0x02A6, 12}, { 0x1DA2, 13}, { 0x1C60, 13}, { 0x1A43, 13}, { 0x0B1D, 13}, -{ 0x08C0, 13}, { 0x055D, 13}, { 0x0003, 3}, { 0x000A, 5}, { 0x0077, 7}, { 0x00E5, 8}, -{ 0x01D9, 9}, { 0x03E5, 10}, { 0x0166, 10}, { 0x0694, 11}, { 0x0152, 11}, { 0x059F, 12}, -{ 0x1F3C, 13}, { 0x1A4B, 13}, { 0x055E, 13}, { 0x000C, 4}, { 0x007D, 7}, { 0x0044, 8}, -{ 0x03E0, 10}, { 0x0769, 11}, { 0x0E31, 12}, { 0x1F26, 13}, { 0x055C, 13}, { 0x001B, 5}, -{ 0x00E2, 8}, { 0x03A5, 10}, { 0x02C9, 11}, { 0x1F23, 13}, { 0x3B47, 14}, { 0x0007, 5}, -{ 0x01D8, 9}, { 0x02D8, 11}, { 0x1F27, 13}, { 0x3494, 14}, { 0x0035, 6}, { 0x03E1, 10}, -{ 0x059C, 12}, { 0x38C3, 14}, { 0x000C, 6}, { 0x0165, 10}, { 0x1D23, 13}, { 0x1638, 14}, -{ 0x0068, 7}, { 0x0693, 11}, { 0x3A45, 14}, { 0x0020, 7}, { 0x0F90, 12}, { 0x7CF6, 15}, -{ 0x00E8, 8}, { 0x058F, 12}, { 0x2CEF, 15}, { 0x0045, 8}, { 0x0B3A, 13}, { 0x01F1, 9}, -{ 0x3B46, 14}, { 0x01A7, 9}, { 0x1676, 14}, { 0x0056, 9}, { 0x692A, 15}, { 0x038D, 10}, -{ 0xE309, 16}, { 0x00AA, 10}, { 0x1C611, 17}, { 0x02DF, 11}, { 0xB3B9, 17}, { 0x02C8, 11}, -{ 0x38C20, 18}, { 0x01B0, 11}, { 0x16390, 18}, { 0x0F9F, 12}, { 0x16771, 18}, { 0x0ED0, 12}, -{ 0x71843, 19}, { 0x0D2A, 12}, { 0xF9E8C, 20}, { 0x0461, 12}, { 0xF9E8E, 20}, { 0x0B67, 13}, -{ 0x055F, 13}, { 0x003F, 6}, { 0x006D, 9}, { 0x0E90, 12}, { 0x054E, 13}, { 0x0013, 6}, -{ 0x0119, 10}, { 0x0B66, 13}, { 0x000B, 6}, { 0x0235, 11}, { 0x7CF5, 15}, { 0x0075, 7}, -{ 0x0D24, 12}, { 0xF9E9, 16}, { 0x002E, 7}, { 0x1F22, 13}, { 0x0021, 7}, { 0x054F, 13}, -{ 0x0014, 7}, { 0x3A44, 14}, { 0x00E4, 8}, { 0x7CF7, 15}, { 0x005E, 8}, { 0x7185, 15}, -{ 0x0037, 8}, { 0x2C73, 15}, { 0x01DB, 9}, { 0x59DD, 16}, { 0x01C7, 9}, { 0x692B, 15}, -{ 0x01A6, 9}, { 0x58E5, 16}, { 0x00B4, 9}, { 0x1F3D0, 17}, { 0x00B0, 9}, { 0xB1C9, 17}, -{ 0x03E6, 10}, { 0x16770, 18}, { 0x016E, 10}, { 0x3E7A2, 18}, { 0x011B, 10}, { 0xF9E8D, 20}, -{ 0x00D9, 10}, { 0xF9E8F, 20}, { 0x00A8, 10}, { 0x2C723, 19}, { 0x0749, 11}, { 0xE3084, 20}, -{ 0x0696, 11}, { 0x58E45, 20}, { 0x02DE, 11}, { 0xB1C88, 21}, { 0x0231, 11}, { 0x1C610A, 21}, -{ 0x01B1, 11}, { 0x71842D, 23}, { 0x0D2B, 12}, { 0x38C217, 22}, { 0x0D2F, 12}, { 0x163913, 22}, -{ 0x05B2, 12}, { 0x163912, 22}, { 0x0469, 12}, { 0x71842C, 23}, { 0x1A42, 13}, { 0x08C1, 13}, -{ 0x0073, 7} -} -}; - static const uint16_t vlc_offs[] = { 0, 520, 552, 616, 1128, 1160, 1224, 1740, 1772, 1836, 1900, 2436, 2986, 3050, 3610, 4154, 4218, 4746, 5326, 5390, 5902, 6554, 7658, 8342, @@ -1639,12 +1418,14 @@ av_cold int ff_vc1_init_common(VC1Context *v) ff_vc1_mv_diff_bits[i], 1, 1, ff_vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); } - for (i = 0; i < 8; i++) { + for (int i = 0, ac_offset = 0; i < 8; i++) { ff_vc1_ac_coeff_table[i].table = &vlc_table[vlc_offs[i * 2 + 21]]; ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i * 2 + 22] - vlc_offs[i * 2 + 21]; - init_vlc(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], - &vc1_ac_tables[i][0][1], 8, 4, - &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], + ff_vc1_ac_coeff_lens + ac_offset, 1, + ff_vc1_ac_coeff_syms + ac_offset, 2, 2, + 0, INIT_VLC_USE_NEW_STATIC, NULL); + ac_offset += ff_vc1_ac_sizes[i]; /* initialize interlaced MVDATA tables (2-Ref) */ ff_vc1_2ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 2 + 22]]; ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22]; diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index 3c9d1d4b8d..42de71eb25 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -504,25 +504,25 @@ static int vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip, int *value, int codingset) { GetBitContext *gb = &v->s.gb; - int index, run, level, lst, sign; - - index = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3); - if (index < 0) - return index; - if (index != ff_vc1_ac_sizes[codingset] - 1) { - run = vc1_index_decode_table[codingset][index][0]; - level = vc1_index_decode_table[codingset][index][1]; - lst = index >= vc1_last_decode_table[codingset] || get_bits_left(gb) < 0; + int symbol, run, level, lst, sign; + + symbol = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3); + if (symbol < 0) + return symbol; + if (symbol > 0) { + run = symbol & 0xFF; + level = symbol >> 9; + lst = symbol & 0x100 || get_bits_left(gb) < 0; sign = get_bits1(gb); } else { int escape = decode210(gb); if (escape != 2) { - index = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3); - if (index >= ff_vc1_ac_sizes[codingset] - 1U) + symbol = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3); + if (symbol <= 0) return AVERROR_INVALIDDATA; - run = vc1_index_decode_table[codingset][index][0]; - level = vc1_index_decode_table[codingset][index][1]; - lst = index >= vc1_last_decode_table[codingset]; + run = symbol & 0xFF; + level = symbol >> 9; + lst = symbol & 0x100; if (escape == 0) { if (lst) level += vc1_last_delta_level_table[codingset][run]; diff --git a/libavcodec/vc1acdata.h b/libavcodec/vc1acdata.h index a70b44ae05..68a4ca82cf 100644 --- a/libavcodec/vc1acdata.h +++ b/libavcodec/vc1acdata.h @@ -26,180 +26,6 @@ #include "vc1data.h" -/* which indexes point to last=1 entries in tables */ -static const int vc1_last_decode_table[AC_MODES] = { - 119, 99, 85, 81, 67, 58, 126, 109 -}; - -static const uint8_t vc1_index_decode_table[AC_MODES][185][2] = { -{ -{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8}, -{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16}, -{ 0, 17}, { 0, 18}, { 0, 19}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 5}, -{ 1, 6}, { 1, 7}, { 1, 8}, { 1, 9}, { 1, 10}, { 1, 11}, { 1, 12}, { 1, 13}, -{ 1, 14}, { 1, 15}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 2, 5}, { 2, 6}, -{ 2, 7}, { 2, 8}, { 2, 9}, { 2, 10}, { 2, 11}, { 2, 12}, { 3, 1}, { 3, 2}, -{ 3, 3}, { 3, 4}, { 3, 5}, { 3, 6}, { 3, 7}, { 3, 8}, { 3, 9}, { 3, 10}, -{ 3, 11}, { 4, 1}, { 4, 2}, { 4, 3}, { 4, 4}, { 4, 5}, { 4, 6}, { 5, 1}, -{ 5, 2}, { 5, 3}, { 5, 4}, { 5, 5}, { 6, 1}, { 6, 2}, { 6, 3}, { 6, 4}, -{ 7, 1}, { 7, 2}, { 7, 3}, { 7, 4}, { 8, 1}, { 8, 2}, { 8, 3}, { 8, 4}, -{ 9, 1}, { 9, 2}, { 9, 3}, { 9, 4}, { 10, 1}, { 10, 2}, { 10, 3}, { 11, 1}, -{ 11, 2}, { 11, 3}, { 12, 1}, { 12, 2}, { 12, 3}, { 13, 1}, { 13, 2}, { 13, 3}, -{ 14, 1}, { 14, 2}, { 14, 3}, { 15, 1}, { 15, 2}, { 15, 3}, { 16, 1}, { 16, 2}, -{ 17, 1}, { 17, 2}, { 18, 1}, { 19, 1}, { 20, 1}, { 21, 1}, { 22, 1}, { 23, 1}, -{ 24, 1}, { 25, 1}, { 26, 1}, { 27, 1}, { 28, 1}, { 29, 1}, { 30, 1}, { 0, 1}, -{ 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 1, 1}, { 1, 2}, { 1, 3}, -{ 1, 4}, { 1, 5}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 3, 1}, { 3, 2}, -{ 3, 3}, { 3, 4}, { 4, 1}, { 4, 2}, { 4, 3}, { 5, 1}, { 5, 2}, { 6, 1}, -{ 6, 2}, { 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1}, -{ 10, 2}, { 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, -{ 14, 2}, { 15, 1}, { 15, 2}, { 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, -{ 21, 1}, { 22, 1}, { 23, 1}, { 24, 1}, { 25, 1}, { 26, 1}, { 27, 1}, { 28, 1}, -{ 29, 1}, { 30, 1}, { 31, 1}, { 32, 1}, { 33, 1}, { 34, 1}, { 35, 1}, { 36, 1}, -{ 37, 1} -}, -{ -{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8}, -{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16}, -{ 0, 17}, { 0, 18}, { 0, 19}, { 0, 20}, { 0, 21}, { 0, 22}, { 0, 23}, { 1, 1}, -{ 1, 2}, { 1, 3}, { 1, 4}, { 1, 5}, { 1, 6}, { 1, 7}, { 1, 8}, { 1, 9}, -{ 1, 10}, { 1, 11}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 2, 5}, { 2, 6}, -{ 2, 7}, { 2, 8}, { 3, 1}, { 3, 2}, { 3, 3}, { 3, 4}, { 3, 5}, { 3, 6}, -{ 3, 7}, { 4, 1}, { 4, 2}, { 4, 3}, { 4, 4}, { 4, 5}, { 5, 1}, { 5, 2}, -{ 5, 3}, { 5, 4}, { 5, 5}, { 6, 1}, { 6, 2}, { 6, 3}, { 6, 4}, { 7, 1}, -{ 7, 2}, { 7, 3}, { 7, 4}, { 8, 1}, { 8, 2}, { 8, 3}, { 9, 1}, { 9, 2}, -{ 9, 3}, { 10, 1}, { 10, 2}, { 10, 3}, { 11, 1}, { 11, 2}, { 11, 3}, { 12, 1}, -{ 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, { 14, 2}, { 15, 1}, { 15, 2}, { 16, 1}, -{ 16, 2}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, { 21, 1}, { 22, 1}, { 23, 1}, -{ 24, 1}, { 25, 1}, { 26, 1}, { 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, -{ 0, 6}, { 0, 7}, { 0, 8}, { 0, 9}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, -{ 1, 5}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 3, 1}, { 3, 2}, { 3, 3}, -{ 3, 4}, { 4, 1}, { 4, 2}, { 4, 3}, { 5, 1}, { 5, 2}, { 5, 3}, { 6, 1}, -{ 6, 2}, { 6, 3}, { 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, -{ 10, 1}, { 10, 2}, { 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, -{ 14, 1}, { 14, 2}, { 15, 1}, { 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, -{ 21, 1}, { 22, 1}, { 23, 1}, { 24, 1}, { 25, 1}, { 26, 1}, { 27, 1}, { 28, 1}, -{ 29, 1}, { 30, 1}, { 31, 1}, { 32, 1}, { 33, 1}, { 34, 1}, { 35, 1}, { 36, 1} -}, -{ -{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8}, -{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16}, -{ 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 5}, { 1, 6}, { 1, 7}, { 1, 8}, -{ 1, 9}, { 1, 10}, { 1, 11}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 2, 5}, -{ 2, 6}, { 2, 7}, { 2, 8}, { 3, 1}, { 3, 2}, { 3, 3}, { 3, 4}, { 3, 5}, -{ 3, 6}, { 3, 7}, { 4, 1}, { 4, 2}, { 4, 3}, { 4, 4}, { 4, 5}, { 5, 1}, -{ 5, 2}, { 5, 3}, { 5, 4}, { 6, 1}, { 6, 2}, { 6, 3}, { 6, 4}, { 7, 1}, -{ 7, 2}, { 7, 3}, { 8, 1}, { 8, 2}, { 8, 3}, { 9, 1}, { 9, 2}, { 9, 3}, -{ 10, 1}, { 10, 2}, { 10, 3}, { 11, 1}, { 11, 2}, { 11, 3}, { 12, 1}, { 12, 2}, -{ 12, 3}, { 13, 1}, { 13, 2}, { 13, 3}, { 14, 1}, { 14, 2}, { 15, 1}, { 15, 2}, -{ 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, { 0, 1}, { 0, 2}, { 0, 3}, -{ 0, 4}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 2, 1}, { 2, 2}, { 2, 3}, -{ 3, 1}, { 3, 2}, { 3, 3}, { 4, 1}, { 4, 2}, { 5, 1}, { 5, 2}, { 6, 1}, -{ 6, 2}, { 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1}, -{ 10, 2}, { 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, -{ 15, 1}, { 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, { 21, 1}, { 22, 1}, -{ 23, 1}, { 24, 1}, { 25, 1}, { 26, 1} -}, -{ -{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8}, -{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 1, 1}, { 1, 2}, -{ 1, 3}, { 1, 4}, { 1, 5}, { 1, 6}, { 1, 7}, { 1, 8}, { 1, 9}, { 2, 1}, -{ 2, 2}, { 2, 3}, { 2, 4}, { 2, 5}, { 3, 1}, { 3, 2}, { 3, 3}, { 3, 4}, -{ 4, 1}, { 4, 2}, { 4, 3}, { 4, 4}, { 5, 1}, { 5, 2}, { 5, 3}, { 5, 4}, -{ 6, 1}, { 6, 2}, { 6, 3}, { 7, 1}, { 7, 2}, { 7, 3}, { 8, 1}, { 8, 2}, -{ 8, 3}, { 9, 1}, { 9, 2}, { 9, 3}, { 10, 1}, { 10, 2}, { 10, 3}, { 11, 1}, -{ 11, 2}, { 11, 3}, { 12, 1}, { 12, 2}, { 12, 3}, { 13, 1}, { 13, 2}, { 14, 1}, -{ 14, 2}, { 15, 1}, { 15, 2}, { 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, -{ 21, 1}, { 22, 1}, { 23, 1}, { 24, 1}, { 25, 1}, { 26, 1}, { 27, 1}, { 28, 1}, -{ 29, 1}, { 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 1, 1}, { 1, 2}, -{ 1, 3}, { 1, 4}, { 2, 1}, { 2, 2}, { 2, 3}, { 3, 1}, { 3, 2}, { 3, 3}, -{ 4, 1}, { 4, 2}, { 5, 1}, { 5, 2}, { 6, 1}, { 6, 2}, { 7, 1}, { 7, 2}, -{ 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1}, { 10, 2}, { 11, 1}, { 11, 2}, -{ 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, { 14, 2}, { 15, 1}, { 15, 2}, -{ 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, { 21, 1}, { 22, 1}, { 23, 1}, -{ 24, 1}, { 25, 1}, { 26, 1}, { 27, 1}, { 28, 1}, { 29, 1}, { 30, 1}, { 31, 1}, -{ 32, 1}, { 33, 1}, { 34, 1}, { 35, 1}, { 36, 1}, { 37, 1}, { 38, 1}, { 39, 1}, -{ 40, 1}, { 41, 1}, { 42, 1}, { 43, 1} -}, -{ -{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8}, -{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16}, -{ 0, 17}, { 0, 18}, { 0, 19}, { 0, 20}, { 0, 21}, { 0, 22}, { 0, 23}, { 0, 24}, -{ 0, 25}, { 0, 26}, { 0, 27}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 5}, -{ 1, 6}, { 1, 7}, { 1, 8}, { 1, 9}, { 1, 10}, { 2, 1}, { 2, 2}, { 2, 3}, -{ 2, 4}, { 2, 5}, { 3, 1}, { 3, 2}, { 3, 3}, { 3, 4}, { 4, 1}, { 4, 2}, -{ 4, 3}, { 5, 1}, { 5, 2}, { 5, 3}, { 6, 1}, { 6, 2}, { 6, 3}, { 7, 1}, -{ 7, 2}, { 7, 3}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1}, { 11, 1}, -{ 12, 1}, { 13, 1}, { 14, 1}, { 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, -{ 0, 6}, { 0, 7}, { 0, 8}, { 1, 1}, { 1, 2}, { 1, 3}, { 2, 1}, { 2, 2}, -{ 3, 1}, { 3, 2}, { 4, 1}, { 4, 2}, { 5, 1}, { 5, 2}, { 6, 1}, { 6, 2}, -{ 7, 1}, { 8, 1}, { 9, 1}, { 10, 1}, { 11, 1}, { 12, 1}, { 13, 1}, { 14, 1}, -{ 15, 1}, { 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1} -}, -{ -{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8}, -{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, -{ 1, 5}, { 1, 6}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 3, 1}, { 3, 2}, -{ 3, 3}, { 4, 1}, { 4, 2}, { 4, 3}, { 5, 1}, { 5, 2}, { 5, 3}, { 6, 1}, -{ 6, 2}, { 6, 3}, { 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, -{ 10, 1}, { 10, 2}, { 11, 1}, { 12, 1}, { 13, 1}, { 14, 1}, { 15, 1}, { 16, 1}, -{ 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, { 21, 1}, { 22, 1}, { 23, 1}, { 24, 1}, -{ 25, 1}, { 26, 1}, { 0, 1}, { 0, 2}, { 0, 3}, { 1, 1}, { 1, 2}, { 2, 1}, -{ 3, 1}, { 4, 1}, { 5, 1}, { 6, 1}, { 7, 1}, { 8, 1}, { 9, 1}, { 10, 1}, -{ 11, 1}, { 12, 1}, { 13, 1}, { 14, 1}, { 15, 1}, { 16, 1}, { 17, 1}, { 18, 1}, -{ 19, 1}, { 20, 1}, { 21, 1}, { 22, 1}, { 23, 1}, { 24, 1}, { 25, 1}, { 26, 1}, -{ 27, 1}, { 28, 1}, { 29, 1}, { 30, 1}, { 31, 1}, { 32, 1}, { 33, 1}, { 34, 1}, -{ 35, 1}, { 36, 1}, { 37, 1}, { 38, 1}, { 39, 1}, { 40, 1} -}, -{ -{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8}, -{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16}, -{ 0, 17}, { 0, 18}, { 0, 19}, { 0, 20}, { 0, 21}, { 0, 22}, { 0, 23}, { 0, 24}, -{ 0, 25}, { 0, 26}, { 0, 27}, { 0, 28}, { 0, 29}, { 0, 30}, { 0, 31}, { 0, 32}, -{ 0, 33}, { 0, 34}, { 0, 35}, { 0, 36}, { 0, 37}, { 0, 38}, { 0, 39}, { 0, 40}, -{ 0, 41}, { 0, 42}, { 0, 43}, { 0, 44}, { 0, 45}, { 0, 46}, { 0, 47}, { 0, 48}, -{ 0, 49}, { 0, 50}, { 0, 51}, { 0, 52}, { 0, 53}, { 0, 54}, { 0, 55}, { 0, 56}, -{ 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 5}, { 1, 6}, { 1, 7}, { 1, 8}, -{ 1, 9}, { 1, 10}, { 1, 11}, { 1, 12}, { 1, 13}, { 1, 14}, { 1, 15}, { 1, 16}, -{ 1, 17}, { 1, 18}, { 1, 19}, { 1, 20}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, -{ 2, 5}, { 2, 6}, { 2, 7}, { 2, 8}, { 2, 9}, { 2, 10}, { 3, 1}, { 3, 2}, -{ 3, 3}, { 3, 4}, { 3, 5}, { 3, 6}, { 3, 7}, { 4, 1}, { 4, 2}, { 4, 3}, -{ 4, 4}, { 4, 5}, { 4, 6}, { 5, 1}, { 5, 2}, { 5, 3}, { 5, 4}, { 5, 5}, -{ 6, 1}, { 6, 2}, { 6, 3}, { 6, 4}, { 7, 1}, { 7, 2}, { 7, 3}, { 8, 1}, -{ 8, 2}, { 8, 3}, { 9, 1}, { 9, 2}, { 9, 3}, { 10, 1}, { 10, 2}, { 11, 1}, -{ 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, { 0, 1}, { 0, 2}, -{ 0, 3}, { 0, 4}, { 1, 1}, { 1, 2}, { 1, 3}, { 2, 1}, { 2, 2}, { 2, 3}, -{ 3, 1}, { 3, 2}, { 4, 1}, { 4, 2}, { 5, 1}, { 5, 2}, { 6, 1}, { 6, 2}, -{ 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1}, { 10, 2}, -{ 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, { 14, 2}, -{ 15, 1}, { 16, 1} -}, -{ -{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8}, -{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16}, -{ 0, 17}, { 0, 18}, { 0, 19}, { 0, 20}, { 0, 21}, { 0, 22}, { 0, 23}, { 0, 24}, -{ 0, 25}, { 0, 26}, { 0, 27}, { 0, 28}, { 0, 29}, { 0, 30}, { 0, 31}, { 0, 32}, -{ 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 5}, { 1, 6}, { 1, 7}, { 1, 8}, -{ 1, 9}, { 1, 10}, { 1, 11}, { 1, 12}, { 1, 13}, { 2, 1}, { 2, 2}, { 2, 3}, -{ 2, 4}, { 2, 5}, { 2, 6}, { 2, 7}, { 2, 8}, { 3, 1}, { 3, 2}, { 3, 3}, -{ 3, 4}, { 3, 5}, { 3, 6}, { 4, 1}, { 4, 2}, { 4, 3}, { 4, 4}, { 4, 5}, -{ 5, 1}, { 5, 2}, { 5, 3}, { 5, 4}, { 6, 1}, { 6, 2}, { 6, 3}, { 6, 4}, -{ 7, 1}, { 7, 2}, { 7, 3}, { 8, 1}, { 8, 2}, { 8, 3}, { 9, 1}, { 9, 2}, -{ 9, 3}, { 10, 1}, { 10, 2}, { 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, -{ 13, 2}, { 14, 1}, { 14, 2}, { 15, 1}, { 15, 2}, { 16, 1}, { 16, 2}, { 17, 1}, -{ 17, 2}, { 18, 1}, { 18, 2}, { 19, 1}, { 19, 2}, { 20, 1}, { 20, 2}, { 21, 1}, -{ 21, 2}, { 22, 1}, { 22, 2}, { 23, 1}, { 24, 1}, { 0, 1}, { 0, 2}, { 0, 3}, -{ 0, 4}, { 1, 1}, { 1, 2}, { 1, 3}, { 2, 1}, { 2, 2}, { 2, 3}, { 3, 1}, -{ 3, 2}, { 3, 3}, { 4, 1}, { 4, 2}, { 5, 1}, { 5, 2}, { 6, 1}, { 6, 2}, -{ 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1}, { 10, 2}, -{ 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, { 14, 2}, -{ 15, 1}, { 15, 2}, { 16, 1}, { 16, 2}, { 17, 1}, { 17, 2}, { 18, 1}, { 18, 2}, -{ 19, 1}, { 19, 2}, { 20, 1}, { 20, 2}, { 21, 1}, { 21, 2}, { 22, 1}, { 22, 2}, -{ 23, 1}, { 23, 2}, { 24, 1}, { 24, 2}, { 25, 1}, { 25, 2}, { 26, 1}, { 26, 2}, -{ 27, 1}, { 27, 2}, { 28, 1}, { 28, 2}, { 29, 1}, { 30, 1} -} -}; - static const uint8_t vc1_delta_level_table[AC_MODES][31] = { { 19, 15, 12, 11, 6, 5, 4, 4, 4, 4, diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c index 0050b959ed..57bc1fa9d6 100644 --- a/libavcodec/vc1data.c +++ b/libavcodec/vc1data.c @@ -1127,6 +1127,231 @@ const uint16_t ff_vc1_b_field_mvpred_scales[7][4] = { { 7, 4, 3, 3 } // ZONE1OFFSET_Y }; +/* +1 to account for dummy nodes added because some trees are incomplete. */ const int ff_vc1_ac_sizes[AC_MODES] = { - 186, 169, 133, 149, 103, 103, 163, 175 + 186, 169, 133, 149, 103 + 1, 103 + 1, 163, 175 }; + +const uint8_t ff_vc1_ac_coeff_lens[] = { + /* High Motion Intra Tables (#177-179) - 186 entries */ + 4, 7, 9, 11, 12, 14, 14, 14, 15, 15, 10, 8, 9, 9, 8, 9, 11, 13, 13, + 13, 13, 12, 12, 14, 14, 13, 12, 8, 5, 8, 8, 7, 9, 10, 13, 13, 12, 14, + 15, 15, 13, 13, 14, 14, 9, 9, 7, 10, 13, 13, 13, 13, 11, 10, 10, 13, 14, + 15, 15, 12, 12, 12, 10, 9, 7, 8, 8, 10, 11, 13, 14, 15, 15, 12, 11, 11, + 11, 13, 14, 14, 12, 8, 6, 11, 11, 12, 12, 11, 9, 8, 7, 6, 11, 14, 14, + 13, 12, 11, 13, 13, 13, 13, 9, 9, 12, 13, 13, 12, 12, 12, 12, 15, 15, 14, + 13, 13, 13, 9, 10, 12, 12, 11, 8, 2, 5, 7, 7, 12, 13, 14, 14, 11, 10, + 10, 10, 8, 8, 10, 11, 12, 14, 14, 14, 14, 9, 5, 5, 3, 6, 8, 8, 7, + 5, 4, 4, 7, 7, 6, 11, 11, 10, 11, 12, 12, 10, 10, 14, 14, 13, 13, 13, + 11, 9, 9, 11, 13, 13, 13, 14, 14, 11, 12, 13, 13, 8, 6, + /* High Motion Inter Tables (#184-186) - 169 entries */ + 3, 7, 9, 10, 10, 8, 10, 12, 13, 13, 13, 13, 12, 9, 8, 8, 11, 14, 14, + 13, 13, 15, 15, 14, 11, 12, 14, 14, 13, 9, 5, 4, 4, 6, 8, 8, 9, 9, + 8, 5, 3, 7, 10, 11, 12, 12, 10, 13, 14, 14, 12, 13, 15, 15, 14, 13, 13, + 8, 7, 10, 11, 11, 10, 10, 9, 10, 10, 5, 4, 8, 8, 8, 11, 11, 13, 15, + 15, 14, 12, 11, 10, 10, 6, 6, 6, 7, 7, 9, 9, 11, 13, 13, 14, 15, 15, + 14, 15, 15, 12, 12, 11, 9, 8, 9, 11, 12, 12, 11, 14, 14, 13, 12, 9, 10, + 10, 14, 14, 13, 14, 14, 13, 11, 12, 13, 14, 14, 11, 9, 7, 6, 5, 5, 4, + 6, 8, 10, 10, 11, 13, 13, 12, 11, 12, 12, 10, 10, 12, 12, 11, 11, 11, 9, + 10, 14, 15, 15, 14, 14, 13, 14, 14, 12, 13, 14, 14, 5, 5, 6, 6, + /* Low Motion Intra Tables (#191-193) - 133 entries */ + 7, 10, 10, 11, 11, 11, 13, 13, 13, 13, 8, 7, 8, 8, 8, 9, 11, 12, 13, + 13, 12, 13, 13, 13, 13, 12, 9, 9, 8, 7, 9, 11, 12, 12, 12, 12, 11, 8, + 4, 5, 7, 8, 9, 10, 10, 7, 8, 9, 13, 13, 12, 11, 12, 12, 11, 7, 11, + 11, 11, 12, 12, 10, 10, 8, 8, 9, 11, 11, 10, 7, 6, 10, 11, 11, 11, 12, + 12, 10, 9, 10, 12, 12, 11, 7, 2, 6, 7, 7, 5, 5, 8, 10, 10, 11, 11, + 12, 12, 12, 12, 8, 9, 11, 11, 11, 12, 12, 7, 8, 9, 10, 11, 12, 12, 4, + 5, 5, 3, 8, 8, 7, 6, 8, 10, 10, 9, 8, 9, 11, 12, 12, 10, 6, 4, + /* Low Motion Inter Tables (#198-200) - 149 entries */ + 10, 11, 11, 11, 12, 13, 14, 15, 15, 11, 11, 9, 9, 7, 8, 10, 12, 12, 13, + 14, 14, 12, 9, 12, 12, 11, 13, 13, 12, 12, 13, 13, 9, 10, 11, 12, 13, 14, + 14, 10, 10, 6, 7, 9, 10, 12, 13, 15, 15, 14, 11, 8, 6, 7, 10, 12, 12, + 12, 14, 14, 13, 9, 9, 10, 13, 14, 15, 15, 13, 14, 14, 11, 6, 6, 5, 7, + 7, 7, 7, 11, 11, 11, 11, 9, 9, 13, 13, 13, 14, 14, 11, 12, 12, 13, 13, + 12, 7, 6, 5, 4, 4, 5, 6, 9, 9, 8, 7, 5, 6, 9, 10, 10, 8, 8, + 8, 3, 5, 7, 9, 13, 14, 14, 12, 12, 13, 13, 10, 8, 13, 13, 12, 12, 12, + 11, 11, 13, 14, 14, 12, 13, 14, 14, 13, 13, 10, 8, 7, 4, 2, + /* Mid Rate Intra Tables (#205-207) - 103 + 1 entries */ + -9, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, + 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 7, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 5, 5, 5, 4, 2, 3, 4, 4, + /* Mid Rate Inter Tables (#212-214) - 103 + 1 entries */ + -9, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, + 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 7, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 5, 5, 5, 4, 2, 3, 4, 4, + /* High Rate Intra Tables (#219-221) - 163 entries */ + 2, 5, 8, 12, 12, 11, 13, 13, 12, 11, 10, 10, 7, 7, 9, 11, 11, 14, 14, + 13, 12, 11, 8, 4, 3, 5, 6, 9, 12, 12, 11, 10, 10, 11, 12, 12, 9, 7, + 4, 6, 6, 10, 10, 9, 8, 12, 12, 11, 11, 12, 12, 9, 9, 10, 10, 8, 8, + 11, 12, 12, 11, 11, 9, 8, 5, 6, 13, 13, 12, 11, 10, 9, 10, 10, 9, 7, + 9, 11, 12, 12, 10, 8, 9, 9, 8, 7, 7, 11, 13, 13, 15, 16, 16, 14, 13, + 10, 10, 11, 12, 13, 13, 8, 7, 11, 11, 10, 9, 8, 7, 4, 5, 6, 12, 12, + 12, 12, 10, 10, 10, 9, 11, 14, 14, 13, 12, 11, 11, 9, 9, 8, 7, 10, 12, + 12, 13, 15, 15, 14, 12, 9, 8, 7, 7, 11, 11, 10, 10, 13, 13, 12, 11, 9, + 11, 13, 13, 12, 10, 8, 9, 11, 11, 10, 6, + /* High Rate Inter Tables (#226-228) - 175 entries */ + 3, 5, 7, 10, 11, 12, 13, 13, 10, 11, 13, 13, 13, 13, 9, 9, 6, 6, 7, + 11, 11, 10, 9, 8, 5, 7, 7, 8, 8, 13, 13, 12, 11, 10, 12, 12, 11, 10, + 8, 6, 6, 5, 9, 10, 11, 14, 18, 21, 22, 22, 20, 19, 17, 16, 15, 13, 12, + 11, 11, 10, 10, 12, 13, 14, 18, 18, 17, 16, 15, 12, 12, 9, 9, 11, 12, 13, + 13, 10, 10, 11, 11, 7, 8, 8, 3, 2, 4, 7, 12, 13, 13, 11, 12, 14, 15, + 15, 13, 11, 11, 12, 12, 11, 12, 12, 9, 9, 6, 5, 7, 8, 13, 18, 20, 21, + 23, 23, 22, 19, 17, 16, 15, 14, 12, 11, 10, 9, 8, 8, 7, 8, 12, 14, 14, + 13, 11, 10, 9, 7, 9, 9, 12, 13, 14, 14, 11, 10, 9, 7, 5, 10, 10, 9, + 12, 13, 13, 12, 13, 13, 10, 10, 11, 13, 17, 18, 20, 20, 20, 20, 16, 15, 15, + 15, 12, 7, 6, +}; + +#define ESCAPE 0 +const uint16_t ff_vc1_ac_coeff_syms[] = { + /* High Motion Intra Tables (#177-179) - 186 entries */ + 0x0201, 0x0601, 0x0404, 0x0604, 0x1201, 0x0806, 0x0323, 0x021A, 0x1802, + 0x0704, 0x0802, 0x0E00, 0x0501, 0x0A01, 0x0306, 0x020D, 0x0A02, 0x0608, + 0x031F, 0x0805, 0x1002, 0x0318, 0x0319, 0x0902, 0x2400, 0x2000, 0x0315, + 0x0307, 0x0202, 0x0801, 0x0209, 0x0402, 0x020C, 0x020E, 0x0507, 0x031C, + 0x1C00, 0x1402, 0x1C01, 0x0410, 0x0901, 0x060C, 0x060F, 0x0903, ESCAPE, + 0x1200, 0x0206, 0x0407, 0x0216, 0x0215, 0x1601, 0x050C, 0x0313, 0x0502, + 0x020F, 0x0E03, 0x1A01, 0x1603, 0x0411, 0x0212, 0x0316, 0x0213, 0x0503, + 0x0405, 0x0C00, 0x0308, 0x030D, 0x1600, 0x1A00, 0x040E, 0x021D, 0x021E, + 0x1E01, 0x0317, 0x040B, 0x040A, 0x0701, 0x0B00, 0x021B, 0x1602, 0x0702, + 0x0309, 0x0204, 0x0605, 0x0312, 0x0607, 0x0E02, 0x040C, 0x0603, 0x020A, + 0x0207, 0x0A00, 0x1001, 0x0A05, 0x0A04, 0x060B, 0x0505, 0x0210, 0x0219, + 0x0217, 0x031E, 0x0322, 0x030E, 0x030F, 0x031D, 0x0508, 0x060A, 0x1E00, + 0x0703, 0x031A, 0x1401, 0x0C04, 0x060E, 0x0807, 0x050A, 0x0218, 0x1202, + 0x0406, 0x040D, 0x0C03, 0x040F, 0x0314, 0x1000, 0x0200, 0x0401, 0x0304, + 0x0500, 0x0804, 0x050B, 0x0808, 0x021C, 0x0A03, 0x0310, 0x0803, 0x0E01, + 0x030A, 0x030B, 0x0409, 0x0900, 0x0506, 0x0325, 0x0B01, 0x0809, 0x0D00, + 0x1400, 0x0800, 0x0203, 0x0400, 0x0302, 0x0602, 0x020B, 0x0305, 0x0301, + 0x0600, 0x0300, 0x0403, 0x0208, 0x0205, 0x050D, 0x0606, 0x0408, 0x0211, + 0x0214, 0x031B, 0x1800, 0x0311, 0x1203, 0x1403, 0x1801, 0x1003, 0x0321, + 0x0504, 0x0700, 0x0C01, 0x0C02, 0x0509, 0x2200, 0x050F, 0x2600, 0x0324, + 0x060D, 0x0609, 0x0320, 0x050E, 0x030C, 0x0303, + /* High Motion Inter Tables (#184-186) - 169 entries */ + 0x0200, 0x0308, 0x020A, 0x0603, 0x020B, 0x0207, 0x0310, 0x0316, 0x0C02, + 0x0901, 0x031F, 0x0804, 0x0507, 0x0602, 0x0403, 0x030B, 0x0318, 0x0608, + 0x0C03, 0x0607, 0x2000, 0x0E03, 0x0B01, 0x050B, 0x0409, 0x040A, 0x031D, + 0x0E02, 0x040B, 0x0404, 0x0202, 0x0400, 0x0201, 0x0800, 0x0501, 0x030C, + 0x1000, 0x0502, 0x030D, 0x0600, 0x0300, 0x0402, 0x020C, 0x0604, 0x0702, + 0x1C00, 0x1400, 0x0D00, 0x2600, 0x1401, 0x0211, 0x0805, 0x1300, 0x2C00, + 0x031E, 0x050A, 0x2200, 0x0209, 0x0601, 0x0313, 0x1800, 0x0214, 0x0312, + 0x0504, 0x0405, 0x0315, 0x0406, 0x0303, 0x0301, 0x030E, 0x0208, 0x0E00, + 0x0323, 0x0319, 0x050E, 0x0903, 0x021A, 0x0705, 0x0508, 0x0803, 0x0900, + 0x0802, 0x0204, 0x0500, 0x0306, 0x0206, 0x030A, 0x0314, ESCAPE, 0x0605, + 0x1201, 0x0322, 0x0902, 0x0706, 0x060B, 0x2800, 0x2E00, 0x0410, 0x1E00, + 0x031C, 0x020F, 0x0503, 0x0801, 0x1200, 0x0506, 0x0509, 0x0215, 0x0408, + 0x0216, 0x1100, 0x0704, 0x0703, 0x030F, 0x1600, 0x0407, 0x0807, 0x0A04, + 0x0609, 0x0321, 0x1601, 0x0320, 0x1A00, 0x1001, 0x2400, 0x0217, 0x0218, + 0x0A02, 0x0A01, 0x0C00, 0x0307, 0x0203, 0x0304, 0x0302, 0x0205, 0x0700, + 0x0505, 0x0C01, 0x031B, 0x040D, 0x050C, 0x050D, 0x0E01, 0x031A, 0x0A03, + 0x0701, 0x020D, 0x0213, 0x0212, 0x0B00, 0x0317, 0x0210, 0x0311, 0x020E, + 0x2A00, 0x1002, 0x040F, 0x0A05, 0x040E, 0x0F00, 0x060A, 0x0219, 0x0606, + 0x040C, 0x0324, 0x0806, 0x0305, 0x0401, 0x0309, 0x0A00, + /* Low Motion Intra Tables (#191-193) - 133 entries */ + 0x0303, 0x0407, 0x0802, 0x0605, 0x0310, 0x040B, 0x0316, 0x2000, 0x031A, + 0x1002, 0x0306, 0x0601, 0x0307, 0x0209, 0x0E00, 0x0A01, 0x0701, 0x1E00, + 0x0901, 0x0806, 0x0804, 0x0214, 0x1601, 0x050C, 0x0A04, 0x060A, 0x020D, + 0x020C, 0x0801, 0x0206, 0x0405, 0x0313, 0x1201, 0x0314, 0x0C03, 0x0317, + 0x1A00, 0x0309, 0x0201, 0x0202, 0x0402, 0x0308, 0x1200, 0x0503, 0x0409, + ESCAPE, 0x030D, 0x0603, 0x0E03, 0x0508, 0x0315, 0x040C, 0x040F, 0x0212, + 0x0210, 0x0C00, 0x0606, 0x1001, 0x050D, 0x0319, 0x060B, 0x020F, 0x020E, + 0x030A, 0x020A, 0x030F, 0x0A02, 0x0A03, 0x0408, 0x0207, 0x0204, 0x1600, + 0x0C02, 0x0312, 0x060D, 0x0E02, 0x0506, 0x0803, 0x0406, 0x040D, 0x1401, + 0x0318, 0x1C00, 0x0304, 0x0200, 0x0A00, 0x0500, 0x0305, 0x0401, 0x0301, + 0x030B, 0x0502, 0x040A, 0x0609, 0x0211, 0x0703, 0x040E, 0x0507, 0x050B, + 0x1000, 0x030E, 0x0505, 0x0900, 0x0504, 0x0805, 0x0608, 0x0403, 0x0602, + 0x1400, 0x0E01, 0x0213, 0x0509, 0x050A, 0x0300, 0x0800, 0x0203, 0x0400, + 0x020B, 0x0404, 0x0208, 0x0302, 0x0501, 0x0604, 0x1800, 0x0700, 0x030C, + 0x0C01, 0x0607, 0x0702, 0x060C, 0x0311, 0x0205, 0x0600, + /* Low Motion Inter Tables (#198-200) - 149 entries */ + 0x0319, 0x0210, 0x0602, 0x0406, 0x0504, 0x0900, 0x050A, 0x050F, 0x0901, + 0x0407, 0x0801, 0x020B, 0x020E, 0x030A, 0x0209, 0x0315, 0x031F, 0x0603, + 0x0218, 0x050E, 0x050D, 0x0212, 0x0314, 0x040C, 0x0213, 0x0214, 0x0507, + 0x0509, 0x1000, 0x0215, 0x0C01, 0x032A, ESCAPE, 0x0502, 0x021B, 0x021A, + 0x040D, 0x0328, 0x0803, 0x0404, 0x0405, 0x0203, 0x0206, 0x020D, 0x0318, + 0x031E, 0x0508, 0x0703, 0x060A, 0x1800, 0x0503, 0x030F, 0x0306, 0x030C, + 0x031A, 0x040A, 0x021C, 0x0A01, 0x0609, 0x0325, 0x040E, 0x0312, 0x031B, + 0x031C, 0x0606, 0x0A02, 0x1C00, 0x1201, 0x0322, 0x1001, 0x0B00, 0x0E00, + 0x0307, 0x0309, 0x0303, 0x030B, 0x030E, 0x030D, 0x0600, 0x0409, 0x0323, + 0x0408, 0x0211, 0x0403, 0x0601, 0x1400, 0x0216, 0x0217, 0x021D, 0x060C, + 0x040B, 0x0506, 0x0219, 0x0329, 0x0607, 0x0802, 0x0207, 0x0308, 0x0202, + 0x0302, 0x0301, 0x0305, 0x0204, 0x0313, 0x020F, 0x0402, 0x0401, 0x0304, + 0x0205, 0x0501, 0x0C00, 0x0317, 0x020A, 0x0310, 0x0800, 0x0200, 0x0400, + 0x0500, 0x0A00, 0x0702, 0x0608, 0x0326, 0x0701, 0x1200, 0x0321, 0x0324, + 0x0700, 0x0311, 0x040F, 0x060B, 0x0320, 0x050C, 0x0605, 0x0505, 0x031D, + 0x0E01, 0x1A00, 0x0804, 0x0604, 0x032B, 0x0327, 0x0805, 0x050B, 0x1600, + 0x0316, 0x020C, 0x0208, 0x0201, 0x0300, + /* Mid Rate Intra Tables (#205-207) - 103 + 1 entries */ + 0, 0x0F00, 0x0D00, 0x2C00, 0x2A00, 0x0502, 0x0701, 0x0B00, 0x020D, + 0x0605, 0x0408, 0x0604, 0x0803, 0x0802, 0x0E01, 0x2800, 0x2600, 0x2E00, + 0x3000, 0x1001, 0x0409, 0x0503, 0x0504, 0x030F, 0x0310, 0x3200, 0x3400, + 0x3600, 0x1201, 0x0606, 0x1401, 0x0A02, 0x0607, 0x020E, 0x1100, 0x0505, + 0x0506, 0x0311, 0x0312, 0x0313, 0x0314, ESCAPE, 0x2400, 0x2200, 0x030E, + 0x030D, 0x030C, 0x030B, 0x030A, 0x0501, 0x0900, 0x020C, 0x020B, 0x0407, + 0x0406, 0x0405, 0x0603, 0x0602, 0x0C01, 0x0A01, 0x2000, 0x0404, 0x1E00, + 0x1C00, 0x1A00, 0x0308, 0x0307, 0x0306, 0x0700, 0x020A, 0x0209, 0x0208, + 0x0309, 0x0403, 0x0801, 0x1800, 0x1600, 0x1400, 0x0304, 0x0303, 0x0206, + 0x0305, 0x0207, 0x0402, 0x0601, 0x1200, 0x0500, 0x0205, 0x0302, 0x0301, + 0x0204, 0x0203, 0x1000, 0x0E00, 0x0401, 0x0C00, 0x0202, 0x0A00, 0x0800, + 0x0300, 0x0200, 0x0400, 0x0201, 0x0600, + /* Mid Rate Inter Tables (#212-214) - 103 + 1 entries */ + 0, 0x0501, 0x0700, 0x1600, 0x1400, 0x031C, 0x031B, 0x031A, 0x0319, + 0x0409, 0x0408, 0x0407, 0x0406, 0x0405, 0x0603, 0x0602, 0x0801, 0x1800, + 0x0A01, 0x0217, 0x0218, 0x031D, 0x031E, 0x031F, 0x0320, 0x0C01, 0x0802, + 0x0604, 0x0605, 0x0606, 0x040A, 0x0219, 0x021A, 0x0321, 0x0322, 0x0323, + 0x0324, 0x0325, 0x0326, 0x0327, 0x0328, ESCAPE, 0x1200, 0x1000, 0x0318, + 0x0317, 0x0316, 0x0315, 0x0314, 0x0313, 0x0312, 0x0311, 0x0500, 0x0216, + 0x0215, 0x0214, 0x0213, 0x0212, 0x0211, 0x0210, 0x020F, 0x0404, 0x0403, + 0x0E00, 0x0C00, 0x0310, 0x030F, 0x030E, 0x030D, 0x030C, 0x030B, 0x030A, + 0x0309, 0x020E, 0x020D, 0x0402, 0x0601, 0x0A00, 0x0308, 0x0307, 0x0306, + 0x0305, 0x020C, 0x020B, 0x020A, 0x0800, 0x0304, 0x0303, 0x0302, 0x0301, + 0x0209, 0x0208, 0x0207, 0x0206, 0x0401, 0x0600, 0x0205, 0x0204, 0x0203, + 0x0300, 0x0200, 0x0201, 0x0202, 0x0400, + /* High Rate Intra Tables (#219-221) - 163 entries */ + 0x0200, 0x0202, 0x0207, 0x6A00, 0x1402, 0x0502, 0x040B, 0x0507, 0x6C00, + 0x030E, 0x4600, 0x1801, 0x0205, 0x1E00, 0x1201, 0x5800, 0x1E01, 0x0509, + 0x0702, 0x0506, 0x0504, 0x0804, 0x2800, 0x0800, 0x0400, 0x0401, 0x1400, + 0x0405, 0x040A, 0x0A04, 0x0408, 0x4400, 0x030B, 0x5600, 0x6800, 0x2601, + 0x3400, 0x1C00, 0x0201, 0x0203, 0x0601, 0x4200, 0x0803, 0x0603, 0x2600, + 0x2401, 0x0607, 0x5400, 0x0700, 0x0805, 0x030F, 0x0500, 0x0306, 0x1601, + 0x0604, 0x0302, 0x0C01, 0x1C01, 0x0503, 0x6600, 0x5200, 0x0A03, 0x3200, + 0x0602, 0x0C00, 0x1200, 0x0A05, 0x0C04, 0x1202, 0x020C, 0x4000, 0x1001, + 0x020A, 0x0309, 0x0802, 0x1A00, 0x0208, 0x5000, 0x6400, 0x6200, 0x3E00, + 0x2400, 0x0305, 0x3000, 0x0403, 0x0801, 0x0402, 0x0E02, 0x0505, 0x0608, + 0x040D, 0x050E, 0x050C, 0x040C, 0x0701, 0x0406, 0x030A, 0x0605, 0x6000, + 0x0806, 0x0900, 0x0206, 0x0204, 0x030D, 0x4E00, 0x3C00, 0x2E00, 0x2200, + 0x1800, 0x0600, 0x0A00, 0x1000, 0x2201, 0x0409, 0x020D, 0x0C03, 0x1401, + 0x0308, 0x0A02, 0x0404, 0x4C00, 0x0508, 0x050A, 0x7000, 0x5E00, 0x1A01, + 0x4A00, 0x0304, 0x2C00, 0x2000, 0x0300, 0x3A00, 0x5C00, 0x2001, 0x2801, + 0x050D, 0x050B, 0x0609, 0x5A00, 0x0E01, 0x0A01, ESCAPE, 0x1600, 0x4800, + 0x020B, 0x3800, 0x0209, 0x0310, 0x6E00, 0x1002, 0x030C, 0x2A00, 0x0407, + 0x020E, 0x0E03, 0x0606, 0x0307, 0x0301, 0x0303, 0x0501, 0x0C02, 0x3600, + 0x0E00, + /* High Rate Inter Tables (#226-228) - 175 entries */ + 0x0400, 0x0800, 0x0306, 0x0313, 0x1201, 0x3400, 0x0900, 0x0505, 0x020F, + 0x2800, 0x1002, 0x4000, 0x1A01, 0x0218, 0x020D, 0x1800, 0x0302, 0x0206, + 0x0E00, 0x0212, 0x0318, 0x0312, 0x0500, 0x0309, 0x0204, 0x0208, 0x0305, + 0x0602, 0x020A, 0x3E00, 0x031E, 0x0216, 0x0317, 0x0501, 0x3200, 0x031C, + 0x0502, 0x0311, 0x1200, 0x0A00, 0x0301, 0x0401, 0x030E, 0x1E00, 0x2600, + 0x0806, 0x0412, 0x0516, 0x051B, 0x051A, 0x0515, 0x0513, 0x050E, 0x050C, + 0x0509, 0x3C00, 0x0409, 0x0211, 0x0803, 0x0406, 0x0E01, 0x0605, 0x040A, + 0x040C, 0x050F, 0x0413, 0x0410, 0x050A, 0x0609, 0x3000, 0x1401, 0x030D, + 0x1600, 0x0604, 0x031B, 0x0701, 0x0217, 0x1C00, 0x0310, 0x0316, 0x0210, + 0x0304, 0x0308, 0x1000, 0x0201, 0x0200, 0x0202, 0x0207, 0x2E00, 0x031D, + 0x3A00, 0x2400, 0x0503, 0x0A04, 0x040D, 0x050B, 0x1801, 0x0407, 0x1001, + 0x0215, 0x0319, 0x0315, 0x2C00, 0x031A, 0x030C, 0x020C, 0x0205, 0x0203, + 0x0C00, 0x0403, 0x3800, 0x0411, 0x0514, 0x0517, 0x051C, 0x0518, 0x0519, + 0x0414, 0x040F, 0x040E, 0x0508, 0x0805, 0x0C02, 0x2200, 0x020E, 0x030B, + 0x0307, 0x0801, ESCAPE, 0x0209, 0x0700, 0x0506, 0x0607, 0x0606, 0x0314, + 0x0603, 0x1400, 0x0303, 0x0404, 0x0A01, 0x0214, 0x3600, 0x040B, 0x0C03, + 0x0A02, 0x1A00, 0x030A, 0x0601, 0x0600, 0x0802, 0x0405, 0x020B, 0x0408, + 0x0504, 0x0A03, 0x2A00, 0x0E02, 0x0804, 0x0C01, 0x030F, 0x2000, 0x1601, + 0x050D, 0x0510, 0x0415, 0x0511, 0x0416, 0x0512, 0x0703, 0x0702, 0x0608, + 0x0507, 0x0213, 0x0402, 0x0300, +}; +#undef ESCAPE diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h index cc53c42a64..136e48e773 100644 --- a/libavcodec/vc1data.h +++ b/libavcodec/vc1data.h @@ -201,7 +201,14 @@ extern const uint16_t ff_vc1_field_mvpred_scales[2][7][4]; extern const uint16_t ff_vc1_b_field_mvpred_scales[7][4]; #define AC_MODES 8 - +/* Transform AC Coefficient Tables + * + * Based upon tables #177-#228 (excluding the delta run/level tables). + * Escape code, delta, run and last_flag are encoded in the symbols as follows: + * Symbol == 0 belongs to the escape code; otherwise run is contained + * in bits 0x3F, level in 0x7E00 and 0x100 is set if this is the last code. */ +extern const uint16_t ff_vc1_ac_coeff_syms[]; +extern const uint8_t ff_vc1_ac_coeff_lens[]; extern const int ff_vc1_ac_sizes[AC_MODES]; #endif /* AVCODEC_VC1DATA_H */ From patchwork Fri Nov 20 07:32:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23807 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 D42E344A644 for ; Fri, 20 Nov 2020 09:34:05 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B3CD868BB7F; Fri, 20 Nov 2020 09:34:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ABE3768B698 for ; Fri, 20 Nov 2020 09:34:04 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id q16so8481857edv.10 for ; Thu, 19 Nov 2020 23:34:04 -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=QNCjy+cEW8CwpPhseZf2RqsJwHwkU9oRHu6zxXSaftU=; b=kY4gT8zs9iM6PI9S04yvozgpkTef8GIkr8ik4gDDSZxbULV8z2Fpoto0tGfmHSZ1sG p9YWyTFokd4p/Dn7+LRXot4Ul5XtUST8QiRgSYAdgd6zPD3rs7c0dcN7zfqBvNDk9dkB 33/uzwlmWZPuYfKXspH/oN6ifQvVs/n2dGCJVCMccbJR8jHzti6Yvd7BvxY9BBzBy+bW DnR2s1b8puB0S8AIweB18Drs1JuaPcg2w0OsGihOFJzyoT1EOOYN3I0840JY/tWxDF2/ q3ixsGxeU2x5J12OYfOiwo7LBoxcs+Nhhy+2m2VndwTiQ9q7w2kuCPigp8mnb2PH41IS RWOg== 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=QNCjy+cEW8CwpPhseZf2RqsJwHwkU9oRHu6zxXSaftU=; b=tsl+qKJBh0+NyzhL0ia6x0QKgUQK3mALk5DA02vbiV96AYC5dLoXSANHhNzbwUNF06 qLCAMRXq6F78LubhtIJhojnLdmNh+w3scM7/7UxDSCyGEO0EO1aPUtW6hD39r/wsUUaE 6YfBd+toRsBYAjFowS+wKQqcLroP0JH63XabLWq5gNtoho1c4XZ0nIhwm9RTeZm7dfnj t/J3mW2CJ6yQh/Wzmr/YS5PQZGAL8c1HvUZAn3A9oEqPPXi/q27OVxyQvAB75HAs8eUp rYLqV6jACm0XltOR9jgmRPA9NIw/mZZeCa0EFZJVm+AfuQCqURr4PMpP6EaRTYQQFbYm guEA== X-Gm-Message-State: AOAM533RfEUdaJqLVlu2KnZF8capj/jrXv+nzxcpajaq9liADTiJ3ngn /YUVxTUPabw/Agv2c5HfCUJ6EkwBXVkuUA== X-Google-Smtp-Source: ABdhPJyZu/AVM/9edDtTjjop8lb9H4/hCAcLIM/t3xBvaXq8/1muHgY1cFiVeORUi6hmzKtrR6O9hQ== X-Received: by 2002:a50:b584:: with SMTP id a4mr34616929ede.301.1605857643793; Thu, 19 Nov 2020 23:34:03 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:03 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:27 +0100 Message-Id: <20201120073327.820745-3-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 102/162] avcodec/vc1_block: Use local variables inside macro 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" This makes it clearer which variables are really just temporary variables of the macro and which are actually used externally. Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1_block.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index 42de71eb25..3ff67d83bf 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -222,7 +222,8 @@ static void vc1_put_blocks_clamped(VC1Context *v, int put_signed) * @param _dmv_y Vertical differential for decoded MV */ #define GET_MVDATA(_dmv_x, _dmv_y) \ - index = 1 + get_vlc2(gb, ff_vc1_mv_diff_vlc[s->mv_table_index].table, \ +do { \ + int index = 1 + get_vlc2(gb, ff_vc1_mv_diff_vlc[s->mv_table_index].table, \ VC1_MV_DIFF_VLC_BITS, 2); \ if (index > 36) { \ mb_has_coeffs = 1; \ @@ -240,7 +241,7 @@ static void vc1_put_blocks_clamped(VC1Context *v, int put_signed) _dmv_y = 0; \ s->mb_intra = 1; \ } else { \ - index1 = index % 6; \ + int index1 = index % 6, sign, val; \ _dmv_x = offset_table[1][index1]; \ val = size_table[index1] - (!s->quarter_sample && index1 == 5); \ if (val > 0) { \ @@ -257,7 +258,8 @@ static void vc1_put_blocks_clamped(VC1Context *v, int put_signed) sign = 0 - (val & 1); \ _dmv_y = (sign ^ ((val >> 1) + _dmv_y)) - sign; \ } \ - } + } \ +} while (0) static av_always_inline void get_mvdata_interlaced(VC1Context *v, int *dmv_x, int *dmv_y, int *pred_flag) @@ -1287,8 +1289,6 @@ static int vc1_decode_p_mb(VC1Context *v) int mb_has_coeffs = 1; /* last_flag */ int dmv_x, dmv_y; /* Differential MV components */ - int index, index1; /* LUT indexes */ - int val, sign; /* temp values */ int first_block = 1; int dst_idx, off; int skipped, fourmv; @@ -1338,9 +1338,9 @@ static int vc1_decode_p_mb(VC1Context *v) if (!s->mb_intra) ff_vc1_mc_1mv(v, 0); dst_idx = 0; for (i = 0; i < 6; i++) { + int val = ((cbp >> (5 - i)) & 1); s->dc_val[0][s->block_index[i]] = 0; dst_idx += i >> 2; - val = ((cbp >> (5 - i)) & 1); off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize); v->mb_type[0][s->block_index[i]] = s->mb_intra; if (s->mb_intra) { @@ -1391,7 +1391,7 @@ static int vc1_decode_p_mb(VC1Context *v) /* Get CBPCY */ cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); for (i = 0; i < 6; i++) { - val = ((cbp >> (5 - i)) & 1); + int val = ((cbp >> (5 - i)) & 1); s->dc_val[0][s->block_index[i]] = 0; s->mb_intra = 0; if (i < 4) { @@ -1851,8 +1851,6 @@ static int vc1_decode_b_mb(VC1Context *v) int mqdiff, mquant; /* MB quantization */ int ttmb = v->ttfrm; /* MB Transform type */ int mb_has_coeffs = 0; /* last_flag */ - int index, index1; /* LUT indexes */ - int val, sign; /* temp values */ int first_block = 1; int dst_idx, off; int skipped, direct; @@ -1957,9 +1955,9 @@ static int vc1_decode_b_mb(VC1Context *v) } dst_idx = 0; for (i = 0; i < 6; i++) { + int val = ((cbp >> (5 - i)) & 1); s->dc_val[0][s->block_index[i]] = 0; dst_idx += i >> 2; - val = ((cbp >> (5 - i)) & 1); off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize); v->mb_type[0][s->block_index[i]] = s->mb_intra; if (s->mb_intra) { From patchwork Fri Nov 20 07:32:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23809 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 DB30A44A644 for ; Fri, 20 Nov 2020 09:34:07 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C4F3A68BC70; Fri, 20 Nov 2020 09:34:07 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E987068BBF4 for ; Fri, 20 Nov 2020 09:34:05 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id v22so8485669edt.9 for ; Thu, 19 Nov 2020 23:34:05 -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=8zqabDuxEA4k6T2hMxetNX4EDOwkm0EDp7/Ku2Ytw9E=; b=ITuPcwm8gi+6DmQvRNO7ep23XiIqQSCDt5P+cDq15ZRprKkYqgfYIRmgxLlDzyc/L8 30yQgaPKKGzcJTSAZIaRCPu6TbhK+FFz2hdctT8oqvVbdipYG3MCXkCS1ZVZt7P9fDyr XJeHdL1EmctJFr45+dECoqXbTgOfJHBlnR9PGH1/U52Ju7g2UmUSCI2Oqxd+U8CKEaCQ Rh6oc0xAI2gFuPXVoIMXE+lICVUteg8WmWQ7L6quiHrV7aY0Iplz3lIDtf+bw10IBUDH 3ljsxHKhFSF/kFtVtiXhvr0qOLxgIdxYbGwNFj9YQX87+WM7vDvVTU51/G7XeKffDQM/ +bkg== 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=8zqabDuxEA4k6T2hMxetNX4EDOwkm0EDp7/Ku2Ytw9E=; b=h2RQCUXblmOUtF7KCD0O2ZURK6SUCdgp+YPmWdpElUeZtknmNxilLLcd5MzSiNywsw waL+wBi4cFViDyeTmfbXDHf2ZbX0UcFFjmaBwnfnYQKB8X3Hk2Nk7VkOUtf0Is+7ekfT N9OnaAbPhDKwrgOxnXFmaipWEuPQ9K4CDDwn9auAwDsgMdvFeNYIOZomojrGvBZ3L0jd 6NI/olMHixAkBFdmMq6NEug/2r9SH7b3+QmJR2wCU6CTsdw/s5zZpJIR2tds4jAguy7X c2JgTfnwwGTupnBiXT97sB1Jb/y47S5RBWHXYRdflnhDBnAo/w9qsrU5d/I+iSSqtX+B rICg== X-Gm-Message-State: AOAM531xeDzCL4atU9UaDWMdM+qz2B17qZudy5U83a5enfGrGeGxqJiX um6Med+ykWCOM6lstO4w1TT/zFoTzdCQUQ== X-Google-Smtp-Source: ABdhPJy3N25x4t52RowbOHbBVN+BKOV8KnsTs+wMhFr6THiGuWXSiqiR/N6rX2flB+fGnS4ybGZrgg== X-Received: by 2002:a50:9e8a:: with SMTP id a10mr35496964edf.150.1605857644866; Thu, 19 Nov 2020 23:34:04 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:04 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:28 +0100 Message-Id: <20201120073327.820745-4-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 103/162] avcodec/vc1: Use symbols table to decode MV differentials 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 VC1 decoder currently follows the spec very closely when decoding MV differentials: The spec uses tables with contiguous indexes and derives four values from it using a pseudo-code procedure: Two flags and two values with a range of 0..5 each; the latter are obtained as the result resp. the remainder of dividing the index by 6 in the spec and in the earlier code. Yet two flags can be encoded on two bits and the two values can be encoded on three bits each. Therefore the new symbols use the two lowest bits for the flags; the two other values are coded separately on three bits each. There is just one additional minor complication: The two three-bits values don't always exist; there is another mode. Instead of using an arbitrary six bit value for the higher bits that is different from all the values used by the ordinary mode this commit instead uses a negative number for it; this is possible by shifting the symbols as stored in the table (to make all fit into an uint8_t) and then shifting the codes downwards when creating the table. The latter is possible thanks to ff_init_vlc_from_lengths(). Switching to ff_init_vlc_from_lengths() also entails replacing 16bit codes by 8bit symbols, thereby saving space. Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1.c | 7 +- libavcodec/vc1_block.c | 30 ++++----- libavcodec/vc1data.c | 149 +++++++++++++++++++---------------------- libavcodec/vc1data.h | 14 +++- 4 files changed, 96 insertions(+), 104 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index 478fe7d66d..a7cc11de54 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1414,9 +1414,10 @@ av_cold int ff_vc1_init_common(VC1Context *v) ff_vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); ff_vc1_mv_diff_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 11]]; ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11]; - init_vlc(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, - ff_vc1_mv_diff_bits[i], 1, 1, - ff_vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, + &ff_vc1_mv_diff_tabs[i][0][1], 2, + &ff_vc1_mv_diff_tabs[i][0][0], 2, 1, + -4, INIT_VLC_USE_NEW_STATIC, NULL); } for (int i = 0, ac_offset = 0; i < 8; i++) { ff_vc1_ac_coeff_table[i].table = &vlc_table[vlc_offs[i * 2 + 21]]; diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index 3ff67d83bf..6820ffb0d7 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -223,25 +223,16 @@ static void vc1_put_blocks_clamped(VC1Context *v, int put_signed) */ #define GET_MVDATA(_dmv_x, _dmv_y) \ do { \ - int index = 1 + get_vlc2(gb, ff_vc1_mv_diff_vlc[s->mv_table_index].table, \ + int symbol = get_vlc2(gb, ff_vc1_mv_diff_vlc[s->mv_table_index].table, \ VC1_MV_DIFF_VLC_BITS, 2); \ - if (index > 36) { \ - mb_has_coeffs = 1; \ - index -= 37; \ - } else \ - mb_has_coeffs = 0; \ - s->mb_intra = 0; \ - if (!index) { \ + mb_has_coeffs = symbol & 1; \ + symbol >>= 1; \ + s->mb_intra = symbol & 1; \ + symbol >>= 1; \ + if (!symbol) { \ _dmv_x = _dmv_y = 0; \ - } else if (index == 35) { \ - _dmv_x = get_bits(gb, v->k_x - 1 + s->quarter_sample); \ - _dmv_y = get_bits(gb, v->k_y - 1 + s->quarter_sample); \ - } else if (index == 36) { \ - _dmv_x = 0; \ - _dmv_y = 0; \ - s->mb_intra = 1; \ - } else { \ - int index1 = index % 6, sign, val; \ + } else if (symbol > 0) { \ + int index1 = symbol & 7, sign, val; \ _dmv_x = offset_table[1][index1]; \ val = size_table[index1] - (!s->quarter_sample && index1 == 5); \ if (val > 0) { \ @@ -250,7 +241,7 @@ do { \ _dmv_x = (sign ^ ((val >> 1) + _dmv_x)) - sign; \ } \ \ - index1 = index / 6; \ + index1 = symbol >> 3; \ _dmv_y = offset_table[1][index1]; \ val = size_table[index1] - (!s->quarter_sample && index1 == 5); \ if (val > 0) { \ @@ -258,6 +249,9 @@ do { \ sign = 0 - (val & 1); \ _dmv_y = (sign ^ ((val >> 1) + _dmv_y)) - sign; \ } \ + } else { \ + _dmv_x = get_bits(gb, v->k_x - 1 + s->quarter_sample); \ + _dmv_y = get_bits(gb, v->k_y - 1 + s->quarter_sample); \ } \ } while (0) diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c index 57bc1fa9d6..be5cd3bffe 100644 --- a/libavcodec/vc1data.c +++ b/libavcodec/vc1data.c @@ -931,86 +931,75 @@ const uint8_t ff_vc1_subblkpat_tabs[3][15][2] = { }; /* MV differential tables, p265 */ -const uint16_t ff_vc1_mv_diff_codes[4][73] = { - { - 0, 2, 3, 8, 576, 3, 2, 6, - 5, 577, 578, 7, 8, 9, 40, 19, - 37, 82, 21, 22, 23, 579, 580, 166, - 96, 167, 49, 194, 195, 581, 582, 583, - 292, 293, 294, 13, 2, 7, 24, 50, - 102, 295, 13, 7, 8, 18, 50, 103, - 38, 20, 21, 22, 39, 204, 103, 23, - 24, 25, 104, 410, 105, 106, 107, 108, - 109, 220, 411, 442, 222, 443, 446, 447, - 7 /* 73 elements */ - }, - { - 0, 4, 5, 3, 4, 3, 4, 5, - 20, 6, 21, 44, 45, 46, 3008, 95, - 112, 113, 57, 3009, 3010, 116, 117, 3011, - 118, 3012, 3013, 3014, 3015, 3016, 3017, 3018, - 3019, 3020, 3021, 3022, 1, 4, 15, 160, - 161, 41, 6, 11, 42, 162, 43, 119, - 56, 57, 58, 163, 236, 237, 3023, 119, - 120, 242, 122, 486, 1512, 487, 246, 494, - 1513, 495, 1514, 1515, 1516, 1517, 1518, 1519, - 31 /* 73 elements */ - }, - { - 0, 512, 513, 514, 515, 2, 3, 258, - 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 1, 5, 287, 288, - 289, 290, 6, 7, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, - 319 /* 73 elements */ - }, - { - 0, 1, 1, 2, 3, 4, 1, 5, - 4, 3, 5, 8, 6, 9, 10, 11, - 12, 7, 104, 14, 105, 4, 10, 15, - 11, 6, 14, 8, 106, 107, 108, 15, - 109, 9, 55, 10, 1, 2, 1, 2, - 3, 12, 6, 2, 6, 7, 28, 7, - 15, 8, 5, 18, 29, 152, 77, 24, - 25, 26, 39, 108, 13, 109, 55, 56, - 57, 116, 11, 153, 234, 235, 118, 119, - 15 /* 73 elements */ - } -}; -const uint8_t ff_vc1_mv_diff_bits[4][73] = { - { - 6, 7, 7, 8, 14, 6, 5, 6, 7, 14, 14, 6, 6, 6, 8, 9, - 10, 9, 7, 7, 7, 14, 14, 10, 9, 10, 8, 10, 10, 14, 14, 14, - 13, 13, 13, 6, 3, 5, 6, 8, 9, 13, 5, 4, 4, 5, 7, 9, - 6, 5, 5, 5, 6, 9, 8, 5, 5, 5, 7, 10, 7, 7, 7, 7, - 7, 8, 10, 9, 8, 9, 9, 9, 3 /* 73 elements */ - }, - { - 5, 7, 7, 6, 6, 5, 5, 6, 7, 5, 7, 8, 8, 8, 14, 9, - 9, 9, 8, 14, 14, 9, 9, 14, 9, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 2, 3, 6, 8, 8, 6, 3, 4, 6, 8, 6, 9, - 6, 6, 6, 8, 8, 8, 14, 7, 7, 8, 7, 9, 13, 9, 8, 9, - 13, 9, 13, 13, 13, 13, 13, 13, 5 /* 73 elements */ - - }, - { - 3, 12, 12, 12, 12, 3, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 1, 5, 11, 11, 11, 11, 4, 4, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11 /* 73 elements */ - }, - { - 15, 11, 15, 15, 15, 15, 12, 15, 12, 11, 12, 12, 15, 12, 12, 12, - 12, 15, 15, 12, 15, 10, 11, 12, 11, 10, 11, 10, 15, 15, 15, 11, - 15, 10, 14, 10, 4, 4, 5, 7, 8, 9, 5, 3, 4, 5, 6, 8, - 5, 4, 3, 5, 6, 8, 7, 5, 5, 5, 6, 7, 9, 7, 6, 6, - 6, 7, 10, 8, 8, 8, 7, 7, 4 /* 73 elements */ - } +const uint8_t ff_vc1_mv_diff_tabs[4][73][2] = { + { /* Based upon table 246 */ + { 0x08, 6 }, { 0x0C, 7 }, { 0x10, 7 }, { 0x14, 8 }, { 0x18, 14 }, + { 0x34, 14 }, { 0x38, 14 }, { 0x74, 14 }, { 0x78, 14 }, { 0xA4, 14 }, + { 0xA8, 14 }, { 0xAC, 14 }, { 0xB0, 13 }, { 0xB4, 13 }, { 0x00, 13 }, + { 0x19, 13 }, { 0x58, 10 }, { 0x54, 9 }, { 0x30, 7 }, { 0x24, 6 }, + { 0x28, 5 }, { 0x2C, 6 }, { 0x44, 6 }, { 0x48, 6 }, { 0x4C, 6 }, + { 0x50, 8 }, { 0x64, 9 }, { 0x84, 10 }, { 0x8C, 10 }, { 0x68, 7 }, + { 0x6C, 7 }, { 0x70, 7 }, { 0x88, 9 }, { 0x94, 10 }, { 0x98, 10 }, + { 0x90, 8 }, { 0x11, 8 }, { 0x15, 9 }, { 0x39, 9 }, { 0x06, 6 }, + { 0x09, 5 }, { 0x05, 3 }, { 0x0D, 6 }, { 0x35, 7 }, { 0x59, 9 }, + { 0x79, 10 }, { 0xA5, 10 }, { 0x65, 8 }, { 0x25, 5 }, { 0x29, 4 }, + { 0x2D, 4 }, { 0x31, 5 }, { 0x45, 6 }, { 0x55, 6 }, { 0x49, 5 }, + { 0x4D, 5 }, { 0x51, 5 }, { 0x69, 5 }, { 0x6D, 5 }, { 0x71, 5 }, + { 0x75, 7 }, { 0x85, 7 }, { 0x89, 7 }, { 0x8D, 7 }, { 0x91, 7 }, + { 0x95, 7 }, { 0x99, 8 }, { 0xA9, 9 }, { 0xB1, 9 }, { 0xAD, 8 }, + { 0xB5, 9 }, { 0x01, 9 }, { 0x07, 3 }, /* 73 elements */ + }, + { /* Based upon table 247 */ + { 0x08, 5 }, { 0x0C, 7 }, { 0x10, 7 }, { 0x14, 6 }, { 0x18, 6 }, + { 0x2C, 6 }, { 0x24, 5 }, { 0x28, 5 }, { 0x30, 7 }, { 0x38, 7 }, + { 0x44, 8 }, { 0x48, 8 }, { 0x4C, 8 }, { 0x50, 14 }, { 0x6C, 14 }, + { 0x70, 14 }, { 0x84, 14 }, { 0x8C, 14 }, { 0x90, 14 }, { 0x94, 14 }, + { 0x98, 14 }, { 0xA4, 14 }, { 0xA8, 14 }, { 0xAC, 14 }, { 0xB0, 14 }, + { 0xB4, 14 }, { 0x00, 14 }, { 0x06, 14 }, { 0x65, 14 }, { 0x85, 13 }, + { 0x95, 13 }, { 0xA5, 13 }, { 0xA9, 13 }, { 0xAD, 13 }, { 0xB1, 13 }, + { 0xB5, 13 }, { 0x01, 13 }, { 0x54, 9 }, { 0x34, 5 }, { 0x58, 9 }, + { 0x64, 9 }, { 0x68, 8 }, { 0x74, 9 }, { 0x78, 9 }, { 0x88, 9 }, + { 0x39, 9 }, { 0x0D, 6 }, { 0x05, 2 }, { 0x09, 3 }, { 0x11, 8 }, + { 0x15, 8 }, { 0x31, 8 }, { 0x51, 8 }, { 0x19, 6 }, { 0x2D, 6 }, + { 0x35, 6 }, { 0x29, 4 }, { 0x25, 3 }, { 0x45, 6 }, { 0x49, 6 }, + { 0x4D, 6 }, { 0x55, 8 }, { 0x59, 8 }, { 0x69, 7 }, { 0x6D, 7 }, + { 0x71, 8 }, { 0x79, 9 }, { 0x89, 9 }, { 0x75, 7 }, { 0x8D, 8 }, + { 0x91, 9 }, { 0x99, 9 }, { 0x07, 5 }, /* 73 elements */ + }, + { /* Based upon table 248 */ + { 0x08, 3 }, { 0x0C, 12 }, { 0x10, 12 }, { 0x14, 12 }, { 0x18, 12 }, + { 0x2C, 11 }, { 0x30, 11 }, { 0x34, 11 }, { 0x38, 11 }, { 0x44, 11 }, + { 0x48, 11 }, { 0x4C, 11 }, { 0x50, 11 }, { 0x54, 11 }, { 0x58, 11 }, + { 0x64, 11 }, { 0x68, 11 }, { 0x6C, 11 }, { 0x70, 11 }, { 0x74, 11 }, + { 0x78, 11 }, { 0x84, 11 }, { 0x88, 11 }, { 0x8C, 11 }, { 0x90, 11 }, + { 0x94, 11 }, { 0x98, 11 }, { 0xA4, 11 }, { 0xA8, 11 }, { 0xAC, 11 }, + { 0xB0, 11 }, { 0xB4, 11 }, { 0x00, 11 }, { 0x06, 11 }, { 0x0D, 11 }, + { 0x11, 11 }, { 0x15, 11 }, { 0x19, 11 }, { 0x2D, 11 }, { 0x31, 11 }, + { 0x35, 11 }, { 0x39, 11 }, { 0x45, 11 }, { 0x49, 11 }, { 0x4D, 11 }, + { 0x51, 11 }, { 0x55, 11 }, { 0x59, 11 }, { 0x65, 11 }, { 0x69, 11 }, + { 0x6D, 11 }, { 0x71, 11 }, { 0x75, 11 }, { 0x79, 11 }, { 0x85, 11 }, + { 0x89, 11 }, { 0x8D, 11 }, { 0x91, 11 }, { 0x95, 11 }, { 0x99, 11 }, + { 0xA5, 11 }, { 0xA9, 11 }, { 0xAD, 11 }, { 0xB1, 11 }, { 0xB5, 11 }, + { 0x01, 11 }, { 0x07, 11 }, { 0x09, 5 }, { 0x28, 4 }, { 0x24, 3 }, + { 0x25, 4 }, { 0x29, 4 }, { 0x05, 1 }, /* 73 elements */ + }, + { /* Based upon table 249 */ + { 0x08, 15 }, { 0x10, 15 }, { 0x14, 15 }, { 0x18, 15 }, { 0x24, 15 }, + { 0x2C, 15 }, { 0x48, 15 }, { 0x64, 15 }, { 0x28, 12 }, { 0x0C, 11 }, + { 0x30, 12 }, { 0x38, 12 }, { 0x34, 11 }, { 0x44, 12 }, { 0x4C, 12 }, + { 0x50, 12 }, { 0x54, 12 }, { 0x58, 12 }, { 0x68, 15 }, { 0x70, 15 }, + { 0x98, 15 }, { 0xA4, 15 }, { 0xA8, 15 }, { 0xB0, 15 }, { 0x00, 14 }, + { 0x6C, 12 }, { 0x84, 12 }, { 0x74, 10 }, { 0x78, 11 }, { 0x88, 11 }, + { 0x8C, 10 }, { 0x90, 11 }, { 0xAC, 11 }, { 0x94, 10 }, { 0xB4, 10 }, + { 0x06, 10 }, { 0xA5, 10 }, { 0x15, 8 }, { 0x11, 7 }, { 0x19, 9 }, + { 0x85, 9 }, { 0x39, 8 }, { 0x0D, 5 }, { 0x05, 4 }, { 0x09, 4 }, + { 0x25, 5 }, { 0x31, 5 }, { 0x29, 3 }, { 0x2D, 4 }, { 0x35, 6 }, + { 0x55, 6 }, { 0x45, 5 }, { 0x49, 4 }, { 0x51, 5 }, { 0x59, 8 }, + { 0xA9, 8 }, { 0x65, 7 }, { 0x75, 6 }, { 0x4D, 3 }, { 0x69, 5 }, + { 0x6D, 5 }, { 0x71, 5 }, { 0x79, 7 }, { 0x89, 7 }, { 0x8D, 6 }, + { 0x91, 6 }, { 0x95, 6 }, { 0x99, 7 }, { 0xAD, 8 }, { 0xB1, 8 }, + { 0xB5, 7 }, { 0x01, 7 }, { 0x07, 4 }, /* 73 elements */ + }, }; /* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */ diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h index 136e48e773..ccd2a0ec57 100644 --- a/libavcodec/vc1data.h +++ b/libavcodec/vc1data.h @@ -153,9 +153,17 @@ extern const uint8_t ff_vc1_ttblk_tabs[3][8][2]; * The symbols contain the Subblock Pattern. */ extern const uint8_t ff_vc1_subblkpat_tabs[3][15][2]; -/* MV differential tables, p265 */ -extern const uint16_t ff_vc1_mv_diff_codes[4][73]; -extern const uint8_t ff_vc1_mv_diff_bits[4][73]; +/* + * MV differential tables. Based upon tables #246-249. + * + * After offsetting the symbols by -4 the symbols contain all + * relevant information: The 0x01 bit contains 'more_present_flag', + * the 0x02 bit contains 'intra_flag'. The case of a negative symbol + * corresponds to the escape mechanism (i.e. index == 35 in the spec). + * Otherwise if the 0xFC bits are zero, both motion vectors are zero + * (index == 0 and index == 36 in the spec); otherwise the 0x1C bits + * contain the spec's index % 6 and bits 0xE0 contain index / 6. */ +extern const uint8_t ff_vc1_mv_diff_tabs[4][73][2]; /* Interlaced frame picture MBMODE VLC tables (p. 246, p. 360) */ extern const uint16_t ff_vc1_intfr_4mv_mbmode_codes[4][15]; From patchwork Fri Nov 20 07:32:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23851 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 5155244AFE3 for ; Fri, 20 Nov 2020 09:44:28 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A63CE68BAA1; Fri, 20 Nov 2020 09:34:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4ED6268BC5A for ; Fri, 20 Nov 2020 09:34:07 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id a16so11539857ejj.5 for ; Thu, 19 Nov 2020 23:34:07 -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=e5u+2pHeDKtW+tQrG1G1eELDzzZ/m/X/WfqWTaHKF/k=; b=HA1AjnKB7eoxgLkPZynd4a0VI2VFogvcJI6hO9sq55yXIjqm+VNkv+0KeruczPWPH4 NN534mhSXxVPsPKeFSR/L73QX1USSDFVdOxTbu1cHz5OnM+hotVtpAy1bgIkXt8IO8q/ GzmLFFfWEtTbRomO8FwurvvRvf05ZBf6hgEd0VcUeMT1Oy3wprJjxS25+PI7dXwGC/tw O6kCNm4r6egjQQML74xMi+A2Tb0NqLkR+iUTub8Kb2R8LFkEMSLRV7MhmaZz9kOi5P+c 0WyE4e8M/Lcy5h12/JRDh9cBu5siexP8BUfFwVpdPfBWLREeJjVHvgPMhmclVg5AbWp7 L9cw== 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=e5u+2pHeDKtW+tQrG1G1eELDzzZ/m/X/WfqWTaHKF/k=; b=kB1tRf0KBrjvBL/z/KTi26Gjn4YM3pm/TT9g12XlXalyd2EXfs+pbsNhEFkzV9hdEv 0b68K89IPkxgPht/seWzsqYcod8o2WGmtzDLtHvqJV/73x4vbFsh6Zbmqg0NOsZlltjT uufboieNAK6eH1Bl+D+EDsCgAKrhyNyQ6lYFOb6qcxll9IWE8gGLpaS9br51+spbHLG5 TTtPkD2MmJcVB7aiB+6y5DbA2s2Aab68mk5NsNzmfXKqV/UDbq02aR9KYw3hNyMvMNLJ Xqsxg8JCzKVXHNPOxzhiTB66cOl8S9Fbu2HFAqsB3d0uhVdSp/a+ZMBggp+SrFz+IDjM Oi3A== X-Gm-Message-State: AOAM530Cy9Ntv+MjjtPeoh21fGyFJPQTB63ulV6rBE15m5a1x9eukFdS /t3KD5lpSfSIMj4ZTrbCndhZeHOQ9jZFGg== X-Google-Smtp-Source: ABdhPJzrHvyHonAK55BVK2ZYNjMPdmU6VwcE3dGhCIKJv2vyY3izUfsdSZW0KLsON6sJ+DWEFHYMFQ== X-Received: by 2002:a17:906:12cf:: with SMTP id l15mr33441279ejb.540.1605857646090; Thu, 19 Nov 2020 23:34:06 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:05 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:29 +0100 Message-Id: <20201120073327.820745-5-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 104/162] avcodec/vc1: Use symbols table to parse macroblock mode 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" Expressions like array[get_vlc2()] can be optimized by using a symbols table if the array is always the same for a given VLC. This requirement is fulfilled for the VLCs used to parse the macroblock mode (MBMODE) element for frame P and B pictures. MBMODE consists of four pieces of information which can easily be encoded on one byte. Doing so not only avoids a dereference, but also some space as the table containing this information becomes redundant; furthermore, some of the VLCs used were initialized with code tables of type uint16_t which are now replaced by symbol tables of type uint8_t (thanks to ff_init_vlc_from_lengths()), thereby saving space. Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1.c | 14 ++-- libavcodec/vc1_block.c | 41 +++++----- libavcodec/vc1data.c | 177 +++++++++++++++++++++++++++-------------- libavcodec/vc1data.h | 18 +++-- 4 files changed, 155 insertions(+), 95 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index a7cc11de54..84617913ba 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1439,15 +1439,17 @@ av_cold int ff_vc1_init_common(VC1Context *v) /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */ ff_vc1_intfr_4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 37]]; ff_vc1_intfr_4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 38] - vlc_offs[i * 3 + 37]; - init_vlc(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, - ff_vc1_intfr_4mv_mbmode_bits[i], 1, 1, - ff_vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, + &ff_vc1_intfr_4mv_mbmode_tabs[i][0][1], 2, + &ff_vc1_intfr_4mv_mbmode_tabs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); /* initialize NON-4MV MBMODE VLC tables for the same */ ff_vc1_intfr_non4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 38]]; ff_vc1_intfr_non4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 39] - vlc_offs[i * 3 + 38]; - init_vlc(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, - ff_vc1_intfr_non4mv_mbmode_bits[i], 1, 1, - ff_vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, + &ff_vc1_intfr_non4mv_mbmode_tabs[i][0][1], 2, + &ff_vc1_intfr_non4mv_mbmode_tabs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); /* initialize interlaced MVDATA tables (1-Ref) */ ff_vc1_1ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 39]]; ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39]; diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index 6820ffb0d7..18637e75d8 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -1518,7 +1518,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) int dst_idx, off; int skipped, fourmv = 0, twomv = 0; int block_cbp = 0, pat, block_tt = 0; - int idx_mbmode = 0, mvbp; + int mvbp; int fieldtx; mquant = v->pq; /* Lossy initialization */ @@ -1528,11 +1528,11 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) else skipped = v->s.mbskip_table[mb_pos]; if (!skipped) { - if (v->fourmvswitch) - idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_INTFR_4MV_MBMODE_VLC_BITS, 2); // try getting this done - else - idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 2); // in a single line - switch (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0]) { + int bits = v->fourmvswitch ? VC1_INTFR_4MV_MBMODE_VLC_BITS : + VC1_INTFR_NON4MV_MBMODE_VLC_BITS; + int mbmode = get_vlc2(gb, v->mbmode_vlc->table, bits, 2); + + switch (mbmode & 0x1F) { /* store the motion vector type in a flag (useful later) */ case MV_PMODE_INTFR_4MV: fourmv = 1; @@ -1562,7 +1562,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) v->blk_mv_type[s->block_index[3]] = 0; break; } - if (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_INTRA) { // intra MB + if ((mbmode & 0x1F) == MV_PMODE_INTFR_INTRA) { // intra MB for (i = 0; i < 4; i++) { s->current_picture.motion_val[1][s->block_index[i]][0] = 0; s->current_picture.motion_val[1][s->block_index[i]][1] = 0; @@ -1605,21 +1605,21 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) } } else { // inter MB - mb_has_coeffs = ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][3]; + mb_has_coeffs = !!(mbmode & RESIDUAL); if (mb_has_coeffs) cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); - if (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_2MV_FIELD) { + if ((mbmode & 0x1F) == MV_PMODE_INTFR_2MV_FIELD) { v->twomvbp = get_vlc2(gb, v->twomvbp_vlc->table, VC1_2MV_BLOCK_PATTERN_VLC_BITS, 1); } else { - if ((ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_4MV) - || (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_4MV_FIELD)) { + if (((mbmode & 0x1F) == MV_PMODE_INTFR_4MV) || + ((mbmode & 0x1F) == MV_PMODE_INTFR_4MV_FIELD)) { v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc->table, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1); } } s->mb_intra = v->is_intra[s->mb_x] = 0; for (i = 0; i < 6; i++) v->mb_type[0][s->block_index[i]] = 0; - fieldtx = v->fieldtx_plane[mb_pos] = ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][1]; + fieldtx = v->fieldtx_plane[mb_pos] = !!(mbmode & FIELDTX); /* for all motion vector read MVDATA and motion compensate each block */ dst_idx = 0; if (fourmv) { @@ -1650,7 +1650,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) ff_vc1_mc_4mv_luma(v, 3, 0, 0); ff_vc1_mc_4mv_chroma4(v, 0, 0, 0); } else { - mvbp = ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][2]; + mvbp = !!(mbmode & MVDIFF); dmv_x = dmv_y = 0; if (mvbp) { get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); @@ -2175,7 +2175,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) int dst_idx, off; int skipped, direct, twomv = 0; int block_cbp = 0, pat, block_tt = 0; - int idx_mbmode = 0, mvbp; + int mbmode = MV_PMODE_INTFR_1MV | MVDIFF | RESIDUAL, mvbp; int stride_y, fieldtx; int bmvtype = BMV_TYPE_BACKWARD; int dir, dir2; @@ -2188,8 +2188,9 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) skipped = v->s.mbskip_table[mb_pos]; if (!skipped) { - idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 2); - if (ff_vc1_mbmode_intfrp[0][idx_mbmode][0] == MV_PMODE_INTFR_2MV_FIELD) { + mbmode = get_vlc2(gb, v->mbmode_vlc->table, + VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 2); + if ((mbmode & 0x1F) == MV_PMODE_INTFR_2MV_FIELD) { twomv = 1; v->blk_mv_type[s->block_index[0]] = 1; v->blk_mv_type[s->block_index[1]] = 1; @@ -2203,7 +2204,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) } } - if (ff_vc1_mbmode_intfrp[0][idx_mbmode][0] == MV_PMODE_INTFR_INTRA) { // intra MB + if ((mbmode & 0x1F) == MV_PMODE_INTFR_INTRA) { // intra MB for (i = 0; i < 4; i++) { s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0] = 0; s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1] = 0; @@ -2309,7 +2310,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) } if (!skipped) { // inter MB - mb_has_coeffs = ff_vc1_mbmode_intfrp[0][idx_mbmode][3]; + mb_has_coeffs = !!(mbmode & RESIDUAL); if (mb_has_coeffs) cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); if (!direct) { @@ -2322,7 +2323,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) for (i = 0; i < 6; i++) v->mb_type[0][s->block_index[i]] = 0; - fieldtx = v->fieldtx_plane[mb_pos] = ff_vc1_mbmode_intfrp[0][idx_mbmode][1]; + fieldtx = v->fieldtx_plane[mb_pos] = !!(mbmode & FIELDTX); /* for all motion vector read MVDATA and motion compensate each block */ dst_idx = 0; if (direct) { @@ -2404,7 +2405,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) } else { dir = bmvtype == BMV_TYPE_BACKWARD; - mvbp = ff_vc1_mbmode_intfrp[0][idx_mbmode][2]; + mvbp = !!(mbmode & MVDIFF); dmv_x = dmv_y = 0; if (mvbp) get_mvdata_interlaced(v, &dmv_x, &dmv_y, NULL); diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c index be5cd3bffe..682d7d174f 100644 --- a/libavcodec/vc1data.c +++ b/libavcodec/vc1data.c @@ -42,41 +42,6 @@ const uint8_t ff_vc1_mv_pmode_table2[2][4] = { { MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_1MV_HPEL_BILIN } }; -/* MBMODE table for interlaced frame P-picture */ -const uint8_t ff_vc1_mbmode_intfrp[2][15][4] = { - { /* 1: 4-MV, 0: non-4-MV */ - /* Type, FIELDTX, 1-MV Differential present, Residuals (CBP) present */ - /* Table 164 - Table 167 */ - { MV_PMODE_INTFR_1MV , 0, 1, 1 }, - { MV_PMODE_INTFR_1MV , 1, 1, 1 }, - { MV_PMODE_INTFR_1MV , 0, 1, 0 }, - { MV_PMODE_INTFR_1MV , 0, 0, 1 }, - { MV_PMODE_INTFR_1MV , 1, 0, 1 }, - { MV_PMODE_INTFR_2MV_FIELD, 0, 0, 1 }, - { MV_PMODE_INTFR_2MV_FIELD, 1, 0, 1 }, - { MV_PMODE_INTFR_2MV_FIELD, 1, 0, 0 }, - { MV_PMODE_INTFR_INTRA , 0, 0, 0 } - }, - { - /* Table 160 - Table 163 */ - { MV_PMODE_INTFR_1MV , 0, 1, 1 }, - { MV_PMODE_INTFR_1MV , 1, 1, 1 }, - { MV_PMODE_INTFR_1MV , 0, 1, 0 }, - { MV_PMODE_INTFR_1MV , 0, 0, 1 }, - { MV_PMODE_INTFR_1MV , 1, 0, 1 }, - { MV_PMODE_INTFR_2MV_FIELD, 0, 0, 1 }, - { MV_PMODE_INTFR_2MV_FIELD, 1, 0, 1 }, - { MV_PMODE_INTFR_2MV_FIELD, 1, 0, 0 }, - { MV_PMODE_INTFR_4MV , 0, 0, 1 }, - { MV_PMODE_INTFR_4MV , 1, 0, 1 }, - { MV_PMODE_INTFR_4MV , 0, 0, 0 }, - { MV_PMODE_INTFR_4MV_FIELD, 0, 0, 1 }, - { MV_PMODE_INTFR_4MV_FIELD, 1, 0, 1 }, - { MV_PMODE_INTFR_4MV_FIELD, 1, 0, 0 }, - { MV_PMODE_INTFR_INTRA , 0, 0, 0 } - } -}; - const int ff_vc1_fps_nr[7] = { 24, 25, 30, 50, 60, 48, 72 }, ff_vc1_fps_dr[2] = { 1000, 1001 }; const uint8_t ff_vc1_pquant_table[3][32] = { @@ -256,34 +221,124 @@ const uint8_t ff_vc1_2mv_block_pattern_bits[4][4] = { { 2, 2, 2, 2 }, { 1, 2, 3, 3 }, { 3, 2, 3, 1 }, { 1, 3, 3, 2 } }; -/* Interlaced frame picture 4MV MBMODE VLC tables (p. 246, p. 360) */ -const uint16_t ff_vc1_intfr_4mv_mbmode_codes[4][15] = { - { 22, 17, 0, 47, 32, 10, 1, 3, 67, 133, 132, 92, 19, 93, 18 }, - { 3, 45, 0, 7, 23, 6, 1, 2, 10, 39, 44, 8, 18, 77, 76 }, - { 15, 6, 28, 9, 41, 6, 2, 15, 14, 8, 40, 29, 0, 21, 11 }, - { 7, 198, 1, 2, 193, 13, 25, 0, 97, 1599, 98, 398, 798, 192, 1598 } -}; - -const uint8_t ff_vc1_intfr_4mv_mbmode_bits[4][15] = { - { 5, 5, 2, 6, 6, 4, 2, 2, 7, 8, 8, 7, 5, 7, 5 }, - { 3, 6, 3, 3, 5, 3, 3, 3, 4, 6, 6, 4, 5, 7, 7 }, - { 4, 3, 5, 5, 7, 4, 2, 5, 5, 5, 7, 5, 2, 6, 5 }, - { 4, 9, 1, 3, 9, 5, 6, 2, 8, 12, 8, 10, 11, 9, 12 } -}; - -/* Interlaced frame picture NON-4MV MBMODE VLC tables (p. 363) */ -const uint8_t ff_vc1_intfr_non4mv_mbmode_codes[4][9] = { - { 9, 22, 0, 17, 16, 10, 1, 3, 23 }, - { 7, 0, 5, 2, 1, 1, 6, 3, 4 }, - { 1, 0, 10, 23, 44, 8, 3, 9, 45 }, - { 7, 97, 1, 2, 49, 13, 25, 0, 96 } +/* Interlaced frame picture 4MV MBMODE VLC tables (tables 160-163) */ +const uint8_t ff_vc1_intfr_4mv_mbmode_tabs[4][15][2] = { + { + { MV_PMODE_INTFR_1MV | MVDIFF, 2 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX | RESIDUAL, 2 }, + { MV_PMODE_INTFR_1MV | FIELDTX | RESIDUAL, 6 }, + { MV_PMODE_INTFR_4MV, 8 }, + { MV_PMODE_INTFR_4MV | FIELDTX | RESIDUAL, 8 }, + { MV_PMODE_INTFR_4MV | RESIDUAL, 7 }, + { MV_PMODE_INTFR_1MV | FIELDTX | MVDIFF | RESIDUAL, 5 }, + { MV_PMODE_INTFR_INTRA, 5 }, + { MV_PMODE_INTFR_4MV_FIELD | FIELDTX | RESIDUAL, 5 }, + { MV_PMODE_INTFR_2MV_FIELD | RESIDUAL, 4 }, + { MV_PMODE_INTFR_1MV | MVDIFF | RESIDUAL, 5 }, + { MV_PMODE_INTFR_4MV_FIELD | RESIDUAL, 7 }, + { MV_PMODE_INTFR_4MV_FIELD | FIELDTX, 7 }, + { MV_PMODE_INTFR_1MV | RESIDUAL, 6 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX, 2 }, + }, + { + { MV_PMODE_INTFR_1MV | MVDIFF, 3 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX | RESIDUAL, 3 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX, 3 }, + { MV_PMODE_INTFR_1MV | MVDIFF | RESIDUAL, 3 }, + { MV_PMODE_INTFR_4MV_FIELD | RESIDUAL, 4 }, + { MV_PMODE_INTFR_4MV_FIELD | FIELDTX | RESIDUAL, 5 }, + { MV_PMODE_INTFR_INTRA, 7 }, + { MV_PMODE_INTFR_4MV_FIELD | FIELDTX, 7 }, + { MV_PMODE_INTFR_4MV | FIELDTX | RESIDUAL, 6 }, + { MV_PMODE_INTFR_4MV | RESIDUAL, 4 }, + { MV_PMODE_INTFR_4MV, 6 }, + { MV_PMODE_INTFR_1MV | FIELDTX | MVDIFF | RESIDUAL, 6 }, + { MV_PMODE_INTFR_1MV | FIELDTX | RESIDUAL, 5 }, + { MV_PMODE_INTFR_2MV_FIELD | RESIDUAL, 3 }, + { MV_PMODE_INTFR_1MV | RESIDUAL, 3 }, + }, + { + { MV_PMODE_INTFR_4MV_FIELD | FIELDTX | RESIDUAL, 2 }, + { MV_PMODE_INTFR_4MV | FIELDTX | RESIDUAL, 5 }, + { MV_PMODE_INTFR_1MV | RESIDUAL, 5 }, + { MV_PMODE_INTFR_4MV, 7 }, + { MV_PMODE_INTFR_1MV | FIELDTX | RESIDUAL, 7 }, + { MV_PMODE_INTFR_4MV_FIELD | FIELDTX, 6 }, + { MV_PMODE_INTFR_INTRA, 5 }, + { MV_PMODE_INTFR_2MV_FIELD | RESIDUAL, 4 }, + { MV_PMODE_INTFR_4MV | RESIDUAL, 5 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX, 5 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX | RESIDUAL, 2 }, + { MV_PMODE_INTFR_1MV | FIELDTX | MVDIFF | RESIDUAL, 3 }, + { MV_PMODE_INTFR_1MV | MVDIFF, 5 }, + { MV_PMODE_INTFR_4MV_FIELD | RESIDUAL, 5 }, + { MV_PMODE_INTFR_1MV | MVDIFF | RESIDUAL, 4 }, + }, + { + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX, 2 }, + { MV_PMODE_INTFR_1MV | RESIDUAL, 3 }, + { MV_PMODE_INTFR_4MV_FIELD | FIELDTX, 9 }, + { MV_PMODE_INTFR_1MV | FIELDTX | RESIDUAL, 9 }, + { MV_PMODE_INTFR_4MV | RESIDUAL, 8 }, + { MV_PMODE_INTFR_4MV, 8 }, + { MV_PMODE_INTFR_1MV | FIELDTX | MVDIFF | RESIDUAL, 9 }, + { MV_PMODE_INTFR_4MV_FIELD | RESIDUAL, 10 }, + { MV_PMODE_INTFR_4MV_FIELD | FIELDTX | RESIDUAL, 11 }, + { MV_PMODE_INTFR_INTRA, 12 }, + { MV_PMODE_INTFR_4MV | FIELDTX | RESIDUAL, 12 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX | RESIDUAL, 6 }, + { MV_PMODE_INTFR_2MV_FIELD | RESIDUAL, 5 }, + { MV_PMODE_INTFR_1MV | MVDIFF | RESIDUAL, 4 }, + { MV_PMODE_INTFR_1MV | MVDIFF, 1 }, + }, }; -const uint8_t ff_vc1_intfr_non4mv_mbmode_bits[4][9] = { - { 4, 5, 2, 5, 5, 4, 2, 2, 5 }, - { 3, 4, 6, 2, 3, 2, 3, 5, 6 }, - { 2, 2, 4, 5, 6, 4, 2, 4, 6 }, - { 4, 8, 1, 3, 7, 5, 6, 2, 8 } +/* Interlaced frame picture NON-4MV MBMODE VLC tables (tables 164-167) */ +const uint8_t ff_vc1_intfr_non4mv_mbmode_tabs[4][9][2] = { + { + { MV_PMODE_INTFR_1MV | MVDIFF, 2 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX | RESIDUAL, 2 }, + { MV_PMODE_INTFR_1MV | FIELDTX | RESIDUAL, 5 }, + { MV_PMODE_INTFR_1MV | RESIDUAL, 5 }, + { MV_PMODE_INTFR_1MV | MVDIFF | RESIDUAL, 4 }, + { MV_PMODE_INTFR_2MV_FIELD | RESIDUAL, 4 }, + { MV_PMODE_INTFR_1MV | FIELDTX | MVDIFF | RESIDUAL, 5 }, + { MV_PMODE_INTFR_INTRA, 5 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX, 2 }, + }, + { + { MV_PMODE_INTFR_1MV | FIELDTX | MVDIFF | RESIDUAL, 4 }, + { MV_PMODE_INTFR_INTRA, 6 }, + { MV_PMODE_INTFR_1MV | MVDIFF, 6 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX, 5 }, + { MV_PMODE_INTFR_1MV | FIELDTX | RESIDUAL, 3 }, + { MV_PMODE_INTFR_2MV_FIELD | RESIDUAL, 2 }, + { MV_PMODE_INTFR_1MV | RESIDUAL, 2 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX | RESIDUAL, 3 }, + { MV_PMODE_INTFR_1MV | MVDIFF | RESIDUAL, 3 }, + }, + { + { MV_PMODE_INTFR_1MV | FIELDTX | MVDIFF | RESIDUAL, 2 }, + { MV_PMODE_INTFR_1MV | MVDIFF | RESIDUAL, 2 }, + { MV_PMODE_INTFR_2MV_FIELD | RESIDUAL, 4 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX, 4 }, + { MV_PMODE_INTFR_1MV | MVDIFF, 4 }, + { MV_PMODE_INTFR_1MV | FIELDTX | RESIDUAL, 6 }, + { MV_PMODE_INTFR_INTRA, 6 }, + { MV_PMODE_INTFR_1MV | RESIDUAL, 5 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX | RESIDUAL, 2 }, + }, + { + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX, 2 }, + { MV_PMODE_INTFR_1MV | RESIDUAL, 3 }, + { MV_PMODE_INTFR_INTRA, 8 }, + { MV_PMODE_INTFR_1MV | FIELDTX | MVDIFF | RESIDUAL, 8 }, + { MV_PMODE_INTFR_1MV | FIELDTX | RESIDUAL, 7 }, + { MV_PMODE_INTFR_2MV_FIELD | FIELDTX | RESIDUAL, 6 }, + { MV_PMODE_INTFR_2MV_FIELD | RESIDUAL, 5 }, + { MV_PMODE_INTFR_1MV | MVDIFF | RESIDUAL, 4 }, + { MV_PMODE_INTFR_1MV | MVDIFF, 1 }, + }, }; /* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */ diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h index ccd2a0ec57..21dec20390 100644 --- a/libavcodec/vc1data.h +++ b/libavcodec/vc1data.h @@ -43,9 +43,6 @@ extern const uint8_t ff_vc1_mv_pmode_table2[2][4]; extern const int ff_vc1_fps_nr[7], ff_vc1_fps_dr[2]; extern const uint8_t ff_vc1_pquant_table[3][32]; -/* MBMODE table for interlaced frame P-picture */ -extern const uint8_t ff_vc1_mbmode_intfrp[2][15][4]; - /** @name VC-1 VLC tables and defines * @todo TODO move this into the context */ @@ -165,11 +162,16 @@ extern const uint8_t ff_vc1_subblkpat_tabs[3][15][2]; * contain the spec's index % 6 and bits 0xE0 contain index / 6. */ extern const uint8_t ff_vc1_mv_diff_tabs[4][73][2]; -/* Interlaced frame picture MBMODE VLC tables (p. 246, p. 360) */ -extern const uint16_t ff_vc1_intfr_4mv_mbmode_codes[4][15]; -extern const uint8_t ff_vc1_intfr_4mv_mbmode_bits[4][15]; -extern const uint8_t ff_vc1_intfr_non4mv_mbmode_codes[4][9]; -extern const uint8_t ff_vc1_intfr_non4mv_mbmode_bits[4][9]; +/* Interlaced frame picture MBMODE VLC tables (tables 160-167) + * The lowest five bits of the symbol contain the MBMODE (enum MBModesIntfr), + * the next three bits the following properties: */ +enum MBModeProperties { + FIELDTX = 1 << 5, + MVDIFF = 1 << 6, + RESIDUAL = 1 << 7, +}; +extern const uint8_t ff_vc1_intfr_4mv_mbmode_tabs[4][15][2]; +extern const uint8_t ff_vc1_intfr_non4mv_mbmode_tabs[4][9][2]; /* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */ extern const uint8_t ff_vc1_if_mmv_mbmode_codes[8][8]; From patchwork Fri Nov 20 07:32:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23852 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 B530444AFE3 for ; Fri, 20 Nov 2020 09:44:39 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B9D3368BC90; Fri, 20 Nov 2020 09:34:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AF56868BC5A for ; Fri, 20 Nov 2020 09:34:07 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id a16so11539872ejj.5 for ; Thu, 19 Nov 2020 23:34:07 -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=HtIyy14ZpIEYNk1PRYr4Xa9QEnkTmt0kvUE3XXdJhkg=; b=WT3s9+R2DuHsK4Yw//6udVHb2pS5M4HG3g2GW5arNNku2q67rE0Qk7CSND1JvfFWmO 7cA+kUgzTSF1k8tnL40c7Zd2KNFo4lTDpHBn/MYrTm7ZtnVQAa0iZDal2Jn3WuY/4BWA xcIv4IC/9d8AuQKz6ow7afmVKipzRNm0++n2Aq4MWrh3BbPnsV8CMKO0P56Lq9CWKu+q Hpf9cBnzEc7uXYyCfb9PrjTjxEzY0pApuPrwv1JI1N+A54Lmt0fnkSIIL2aOu6xeOvb2 O67HMN4iOQiAKLsk53f+Nb06xRnqa4QbHITTZziNcIXLAuz3L3yXWa2jPaVhtParOJUJ zXlQ== 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=HtIyy14ZpIEYNk1PRYr4Xa9QEnkTmt0kvUE3XXdJhkg=; b=XNJmrmhcC2Px4HID+CLVIa3Ec2bZ/j7akRNjIQFxOrmbb48c4nFeXtOYe5jcv+RQ8t atSw/SwubJI4Ew6xedfl68dJwXkniLvYbnW01jd/sBdYlWM0gDxDKj8o0FAeV4moG4mB f5Uwki/5UmtFW7L+SmP02fqqCXfDVLu7264+YT1JcwA6+lAuEJ14q27w51aqPbY17rgR Oz1NSl+Vl6AFkbK1RhuSg4lCF10s53A6Xnqx2u2pqtNMqysm8tnnDcMiP9qdzI8nRdb8 Fz+P9RXI7cBZQmSwgiY9lFg39xHTVENm8onFQk2kf4SBWUpT27FOQW1r0vapyY1xOmwl hZcA== X-Gm-Message-State: AOAM533PLRJAPjQSnwxLXrVj+lN3Aw960/Lsp13LpQ8zemEmxBCXGfgo jTe78nt2p06j4Np0LrbMHpuRUsujp3GsCQ== X-Google-Smtp-Source: ABdhPJxzPUL9UIqurnRg9Uf9kqWgR0zePTjQmsiGBpg0L5NXoyNfdYL0b1dSMDqRorBcH+e/ObCo6g== X-Received: by 2002:a17:906:5a96:: with SMTP id l22mr31391385ejq.303.1605857647089; Thu, 19 Nov 2020 23:34:07 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:06 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:30 +0100 Message-Id: <20201120073327.820745-6-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 105/162] avcodec/vc1: Don't check for errors for complete 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/vc1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index 84617913ba..23a0743813 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -614,7 +614,7 @@ static void rotate_luts(VC1Context *v) static int read_bfraction(VC1Context *v, GetBitContext* gb) { int bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1); - if (bfraction_lut_index == 21 || bfraction_lut_index < 0) { + if (bfraction_lut_index == 21) { av_log(v->s.avctx, AV_LOG_ERROR, "bfraction invalid\n"); return AVERROR_INVALIDDATA; } From patchwork Fri Nov 20 07:32:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23854 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 C6ACC44AFE3 for ; Fri, 20 Nov 2020 09:45:00 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2DF7D68BCA1; Fri, 20 Nov 2020 09:34:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0B0F868BC82 for ; Fri, 20 Nov 2020 09:34:09 +0200 (EET) Received: by mail-ej1-f48.google.com with SMTP id oq3so11500559ejb.7 for ; Thu, 19 Nov 2020 23:34:09 -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=jYQi6Nra4Dt2bScZdTzjGJnsQXX1KAsvhVZ1KD9FDow=; b=mUtXN6GxA3Kz+bGRkIxvYsauiSZ1A6+rTVO+TFLyv2g7B7ReOs/ZyA7uplybzyUZCE JkrVR7iwBwyDrQhZeUVHQJw3jmyWTApVRAPmk7wyhc8nTsr1a6WoFYVQ+uVR4mPG/NsQ TBTnKJtK5b4dnmxUXu4c/+jKCfIKd0I6CaDEcxHigKzD6LR+GZAUCiFVII+VuV7fnGVU tJrlRYLFvLgRI2HJtFb6ZwW+XQp6u0KyepaqLQT7HsHYVCqV2jdIrnPPmoMRWS5fsFQK dZeN0e4sk4bu9wQg3/0hNtPnwF7mVfFLOStYuYqMh04LPCK+7kTk7mfZtI2h4YwBQAzo DkRg== 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=jYQi6Nra4Dt2bScZdTzjGJnsQXX1KAsvhVZ1KD9FDow=; b=OLXf4u/Kl5f0fv8JxB18knjS5ERerOTpJ5EGVoEubPEcv8Ia74BFeHPiG8lWXn8/A9 bb4N2HK1JUR4h55ULAxWZBy+Gq3F2wAKWUZmjVsqCl8fe3jCSCZ6wV8kt5eIf0nErpMQ y/up/hvxwzc2uvwZskRPtbmrKn7NzJy1tkcTbhhH33vmcXDLCjxJ6FBAOlR3h7Ja14k2 QKysIaY4SJBDC54NaL+Z9DbQ/8kFLVHmk6I1zpeC+j848sc54aFjYrSBIUmqCcxZmfy1 XOHGGUK360pp+F9cx8J/pMGOzIuRtJFgzT6AZQ0TRqa1EdjdiPjqVqsBPGZI6cf70PBl G27A== X-Gm-Message-State: AOAM531m5/zJn5mHxvUC2Sl2YKp9zohQAoPdyiT360/1ODm297sGYKH7 cwCBWV2QRerKt9xAgaied/rnkMBTsVjoCQ== X-Google-Smtp-Source: ABdhPJzIIo0iQMJ0ZO21Brrqpj9E8LjKXSuRSPPIDwxn+Kmtmp6A7/0CaJNAV+Oq3YFaTeTwHzo64g== X-Received: by 2002:a17:906:6b82:: with SMTP id l2mr30959968ejr.241.1605857648148; Thu, 19 Nov 2020 23:34:08 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:07 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:31 +0100 Message-Id: <20201120073327.820745-7-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 106/162] avcodec/vc1: Make tables used to initialize VLCs 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" By switching to ff_init_vlc_from_lengths() from ff_init_vlc_sparse() one can replace codes of type uint16_t by symbols of type uint8_t, saving space. Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1.c | 27 +-- libavcodec/vc1data.c | 488 ++++++++++++++++++++----------------------- libavcodec/vc1data.h | 35 ++-- 3 files changed, 256 insertions(+), 294 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index 23a0743813..c2a440d2e7 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1376,18 +1376,19 @@ av_cold int ff_vc1_init_common(VC1Context *v) INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, ff_vc1_norm2_bits, 1, 1, ff_vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS); - INIT_VLC_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64, - ff_vc1_norm6_bits, 1, 1, - ff_vc1_norm6_codes, 2, 2, 556); + INIT_VLC_STATIC_FROM_LENGTHS(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 77, + &ff_vc1_norm6_tab[0][1], 2, + &ff_vc1_norm6_tab[0][0], 2, 1, 0, 0, 556); INIT_VLC_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, ff_vc1_imode_bits, 1, 1, ff_vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS); for (i = 0; i < 3; i++) { ff_vc1_ttmb_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 0]]; ff_vc1_ttmb_vlc[i].table_allocated = vlc_offs[i * 3 + 1] - vlc_offs[i * 3 + 0]; - init_vlc(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, - ff_vc1_ttmb_bits[i], 1, 1, - ff_vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, + &ff_vc1_ttmb_tabs[i][0][1], 2, + &ff_vc1_ttmb_tabs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); ff_vc1_ttblk_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 1]]; ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1]; ff_init_vlc_from_lengths(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, @@ -1409,9 +1410,10 @@ av_cold int ff_vc1_init_common(VC1Context *v) ff_vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); ff_vc1_cbpcy_p_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 10]]; ff_vc1_cbpcy_p_vlc[i].table_allocated = vlc_offs[i * 3 + 11] - vlc_offs[i * 3 + 10]; - init_vlc(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, - ff_vc1_cbpcy_p_bits[i], 1, 1, - ff_vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, + &ff_vc1_cbpcy_p_tabs[i][0][1], 2, + &ff_vc1_cbpcy_p_tabs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); ff_vc1_mv_diff_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 11]]; ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11]; ff_init_vlc_from_lengths(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, @@ -1470,9 +1472,10 @@ av_cold int ff_vc1_init_common(VC1Context *v) /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */ ff_vc1_icbpcy_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 53]]; ff_vc1_icbpcy_vlc[i].table_allocated = vlc_offs[i * 3 + 54] - vlc_offs[i * 3 + 53]; - init_vlc(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, - ff_vc1_icbpcy_p_bits[i], 1, 1, - ff_vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, + &ff_vc1_icbpcy_p_tabs[i][0][1], 2, + &ff_vc1_icbpcy_p_tabs[i][0][0], 2, 1, + 0, INIT_VLC_USE_NEW_STATIC, NULL); /* Initialize interlaced field picture MBMODE VLC tables */ ff_vc1_if_mmv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 54]]; ff_vc1_if_mmv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 55] - vlc_offs[i * 3 + 54]; diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c index 682d7d174f..6c78895a38 100644 --- a/libavcodec/vc1data.c +++ b/libavcodec/vc1data.c @@ -184,18 +184,25 @@ const uint8_t ff_vc1_norm2_bits[4] = { 1, 3, 3, 2 }; -const uint16_t ff_vc1_norm6_codes[64] = { - 0x001, 0x002, 0x003, 0x000, 0x004, 0x001, 0x002, 0x047, 0x005, 0x003, 0x004, 0x04B, 0x005, 0x04D, 0x04E, 0x30E, - 0x006, 0x006, 0x007, 0x053, 0x008, 0x055, 0x056, 0x30D, 0x009, 0x059, 0x05A, 0x30C, 0x05C, 0x30B, 0x30A, 0x037, - 0x007, 0x00A, 0x00B, 0x043, 0x00C, 0x045, 0x046, 0x309, 0x00D, 0x049, 0x04A, 0x308, 0x04C, 0x307, 0x306, 0x036, - 0x00E, 0x051, 0x052, 0x305, 0x054, 0x304, 0x303, 0x035, 0x058, 0x302, 0x301, 0x034, 0x300, 0x033, 0x032, 0x007, -}; - -const uint8_t ff_vc1_norm6_bits[64] = { - 1, 4, 4, 8, 4, 8, 8, 10, 4, 8, 8, 10, 8, 10, 10, 13, - 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9, - 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9, - 8, 10, 10, 13, 10, 13, 13, 9, 10, 13, 13, 9, 13, 9, 9, 6, +/* The negative lengths in the following table correspond to + * open ends in the tree: It is incomplete. */ +const uint8_t ff_vc1_norm6_tab[77][2] = { + { 0x03, 8 }, { 0x05, 8 }, { 0x06, 8 }, { 0x09, 8 }, { 0x0A, 8 }, + { 0x0C, 8 }, { 0x11, 8 }, { 0x12, 8 }, { 0x14, 8 }, { 0x18, 8 }, + { 0x21, 8 }, { 0x22, 8 }, { 0x24, 8 }, { 0x28, 8 }, { 0x30, 8 }, + { 0, -8 }, { 0, -9 }, { 0,-10 }, { 0x23, 10 }, { 0,-10 }, + { 0x25, 10 }, { 0x26, 10 }, { 0x07, 10 }, { 0,-10 }, { 0x29, 10 }, + { 0x2A, 10 }, { 0x0B, 10 }, { 0x2C, 10 }, { 0x0D, 10 }, { 0x0E, 10 }, + { 0,-10 }, { 0,-10 }, { 0x31, 10 }, { 0x32, 10 }, { 0x13, 10 }, + { 0x34, 10 }, { 0x15, 10 }, { 0x16, 10 }, { 0,-10 }, { 0x38, 10 }, + { 0x19, 10 }, { 0x1A, 10 }, { 0,-10 }, { 0x1C, 10 }, { 0,-10 }, + { 0, -9 }, { 0x3C, 13 }, { 0x3A, 13 }, { 0x39, 13 }, { 0x36, 13 }, + { 0x35, 13 }, { 0x33, 13 }, { 0x2E, 13 }, { 0x2D, 13 }, { 0x2B, 13 }, + { 0x27, 13 }, { 0x1E, 13 }, { 0x1D, 13 }, { 0x1B, 13 }, { 0x17, 13 }, + { 0x0F, 13 }, { 0,-13 }, { 0, -9 }, { 0x3E, 9 }, { 0x3D, 9 }, + { 0x3B, 9 }, { 0x37, 9 }, { 0x2F, 9 }, { 0x1F, 9 }, { 0x3F, 6 }, + { 0x01, 4 }, { 0x02, 4 }, { 0x04, 4 }, { 0x08, 4 }, { 0x10, 4 }, + { 0x20, 4 }, { 0x00, 1 }, }; /* 4MV Block pattern VLC tables */ @@ -694,261 +701,218 @@ const uint8_t ff_wmv3_dc_scale_table[32] = { /* P-Picture CBPCY VLC tables */ // Looks like original tables are not conforming to standard at all. Are they used for old WMV? -const uint16_t ff_vc1_cbpcy_p_codes[4][64] = { - { - 0, 6, 15, 13, 13, 11, 3, 13, 5, 8, 49, 10, 12, 114, 102, 119, - 1, 54, 96, 8, 10, 111, 5, 15, 12, 10, 2, 12, 13, 115, 53, 63, - 1, 7, 1, 7, 14, 12, 4, 14, 1, 9, 97, 11, 7, 58, 52, 62, - 4, 103, 1, 9, 11, 56, 101, 118, 4, 110, 100, 30, 2, 5, 4, 3 - }, - { - 0, 9, 1, 18, 5, 14, 237, 26, 3, 121, 3, 22, 13, 16, 6, 30, - 2, 10, 1, 20, 12, 241, 5, 28, 16, 12, 3, 24, 28, 124, 239, 247, - 1, 240, 1, 19, 18, 15, 4, 27, 1, 122, 2, 23, 1, 17, 7, 31, - 1, 11, 2, 21, 19, 246, 238, 29, 17, 13, 236, 25, 58, 63, 8, 125 - }, - { - 0, 201, 25, 231, 5, 221, 1, 3, 2, 414, 2, 241, 16, 225, 195, 492, - 2, 412, 1, 240, 7, 224, 98, 245, 1, 220, 96, 5, 9, 230, 101, 247, - 1, 102, 1, 415, 24, 3, 2, 244, 3, 54, 3, 484, 17, 114, 200, 493, - 3, 413, 1, 4, 13, 113, 99, 485, 4, 111, 194, 243, 5, 29, 26, 31 - }, - { - 0, 28, 12, 44, 3, 36, 20, 52, 2, 32, 16, 48, 8, 40, 24, 28, - 1, 30, 14, 46, 6, 38, 22, 54, 3, 34, 18, 50, 10, 42, 26, 30, - 1, 29, 13, 45, 5, 37, 21, 53, 2, 33, 17, 49, 9, 41, 25, 29, - 1, 31, 15, 47, 7, 39, 23, 55, 4, 35, 19, 51, 11, 43, 27, 31 - } -}; - -const uint8_t ff_vc1_cbpcy_p_bits[4][64] = { - { - 13, 13, 7, 13, 7, 13, 13, 12, 6, 13, 7, 12, 6, 8, 8, 8, - 5, 7, 8, 12, 6, 8, 13, 12, 7, 13, 13, 12, 6, 8, 7, 7, - 6, 13, 8, 12, 7, 13, 13, 12, 7, 13, 8, 12, 5, 7, 7, 7, - 6, 8, 13, 12, 6, 7, 8, 8, 5, 8, 8, 6, 3, 3, 3, 2 - }, - { - 14, 13, 8, 13, 3, 13, 8, 13, 3, 7, 8, 13, 4, 13, 13, 13, - 3, 13, 13, 13, 4, 8, 13, 13, 5, 13, 13, 13, 5, 7, 8, 8, - 3, 8, 14, 13, 5, 13, 13, 13, 4, 7, 13, 13, 6, 13, 13, 13, - 5, 13, 8, 13, 5, 8, 8, 13, 5, 13, 8, 13, 6, 6, 13, 7 - }, - { - 13, 8, 6, 8, 4, 8, 13, 12, 4, 9, 8, 8, 5, 8, 8, 9, - 5, 9, 10, 8, 4, 8, 7, 8, 6, 8, 7, 13, 4, 8, 7, 8, - 5, 7, 8, 9, 6, 13, 13, 8, 4, 6, 8, 9, 5, 7, 8, 9, - 5, 9, 9, 13, 5, 7, 7, 9, 4, 7, 8, 8, 3, 5, 5, 5 - }, - { - 9, 9, 9, 9, 2, 9, 9, 9, 2, 9, 9, 9, 9, 9, 9, 8, - 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, - 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8 - } +const uint8_t ff_vc1_cbpcy_p_tabs[4][64][2] = { + { /* Table 169 */ + { 0x00, 13 }, { 0x32, 13 }, { 0x1A, 13 }, { 0x06, 13 }, { 0x26, 13 }, + { 0x16, 13 }, { 0x01, 13 }, { 0x21, 13 }, { 0x09, 13 }, { 0x29, 13 }, + { 0x19, 13 }, { 0x05, 13 }, { 0x25, 13 }, { 0x03, 13 }, { 0x23, 12 }, + { 0x13, 12 }, { 0x33, 12 }, { 0x0B, 12 }, { 0x2B, 12 }, { 0x1B, 12 }, + { 0x07, 12 }, { 0x27, 12 }, { 0x17, 12 }, { 0x22, 8 }, { 0x28, 7 }, + { 0x20, 6 }, { 0x10, 5 }, { 0x30, 6 }, { 0x08, 6 }, { 0x18, 7 }, + { 0x04, 7 }, { 0x24, 7 }, { 0x02, 7 }, { 0x38, 5 }, { 0x14, 6 }, + { 0x34, 6 }, { 0x0C, 6 }, { 0x1C, 6 }, { 0x2C, 5 }, { 0x3C, 3 }, + { 0x12, 8 }, { 0x2A, 8 }, { 0x0A, 7 }, { 0x3A, 8 }, { 0x36, 8 }, + { 0x0E, 8 }, { 0x31, 8 }, { 0x2E, 7 }, { 0x1E, 7 }, { 0x11, 7 }, + { 0x39, 8 }, { 0x15, 8 }, { 0x35, 7 }, { 0x0D, 8 }, { 0x1D, 8 }, + { 0x2D, 7 }, { 0x37, 8 }, { 0x0F, 8 }, { 0x3B, 6 }, { 0x2F, 7 }, + { 0x1F, 7 }, { 0x3E, 3 }, { 0x3D, 3 }, { 0x3F, 2 }, + }, + { /* Table 170 */ + { 0x00, 14 }, { 0x22, 14 }, { 0x12, 13 }, { 0x2A, 13 }, { 0x1A, 13 }, + { 0x26, 13 }, { 0x16, 13 }, { 0x0E, 13 }, { 0x2E, 13 }, { 0x3E, 13 }, + { 0x01, 13 }, { 0x11, 13 }, { 0x31, 13 }, { 0x19, 13 }, { 0x39, 13 }, + { 0x05, 13 }, { 0x25, 13 }, { 0x0D, 13 }, { 0x2D, 13 }, { 0x03, 13 }, + { 0x23, 13 }, { 0x13, 13 }, { 0x33, 13 }, { 0x0B, 13 }, { 0x2B, 13 }, + { 0x1B, 13 }, { 0x3B, 13 }, { 0x07, 13 }, { 0x27, 13 }, { 0x17, 13 }, + { 0x37, 13 }, { 0x0F, 13 }, { 0x2F, 13 }, { 0x02, 8 }, { 0x32, 8 }, + { 0x0A, 8 }, { 0x2C, 6 }, { 0x30, 5 }, { 0x28, 4 }, { 0x20, 3 }, + { 0x10, 3 }, { 0x08, 3 }, { 0x18, 5 }, { 0x38, 5 }, { 0x24, 5 }, + { 0x34, 5 }, { 0x04, 3 }, { 0x14, 4 }, { 0x0C, 4 }, { 0x1C, 5 }, + { 0x3C, 6 }, { 0x3A, 8 }, { 0x06, 8 }, { 0x36, 8 }, { 0x1E, 8 }, + { 0x21, 8 }, { 0x15, 8 }, { 0x09, 7 }, { 0x29, 7 }, { 0x35, 8 }, + { 0x1F, 8 }, { 0x1D, 7 }, { 0x3F, 7 }, { 0x3D, 6 }, + }, + { /* Table 171 */ + { 0x00, 13 }, { 0x06, 13 }, { 0x26, 13 }, { 0x25, 13 }, { 0x33, 13 }, + { 0x1B, 13 }, { 0x07, 12 }, { 0x12, 10 }, { 0x32, 9 }, { 0x22, 8 }, + { 0x0A, 8 }, { 0x2A, 8 }, { 0x18, 6 }, { 0x20, 5 }, { 0x10, 5 }, + { 0x30, 5 }, { 0x08, 4 }, { 0x28, 4 }, { 0x38, 4 }, { 0x04, 4 }, + { 0x24, 6 }, { 0x02, 6 }, { 0x34, 5 }, { 0x14, 4 }, { 0x0C, 5 }, + { 0x2C, 5 }, { 0x1C, 4 }, { 0x3C, 3 }, { 0x1A, 7 }, { 0x3A, 8 }, + { 0x0E, 8 }, { 0x16, 7 }, { 0x36, 7 }, { 0x2E, 8 }, { 0x01, 8 }, + { 0x1E, 7 }, { 0x21, 7 }, { 0x11, 9 }, { 0x31, 9 }, { 0x09, 9 }, + { 0x23, 9 }, { 0x3E, 5 }, { 0x29, 6 }, { 0x19, 8 }, { 0x05, 8 }, + { 0x39, 7 }, { 0x15, 8 }, { 0x0D, 8 }, { 0x35, 7 }, { 0x2D, 7 }, + { 0x1D, 8 }, { 0x03, 8 }, { 0x3D, 5 }, { 0x13, 8 }, { 0x0B, 8 }, + { 0x2B, 9 }, { 0x37, 9 }, { 0x3B, 8 }, { 0x27, 8 }, { 0x17, 8 }, + { 0x0F, 9 }, { 0x2F, 9 }, { 0x1F, 8 }, { 0x3F, 5 }, + }, + { /* Table 172 */ + { 0x00, 9 }, { 0x30, 9 }, { 0x28, 9 }, { 0x18, 9 }, { 0x38, 9 }, + { 0x24, 9 }, { 0x14, 9 }, { 0x34, 9 }, { 0x0C, 9 }, { 0x2C, 9 }, + { 0x1C, 9 }, { 0x3C, 9 }, { 0x02, 9 }, { 0x22, 9 }, { 0x12, 9 }, + { 0x32, 9 }, { 0x0A, 9 }, { 0x2A, 9 }, { 0x1A, 9 }, { 0x3A, 9 }, + { 0x06, 9 }, { 0x26, 9 }, { 0x16, 9 }, { 0x36, 9 }, { 0x0E, 9 }, + { 0x2E, 9 }, { 0x1E, 9 }, { 0x3E, 9 }, { 0x01, 9 }, { 0x21, 9 }, + { 0x11, 9 }, { 0x31, 9 }, { 0x09, 9 }, { 0x29, 9 }, { 0x19, 9 }, + { 0x39, 9 }, { 0x05, 9 }, { 0x25, 9 }, { 0x15, 9 }, { 0x35, 9 }, + { 0x0D, 9 }, { 0x2D, 9 }, { 0x1D, 9 }, { 0x3D, 9 }, { 0x03, 9 }, + { 0x23, 9 }, { 0x13, 9 }, { 0x33, 9 }, { 0x0B, 9 }, { 0x2B, 9 }, + { 0x1B, 9 }, { 0x3B, 9 }, { 0x07, 9 }, { 0x27, 9 }, { 0x17, 9 }, + { 0x37, 9 }, { 0x0F, 8 }, { 0x2F, 8 }, { 0x1F, 8 }, { 0x3F, 8 }, + { 0x10, 3 }, { 0x20, 2 }, { 0x08, 2 }, { 0x04, 2 }, + }, }; /* Interlaced CBPCY VLC tables (Table 124 - Table 131) */ -const uint16_t ff_vc1_icbpcy_p_codes[8][63] = { - { - 0x2F1A, 0x2F1B, 0x178C, 0x0090, 0x02A8, 0x02A9, 0x0BC7, 0x0091, - 0x02AA, 0x02AB, 0x05E0, 0x004A, 0x0096, 0x0097, 0x00BD, 0x0092, - 0x02AC, 0x02AD, 0x05E1, 0x0098, 0x0132, 0x0133, 0x0179, 0x0134, - 0x026A, 0x026B, 0x02FC, 0x004E, 0x0040, 0x0041, 0x002B, 0x0093, - 0x02AE, 0x02AF, 0x05E2, 0x0136, 0x026E, 0x026F, 0x02FD, 0x009E, - 0x013E, 0x013F, 0x017F, 0x0050, 0x0042, 0x0043, 0x002C, 0x0051, - 0x00A4, 0x00A5, 0x00BE, 0x0053, 0x0044, 0x0045, 0x002D, 0x0054, - 0x0046, 0x0047, 0x002E, 0x0003, 0x0000, 0x0001, 0x0001 - }, - { - 0x0041, 0x0042, 0x0100, 0x0043, 0x0088, 0x0089, 0x0101, 0x0045, - 0x008C, 0x008D, 0x0102, 0x0010, 0x0022, 0x0023, 0x0024, 0x0047, - 0x0010, 0x0011, 0x0103, 0x0025, 0x0058, 0x0059, 0x005A, 0x005B, - 0x005A, 0x005B, 0x005C, 0x000C, 0x0030, 0x0031, 0x0019, 0x0009, - 0x0014, 0x0015, 0x002C, 0x005C, 0x005D, 0x005E, 0x005F, 0x0026, - 0x005D, 0x005E, 0x005F, 0x000D, 0x0034, 0x0035, 0x001B, 0x0014, - 0x0027, 0x002A, 0x002B, 0x000E, 0x0038, 0x0039, 0x001D, 0x000F, - 0x003C, 0x003D, 0x001F, 0x0005, 0x0009, 0x0000, 0x0003 - }, - { - 0x0032, 0x0033, 0x001A, 0x0026, 0x00E4, 0x00E5, 0x01E6, 0x0027, - 0x00E6, 0x00E7, 0x01E7, 0x000E, 0x0063, 0x006C, 0x0077, 0x0028, - 0x00E8, 0x00E9, 0x01E8, 0x007B, 0x00DA, 0x00DB, 0x00EC, 0x00F5, - 0x01B8, 0x01B9, 0x01DA, 0x0021, 0x004B, 0x0054, 0x002B, 0x0029, - 0x00EA, 0x00EB, 0x01E9, 0x004A, 0x01BA, 0x01BB, 0x01DB, 0x0020, - 0x00DE, 0x00DF, 0x00F2, 0x0022, 0x0055, 0x0058, 0x002D, 0x000F, - 0x0070, 0x0071, 0x0078, 0x0023, 0x0059, 0x005C, 0x002F, 0x0024, - 0x005D, 0x0062, 0x0030, 0x0002, 0x001F, 0x0006, 0x0000 - }, - { - 0x0028, 0x0029, 0x009D, 0x0000, 0x01EA, 0x01EB, 0x01EC, 0x0001, - 0x01ED, 0x01EE, 0x01EF, 0x0005, 0x00F0, 0x00F1, 0x003B, 0x0002, - 0x01F0, 0x01F1, 0x01F2, 0x003F, 0x015C, 0x015D, 0x0099, 0x0010, - 0x03D0, 0x03D1, 0x0130, 0x000F, 0x009E, 0x009F, 0x00FB, 0x0003, - 0x01F3, 0x01F4, 0x01F5, 0x0011, 0x03D2, 0x03D3, 0x0131, 0x0009, - 0x015E, 0x015F, 0x009C, 0x0010, 0x00A8, 0x00A9, 0x0038, 0x0006, - 0x00F2, 0x00F3, 0x004D, 0x0011, 0x00AA, 0x00AB, 0x0039, 0x0012, - 0x00AC, 0x00AD, 0x003A, 0x0006, 0x0016, 0x0017, 0x000E - }, - { - 0x003C, 0x003D, 0x001F, 0x000A, 0x0061, 0x0062, 0x0002, 0x000B, - 0x0063, 0x0064, 0x0003, 0x0007, 0x0003, 0x0004, 0x000B, 0x000C, - 0x0065, 0x0066, 0x0004, 0x0012, 0x000A, 0x000B, 0x0014, 0x001B, - 0x0018, 0x0019, 0x0034, 0x002C, 0x0067, 0x0068, 0x0035, 0x000D, - 0x0069, 0x006C, 0x0005, 0x0060, 0x001A, 0x001B, 0x0035, 0x0013, - 0x000E, 0x000F, 0x0015, 0x002D, 0x006D, 0x006E, 0x0038, 0x0008, - 0x0008, 0x0009, 0x000C, 0x002E, 0x006F, 0x0072, 0x003A, 0x002F, - 0x0073, 0x0000, 0x003B, 0x0007, 0x0014, 0x0015, 0x0004 - }, - { - 0x0038, 0x0039, 0x009D, 0x000A, 0x0091, 0x0092, 0x0093, 0x000B, - 0x0094, 0x0095, 0x0096, 0x0003, 0x00EE, 0x00EF, 0x0036, 0x000C, - 0x0097, 0x0098, 0x0099, 0x0008, 0x01E4, 0x01E5, 0x006A, 0x0018, - 0x03CC, 0x03CD, 0x00D6, 0x000E, 0x009E, 0x009F, 0x00F5, 0x000D, - 0x009A, 0x009B, 0x009C, 0x0019, 0x03CE, 0x03CF, 0x00D7, 0x0009, - 0x01E8, 0x01E9, 0x0090, 0x000F, 0x00E8, 0x00E9, 0x00F6, 0x0005, - 0x00F0, 0x00F1, 0x0037, 0x0010, 0x00EA, 0x00EB, 0x00F7, 0x0011, - 0x00EC, 0x00ED, 0x0034, 0x0000, 0x003E, 0x003F, 0x0002 - }, - { - 0x003C, 0x003D, 0x01CF, 0x0000, 0x00BF, 0x00E0, 0x01FC, 0x0001, - 0x00E1, 0x00E2, 0x01FD, 0x0009, 0x01F1, 0x01F2, 0x01F3, 0x0002, - 0x00E3, 0x00E4, 0x01FE, 0x0011, 0x03EE, 0x03EF, 0x03F0, 0x0021, - 0x07E2, 0x07E3, 0x07E4, 0x0018, 0x03F7, 0x03FE, 0x03FF, 0x0003, - 0x00E5, 0x00E6, 0x0080, 0x002E, 0x07E5, 0x07E6, 0x07E7, 0x0016, - 0x03F4, 0x03F5, 0x03F6, 0x0019, 0x0102, 0x0103, 0x0104, 0x000A, - 0x01F4, 0x01F5, 0x01F6, 0x001A, 0x0105, 0x0106, 0x0107, 0x001B, - 0x0178, 0x0179, 0x01CE, 0x001D, 0x00BD, 0x00BE, 0x01F0 - }, - { - 0x0003, 0x0004, 0x01B6, 0x0004, 0x002E, 0x002F, 0x000E, 0x0005, - 0x0030, 0x0031, 0x000F, 0x0003, 0x000A, 0x000B, 0x0014, 0x0006, - 0x0032, 0x0033, 0x0010, 0x0005, 0x0030, 0x0031, 0x0032, 0x0009, - 0x0066, 0x0067, 0x0068, 0x001D, 0x01B7, 0x01B8, 0x01B9, 0x0007, - 0x0034, 0x0035, 0x0011, 0x0016, 0x0069, 0x006A, 0x006B, 0x000A, - 0x0036, 0x0037, 0x00D8, 0x001E, 0x01BA, 0x01BB, 0x01BC, 0x0004, - 0x0015, 0x0016, 0x0017, 0x001F, 0x01BD, 0x01BE, 0x01BF, 0x0000, - 0x0010, 0x0011, 0x0012, 0x001C, 0x00D9, 0x00DA, 0x0013 - } -}; - -const uint8_t ff_vc1_icbpcy_p_bits[8][63] = { - { - 15, 15, 14, 9, 11, 11, 13, 9, 11, 11, 12, 8, 9, 9, 9, 9, - 11, 11, 12, 9, 10, 10, 10, 10, 11, 11, 11, 8, 8, 8, 7, 9, - 11, 11, 12, 10, 11, 11, 11, 9, 10, 10, 10, 8, 8, 8, 7, 8, - 9, 9, 9, 8, 8, 8, 7, 8, 8, 8, 7, 3, 3, 3, 1 - }, - { - 7, 7, 9, 7, 8, 8, 9, 7, 8, 8, 9, 6, 7, 7, 7, 7, - 7, 7, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6, - 7, 7, 8, 8, 9, 9, 9, 7, 8, 8, 8, 6, 7, 7, 6, 6, - 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 4, 3, 2 - }, - { - 6, 6, 5, 6, 8, 8, 9, 6, 8, 8, 9, 5, 7, 7, 7, 6, - 8, 8, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6, - 8, 8, 9, 7, 9, 9, 9, 6, 8, 8, 8, 6, 7, 7, 6, 5, - 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 5, 4, 2 - }, - { - 6, 6, 8, 4, 9, 9, 9, 4, 9, 9, 9, 4, 8, 8, 7, 4, - 9, 9, 9, 6, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4, - 9, 9, 9, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 7, 4, - 8, 8, 7, 5, 8, 8, 7, 5, 8, 8, 7, 3, 5, 5, 4 - }, - { - 6, 6, 5, 5, 7, 7, 7, 5, 7, 7, 7, 5, 6, 6, 6, 5, - 7, 7, 7, 6, 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 6, 5, - 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 7, 6, 7, 7, 6, 5, - 6, 6, 6, 6, 7, 7, 6, 6, 7, 6, 6, 4, 5, 5, 3 - }, - { - 6, 6, 8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 8, 7, 4, - 8, 8, 8, 5, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4, - 8, 8, 8, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 8, 4, - 8, 8, 7, 5, 8, 8, 8, 5, 8, 8, 7, 3, 6, 6, 4 - }, - { - 6, 6, 9, 3, 8, 8, 9, 3, 8, 8, 9, 4, 9, 9, 9, 3, - 8, 8, 9, 5, 10, 10, 10, 6, 11, 11, 11, 5, 10, 10, 10, 3, - 8, 8, 8, 6, 11, 11, 11, 5, 10, 10, 10, 5, 9, 9, 9, 4, - 9, 9, 9, 5, 9, 9, 9, 5, 9, 9, 9, 5, 8, 8, 9 - }, - { - 6, 6, 10, 3, 7, 7, 7, 3, 7, 7, 7, 4, 8, 8, 8, 3, - 7, 7, 7, 5, 9, 9, 9, 6, 10, 10, 10, 6, 10, 10, 10, 3, - 7, 7, 7, 6, 10, 10, 10, 5, 9, 9, 9, 6, 10, 10, 10, 4, - 8, 8, 8, 6, 10, 10, 10, 5, 9, 9, 9, 6, 9, 9, 9 - } -}; - -/* MacroBlock Transform Type: 7.1.3.11, p89 - * 8x8:B - * 8x4:B:btm 8x4:B:top 8x4:B:both, - * 4x8:B:right 4x8:B:left 4x8:B:both - * 4x4:B 8x8:MB - * 8x4:MB:btm 8x4:MB:top 8x4,MB,both - * 4x8,MB,right 4x8,MB,left - * 4x4,MB */ -const uint16_t ff_vc1_ttmb_codes[3][16] = { - { - 0x0003, - 0x002E, 0x005F, 0x0000, - 0x0016, 0x0015, 0x0001, - 0x0004, 0x0014, - 0x02F1, 0x0179, 0x017B, - 0x0BC0, 0x0BC1, 0x05E1, - 0x017A - }, - { - 0x0006, - 0x0006, 0x0003, 0x0007, - 0x000F, 0x000E, 0x0000, - 0x0002, 0x0002, - 0x0014, 0x0011, 0x000B, - 0x0009, 0x0021, 0x0015, - 0x0020 - }, - { - 0x0006, - 0x0000, 0x000E, 0x0005, - 0x0002, 0x0003, 0x0003, - 0x000F, 0x0002, - 0x0081, 0x0021, 0x0009, - 0x0101, 0x0041, 0x0011, - 0x0100 - } +const uint8_t ff_vc1_icbpcy_p_tabs[8][63][2] = { + { + { 0x3C, 3 }, { 0x3D, 3 }, { 0x1C, 8 }, { 0x1D, 8 }, { 0x2C, 8 }, + { 0x2D, 8 }, { 0x34, 8 }, { 0x35, 8 }, { 0x38, 8 }, { 0x39, 8 }, + { 0x03, 9 }, { 0x07, 9 }, { 0x0F, 9 }, { 0x1F, 9 }, { 0x0B, 8 }, + { 0x0C, 9 }, { 0x0D, 9 }, { 0x13, 9 }, { 0x14, 10 }, { 0x15, 10 }, + { 0x17, 10 }, { 0x18, 11 }, { 0x19, 11 }, { 0x23, 10 }, { 0x24, 11 }, + { 0x25, 11 }, { 0x1B, 8 }, { 0x27, 9 }, { 0x28, 10 }, { 0x29, 10 }, + { 0x2B, 8 }, { 0x2F, 8 }, { 0x30, 9 }, { 0x31, 9 }, { 0x33, 8 }, + { 0x37, 8 }, { 0x04, 11 }, { 0x05, 11 }, { 0x08, 11 }, { 0x09, 11 }, + { 0x10, 11 }, { 0x11, 11 }, { 0x20, 11 }, { 0x21, 11 }, { 0x1E, 7 }, + { 0x2E, 7 }, { 0x36, 7 }, { 0x3A, 7 }, { 0x0A, 12 }, { 0x12, 12 }, + { 0x22, 12 }, { 0x02, 14 }, { 0x00, 15 }, { 0x01, 15 }, { 0x06, 13 }, + { 0x16, 10 }, { 0x0E, 9 }, { 0x32, 9 }, { 0x1A, 11 }, { 0x26, 11 }, + { 0x2A, 10 }, { 0x3B, 3 }, { 0x3E, 1 }, + }, + { + { 0x3D, 3 }, { 0x10, 7 }, { 0x11, 7 }, { 0x1F, 6 }, { 0x20, 7 }, + { 0x21, 7 }, { 0x22, 8 }, { 0x18, 9 }, { 0x19, 9 }, { 0x1A, 9 }, + { 0x24, 9 }, { 0x25, 9 }, { 0x26, 9 }, { 0x1B, 6 }, { 0x2B, 6 }, + { 0x33, 6 }, { 0x37, 6 }, { 0x0B, 6 }, { 0x0C, 7 }, { 0x0D, 7 }, + { 0x0E, 7 }, { 0x13, 7 }, { 0x27, 7 }, { 0x30, 7 }, { 0x2F, 6 }, + { 0x31, 7 }, { 0x32, 7 }, { 0x14, 8 }, { 0x15, 8 }, { 0x16, 8 }, + { 0x17, 8 }, { 0x23, 8 }, { 0x28, 8 }, { 0x29, 8 }, { 0x2A, 8 }, + { 0x1C, 7 }, { 0x1D, 7 }, { 0x1E, 6 }, { 0x2C, 7 }, { 0x2D, 7 }, + { 0x2E, 6 }, { 0x34, 7 }, { 0x35, 7 }, { 0x36, 6 }, { 0x38, 7 }, + { 0x39, 7 }, { 0x3A, 6 }, { 0x02, 9 }, { 0x06, 9 }, { 0x0A, 9 }, + { 0x12, 9 }, { 0x00, 7 }, { 0x01, 7 }, { 0x03, 7 }, { 0x04, 8 }, + { 0x05, 8 }, { 0x07, 7 }, { 0x08, 8 }, { 0x09, 8 }, { 0x0F, 7 }, + { 0x3C, 4 }, { 0x3B, 3 }, { 0x3E, 2 }, + }, + { + { 0x3E, 2 }, { 0x3B, 3 }, { 0x3D, 4 }, { 0x0B, 5 }, { 0x2F, 5 }, + { 0x27, 6 }, { 0x1B, 6 }, { 0x2B, 6 }, { 0x33, 6 }, { 0x37, 6 }, + { 0x23, 7 }, { 0x1C, 7 }, { 0x03, 6 }, { 0x07, 6 }, { 0x0F, 6 }, + { 0x1F, 6 }, { 0x1D, 7 }, { 0x2C, 7 }, { 0x1E, 6 }, { 0x2D, 7 }, + { 0x34, 7 }, { 0x2E, 6 }, { 0x35, 7 }, { 0x38, 7 }, { 0x36, 6 }, + { 0x3A, 6 }, { 0x39, 7 }, { 0x0C, 7 }, { 0x00, 6 }, { 0x01, 6 }, + { 0x02, 5 }, { 0x0D, 7 }, { 0x14, 8 }, { 0x15, 8 }, { 0x18, 9 }, + { 0x19, 9 }, { 0x24, 9 }, { 0x25, 9 }, { 0x28, 8 }, { 0x29, 8 }, + { 0x30, 7 }, { 0x31, 7 }, { 0x04, 8 }, { 0x05, 8 }, { 0x08, 8 }, + { 0x09, 8 }, { 0x10, 8 }, { 0x11, 8 }, { 0x20, 8 }, { 0x21, 8 }, + { 0x16, 8 }, { 0x1A, 9 }, { 0x26, 9 }, { 0x0E, 7 }, { 0x32, 7 }, + { 0x2A, 8 }, { 0x06, 9 }, { 0x0A, 9 }, { 0x12, 9 }, { 0x22, 9 }, + { 0x17, 8 }, { 0x13, 7 }, { 0x3C, 5 }, + }, + { + { 0x03, 4 }, { 0x07, 4 }, { 0x0F, 4 }, { 0x1F, 4 }, { 0x17, 6 }, + { 0x23, 6 }, { 0x27, 5 }, { 0x0B, 4 }, { 0x2F, 4 }, { 0x2E, 7 }, + { 0x36, 7 }, { 0x3A, 7 }, { 0x0E, 7 }, { 0x1B, 5 }, { 0x2B, 5 }, + { 0x33, 5 }, { 0x37, 5 }, { 0x1A, 9 }, { 0x26, 9 }, { 0x16, 8 }, + { 0x32, 7 }, { 0x2A, 8 }, { 0x02, 8 }, { 0x1C, 8 }, { 0x1D, 8 }, + { 0x00, 6 }, { 0x01, 6 }, { 0x2C, 8 }, { 0x2D, 8 }, { 0x34, 8 }, + { 0x35, 8 }, { 0x38, 8 }, { 0x39, 8 }, { 0x14, 9 }, { 0x15, 9 }, + { 0x28, 9 }, { 0x29, 9 }, { 0x3C, 5 }, { 0x3D, 5 }, { 0x3B, 3 }, + { 0x3E, 4 }, { 0x0C, 8 }, { 0x0D, 8 }, { 0x30, 8 }, { 0x31, 8 }, + { 0x18, 10 }, { 0x19, 10 }, { 0x24, 10 }, { 0x25, 10 }, { 0x04, 9 }, + { 0x05, 9 }, { 0x06, 9 }, { 0x08, 9 }, { 0x09, 9 }, { 0x0A, 9 }, + { 0x10, 9 }, { 0x11, 9 }, { 0x12, 9 }, { 0x20, 9 }, { 0x21, 9 }, + { 0x22, 9 }, { 0x1E, 8 }, { 0x13, 6 }, + }, + { + { 0x39, 6 }, { 0x06, 7 }, { 0x0A, 7 }, { 0x12, 7 }, { 0x22, 7 }, + { 0x0C, 6 }, { 0x0D, 6 }, { 0x14, 7 }, { 0x15, 7 }, { 0x18, 8 }, + { 0x19, 8 }, { 0x24, 8 }, { 0x25, 8 }, { 0x28, 7 }, { 0x29, 7 }, + { 0x30, 6 }, { 0x31, 6 }, { 0x16, 7 }, { 0x2A, 7 }, { 0x0E, 6 }, + { 0x32, 6 }, { 0x1A, 8 }, { 0x26, 8 }, { 0x17, 7 }, { 0x0B, 5 }, + { 0x2F, 5 }, { 0x13, 6 }, { 0x27, 6 }, { 0x03, 5 }, { 0x07, 5 }, + { 0x0F, 5 }, { 0x1F, 5 }, { 0x3B, 4 }, { 0x3E, 3 }, { 0x3C, 5 }, + { 0x3D, 5 }, { 0x1B, 6 }, { 0x2B, 6 }, { 0x33, 6 }, { 0x37, 6 }, + { 0x23, 7 }, { 0x04, 7 }, { 0x05, 7 }, { 0x08, 7 }, { 0x09, 7 }, + { 0x10, 7 }, { 0x11, 7 }, { 0x1C, 7 }, { 0x1D, 7 }, { 0x20, 7 }, + { 0x1E, 6 }, { 0x21, 7 }, { 0x2C, 7 }, { 0x2D, 7 }, { 0x34, 7 }, + { 0x2E, 6 }, { 0x35, 7 }, { 0x38, 7 }, { 0x36, 6 }, { 0x3A, 6 }, + { 0x00, 6 }, { 0x01, 6 }, { 0x02, 5 }, + }, + { + { 0x3B, 3 }, { 0x3E, 4 }, { 0x0B, 4 }, { 0x13, 5 }, { 0x27, 5 }, + { 0x2F, 4 }, { 0x17, 6 }, { 0x23, 6 }, { 0x3A, 7 }, { 0x16, 8 }, + { 0x1A, 9 }, { 0x26, 9 }, { 0x0E, 7 }, { 0x32, 7 }, { 0x1B, 5 }, + { 0x2B, 5 }, { 0x33, 5 }, { 0x37, 5 }, { 0x2A, 8 }, { 0x04, 8 }, + { 0x05, 8 }, { 0x06, 8 }, { 0x08, 8 }, { 0x09, 8 }, { 0x0A, 8 }, + { 0x10, 8 }, { 0x11, 8 }, { 0x12, 8 }, { 0x20, 8 }, { 0x21, 8 }, + { 0x22, 8 }, { 0x02, 8 }, { 0x1C, 8 }, { 0x1D, 8 }, { 0x03, 4 }, + { 0x07, 4 }, { 0x0F, 4 }, { 0x1F, 4 }, { 0x00, 6 }, { 0x01, 6 }, + { 0x2C, 8 }, { 0x2D, 8 }, { 0x34, 8 }, { 0x35, 8 }, { 0x38, 8 }, + { 0x39, 8 }, { 0x0C, 8 }, { 0x0D, 8 }, { 0x30, 8 }, { 0x31, 8 }, + { 0x14, 9 }, { 0x15, 9 }, { 0x18, 10 }, { 0x19, 10 }, { 0x24, 10 }, + { 0x25, 10 }, { 0x28, 9 }, { 0x29, 9 }, { 0x1E, 8 }, { 0x2E, 8 }, + { 0x36, 8 }, { 0x3C, 6 }, { 0x3D, 6 }, + }, + { + { 0x03, 3 }, { 0x07, 3 }, { 0x0F, 3 }, { 0x1F, 3 }, { 0x22, 8 }, + { 0x2C, 9 }, { 0x2D, 9 }, { 0x2E, 9 }, { 0x34, 9 }, { 0x35, 9 }, + { 0x36, 9 }, { 0x17, 6 }, { 0x13, 5 }, { 0x0B, 4 }, { 0x2F, 4 }, + { 0x27, 5 }, { 0x23, 6 }, { 0x38, 9 }, { 0x39, 9 }, { 0x3C, 8 }, + { 0x3D, 8 }, { 0x04, 8 }, { 0x1B, 5 }, { 0x2B, 5 }, { 0x33, 5 }, + { 0x37, 5 }, { 0x05, 8 }, { 0x08, 8 }, { 0x09, 8 }, { 0x10, 8 }, + { 0x11, 8 }, { 0x20, 8 }, { 0x21, 8 }, { 0x3A, 9 }, { 0x02, 9 }, + { 0x3B, 5 }, { 0x00, 6 }, { 0x01, 6 }, { 0x3E, 9 }, { 0x0C, 9 }, + { 0x0D, 9 }, { 0x0E, 9 }, { 0x30, 9 }, { 0x31, 9 }, { 0x32, 9 }, + { 0x14, 10 }, { 0x15, 10 }, { 0x16, 10 }, { 0x18, 11 }, { 0x19, 11 }, + { 0x1A, 11 }, { 0x24, 11 }, { 0x25, 11 }, { 0x26, 11 }, { 0x28, 10 }, + { 0x29, 10 }, { 0x2A, 10 }, { 0x1C, 10 }, { 0x06, 9 }, { 0x0A, 9 }, + { 0x12, 9 }, { 0x1D, 10 }, { 0x1E, 10 }, + }, + { + { 0x37, 5 }, { 0x38, 9 }, { 0x39, 9 }, { 0x3A, 9 }, { 0x3E, 9 }, + { 0x0C, 8 }, { 0x0D, 8 }, { 0x00, 6 }, { 0x01, 6 }, { 0x0E, 8 }, + { 0x30, 8 }, { 0x31, 8 }, { 0x32, 8 }, { 0x14, 9 }, { 0x15, 9 }, + { 0x16, 9 }, { 0x18, 10 }, { 0x19, 10 }, { 0x1A, 10 }, { 0x24, 10 }, + { 0x25, 10 }, { 0x26, 10 }, { 0x28, 9 }, { 0x29, 9 }, { 0x06, 7 }, + { 0x0A, 7 }, { 0x12, 7 }, { 0x22, 7 }, { 0x17, 6 }, { 0x13, 5 }, + { 0x0B, 4 }, { 0x2F, 4 }, { 0x27, 5 }, { 0x23, 6 }, { 0x04, 7 }, + { 0x05, 7 }, { 0x08, 7 }, { 0x09, 7 }, { 0x10, 7 }, { 0x11, 7 }, + { 0x20, 7 }, { 0x21, 7 }, { 0x2A, 9 }, { 0x3C, 9 }, { 0x3D, 9 }, + { 0x02, 10 }, { 0x1C, 10 }, { 0x1D, 10 }, { 0x1E, 10 }, { 0x2C, 10 }, + { 0x2D, 10 }, { 0x2E, 10 }, { 0x34, 10 }, { 0x35, 10 }, { 0x36, 10 }, + { 0x3B, 6 }, { 0x1B, 6 }, { 0x2B, 6 }, { 0x33, 6 }, { 0x03, 3 }, + { 0x07, 3 }, { 0x0F, 3 }, { 0x1F, 3 }, + }, }; -const uint8_t ff_vc1_ttmb_bits[3][16] = { - { - 2, - 6, 7, 2, - 5, 5, 2, - 3, 5, - 10, 9, 9, - 12, 12, 11, - 9 - }, - { - 3, - 4, 4, 4, - 4, 4, 3, - 3, 2, - 7, 7, 6, - 6, 8, 7, - 8 - }, - { - 3, - 3, 4, 5, - 3, 3, 4, - 4, 2, - 10, 8, 6, - 11, 9, 7, - 11 - } +/* MacroBlock Transform Type: 7.1.3.10, tables 54-56 + * The "| 8" in the following table means that the transform type + * is valid for the whole macroblock. */ +const uint8_t ff_vc1_ttmb_tabs[3][16][2] = { + { + { TT_8X4, 2 }, { TT_4X8, 2 }, { TT_4X4, 3 }, { TT_8X8 | 8, 5 }, + { TT_4X8_LEFT, 5 }, { TT_4X8_RIGHT, 5 }, { TT_8X4_BOTTOM, 6 }, + { TT_4X8_RIGHT | 8, 12 }, { TT_4X8_LEFT | 8, 12 }, { TT_4X8 | 8, 11 }, + { TT_8X4_BOTTOM | 8, 10 }, { TT_8X4_TOP | 8, 9 }, { TT_4X4 | 8, 9 }, + { TT_8X4 | 8, 9 }, { TT_8X4_TOP, 7 }, { TT_8X8, 2 }, + }, + { + { TT_4X8, 3 }, { TT_4X4 | 8, 8 }, { TT_4X8_LEFT | 8, 8 }, + { TT_8X4_TOP | 8, 7 }, { TT_4X8_RIGHT | 8, 6 }, { TT_8X4_BOTTOM | 8, 7 }, + { TT_4X8 | 8, 7 }, { TT_8X4 | 8, 6 }, { TT_8X4_TOP, 4 }, { TT_4X4, 3 }, + { TT_8X4_BOTTOM, 4 }, { TT_8X4, 4 }, { TT_8X8 | 8, 2 }, { TT_8X8, 3 }, + { TT_4X8_LEFT, 4 }, { TT_4X8_RIGHT, 4 }, + }, + { + { TT_8X4_BOTTOM, 3 }, { TT_4X4 | 8, 11 }, { TT_4X8_RIGHT | 8, 11 }, + { TT_8X4_BOTTOM | 8, 10 }, { TT_4X8_LEFT | 8, 9 }, { TT_8X4_TOP | 8, 8 }, + { TT_4X8 | 8, 7 }, { TT_8X4 | 8, 6 }, { TT_8X4, 5 }, { TT_4X8, 4 }, + { TT_4X8_RIGHT, 3 }, { TT_4X8_LEFT, 3 }, { TT_8X8 | 8, 2 }, + { TT_8X8, 3 }, { TT_8X4_TOP, 4 }, { TT_4X4, 4 }, + }, }; /* TTBLK (Transform Type per Block) tables */ const uint8_t ff_vc1_ttblk_tabs[3][8][2] = { diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h index 21dec20390..d376b35368 100644 --- a/libavcodec/vc1data.h +++ b/libavcodec/vc1data.h @@ -107,9 +107,11 @@ extern const uint8_t ff_vc1_imode_bits[7]; /* Normal-2 imode */ extern const uint8_t ff_vc1_norm2_codes[4]; extern const uint8_t ff_vc1_norm2_bits[4]; -extern const uint16_t ff_vc1_norm6_codes[64]; -extern const uint8_t ff_vc1_norm6_bits[64]; -/* Normal-6 imode */ +/* Normal-6 imode (based upon table #81) + * The symbols contain the complete code of the tile, i.e. + * the possibly existing fixed length code resp. the second VLC + * are already incorporated. */ +extern const uint8_t ff_vc1_norm6_tab[77][2]; extern const uint8_t ff_vc1_norm6_spec[64][5]; /* 4MV Block pattern VLC tables */ @@ -122,25 +124,18 @@ extern const uint8_t ff_vc1_2mv_block_pattern_bits[4][4]; extern const uint8_t ff_wmv3_dc_scale_table[32]; -/* P-Picture CBPCY VLC tables */ -extern const uint16_t ff_vc1_cbpcy_p_codes[4][64]; -extern const uint8_t ff_vc1_cbpcy_p_bits[4][64]; +/* P-Picture CBPCY VLC tables (Tables #169-#172) */ +extern const uint8_t ff_vc1_cbpcy_p_tabs[4][64][2]; /* Interlaced CBPCY VLC tables (Table 124 - Table 131) */ -extern const uint16_t ff_vc1_icbpcy_p_codes[8][63]; -extern const uint8_t ff_vc1_icbpcy_p_bits[8][63]; - -/* MacroBlock Transform Type: 7.1.3.11, p89 - * 8x8:B - * 8x4:B:btm 8x4:B:top 8x4:B:both, - * 4x8:B:right 4x8:B:left 4x8:B:both - * 4x4:B 8x8:MB - * 8x4:MB:btm 8x4:MB:top 8x4,MB,both - * 4x8,MB,right 4x8,MB,left - * 4x4,MB */ -extern const uint16_t ff_vc1_ttmb_codes[3][16]; - -extern const uint8_t ff_vc1_ttmb_bits[3][16]; +extern const uint8_t ff_vc1_icbpcy_p_tabs[8][63][2]; + +/* MacroBlock Transform Type (tables #54-#56): + * The lower three bits of the symbols contain + * an enum TransformTypes (TT_*) value containing Transform Type + * and Subblock Pattern; the 0x8 bit being set means that the value + * is valid for the whole macroblock. */ +extern const uint8_t ff_vc1_ttmb_tabs[3][16][2]; /* TTBLK (Transform Type per Block) tables (tables #62-#64). * The symbols contain enum TransformTypes (TT_*) values. */ From patchwork Fri Nov 20 07:32:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23853 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 5A18644AFE3 for ; Fri, 20 Nov 2020 09:44:50 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2AF8368BC9B; Fri, 20 Nov 2020 09:34:15 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B16E668BB1A for ; Fri, 20 Nov 2020 09:34:09 +0200 (EET) Received: by mail-ed1-f66.google.com with SMTP id y4so8498712edy.5 for ; Thu, 19 Nov 2020 23:34:09 -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=BdOOdMw3do69xH4l2kY+mxbiH6LuIGQCpcY3/2s2IUI=; b=CQ9hn0TkeIBjldWitcFqaVYjAJ2CSynXakBzSYJhdL8VGyPcci+WIb6TD/iS6XQWsR Aeygvr5k+mdVoubl1+PSKPaEUteSXBVGEPKsL3vwULYTFX0tguPz/llaksywA0ZWiCzv 5Q1/wKBV3JgcggBs0cDLHCouAfYRQMe98vJSK4kET6yUqhdedas9P2oJRep0mp6Th4PN 0UtXw4DwYKCh4YaW3fBjhV/ZkuhAdgxg9ZDL7rZ8F8KBXy4RgHtYVXA/VZ44wAAV3/bI 8c+r6UXySaraHLAGlNkS7iotvc6DyYvOtcQFvPb8T7WKMcQxq3n9+Q1/BXe8mSwCuRHt DlLw== 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=BdOOdMw3do69xH4l2kY+mxbiH6LuIGQCpcY3/2s2IUI=; b=pdQ1zTO1r8NEfvOeFSykTBCslfSXGdOHnBYqcYg0OdSrQhi75Rh1e0IkZvXK50PbTn ZMYba4F7FEQ6+JYxg04M5eKFSdeDGyFMpNg+mIbvA2fb8Oco8fTZ0j/QBs5sYCMlHojj ED57WE8CV6WgoHsLcwnLLqnGKfTMjsk9jwZ3H73aCWLadglSd7ZbmMbcZpcIBBc/RIyj tJAMJuKK4Sm8gHNIqadjIg/f1NMRZK0X8s7uhX3mDoKfviUS4LXOtOsUHmpVdV2AQJxK 04FZM3C0F8KZlZGTg9azXlcu4zNDR328phN2g+SmNwFYBBorWEcbc1Ts2xkqk9E0NG31 AcHw== X-Gm-Message-State: AOAM531sEfeUWk1sSnJBM+9caNKBt0Regqb8qiqpX4i68w5BESPRmdLY JIhUEvzQx1pNObUHPZl2cPcAizWsrT6NBA== X-Google-Smtp-Source: ABdhPJwsKleVyq7aVveLAwEPXbtLeN+FD7Fjh4BKuUfiu2CZkuriZxlzecm3ruxu1RqXQygocswc9Q== X-Received: by 2002:a05:6402:22af:: with SMTP id cx15mr33258518edb.207.1605857649007; Thu, 19 Nov 2020 23:34:09 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:08 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:32 +0100 Message-Id: <20201120073327.820745-8-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 107/162] avcodec/vc1data: Remove declaration of inexistent array 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" ff_vc1_norm6_spec has been removed in commit 356be9307cbffa1226bed52b26aa2ac9c7af174f (and it seems that it has never been used). Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1data.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h index d376b35368..f08b1feedd 100644 --- a/libavcodec/vc1data.h +++ b/libavcodec/vc1data.h @@ -112,7 +112,6 @@ extern const uint8_t ff_vc1_norm2_bits[4]; * the possibly existing fixed length code resp. the second VLC * are already incorporated. */ extern const uint8_t ff_vc1_norm6_tab[77][2]; -extern const uint8_t ff_vc1_norm6_spec[64][5]; /* 4MV Block pattern VLC tables */ extern const uint8_t ff_vc1_4mv_block_pattern_codes[4][16]; From patchwork Fri Nov 20 07:32:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23856 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 BDE1F44B17A for ; Fri, 20 Nov 2020 09:45:13 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1A4DC68BCA6; Fri, 20 Nov 2020 09:34:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC9EB68BC8F for ; Fri, 20 Nov 2020 09:34:10 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id oq3so11500586ejb.7 for ; Thu, 19 Nov 2020 23:34:10 -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=uGKVAHuedgiCuLKKIXfwvzX55Qs7wZB2ER+eNt24Y8o=; b=pimJnsPAFZ7dwHQ+HY5gzu6Wsc3cvROSO9TIY0UJc2W+J5ZS2oDc+gXTBVBoIMAnJ8 iISxHHqGAIRTUqC7G9DGeDPTRpZbt8HSJEOTA1c1ejtNzjwzjQ/JuiHqJTwoKbEPUJNW sX2JyA/s77LcpL8IvsLvkJySp7PM6km3r0QWh7PDgADLOBu5gvfThgiO5zzf6HQBUCK7 7Q19A/7jlc4bpk2qx9OhiCEWW+feZKBXc5K9xZNNaxpGPGmByejJnCZF9/8/yovA8okf Fvd0Uxhc+tZzspwN4qZZL8IYUqNB/iooxRsVSgrWogc9Qw41Ah+hoseRYyDllxhJG0Ca ImgQ== 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=uGKVAHuedgiCuLKKIXfwvzX55Qs7wZB2ER+eNt24Y8o=; b=Q9XF7mRG+/ZrxKV0PbIblMQ1IFKW0vrFTCMCvQ62zVimHrSrCssrcCmLGjabLZ7SZp yuw2x/VlMxDkrNGbztmmHCn1oOzhxenKGWVAJN+PtSNE8n1PDgT+vYosgH/Ca2koxazO 0gKZ96ZPUoBxnd70AMFKm5DAIMEHfQJ53bFGQgJRC5hzcmrU43f827qcKJj2D+b96vvT hWWYClTr1YHac1uslb7ioMn4WCQXKWQDa+GQHJk5TZSVWkRaBfdpT39evMZXlkoj0O/B hscaIcfAa55mBlzZTnAq+AQ/dU1QnxLBcn4tENR+6LnHPqd6cUIIgu5vFNHinqTWSkxQ 29Zw== X-Gm-Message-State: AOAM5326aPHW4lzAKwsfmue+3qRrX197rvtKge0u9Kaf+2BFWhztHBtf GSZnPxU/oexAXUVAsA951N4pQSuiU0oPAQ== X-Google-Smtp-Source: ABdhPJyeOgJMNDgLdMVTc8Cmuc9VMNZgUhyxdodlkJeT+elFV31OKE5YnWclGt24EJkduZS35+J6Vw== X-Received: by 2002:a17:906:7c95:: with SMTP id w21mr9017616ejo.304.1605857650027; Thu, 19 Nov 2020 23:34:10 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:09 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:33 +0100 Message-Id: <20201120073327.820745-9-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 108/162] avcodec/vc1: Make ff_vc1_init_common() thread-safe 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/vc1.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index c2a440d2e7..d4378cbae9 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -27,6 +27,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/thread.h" #include "internal.h" #include "avcodec.h" #include "mpegvideo.h" @@ -1355,21 +1356,11 @@ static const uint16_t vlc_offs[] = { 31714, 31746, 31778, 32306, 32340, 32372 }; -/** - * Init VC-1 specific tables and VC1Context members - * @param v The VC1Context to initialize - * @return Status - */ -av_cold int ff_vc1_init_common(VC1Context *v) +static av_cold void vc1_init_static(void) { - static int done = 0; int i = 0; static VLC_TYPE vlc_table[32372][2]; - v->hrd_rate = v->hrd_buffer = NULL; - - /* VLC tables */ - if (!done) { INIT_VLC_STATIC(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23, ff_vc1_bfraction_bits, 1, 1, ff_vc1_bfraction_codes, 1, 1, 1 << VC1_BFRACTION_VLC_BITS); @@ -1488,14 +1479,27 @@ av_cold int ff_vc1_init_common(VC1Context *v) ff_vc1_if_1mv_mbmode_bits[i], 1, 1, ff_vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); } - done = 1; - } +} - /* Other defaults */ +/** + * Init VC-1 specific tables and VC1Context members + * @param v The VC1Context to initialize + * @return Status + */ +av_cold int ff_vc1_init_common(VC1Context *v) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + + v->hrd_rate = v->hrd_buffer = NULL; + + /* Nonstatic defaults */ v->pq = -1; v->mvrange = 0; /* 7.1.1.18, p80 */ ff_vc1dsp_init(&v->vc1dsp); + /* VLC tables */ + ff_thread_once(&init_static_once, vc1_init_static); + return 0; } From patchwork Fri Nov 20 07:32:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23857 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 C99E044B17A for ; Fri, 20 Nov 2020 09:45:25 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1677D68BCAE; Fri, 20 Nov 2020 09:34:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 931B068BC27 for ; Fri, 20 Nov 2020 09:34:12 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id f20so11518291ejz.4 for ; Thu, 19 Nov 2020 23:34:12 -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=0KKYWrAKUH177MSrYHy8eeqocWuKckv1tQU5zEPYFr4=; b=QoIqgbwOLlmjvz1KIDH2WWeKSthpbWO6fgcm35kNcgwMQ2fugMnepLAOTjQE2VSfFZ pNJUGgYwQRw/mXBBdRbFBPnTigM4pL3pfZdm5xAZ1GQwug04XBOU0xcoI7DgSIMOMR8/ 2muI9aAgBNVKSxNZsYOA7tlqtzvSsSoJLBp3Z+doFrbuk7QJ4UT7VE78r6P3utvPRUTg ZOR2mJejZnybli2T1bTC05EDH/bDAZY5TgzyVzJlcdHZ5+foUygnLfSbxPUZPO69TGyX 53T13n/xpkEd4FVV1ucxhGcYF+X1pWQf49qu4lxZrU5HfQDDPCaUSXCN0cfL4CHmymcb 00HQ== 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=0KKYWrAKUH177MSrYHy8eeqocWuKckv1tQU5zEPYFr4=; b=YyaTVJt2JmqiBGb2nxA9C+83vDDsDN9OEDyFXC00JWVtGMueJHxpY6Y7Q50/Zyb2Ug PWXEH77Dlf0TG3Uf0KsI9zSqHDo8gs9Djk1Bq1z0kuJCc/jp4/acDYHI62xpf1TvbfJu a7PzKw5Sc3+9Gg6zQZhFur5mKED9VaSw/PKWe7WLZ/3oT627eGGUg/jqwpKZ4v2Ze+ye TFCz+SOFPAZqXotAoPea+vEEVkXVwfkC39vmwENwla9ogXMo5ot/d4iYVEBysI/PcmU4 LrASQ4IPbhCsErRaYP0OgJOqay0tR6GkG/ULc7aXLTywQQbRadttVstCF9oeYD5I6Qrb sq9g== X-Gm-Message-State: AOAM530PBM6YOUAAAAerdFHiPY56A1EYo4TElsua6Sfc9t5ieYDOQHjR OJmEYxThmvzdLG4eYKn5EogL2xzYVX3LuA== X-Google-Smtp-Source: ABdhPJzq+PyckiiIht8d7Jp5lE4ABz8Q5RETONkJ3/henEGaQitYvtphqagpM89UKb7pC9ks2fLNnA== X-Received: by 2002:a17:906:4a02:: with SMTP id w2mr13909722eju.267.1605857651293; Thu, 19 Nov 2020 23:34:11 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:10 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:34 +0100 Message-Id: <20201120073327.820745-10-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 109/162] avcodec/vc1: 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" This has been achieved by switching those VLCs that still used ff_init_vlc_sparse() to ff_init_vlc_lengths() even though the codes tables used uint8_t in these cases. But it allows to use one auxiliary function to initialize the VLCs and by using tables that interleave symbols and lengths said function only needs one parameter for the tables, not two. The only table that uses an uint16_t symbols table still has to be treated specially for this reason. The offsets table has been removed as a byproduct of these changes; furthermore, some of the loops have been combined while just at it. Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1.c | 174 +++++++++++++++---------------------------- libavcodec/vc1data.c | 159 +++++++++++++++++++-------------------- libavcodec/vc1data.h | 36 +++++---- 3 files changed, 154 insertions(+), 215 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index d4378cbae9..ed31b03a8a 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1346,138 +1346,84 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) return 0; } -static const uint16_t vlc_offs[] = { - 0, 520, 552, 616, 1128, 1160, 1224, 1740, 1772, 1836, 1900, 2436, - 2986, 3050, 3610, 4154, 4218, 4746, 5326, 5390, 5902, 6554, 7658, 8342, - 9304, 9988, 10630, 11234, 12174, 13006, 13560, 14232, 14786, 15432, 16350, 17522, - 20372, 21818, 22330, 22394, 23166, 23678, 23742, 24820, 25332, 25396, 26460, 26980, - 27048, 27592, 27600, 27608, 27616, 27624, 28224, 28258, 28290, 28802, 28834, 28866, - 29378, 29412, 29444, 29960, 29994, 30026, 30538, 30572, 30604, 31120, 31154, 31186, - 31714, 31746, 31778, 32306, 32340, 32372 -}; +static VLC_TYPE vlc_buf[33080][2]; + +static av_cold void vc1_init_vlc(VLC *vlc, int nb_bits, int nb_codes, + unsigned *buf_offset, const uint8_t (*tab)[2], + int offset) +{ + vlc->table = &vlc_buf[*buf_offset]; + vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *buf_offset; + + ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + &tab[0][1], 2, &tab[0][0], 2, 1, + offset, INIT_VLC_STATIC_OVERLONG, NULL); + *buf_offset += vlc->table_size; +} static av_cold void vc1_init_static(void) { + unsigned offset = 0; int i = 0; - static VLC_TYPE vlc_table[32372][2]; - - INIT_VLC_STATIC(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23, - ff_vc1_bfraction_bits, 1, 1, - ff_vc1_bfraction_codes, 1, 1, 1 << VC1_BFRACTION_VLC_BITS); - INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, - ff_vc1_norm2_bits, 1, 1, - ff_vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 77, - &ff_vc1_norm6_tab[0][1], 2, - &ff_vc1_norm6_tab[0][0], 2, 1, 0, 0, 556); - INIT_VLC_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, - ff_vc1_imode_bits, 1, 1, - ff_vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS); + + vc1_init_vlc(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23, + &offset, ff_vc1_bfraction_tab, 0); + vc1_init_vlc(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, + &offset, ff_vc1_norm2_tab, 0); + vc1_init_vlc(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 77, + &offset, ff_vc1_norm6_tab, 0); + vc1_init_vlc(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, + &offset, ff_vc1_imode_tab, 0); for (i = 0; i < 3; i++) { - ff_vc1_ttmb_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 0]]; - ff_vc1_ttmb_vlc[i].table_allocated = vlc_offs[i * 3 + 1] - vlc_offs[i * 3 + 0]; - ff_init_vlc_from_lengths(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, - &ff_vc1_ttmb_tabs[i][0][1], 2, - &ff_vc1_ttmb_tabs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); - ff_vc1_ttblk_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 1]]; - ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1]; - ff_init_vlc_from_lengths(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, - &ff_vc1_ttblk_tabs[i][0][1], 2, - &ff_vc1_ttblk_tabs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); - ff_vc1_subblkpat_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 2]]; - ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2]; - ff_init_vlc_from_lengths(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, - &ff_vc1_subblkpat_tabs[i][0][1], 2, - &ff_vc1_subblkpat_tabs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + vc1_init_vlc(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, + &offset, ff_vc1_ttmb_tabs[i], 0); + vc1_init_vlc(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, + &offset, ff_vc1_ttblk_tabs[i], 0); + vc1_init_vlc(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, + &offset, ff_vc1_subblkpat_tabs[i], 0); } for (i = 0; i < 4; i++) { - ff_vc1_4mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 9]]; - ff_vc1_4mv_block_pattern_vlc[i].table_allocated = vlc_offs[i * 3 + 10] - vlc_offs[i * 3 + 9]; - init_vlc(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16, - ff_vc1_4mv_block_pattern_bits[i], 1, 1, - ff_vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); - ff_vc1_cbpcy_p_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 10]]; - ff_vc1_cbpcy_p_vlc[i].table_allocated = vlc_offs[i * 3 + 11] - vlc_offs[i * 3 + 10]; - ff_init_vlc_from_lengths(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, - &ff_vc1_cbpcy_p_tabs[i][0][1], 2, - &ff_vc1_cbpcy_p_tabs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); - ff_vc1_mv_diff_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 11]]; - ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11]; - ff_init_vlc_from_lengths(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, - &ff_vc1_mv_diff_tabs[i][0][1], 2, - &ff_vc1_mv_diff_tabs[i][0][0], 2, 1, - -4, INIT_VLC_USE_NEW_STATIC, NULL); + vc1_init_vlc(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16, + &offset, ff_vc1_4mv_block_pattern_tabs[i], 0); + vc1_init_vlc(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, + &offset, ff_vc1_cbpcy_p_tabs[i], 0); + vc1_init_vlc(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, + &offset, ff_vc1_mv_diff_tabs[i], -4); + /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */ + vc1_init_vlc(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, + &offset, ff_vc1_intfr_4mv_mbmode_tabs[i], 0); + /* initialize NON-4MV MBMODE VLC tables for the same */ + vc1_init_vlc(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, + &offset, ff_vc1_intfr_non4mv_mbmode_tabs[i], 0); + /* initialize interlaced MVDATA tables (1-Ref) */ + vc1_init_vlc(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72, + &offset, ff_vc1_1ref_mvdata_tabs[i], 0); + /* Initialize 2MV Block pattern VLC tables */ + vc1_init_vlc(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4, + &offset, ff_vc1_2mv_block_pattern_tabs[i], 0); } for (int i = 0, ac_offset = 0; i < 8; i++) { - ff_vc1_ac_coeff_table[i].table = &vlc_table[vlc_offs[i * 2 + 21]]; - ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i * 2 + 22] - vlc_offs[i * 2 + 21]; + ff_vc1_ac_coeff_table[i].table = &vlc_buf[offset]; + ff_vc1_ac_coeff_table[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; ff_init_vlc_from_lengths(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], ff_vc1_ac_coeff_lens + ac_offset, 1, ff_vc1_ac_coeff_syms + ac_offset, 2, 2, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + 0, INIT_VLC_STATIC_OVERLONG, NULL); ac_offset += ff_vc1_ac_sizes[i]; + offset += ff_vc1_ac_coeff_table[i].table_size; /* initialize interlaced MVDATA tables (2-Ref) */ - ff_vc1_2ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 2 + 22]]; - ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22]; - ff_init_vlc_from_lengths(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, - &ff_vc1_2ref_mvdata_tabs[i][0][1], 2, - &ff_vc1_2ref_mvdata_tabs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); - } - for (i = 0; i < 4; i++) { - /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */ - ff_vc1_intfr_4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 37]]; - ff_vc1_intfr_4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 38] - vlc_offs[i * 3 + 37]; - ff_init_vlc_from_lengths(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, - &ff_vc1_intfr_4mv_mbmode_tabs[i][0][1], 2, - &ff_vc1_intfr_4mv_mbmode_tabs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); - /* initialize NON-4MV MBMODE VLC tables for the same */ - ff_vc1_intfr_non4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 38]]; - ff_vc1_intfr_non4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 39] - vlc_offs[i * 3 + 38]; - ff_init_vlc_from_lengths(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, - &ff_vc1_intfr_non4mv_mbmode_tabs[i][0][1], 2, - &ff_vc1_intfr_non4mv_mbmode_tabs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); - /* initialize interlaced MVDATA tables (1-Ref) */ - ff_vc1_1ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 39]]; - ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39]; - ff_init_vlc_from_lengths(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72, - &ff_vc1_1ref_mvdata_tabs[i][0][1], 2, - &ff_vc1_1ref_mvdata_tabs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); - } - for (i = 0; i < 4; i++) { - /* Initialize 2MV Block pattern VLC tables */ - ff_vc1_2mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i + 49]]; - ff_vc1_2mv_block_pattern_vlc[i].table_allocated = vlc_offs[i + 50] - vlc_offs[i + 49]; - init_vlc(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4, - ff_vc1_2mv_block_pattern_bits[i], 1, 1, - ff_vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_init_vlc(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, + &offset, ff_vc1_2ref_mvdata_tabs[i], 0); } for (i = 0; i < 8; i++) { /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */ - ff_vc1_icbpcy_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 53]]; - ff_vc1_icbpcy_vlc[i].table_allocated = vlc_offs[i * 3 + 54] - vlc_offs[i * 3 + 53]; - ff_init_vlc_from_lengths(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, - &ff_vc1_icbpcy_p_tabs[i][0][1], 2, - &ff_vc1_icbpcy_p_tabs[i][0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + vc1_init_vlc(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, + &offset, ff_vc1_icbpcy_p_tabs[i], 0); /* Initialize interlaced field picture MBMODE VLC tables */ - ff_vc1_if_mmv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 54]]; - ff_vc1_if_mmv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 55] - vlc_offs[i * 3 + 54]; - init_vlc(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8, - ff_vc1_if_mmv_mbmode_bits[i], 1, 1, - ff_vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); - ff_vc1_if_1mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 55]]; - ff_vc1_if_1mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 56] - vlc_offs[i * 3 + 55]; - init_vlc(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6, - ff_vc1_if_1mv_mbmode_bits[i], 1, 1, - ff_vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_init_vlc(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8, + &offset, ff_vc1_if_mmv_mbmode_tabs[i], 0); + vc1_init_vlc(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6, + &offset, ff_vc1_if_1mv_mbmode_tabs[i], 0); } } diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c index 6c78895a38..9c4e95f2f3 100644 --- a/libavcodec/vc1data.c +++ b/libavcodec/vc1data.c @@ -129,23 +129,14 @@ const int16_t ff_vc1_bfraction_lut[23] = { }; #endif -const uint8_t ff_vc1_bfraction_bits[23] = { - 3, 3, 3, 3, - 3, 3, 3, - 7, 7, 7, 7, - 7, 7, 7, 7, - 7, 7, 7, 7, - 7, 7, - 7, 7 -}; -const uint8_t ff_vc1_bfraction_codes[23] = { - 0, 1, 2, 3, - 4, 5, 6, - 112, 113, 114, 115, - 116, 117, 118, 119, - 120, 121, 122, 123, - 124, 125, - 126, 127 +const uint8_t ff_vc1_bfraction_tab[23][2] = { + { 0, 3 }, { 1, 3 }, { 2, 3 }, { 3, 3 }, + { 4, 3 }, { 5, 3 }, { 6, 3 }, + { 7, 7 }, { 8, 7 }, { 9, 7 }, { 10, 7 }, + { 11, 7 }, { 12, 7 }, { 13, 7 }, { 14, 7 }, + { 15, 7 }, { 16, 7 }, { 17, 7 }, { 18, 7 }, + { 19, 7 }, { 20, 7 }, + { 21, 7 }, { 22, 7 }, }; //Same as H.264 @@ -169,19 +160,14 @@ const AVRational ff_vc1_pixel_aspect[16] = { }; /* BitPlane IMODE - such a small table... */ -const uint8_t ff_vc1_imode_codes[7] = { - 0, 2, 1, 3, 1, 2, 3 -}; -const uint8_t ff_vc1_imode_bits[7] = { - 4, 2, 3, 2, 4, 3, 3 +const uint8_t ff_vc1_imode_tab[7][2] = { + { IMODE_RAW, 4 }, { IMODE_DIFF6, 4 }, { IMODE_DIFF2, 3 }, { IMODE_ROWSKIP, 3 }, + { IMODE_COLSKIP, 3 }, { IMODE_NORM2, 2 }, { IMODE_NORM6, 2 }, }; /* Normal-2 imode */ -const uint8_t ff_vc1_norm2_codes[4] = { - 0, 4, 5, 3 -}; -const uint8_t ff_vc1_norm2_bits[4] = { - 1, 3, 3, 2 +const uint8_t ff_vc1_norm2_tab[4][2] = { + { 0, 1 }, { 1, 3 }, { 2, 3 }, { 3, 2 }, }; /* The negative lengths in the following table correspond to @@ -206,26 +192,39 @@ const uint8_t ff_vc1_norm6_tab[77][2] = { }; /* 4MV Block pattern VLC tables */ -const uint8_t ff_vc1_4mv_block_pattern_codes[4][16] = { - { 14, 58, 59, 25, 12, 26, 15, 15, 13, 24, 27, 0, 28, 1, 2, 2 }, - { 8, 18, 19, 4, 20, 5, 30, 11, 21, 31, 6, 12, 7, 13, 14, 0 }, - { 15, 6, 7, 2, 8, 3, 28, 9, 10, 29, 4, 11, 5, 12, 13, 0 }, - { 0, 11, 12, 4, 13, 5, 30, 16, 14, 31, 6, 17, 7, 18, 19, 10 } -}; -const uint8_t ff_vc1_4mv_block_pattern_bits[4][16] = { - { 5, 6, 6, 5, 5, 5, 5, 4, 5, 5, 5, 3, 5, 3, 3, 2 }, - { 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4, 4, 4, 4, 4, 2 }, - { 4, 4, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 4, 3 }, - { 2, 4, 4, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4 } +const uint8_t ff_vc1_4mv_block_pattern_tabs[4][16][2] = { + { + { 0x0B, 3 }, { 0x0D, 3 }, { 0x0E, 3 }, { 0x04, 5 }, { 0x08, 5 }, + { 0x00, 5 }, { 0x06, 5 }, { 0x0F, 2 }, { 0x09, 5 }, { 0x03, 5 }, + { 0x05, 5 }, { 0x0A, 5 }, { 0x0C, 5 }, { 0x01, 6 }, { 0x02, 6 }, + { 0x07, 4 }, + }, + { + { 0x0F, 2 }, { 0x03, 4 }, { 0x05, 4 }, { 0x0A, 4 }, { 0x0C, 4 }, + { 0x00, 4 }, { 0x01, 5 }, { 0x02, 5 }, { 0x04, 5 }, { 0x08, 5 }, + { 0x07, 4 }, { 0x0B, 4 }, { 0x0D, 4 }, { 0x0E, 4 }, { 0x06, 5 }, + { 0x09, 5 }, + }, + { + { 0x0F, 3 }, { 0x03, 4 }, { 0x05, 4 }, { 0x0A, 4 }, { 0x0C, 4 }, + { 0x01, 4 }, { 0x02, 4 }, { 0x04, 4 }, { 0x07, 4 }, { 0x08, 4 }, + { 0x0B, 4 }, { 0x0D, 4 }, { 0x0E, 4 }, { 0x06, 5 }, { 0x09, 5 }, + { 0x00, 4 }, + }, + { + { 0x00, 2 }, { 0x03, 4 }, { 0x05, 4 }, { 0x0A, 4 }, { 0x0C, 4 }, + { 0x07, 5 }, { 0x0B, 5 }, { 0x0D, 5 }, { 0x0E, 5 }, { 0x0F, 4 }, + { 0x01, 4 }, { 0x02, 4 }, { 0x04, 4 }, { 0x08, 4 }, { 0x06, 5 }, + { 0x09, 5 }, + }, }; /* 2MV Block pattern VLC tables */ -const uint8_t ff_vc1_2mv_block_pattern_codes[4][4] = { - { 2, 1, 0, 3 }, { 1, 0, 2, 3 }, { 2, 0, 3, 1 }, { 1, 3, 2, 0 } -}; - -const uint8_t ff_vc1_2mv_block_pattern_bits[4][4] = { - { 2, 2, 2, 2 }, { 1, 2, 3, 3 }, { 3, 2, 3, 1 }, { 1, 3, 3, 2 } +const uint8_t ff_vc1_2mv_block_pattern_tabs[4][4][2] = { + { { 0x02, 2 }, { 0x01, 2 }, { 0x00, 2 }, { 0x03, 2 } }, + { { 0x01, 2 }, { 0x02, 3 }, { 0x03, 3 }, { 0x00, 1 } }, + { { 0x01, 2 }, { 0x00, 3 }, { 0x02, 3 }, { 0x03, 1 } }, + { { 0x03, 2 }, { 0x02, 3 }, { 0x01, 3 }, { 0x00, 1 } }, }; /* Interlaced frame picture 4MV MBMODE VLC tables (tables 160-163) */ @@ -350,46 +349,42 @@ const uint8_t ff_vc1_intfr_non4mv_mbmode_tabs[4][9][2] = { /* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */ /* mixed-MV */ -const uint8_t ff_vc1_if_mmv_mbmode_codes[8][8] = { - { 16, 17, 3, 3, 0, 5, 9, 2 }, - { 8, 9, 3, 6, 7, 0, 5, 2 }, - { 16, 17, 5, 3, 0, 3, 9, 2 }, - { 56, 57, 15, 4, 5, 6, 29, 0 }, - { 52, 53, 27, 14, 15, 2, 12, 0 }, - { 56, 57, 29, 5, 6, 0, 15, 4 }, - { 16, 17, 6, 7, 0, 1, 9, 5 }, - { 56, 57, 0, 5, 6, 29, 4, 15 } -}; -const uint8_t ff_vc1_if_mmv_mbmode_bits[8][8] = { - { 6, 6, 2, 3, 2, 4, 5, 2 }, - { 5, 5, 3, 3, 3, 2, 4, 2 }, - { 6, 6, 4, 3, 2, 2, 5, 2 }, - { 6, 6, 4, 3, 3, 3, 5, 1 }, - { 6, 6, 5, 4, 4, 2, 4, 1 }, - { 6, 6, 5, 3, 3, 1, 4, 3 }, - { 5, 5, 3, 3, 2, 2, 4, 3 }, - { 6, 6, 1, 3, 3, 5, 3, 4 } +const uint8_t ff_vc1_if_mmv_mbmode_tabs[8][8][2] = { + { { 0x04, 2 }, { 0x00, 6 }, { 0x01, 6 }, { 0x06, 5 }, + { 0x05, 4 }, { 0x03, 3 }, { 0x07, 2 }, { 0x02, 2 } }, + { { 0x05, 2 }, { 0x00, 5 }, { 0x01, 5 }, { 0x06, 4 }, + { 0x02, 3 }, { 0x07, 2 }, { 0x03, 3 }, { 0x04, 3 } }, + { { 0x04, 2 }, { 0x00, 6 }, { 0x01, 6 }, { 0x06, 5 }, + { 0x02, 4 }, { 0x03, 3 }, { 0x07, 2 }, { 0x05, 2 } }, + { { 0x07, 1 }, { 0x03, 3 }, { 0x04, 3 }, { 0x05, 3 }, + { 0x00, 6 }, { 0x01, 6 }, { 0x06, 5 }, { 0x02, 4 } }, + { { 0x07, 1 }, { 0x05, 2 }, { 0x06, 4 }, { 0x00, 6 }, + { 0x01, 6 }, { 0x02, 5 }, { 0x03, 4 }, { 0x04, 4 } }, + { { 0x05, 1 }, { 0x07, 3 }, { 0x03, 3 }, { 0x04, 3 }, + { 0x00, 6 }, { 0x01, 6 }, { 0x02, 5 }, { 0x06, 4 } }, + { { 0x04, 2 }, { 0x05, 2 }, { 0x00, 5 }, { 0x01, 5 }, + { 0x06, 4 }, { 0x07, 3 }, { 0x02, 3 }, { 0x03, 3 } }, + { { 0x02, 1 }, { 0x06, 3 }, { 0x03, 3 }, { 0x04, 3 }, + { 0x00, 6 }, { 0x01, 6 }, { 0x05, 5 }, { 0x07, 4 } }, }; /* 1MV */ -const uint8_t ff_vc1_if_1mv_mbmode_codes[8][6] = { - { 0, 1, 1, 1, 1, 1 }, - { 0, 1, 1, 1, 1, 1 }, - { 16, 17, 3, 0, 9, 5 }, - { 20, 21, 3, 11, 0, 4 }, - { 4, 5, 2, 3, 3, 0 }, - { 4, 5, 3, 2, 0, 3 }, - { 0, 1, 1, 1, 1, 1 }, - { 16, 17, 9, 5, 3, 0 } -}; -const uint8_t ff_vc1_if_1mv_mbmode_bits[8][6] = { - { 5, 5, 1, 3, 2, 4 }, - { 5, 5, 1, 2, 3, 4 }, - { 5, 5, 2, 1, 4, 3 }, - { 5, 5, 2, 4, 1, 3 }, - { 4, 4, 2, 3, 2, 2 }, - { 4, 4, 3, 2, 2, 2 }, - { 5, 5, 3, 4, 1, 2 }, - { 5, 5, 4, 3, 2, 1 } +const uint8_t ff_vc1_if_1mv_mbmode_tabs[8][6][2] = { + { { 0x00, 5 }, { 0x01, 5 }, { 0x05, 4 }, + { 0x03, 3 }, { 0x04, 2 }, { 0x02, 1 } }, + { { 0x00, 5 }, { 0x01, 5 }, { 0x05, 4 }, + { 0x04, 3 }, { 0x03, 2 }, { 0x02, 1 } }, + { { 0x03, 1 }, { 0x00, 5 }, { 0x01, 5 }, + { 0x04, 4 }, { 0x05, 3 }, { 0x02, 2 } }, + { { 0x04, 1 }, { 0x05, 3 }, { 0x00, 5 }, + { 0x01, 5 }, { 0x03, 4 }, { 0x02, 2 } }, + { { 0x05, 2 }, { 0x00, 4 }, { 0x01, 4 }, + { 0x03, 3 }, { 0x02, 2 }, { 0x04, 2 } }, + { { 0x04, 2 }, { 0x00, 4 }, { 0x01, 4 }, + { 0x02, 3 }, { 0x03, 2 }, { 0x05, 2 } }, + { { 0x00, 5 }, { 0x01, 5 }, { 0x03, 4 }, + { 0x02, 3 }, { 0x05, 2 }, { 0x04, 1 } }, + { { 0x05, 1 }, { 0x00, 5 }, { 0x01, 5 }, + { 0x02, 4 }, { 0x03, 3 }, { 0x04, 2 } }, }; /* Interlaced frame/field picture MVDATA VLC tables */ diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h index f08b1feedd..17c112d6b9 100644 --- a/libavcodec/vc1data.h +++ b/libavcodec/vc1data.h @@ -94,32 +94,31 @@ extern VLC ff_vc1_ac_coeff_table[8]; /* pre-computed scales for all bfractions and base=256 */ extern const int16_t ff_vc1_bfraction_lut[23]; -extern const uint8_t ff_vc1_bfraction_bits[23]; -extern const uint8_t ff_vc1_bfraction_codes[23]; +extern const uint8_t ff_vc1_bfraction_tab[23][2]; /* based upon table 40 */ //Same as H.264 extern const AVRational ff_vc1_pixel_aspect[16]; -/* BitPlane IMODE - such a small table... */ -extern const uint8_t ff_vc1_imode_codes[7]; -extern const uint8_t ff_vc1_imode_bits[7]; +/* BitPlane IMODE (table #69) + * The symbols contain enum Imode (IMODE_*) values. */ +extern const uint8_t ff_vc1_imode_tab[7][2]; -/* Normal-2 imode */ -extern const uint8_t ff_vc1_norm2_codes[4]; -extern const uint8_t ff_vc1_norm2_bits[4]; +/* Normal-2 imode (table #80) + * 'SYMBOL 2N' is contained in the 0x1 bit, 'SYMBOL 2N+1' in 0x2. */ +extern const uint8_t ff_vc1_norm2_tab[4][2]; /* Normal-6 imode (based upon table #81) * The symbols contain the complete code of the tile, i.e. * the possibly existing fixed length code resp. the second VLC * are already incorporated. */ extern const uint8_t ff_vc1_norm6_tab[77][2]; -/* 4MV Block pattern VLC tables */ -extern const uint8_t ff_vc1_4mv_block_pattern_codes[4][16]; -extern const uint8_t ff_vc1_4mv_block_pattern_bits[4][16]; +/* 4MV Block pattern VLC tables (tables #116-#119) + * The symbols contain the '4-MV Coded Pattern'. */ +extern const uint8_t ff_vc1_4mv_block_pattern_tabs[4][16][2]; -/* 2MV Block pattern VLC tables */ -extern const uint8_t ff_vc1_2mv_block_pattern_codes[4][4]; -extern const uint8_t ff_vc1_2mv_block_pattern_bits[4][4]; +/* 2MV Block pattern VLC tables (tables #120-#123) + * Bit 0x1 of the symbols contains the 'Bottom' value, 0x2 the 'Top' value. */ +extern const uint8_t ff_vc1_2mv_block_pattern_tabs[4][4][2]; extern const uint8_t ff_wmv3_dc_scale_table[32]; @@ -167,11 +166,10 @@ enum MBModeProperties { extern const uint8_t ff_vc1_intfr_4mv_mbmode_tabs[4][15][2]; extern const uint8_t ff_vc1_intfr_non4mv_mbmode_tabs[4][9][2]; -/* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */ -extern const uint8_t ff_vc1_if_mmv_mbmode_codes[8][8]; -extern const uint8_t ff_vc1_if_mmv_mbmode_bits[8][8]; -extern const uint8_t ff_vc1_if_1mv_mbmode_codes[8][6]; -extern const uint8_t ff_vc1_if_1mv_mbmode_bits[8][6]; +/* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) + * The symbols contain the MB Mode value. */ +extern const uint8_t ff_vc1_if_mmv_mbmode_tabs[8][8][2]; /* tables #144-#151 */ +extern const uint8_t ff_vc1_if_1mv_mbmode_tabs[8][6][2]; /* tables #152-#159 */ /* Interlaced frame/field picture MVDATA VLC tables * The escape value of each table has the symbol 0; From patchwork Fri Nov 20 07:32:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23858 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 8C49C44B17A for ; Fri, 20 Nov 2020 09:45:37 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E8D7768BCB4; Fri, 20 Nov 2020 09:34:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E46CF68BC91 for ; Fri, 20 Nov 2020 09:34:12 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id y4so8498843edy.5 for ; Thu, 19 Nov 2020 23:34:12 -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=hBfRonJDar8u7bPWwf8ZKMpCj4geEMLhWuj/fa3cTGA=; b=fthjwXaDomIREB1TzRqVlUuUISdxEel2W3z7geCGOQ0yFdF9hD6clIM9bmyEKZbw0K iVhlImBcJVMohIOgDLv4whs8e/SUCEUI0jF1UGNozgoS/x7Kdl5/sb4+HI7HSRmK9+zH JWV1gzj1bkQwQMfGM1DXpuRZn+UzSQhG7I02xHDrJhEDXroeqATUZ6UuL+oa/9YhKQGR krhZ9/H81zkAefOZemWguMfYWp8Ni15lVWDlRWUVPAoq2LmHE7MH6DNIdg1lPhj4dqzH LMQZblVeXB+y+yfjKRz1nw8Jo1zp1dG+jIZ9/ROo98nfbW1b+Nrh9DWs9tP5W32IVQQP cjjQ== 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=hBfRonJDar8u7bPWwf8ZKMpCj4geEMLhWuj/fa3cTGA=; b=nLecBlKX6/o5PyK3uODmVVXl/vqhBNQynnfDmDVCunoRbFzUW2Ihvu1iOION4S22me wEi+o4CEaV3U4/tLouT/qSRVs6arNZ6ShIN/zqnEwSJJcY+KqGnOetYB588TbxfPxy+R ZSn7piA6SAnLgM5CEGBWxbb7QJIEZo/bqMJM0Yj/oYBsl9Nl3it46bLFRcTGAss79iMy qutZ0bgg0sPYtXVmJpsP8IxlMveL8l5j7Xo4ixiWEV1hhFvz6T8+PsxJiGT4qfaAlGQ9 PnKdmFMSsKcUwqBA/McSUdwK41ry2AhizLo50t/vtRqfa7BzNeYVXo5Fk4DJ4wr4Xlv8 x73w== X-Gm-Message-State: AOAM532FMUeMg0HSMwTFV+doXbgglewzm/ZnuZb5qSMYS8vqjLT0wN5g K2+6gUETO9KA3Eebbm1IagQOR+wjEww7Ww== X-Google-Smtp-Source: ABdhPJwGG6D2cwRi9jcOFREzCxsdm4KarDGgoauoidRINMmBME4SN0SkUh3F3xTnEXJZxS8qUnA1VA== X-Received: by 2002:a50:cc98:: with SMTP id q24mr5635989edi.184.1605857652214; Thu, 19 Nov 2020 23:34:12 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:11 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:35 +0100 Message-Id: <20201120073327.820745-11-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 110/162] avcodec/vc1: Reindentation 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" Also combine two loops while at it. Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index ed31b03a8a..a4f72c1808 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1364,7 +1364,6 @@ static av_cold void vc1_init_vlc(VLC *vlc, int nb_bits, int nb_codes, static av_cold void vc1_init_static(void) { unsigned offset = 0; - int i = 0; vc1_init_vlc(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23, &offset, ff_vc1_bfraction_tab, 0); @@ -1374,15 +1373,15 @@ static av_cold void vc1_init_static(void) &offset, ff_vc1_norm6_tab, 0); vc1_init_vlc(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, &offset, ff_vc1_imode_tab, 0); - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { vc1_init_vlc(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, &offset, ff_vc1_ttmb_tabs[i], 0); vc1_init_vlc(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, &offset, ff_vc1_ttblk_tabs[i], 0); vc1_init_vlc(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, &offset, ff_vc1_subblkpat_tabs[i], 0); - } - for (i = 0; i < 4; i++) { + } + for (int i = 0; i < 4; i++) { vc1_init_vlc(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16, &offset, ff_vc1_4mv_block_pattern_tabs[i], 0); vc1_init_vlc(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, @@ -1401,30 +1400,28 @@ static av_cold void vc1_init_static(void) /* Initialize 2MV Block pattern VLC tables */ vc1_init_vlc(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4, &offset, ff_vc1_2mv_block_pattern_tabs[i], 0); - } - for (int i = 0, ac_offset = 0; i < 8; i++) { + } + for (int i = 0, ac_offset = 0; i < 8; i++) { ff_vc1_ac_coeff_table[i].table = &vlc_buf[offset]; ff_vc1_ac_coeff_table[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - ff_init_vlc_from_lengths(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], - ff_vc1_ac_coeff_lens + ac_offset, 1, - ff_vc1_ac_coeff_syms + ac_offset, 2, 2, + ff_init_vlc_from_lengths(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], + ff_vc1_ac_coeff_lens + ac_offset, 1, + ff_vc1_ac_coeff_syms + ac_offset, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); - ac_offset += ff_vc1_ac_sizes[i]; + ac_offset += ff_vc1_ac_sizes[i]; offset += ff_vc1_ac_coeff_table[i].table_size; - /* initialize interlaced MVDATA tables (2-Ref) */ + /* initialize interlaced MVDATA tables (2-Ref) */ vc1_init_vlc(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, &offset, ff_vc1_2ref_mvdata_tabs[i], 0); - } - for (i = 0; i < 8; i++) { - /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */ + /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */ vc1_init_vlc(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, &offset, ff_vc1_icbpcy_p_tabs[i], 0); - /* Initialize interlaced field picture MBMODE VLC tables */ + /* Initialize interlaced field picture MBMODE VLC tables */ vc1_init_vlc(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8, &offset, ff_vc1_if_mmv_mbmode_tabs[i], 0); vc1_init_vlc(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6, &offset, ff_vc1_if_1mv_mbmode_tabs[i], 0); - } + } } /** From patchwork Fri Nov 20 07:32:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23860 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 87AA944B17A for ; Fri, 20 Nov 2020 09:46:02 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D706A68BCC4; Fri, 20 Nov 2020 09:34:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 17A5768BCB6 for ; Fri, 20 Nov 2020 09:34:14 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id k4so8527860edl.0 for ; Thu, 19 Nov 2020 23:34:14 -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=0ig7y3qbx1SpM7TER2/Ca6qU43k2VflZHjTdUEphCYw=; b=icdxFjPj8rCKuYZshtHxZq0VPZL6rstWAFpk29+hXoUGHJLgSTRd8Xr78Y0isCExv+ nLS8zgEYJl3mHWRmdn0s1lqsiMijUpIPAwflSywIa+63mPf6PL9uhihqWCGwB+LX3s3H l2G9ZQfZae10qsPB2Iyd9EboAY5hP+k/zZ/dbrctYBUiEXn2NMSgbYdzpyF0iY6qn3W1 PWJcju+TB26WIlY7olols8HQO/cmQnn7XyFo9ZCkUkR/VmNCpjwLhP7dMggUgPsVwnOo MLjz8I34BYSa3uLMvuWNU24atw2ZM3014CdN2A4Deho+BUVAbcCjc2tdS3xnfzHV3RBB l42Q== 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=0ig7y3qbx1SpM7TER2/Ca6qU43k2VflZHjTdUEphCYw=; b=kY2WeztZw+uvcXlzNcwRhO5s9ER2V0MIEieKZOKxrOwIkq5ifXLnxmUhfBLzg9Da0F 9/o7F2zSo3R1MDKUfY9IuijcgImhMIRIz5XslPOXbZzad8FCizkU+OPuERPtAR5ngG+1 sBpytXY7FZKnT0EUEgqdL1ceVxB1ZNmdkEHI5CskzcJuvHaCB1aAo7JkhHFbGzd6g6nH N/Wp5vFGbYPHVEFHK1gRktOTMA9ow0IuMw9yi0w5Ac/VEqeRDqOICtxoXrptl4Fj2RgF R/QKD83GZwth3Ng2NUL9JUIyqw6Y5SFXFMl5BO72VmEMx+QvMENo5cmxj/BB6jPe24Id KATw== X-Gm-Message-State: AOAM530D1Nda7hUsBygAvaAFZ+EcQht3ePUV3RAuaxireHGUQl0SvqMf urEJ6hwtUd3P3h6Yr+KNA+ZDiRzZuvvZDg== X-Google-Smtp-Source: ABdhPJxCkiAt6pIDXvFgCzY2kvN4XMObVBFXgSTWcVojr14+DN5nXeJPRaGfqSdjADH3iwk6jiK5HA== X-Received: by 2002:aa7:c90a:: with SMTP id b10mr32980330edt.266.1605857653184; Thu, 19 Nov 2020 23:34:13 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:12 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:36 +0100 Message-Id: <20201120073327.820745-12-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 111/162] avcodec/rv34: Avoid offsets table for initialization of static 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/rv34.c | 68 +++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index 09fa962b2f..e633c348bd 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -76,27 +76,6 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type); * @{ */ -static const int table_offs[] = { - 0, 1818, 3622, 4144, 4698, 5234, 5804, 5868, 5900, 5932, - 5996, 6252, 6316, 6348, 6380, 7674, 8944, 10274, 11668, 12250, - 14060, 15846, 16372, 16962, 17512, 18148, 18180, 18212, 18244, 18308, - 18564, 18628, 18660, 18692, 20036, 21314, 22648, 23968, 24614, 26384, - 28190, 28736, 29366, 29938, 30608, 30640, 30672, 30704, 30768, 31024, - 31088, 31120, 31184, 32570, 33898, 35236, 36644, 37286, 39020, 40802, - 41368, 42052, 42692, 43348, 43380, 43412, 43444, 43476, 43604, 43668, - 43700, 43732, 45100, 46430, 47778, 49160, 49802, 51550, 53340, 53972, - 54648, 55348, 55994, 56122, 56154, 56186, 56218, 56346, 56410, 56442, - 56474, 57878, 59290, 60636, 62036, 62682, 64460, 64524, 64588, 64716, - 64844, 66076, 67466, 67978, 68542, 69064, 69648, 70296, 72010, 72074, - 72138, 72202, 72330, 73572, 74936, 75454, 76030, 76566, 77176, 77822, - 79582, 79646, 79678, 79742, 79870, 81180, 82536, 83064, 83672, 84242, - 84934, 85576, 87384, 87448, 87480, 87544, 87672, 88982, 90340, 90902, - 91598, 92182, 92846, 93488, 95246, 95278, 95310, 95374, 95502, 96878, - 98266, 98848, 99542, 100234, 100884, 101524, 103320, 103352, 103384, 103416, - 103480, 104874, 106222, 106910, 107584, 108258, 108902, 109544, 111366, 111398, - 111430, 111462, 111494, 112878, 114320, 114988, 115660, 116310, 116950, 117592 -}; - static VLC_TYPE table_data[117592][2]; /** @@ -108,7 +87,7 @@ static VLC_TYPE table_data[117592][2]; * @param num VLC table number (for static initialization) */ static void rv34_gen_vlc(const uint8_t *bits, int size, VLC *vlc, const uint8_t *syms, - const int num) + int *offset) { int counts[17] = {0}, codes[17]; uint16_t cw[MAX_VLC_SIZE]; @@ -128,12 +107,13 @@ static void rv34_gen_vlc(const uint8_t *bits, int size, VLC *vlc, const uint8_t for (int i = 0; i < size; i++) cw[i] = codes[bits[i]]++; - vlc->table = &table_data[table_offs[num]]; - vlc->table_allocated = table_offs[num + 1] - table_offs[num]; + vlc->table = &table_data[*offset]; + vlc->table_allocated = FF_ARRAY_ELEMS(table_data) - *offset; ff_init_vlc_sparse(vlc, FFMIN(maxbits, 9), size, bits, 1, 1, cw, 2, 2, - syms, !!syms, !!syms, INIT_VLC_USE_NEW_STATIC); + syms, !!syms, !!syms, INIT_VLC_STATIC_OVERLONG); + *offset += vlc->table_size; } /** @@ -141,34 +121,46 @@ static void rv34_gen_vlc(const uint8_t *bits, int size, VLC *vlc, const uint8_t */ static av_cold void rv34_init_tables(void) { - int i, j, k; + int i, j, k, offset = 0; for(i = 0; i < NUM_INTRA_TABLES; i++){ for(j = 0; j < 2; j++){ - rv34_gen_vlc(rv34_table_intra_cbppat [i][j], CBPPAT_VLC_SIZE, &intra_vlcs[i].cbppattern[j], NULL, 19*i + 0 + j); - rv34_gen_vlc(rv34_table_intra_secondpat[i][j], OTHERBLK_VLC_SIZE, &intra_vlcs[i].second_pattern[j], NULL, 19*i + 2 + j); - rv34_gen_vlc(rv34_table_intra_thirdpat [i][j], OTHERBLK_VLC_SIZE, &intra_vlcs[i].third_pattern[j], NULL, 19*i + 4 + j); + rv34_gen_vlc(rv34_table_intra_cbppat [i][j], CBPPAT_VLC_SIZE, + &intra_vlcs[i].cbppattern[j], NULL, &offset); + rv34_gen_vlc(rv34_table_intra_secondpat[i][j], OTHERBLK_VLC_SIZE, + &intra_vlcs[i].second_pattern[j], NULL, &offset); + rv34_gen_vlc(rv34_table_intra_thirdpat [i][j], OTHERBLK_VLC_SIZE, + &intra_vlcs[i].third_pattern[j], NULL, &offset); for(k = 0; k < 4; k++){ - rv34_gen_vlc(rv34_table_intra_cbp[i][j+k*2], CBP_VLC_SIZE, &intra_vlcs[i].cbp[j][k], rv34_cbp_code, 19*i + 6 + j*4 + k); + rv34_gen_vlc(rv34_table_intra_cbp[i][j+k*2], CBP_VLC_SIZE, + &intra_vlcs[i].cbp[j][k], rv34_cbp_code, &offset); } } for(j = 0; j < 4; j++){ - rv34_gen_vlc(rv34_table_intra_firstpat[i][j], FIRSTBLK_VLC_SIZE, &intra_vlcs[i].first_pattern[j], NULL, 19*i + 14 + j); + rv34_gen_vlc(rv34_table_intra_firstpat[i][j], FIRSTBLK_VLC_SIZE, + &intra_vlcs[i].first_pattern[j], NULL, &offset); } - rv34_gen_vlc(rv34_intra_coeff[i], COEFF_VLC_SIZE, &intra_vlcs[i].coefficient, NULL, 19*i + 18); + rv34_gen_vlc(rv34_intra_coeff[i], COEFF_VLC_SIZE, + &intra_vlcs[i].coefficient, NULL, &offset); } for(i = 0; i < NUM_INTER_TABLES; i++){ - rv34_gen_vlc(rv34_inter_cbppat[i], CBPPAT_VLC_SIZE, &inter_vlcs[i].cbppattern[0], NULL, i*12 + 95); + rv34_gen_vlc(rv34_inter_cbppat[i], CBPPAT_VLC_SIZE, + &inter_vlcs[i].cbppattern[0], NULL, &offset); for(j = 0; j < 4; j++){ - rv34_gen_vlc(rv34_inter_cbp[i][j], CBP_VLC_SIZE, &inter_vlcs[i].cbp[0][j], rv34_cbp_code, i*12 + 96 + j); + rv34_gen_vlc(rv34_inter_cbp[i][j], CBP_VLC_SIZE, + &inter_vlcs[i].cbp[0][j], rv34_cbp_code, &offset); } for(j = 0; j < 2; j++){ - rv34_gen_vlc(rv34_table_inter_firstpat [i][j], FIRSTBLK_VLC_SIZE, &inter_vlcs[i].first_pattern[j], NULL, i*12 + 100 + j); - rv34_gen_vlc(rv34_table_inter_secondpat[i][j], OTHERBLK_VLC_SIZE, &inter_vlcs[i].second_pattern[j], NULL, i*12 + 102 + j); - rv34_gen_vlc(rv34_table_inter_thirdpat [i][j], OTHERBLK_VLC_SIZE, &inter_vlcs[i].third_pattern[j], NULL, i*12 + 104 + j); + rv34_gen_vlc(rv34_table_inter_firstpat [i][j], FIRSTBLK_VLC_SIZE, + &inter_vlcs[i].first_pattern[j], NULL, &offset); + rv34_gen_vlc(rv34_table_inter_secondpat[i][j], OTHERBLK_VLC_SIZE, + &inter_vlcs[i].second_pattern[j], NULL, &offset); + rv34_gen_vlc(rv34_table_inter_thirdpat [i][j], OTHERBLK_VLC_SIZE, + &inter_vlcs[i].third_pattern[j], NULL, &offset); } - rv34_gen_vlc(rv34_inter_coeff[i], COEFF_VLC_SIZE, &inter_vlcs[i].coefficient, NULL, i*12 + 106); + rv34_gen_vlc(rv34_inter_coeff[i], COEFF_VLC_SIZE, + &inter_vlcs[i].coefficient, NULL, &offset); } } From patchwork Fri Nov 20 07:32:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23861 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 783B544B2D5 for ; Fri, 20 Nov 2020 09:46:14 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8643B68BCCB; Fri, 20 Nov 2020 09:34:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BF59D68BC27 for ; Fri, 20 Nov 2020 09:34:14 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id y17so11480074ejh.11 for ; Thu, 19 Nov 2020 23:34:14 -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=gSeO2F148zwy9tzTU0JHXVa55YkF/QB3/zEDoukkOms=; b=Vao0bRHUpUxjekCS9K/hMVk71dxCpdF72uTLdceCL6eFP4CJ6mX38m8bOV/zBNT7np 6Bw2TI5pQQ+CHHQTqiyUd46EdDgR0a9Q20tEbYxmn/7poLOsE9SexICTRop4WIj1skqZ ytyVm+y7G3nStXRIcCU1DE9LV9smujhkU/COfY5eO4IMQnpPkWt4NGL8Cq4ZwrrjL6XM G1SJcK82o/bUiQGtJjFw1iyQpDyJilRs0FOnLOVFxKZlPbr29f3IWjHrabUmxK3d8uGZ 9XjGweW+LS+/T3viBzCaII5nANlHXyyDPfKQwqkOSk+8pRBz4+b5e9fNZZRMklbFa2On tSVA== 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=gSeO2F148zwy9tzTU0JHXVa55YkF/QB3/zEDoukkOms=; b=rVElbD9B0vAOjdevu3/+ZBXZ8lRxP0RH1WgrDW6w87pBB8PQ113LmnSd4O93j1G6U8 9sjBLoWtXj6ANO+Kb1qlgpcVDGiTbgY/935cJMkwg1bRSKvtnH6asQkil0M35BzRoXRu YBDZMgDjdfJBTmREoY6IWusVPSNXL66qayNmj1jygWQtOI+0IBt/P0GH+7Z3xquHJOwN tRejw4o//+3D9QWN45h8GMlhHMBaRPwiK2gAnIHNBBwDXngDl6UEr2+CkUacZcAeyQgv Zj89A9eGZHQcBm87gxftm3hHvkQCVlBasIFwIpmco2q5rldGd9foggxcO+o8PhSH6D3L hRMA== X-Gm-Message-State: AOAM531tG4PQISxu6dvk7mBFc9zob7l2A+bqrUfmmRuWHq0NgdEVZ6Dg FtuMwmXTpiGA5QPKwdZyl+n/P/d+7tQrrA== X-Google-Smtp-Source: ABdhPJx/SzlR4zEksHjywxdrqrLV/Aqk12odKW9JV4DiQWstZA8WBPDjZi0q/HOZSILGla58VPw/Yg== X-Received: by 2002:a17:906:7698:: with SMTP id o24mr30584370ejm.447.1605857654081; Thu, 19 Nov 2020 23:34:14 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:13 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:37 +0100 Message-Id: <20201120073327.820745-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 112/162] avcodec/rv34: Make initializing static VLC tables thread-safe 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/rv34.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index e633c348bd..13f9b609e2 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -27,6 +27,7 @@ #include "libavutil/avassert.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "error_resilience.h" @@ -1481,6 +1482,7 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int */ av_cold int ff_rv34_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; RV34DecContext *r = avctx->priv_data; MpegEncContext *s = &r->s; int ret; @@ -1513,8 +1515,7 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx) return ret; } - if(!intra_vlcs[0].cbppattern[0].bits) - rv34_init_tables(); + ff_thread_once(&init_static_once, rv34_init_tables); return 0; } From patchwork Fri Nov 20 07:32:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23862 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 57CCE44B2D5 for ; Fri, 20 Nov 2020 09:46:26 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DF43A68BCB3; Fri, 20 Nov 2020 09:34:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DFCFC68BB0D for ; Fri, 20 Nov 2020 09:34:15 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id t9so8492695edq.8 for ; Thu, 19 Nov 2020 23:34:15 -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=Rf5ix6JEVS3caUukrTMhNiloUk0B0iLJVfJ19E/qJDI=; b=TiUJzz5IqtuSlWYgA/z7Lhy2Fbg1PJNars1Q1w2ZAo6COcNwTt7elCPHg6eR80BZrn 7AbALNUWt3n2ETsRes1L39mPIdfLOIbdcoJuA4UL5iQVhtaAufQNBkePJRQ3qSZzTUKn 5cfZbwFh5fzF0uLdUm5pZbfCyaJyytPW1HSKW/AGqJiZqKh25Zyz8201XcVGHjB+4PSI KJt4qQY+YAHrqr433shzsni/4gTxTKIDtB6wfUzDleC95Yi5mnofqRIi2Adf2Ni7bc9F 2wrATss4BSVCkVms7e70LxqKT5n9LWcRXEYu0LMgjtKi0t+OxAQtCoEASeXwtZ8vNCeI /TdQ== 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=Rf5ix6JEVS3caUukrTMhNiloUk0B0iLJVfJ19E/qJDI=; b=mKMLDjMXJkdPX89sxjOqtsRsecC51BR6KyiGCMORiqqvMXxGjXghgqrc0rzqU92qGr WoIg2kMpydCuDJtk2Ocrl4ohsehFbT4bE1MGF7qvQeTmEdED3Z1qj6CQ58TSp+kTYiWJ IWDv9dqLxUTenhdLy8nWA4XnA4k0La7DV0jsQPC7fRIES0olSPfgwuy9pIcJ08ofQl9D +yucbj/ICgdJP5dnyFxw5ZvRfvQU6NTkcAcwSEycLTycGlabVNv/B9wHeo+fx97eUI4U oCykg6XPzYv/DkFp7hH6mGj7gMZKLSlCm/BAE/xHLuuSLbQw2UJc9Oa8Ny3R+wnNW3IB S++A== X-Gm-Message-State: AOAM530wGZRRSKmc+b4Wvz7DLd6iMcUWFiEcwnpkkhRlapy9f2JlRc28 9IWHpOX3ykBOl5ANENEfOgsyllkK0/j2GA== X-Google-Smtp-Source: ABdhPJzBWeHHvR+h7Ut6pGbmWRtCq+LhPxRGgEoxqEbCqk9iMKjwgAIn+LxNogG9FChFvDlKC0ayqw== X-Received: by 2002:a50:8745:: with SMTP id 5mr33937643edv.49.1605857655030; Thu, 19 Nov 2020 23:34:15 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:14 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:38 +0100 Message-Id: <20201120073327.820745-14-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 113/162] avcodec/atrac9dec: Don't confuse max_depth of VLC with max codelength 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 whole point of VLCs with their tables is to read more than one bit at a time; therefore max_depth, the number of times one has to (maximally) read further bits is given by ceil(max_code_length / table_bits) which in the case of ATRAC9's coefficient VLCs gives an upper bound of two. Instead the maximum length of a code of the given VLC has been used (which is not even a compile-time constant). Use two instead. Furthermore, given that this was the only usage of the field containing the maximum of all the code lengths of a given VLC the field has been removed from its containing struct. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac9dec.c | 2 +- libavcodec/atrac9tab.h | 105 ++++++++++++++++++++--------------------- 2 files changed, 53 insertions(+), 54 deletions(-) diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index 075d610e75..a1af3c22ef 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -411,7 +411,7 @@ static inline void read_coeffs_coarse(ATRAC9Context *s, ATRAC9BlockData *b, const int groups = bands >> huff->value_cnt_pow; for (int j = 0; j < groups; j++) { - uint16_t val = get_vlc2(gb, tab->table, 9, huff->max_bit_size); + uint16_t val = get_vlc2(gb, tab->table, 9, 2); for (int k = 0; k < huff->value_cnt; k++) { coeffs[k] = sign_extend(val, huff->value_bits); diff --git a/libavcodec/atrac9tab.h b/libavcodec/atrac9tab.h index 8f290f158c..c25d0e2744 100644 --- a/libavcodec/atrac9tab.h +++ b/libavcodec/atrac9tab.h @@ -476,26 +476,25 @@ typedef struct HuffmanCodebook { const int value_cnt; const int value_cnt_pow; const int value_bits; - const int max_bit_size; } HuffmanCodebook; static const HuffmanCodebook at9_huffman_sf_unsigned[] = { { 0 }, - { huff_sfb_a1_bits, huff_sfb_a1_codes, 2, 1, 0, 1, 1, }, - { huff_sfb_a2_bits, huff_sfb_a2_codes, 4, 1, 0, 2, 3, }, - { huff_sfb_a3_bits, huff_sfb_a3_codes, 8, 1, 0, 3, 6, }, - { huff_sfb_a4_bits, huff_sfb_a4_codes, 16, 1, 0, 4, 8, }, - { huff_sfb_a5_bits, huff_sfb_a5_codes, 32, 1, 0, 5, 8, }, - { huff_sfb_a6_bits, huff_sfb_a6_codes, 64, 1, 0, 6, 8, }, + { huff_sfb_a1_bits, huff_sfb_a1_codes, 2, 1, 0, 1 }, + { huff_sfb_a2_bits, huff_sfb_a2_codes, 4, 1, 0, 2 }, + { huff_sfb_a3_bits, huff_sfb_a3_codes, 8, 1, 0, 3 }, + { huff_sfb_a4_bits, huff_sfb_a4_codes, 16, 1, 0, 4 }, + { huff_sfb_a5_bits, huff_sfb_a5_codes, 32, 1, 0, 5 }, + { huff_sfb_a6_bits, huff_sfb_a6_codes, 64, 1, 0, 6 }, }; static const HuffmanCodebook at9_huffman_sf_signed[] = { { 0 }, { 0 }, - { huff_sfb_b2_bits, huff_sfb_b2_codes, 4, 1, 0, 2, 2, }, - { huff_sfb_b3_bits, huff_sfb_b3_codes, 8, 1, 0, 3, 6, }, - { huff_sfb_b4_bits, huff_sfb_b4_codes, 16, 1, 0, 4, 8, }, - { huff_sfb_b5_bits, huff_sfb_b5_codes, 32, 1, 0, 5, 8, }, + { huff_sfb_b2_bits, huff_sfb_b2_codes, 4, 1, 0, 2 }, + { huff_sfb_b3_bits, huff_sfb_b3_codes, 8, 1, 0, 3 }, + { huff_sfb_b4_bits, huff_sfb_b4_codes, 16, 1, 0, 4 }, + { huff_sfb_b5_bits, huff_sfb_b5_codes, 32, 1, 0, 5 }, }; static const uint8_t huff_spec_a21_bits[] = { @@ -1539,40 +1538,40 @@ static const HuffmanCodebook at9_huffman_coeffs[][8][4] = { { { 0 } }, { { 0 } }, { - { huff_spec_a21_bits, huff_spec_a21_codes, 16, 2, 1, 2, 3, }, - { huff_spec_a22_bits, huff_spec_a22_codes, 256, 4, 2, 2, 8, }, - { huff_spec_a23_bits, huff_spec_a23_codes, 256, 4, 2, 2, 9, }, - { huff_spec_a24_bits, huff_spec_a24_codes, 256, 4, 2, 2, 10, }, + { huff_spec_a21_bits, huff_spec_a21_codes, 16, 2, 1, 2 }, + { huff_spec_a22_bits, huff_spec_a22_codes, 256, 4, 2, 2 }, + { huff_spec_a23_bits, huff_spec_a23_codes, 256, 4, 2, 2 }, + { huff_spec_a24_bits, huff_spec_a24_codes, 256, 4, 2, 2 }, }, { - { huff_spec_a31_bits, huff_spec_a31_codes, 64, 2, 1, 3, 7, }, - { huff_spec_a32_bits, huff_spec_a32_codes, 64, 2, 1, 3, 7, }, - { huff_spec_a33_bits, huff_spec_a33_codes, 64, 2, 1, 3, 8, }, - { huff_spec_a34_bits, huff_spec_a34_codes, 64, 2, 1, 3, 10, }, + { huff_spec_a31_bits, huff_spec_a31_codes, 64, 2, 1, 3 }, + { huff_spec_a32_bits, huff_spec_a32_codes, 64, 2, 1, 3 }, + { huff_spec_a33_bits, huff_spec_a33_codes, 64, 2, 1, 3 }, + { huff_spec_a34_bits, huff_spec_a34_codes, 64, 2, 1, 3 }, }, { - { huff_spec_a41_bits, huff_spec_a41_codes, 256, 2, 1, 4, 9, }, - { huff_spec_a42_bits, huff_spec_a42_codes, 256, 2, 1, 4, 10, }, - { huff_spec_a43_bits, huff_spec_a43_codes, 256, 2, 1, 4, 10, }, - { huff_spec_a44_bits, huff_spec_a44_codes, 256, 2, 1, 4, 10, }, + { huff_spec_a41_bits, huff_spec_a41_codes, 256, 2, 1, 4 }, + { huff_spec_a42_bits, huff_spec_a42_codes, 256, 2, 1, 4 }, + { huff_spec_a43_bits, huff_spec_a43_codes, 256, 2, 1, 4 }, + { huff_spec_a44_bits, huff_spec_a44_codes, 256, 2, 1, 4 }, }, { - { huff_spec_a51_bits, huff_spec_a51_codes, 32, 1, 0, 5, 6, }, - { huff_spec_a52_bits, huff_spec_a52_codes, 32, 1, 0, 5, 6, }, - { huff_spec_a53_bits, huff_spec_a53_codes, 32, 1, 0, 5, 7, }, - { huff_spec_a54_bits, huff_spec_a54_codes, 32, 1, 0, 5, 8, }, + { huff_spec_a51_bits, huff_spec_a51_codes, 32, 1, 0, 5 }, + { huff_spec_a52_bits, huff_spec_a52_codes, 32, 1, 0, 5 }, + { huff_spec_a53_bits, huff_spec_a53_codes, 32, 1, 0, 5 }, + { huff_spec_a54_bits, huff_spec_a54_codes, 32, 1, 0, 5 }, }, { - { huff_spec_a61_bits, huff_spec_a61_codes, 64, 1, 0, 6, 7, }, - { huff_spec_a62_bits, huff_spec_a62_codes, 64, 1, 0, 6, 7, }, - { huff_spec_a63_bits, huff_spec_a63_codes, 64, 1, 0, 6, 8, }, - { huff_spec_a64_bits, huff_spec_a64_codes, 64, 1, 0, 6, 9, }, + { huff_spec_a61_bits, huff_spec_a61_codes, 64, 1, 0, 6 }, + { huff_spec_a62_bits, huff_spec_a62_codes, 64, 1, 0, 6 }, + { huff_spec_a63_bits, huff_spec_a63_codes, 64, 1, 0, 6 }, + { huff_spec_a64_bits, huff_spec_a64_codes, 64, 1, 0, 6 }, }, { - { huff_spec_a71_bits, huff_spec_a71_codes, 128, 1, 0, 7, 8, }, - { huff_spec_a72_bits, huff_spec_a72_codes, 128, 1, 0, 7, 8, }, - { huff_spec_a73_bits, huff_spec_a73_codes, 128, 1, 0, 7, 9, }, - { huff_spec_a74_bits, huff_spec_a74_codes, 128, 1, 0, 7, 10, }, + { huff_spec_a71_bits, huff_spec_a71_codes, 128, 1, 0, 7 }, + { huff_spec_a72_bits, huff_spec_a72_codes, 128, 1, 0, 7 }, + { huff_spec_a73_bits, huff_spec_a73_codes, 128, 1, 0, 7 }, + { huff_spec_a74_bits, huff_spec_a74_codes, 128, 1, 0, 7 }, }, }, { @@ -1580,39 +1579,39 @@ static const HuffmanCodebook at9_huffman_coeffs[][8][4] = { { { 0 } }, { { 0 }, - { huff_spec_b22_bits, huff_spec_b22_codes, 256, 4, 2, 2, 10, }, - { huff_spec_b23_bits, huff_spec_b23_codes, 256, 4, 2, 2, 10, }, - { huff_spec_b24_bits, huff_spec_b24_codes, 256, 4, 2, 2, 10, }, + { huff_spec_b22_bits, huff_spec_b22_codes, 256, 4, 2, 2 }, + { huff_spec_b23_bits, huff_spec_b23_codes, 256, 4, 2, 2 }, + { huff_spec_b24_bits, huff_spec_b24_codes, 256, 4, 2, 2 }, }, { { 0 }, - { huff_spec_b32_bits, huff_spec_b32_codes, 64, 2, 1, 3, 9, }, - { huff_spec_b33_bits, huff_spec_b33_codes, 64, 2, 1, 3, 10, }, - { huff_spec_b34_bits, huff_spec_b34_codes, 64, 2, 1, 3, 10, }, + { huff_spec_b32_bits, huff_spec_b32_codes, 64, 2, 1, 3 }, + { huff_spec_b33_bits, huff_spec_b33_codes, 64, 2, 1, 3 }, + { huff_spec_b34_bits, huff_spec_b34_codes, 64, 2, 1, 3 }, }, { { 0 }, - { huff_spec_b42_bits, huff_spec_b42_codes, 256, 2, 1, 4, 10, }, - { huff_spec_b43_bits, huff_spec_b43_codes, 256, 2, 1, 4, 10, }, - { huff_spec_b44_bits, huff_spec_b44_codes, 256, 2, 1, 4, 10, }, + { huff_spec_b42_bits, huff_spec_b42_codes, 256, 2, 1, 4 }, + { huff_spec_b43_bits, huff_spec_b43_codes, 256, 2, 1, 4 }, + { huff_spec_b44_bits, huff_spec_b44_codes, 256, 2, 1, 4 }, }, { { 0 }, - { huff_spec_b52_bits, huff_spec_b52_codes, 32, 1, 0, 5, 7, }, - { huff_spec_b53_bits, huff_spec_b53_codes, 32, 1, 0, 5, 8, }, - { huff_spec_b54_bits, huff_spec_b54_codes, 32, 1, 0, 5, 9, }, + { huff_spec_b52_bits, huff_spec_b52_codes, 32, 1, 0, 5 }, + { huff_spec_b53_bits, huff_spec_b53_codes, 32, 1, 0, 5 }, + { huff_spec_b54_bits, huff_spec_b54_codes, 32, 1, 0, 5 }, }, { { 0 }, - { huff_spec_b62_bits, huff_spec_b62_codes, 64, 1, 0, 6, 8, }, - { huff_spec_b63_bits, huff_spec_b63_codes, 64, 1, 0, 6, 9, }, - { huff_spec_b64_bits, huff_spec_b64_codes, 64, 1, 0, 6, 10, }, + { huff_spec_b62_bits, huff_spec_b62_codes, 64, 1, 0, 6 }, + { huff_spec_b63_bits, huff_spec_b63_codes, 64, 1, 0, 6 }, + { huff_spec_b64_bits, huff_spec_b64_codes, 64, 1, 0, 6 }, }, { { 0 }, - { huff_spec_b72_bits, huff_spec_b72_codes, 128, 1, 0, 7, 9, }, - { huff_spec_b73_bits, huff_spec_b73_codes, 128, 1, 0, 7, 10, }, - { huff_spec_b74_bits, huff_spec_b74_codes, 128, 1, 0, 7, 10, }, + { huff_spec_b72_bits, huff_spec_b72_codes, 128, 1, 0, 7 }, + { huff_spec_b73_bits, huff_spec_b73_codes, 128, 1, 0, 7 }, + { huff_spec_b74_bits, huff_spec_b74_codes, 128, 1, 0, 7 }, }, }, }; From patchwork Fri Nov 20 07:32:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23864 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 1C0E544B2D5 for ; Fri, 20 Nov 2020 09:46:49 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 22E7568B939; Fri, 20 Nov 2020 09:34:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DDA5D68BC9C for ; Fri, 20 Nov 2020 09:34:16 +0200 (EET) Received: by mail-ed1-f66.google.com with SMTP id q3so8465427edr.12 for ; Thu, 19 Nov 2020 23:34:16 -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=4Tp92Ur2RGs+GrI42juDeTYy8Mdhfw7UMw5jweCYz3s=; b=NJRBTiJrvHPBlpuAvpIaogGJgfroY4mvQg9WluAkxCgHKkqcqRc7pUV0Lw9QNMQiR0 bGJs8nH+MXfPy139un7YqGSmyIvszbC9DXRcLCKXNCLJ4tmW++lswVzid75GsGMw2DWP yp6kGzFfHm0P1oDwCQtPc8ttG3YgHPTVUWbLqOdz1ACC0eAb5SCFbQER8yWZwkGdY/ft JWcWHxzeVkN7ox84kVHxwxL1kBQz+bjOVaRTNuBEG6qVjvZelHn9N0razz0jjXrBrRVS 7pRhP+gCDaB7T40IFQGopygJ3If7HBYIaIHkBQVNeUj8zkEsaRTPxs/XR5TETCtq44oN s0mQ== 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=4Tp92Ur2RGs+GrI42juDeTYy8Mdhfw7UMw5jweCYz3s=; b=iWUz18P38wire1G/Ck7y6wTxB9r8CxLh4hmgJe9Ia/+hfrfi+UdgHXVpQVtI2UtzPK U+DVCtAlKx65UYZD2P8x6DGiXpHChSkRSjmuMUZ/HLh2bCxWm7uqcYF4DEtHrBPiMjRY BtL5DT5GJdskA/usyR3Onq6dGSX56LdaZeBds1znlMOlrxy/AtyMwFlO88k9AJHKgaBg DFxTubPZ1BdMLVo/epMeBCKDdNiYQrM3ZgSOQIVmP5vtOYnkl67j4GMfS0/jupDrPyLh wDIaf3/CfhG+Yd9U97ZmReU8vh6oL0G9x3YxWm5vbhdVDF3GUN4OhbcC31SkJ5w0MOLb cLig== X-Gm-Message-State: AOAM531PQbvaFR639/0UH8b+Ahi7lrQdFkFJorYAA/sPniADt+ZF/uNO gIV1Yj402iKtT0r1D186EpdJIy/FT9HgQQ== X-Google-Smtp-Source: ABdhPJwNPS6eqj4TA0Gcb5hKf//AzHYaJd1+4Z155wDUrJYNwPXuS/LBKdkYV8+9tgInqdPIADJbLg== X-Received: by 2002:a50:b224:: with SMTP id o33mr33005541edd.21.1605857656221; Thu, 19 Nov 2020 23:34:16 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:15 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:39 +0100 Message-Id: <20201120073327.820745-15-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 114/162] avcodec/atrac9dec: Use least max_depth in calls to get_vlc2() 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/atrac9dec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index a1af3c22ef..ecf95f1777 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -272,7 +272,7 @@ static inline int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, c->scalefactors[0] = get_bits(gb, len); for (int i = 1; i < b->band_ext_q_unit; i++) { - int val = c->scalefactors[i - 1] + get_vlc2(gb, tab->table, 9, 2); + int val = c->scalefactors[i - 1] + get_vlc2(gb, tab->table, 9, 1); c->scalefactors[i] = val & ((1 << len) - 1); } @@ -302,7 +302,7 @@ static inline int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, const VLC *tab = &s->sf_vlc[1][len]; for (int i = 0; i < unit_cnt; i++) { - int dist = get_vlc2(gb, tab->table, 9, 2); + int dist = get_vlc2(gb, tab->table, 9, 1); c->scalefactors[i] = baseline[i] + dist; } @@ -325,7 +325,7 @@ static inline int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, c->scalefactors[0] = get_bits(gb, len); for (int i = 1; i < unit_cnt; i++) { - int val = c->scalefactors[i - 1] + get_vlc2(gb, tab->table, 9, 2); + int val = c->scalefactors[i - 1] + get_vlc2(gb, tab->table, 9, 1); c->scalefactors[i] = val & ((1 << len) - 1); } From patchwork Fri Nov 20 07:32:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23859 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 8BFB444B17A for ; Fri, 20 Nov 2020 09:45:50 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0DD0968BCBC; Fri, 20 Nov 2020 09:34:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2444D68BCA2 for ; Fri, 20 Nov 2020 09:34:18 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id f20so11518547ejz.4 for ; Thu, 19 Nov 2020 23:34: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=zAEfyK0D8FCXfVdA+6KrlxkCyINpFblxXGWWtiz0hgM=; b=UwzPdTGK5mVn40NMu31/vkVLY0jHGUa5oJtTIblg5X5WSMpedVgrc2ItToWOKL/xSN hD3YaE5lGPCloEc/Jgdutl6tx+jNBV8K8nW6Hj4g3IntQmhAdW5ACe+VLVcQGl79XsnD fMu7OXDkTfbdsc5BjaEt+PZR9sRki2eaKBnrESvw9rl0k+N7HDerNEUlt/U7NriX1Wc3 wGnA+qCppwFY0EfLFUPlScz7HEwihuOWRNfMPPVK8qrz9ytJhVPMoltQpkhRQ2GKRsvn axDOjCmWeyO7eNnl9uzj3ewDm+WQlw8uXs3eB2g94BxBVT+DGLSSpHlNXHa3RYIrf5pQ G/QQ== 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=zAEfyK0D8FCXfVdA+6KrlxkCyINpFblxXGWWtiz0hgM=; b=gUXAQo4jhS7st2DgNC4Yb1vifuPqsiXp5ZpT/bKQ6tnHQaSEjDn4QrZbMyqPYLudTN OvI3mJ1HKBCdHC42ma+y4IzIRud+SHqMJAn9aINz41vgRRqkxaprVCykxX0OV10MCVSt VHwptoSl+4l+IjIEq9V6HUKl+HPLLB5/ySzLfUZVarr1RLHsGMYu3bms1ZGDgKcBfWFv 29Zs1SNmsQCFiYfdQ77YFRzeS57CRvecsAU6jZ4cnTCb3ZDI+58LBVhfoxsrptIwkrpv 8aNElIk+V+zr7ace4YiChdeeTafkA0d0q1IKwmTBZrHlAel7jZZOIPzzFRpco4iUPzxJ PY5Q== X-Gm-Message-State: AOAM530wcQ37fM+HTB9x3Jp4qmEvOFEPB8VPpvopg5t1StyDnAYGmcHr NrM1BOeGRaTgyLWL4YQoP5PYC6IgTesNig== X-Google-Smtp-Source: ABdhPJxREB2oZYNwkfCL+rRT/k+nzMjLdnCLIp7yE+TpZI6S5XjRH9Dag8t2+dXZqElXYgIanWP7tA== X-Received: by 2002:a17:906:3ac4:: with SMTP id z4mr31661054ejd.92.1605857657122; Thu, 19 Nov 2020 23:34:17 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:16 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:40 +0100 Message-Id: <20201120073327.820745-16-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 115/162] avcodec/atrac9dec: Don't use unnecessarily large VLC tables 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" Using more bits for a VLC than the longest code has has no advantage. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac9dec.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index ecf95f1777..0477b304d2 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -26,6 +26,8 @@ #include "libavutil/lfg.h" #include "libavutil/float_dsp.h" +#define ATRAC9_SF_VLC_BITS 8 + typedef struct ATRAC9ChannelData { int band_ext; int q_unit_cnt; @@ -272,7 +274,8 @@ static inline int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, c->scalefactors[0] = get_bits(gb, len); for (int i = 1; i < b->band_ext_q_unit; i++) { - int val = c->scalefactors[i - 1] + get_vlc2(gb, tab->table, 9, 1); + int val = c->scalefactors[i - 1] + get_vlc2(gb, tab->table, + ATRAC9_SF_VLC_BITS, 1); c->scalefactors[i] = val & ((1 << len) - 1); } @@ -302,7 +305,7 @@ static inline int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, const VLC *tab = &s->sf_vlc[1][len]; for (int i = 0; i < unit_cnt; i++) { - int dist = get_vlc2(gb, tab->table, 9, 1); + int dist = get_vlc2(gb, tab->table, ATRAC9_SF_VLC_BITS, 1); c->scalefactors[i] = baseline[i] + dist; } @@ -325,7 +328,8 @@ static inline int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, c->scalefactors[0] = get_bits(gb, len); for (int i = 1; i < unit_cnt; i++) { - int val = c->scalefactors[i - 1] + get_vlc2(gb, tab->table, 9, 1); + int val = c->scalefactors[i - 1] + get_vlc2(gb, tab->table, + ATRAC9_SF_VLC_BITS, 1); c->scalefactors[i] = val & ((1 << len) - 1); } @@ -930,7 +934,8 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) for (int i = 1; i < 7; i++) { const HuffmanCodebook *hf = &at9_huffman_sf_unsigned[i]; - init_vlc(&s->sf_vlc[0][i], 9, hf->size, hf->bits, 1, 1, hf->codes, + init_vlc(&s->sf_vlc[0][i], ATRAC9_SF_VLC_BITS, hf->size, + hf->bits, 1, 1, hf->codes, 2, 2, 0); } @@ -943,7 +948,7 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) for (int j = 0; j < nums; j++) sym[j] = sign_extend(j, hf->value_bits); - ff_init_vlc_sparse(&s->sf_vlc[1][i], 9, hf->size, hf->bits, 1, 1, + ff_init_vlc_sparse(&s->sf_vlc[1][i], ATRAC9_SF_VLC_BITS, hf->size, hf->bits, 1, 1, hf->codes, 2, 2, sym, sizeof(*sym), sizeof(*sym), 0); } From patchwork Fri Nov 20 07:32:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23869 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 B3F7D448F87 for ; Fri, 20 Nov 2020 09:47:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 773BB68BCFB; Fri, 20 Nov 2020 09:34:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 769C168BCCA for ; Fri, 20 Nov 2020 09:34:23 +0200 (EET) Received: by mail-ej1-f46.google.com with SMTP id f23so11548552ejk.2 for ; Thu, 19 Nov 2020 23:34:23 -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=XF6EQstbn5IbQ4eZLKRphivyupZT4oIWw5z87hq7cw0=; b=Lo4JGJ8euHPEyBcSNLPNRG0on8ThqyIoRxsgsTuznm5XDslZU6Q8Eowval5UHpq4t7 PdKRdCj258JQx3ES466+WaJT0KoYaba/e/4z3liu3Q3Rt9DagSjPowFFnig5mB/tpVTV 1xI6eR0oYv4R9eh9a8qflbNrG6eZSCoy+L/v67pHD+FWvQkvKZgLitDoayKD1/7xdlDg nSOtuUWAQox3RPjz0jHA+MuF0yXlXTMtD1zmj3WYAooDTGqcOwefmL9OpNSznz57n1dz 3fU9YYuCHykriAvoHYA+rQYpqDDYioajnsPVBotRPs3SQzlKbYbcdYyHfy8561rTc9Z9 oLdQ== 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=XF6EQstbn5IbQ4eZLKRphivyupZT4oIWw5z87hq7cw0=; b=CH+Lmi92lEzdSiHN44hOC3iqbP2+2ttTsX25MUESbsm3dXxFHSmr8WACnz6UL/GHUR +VVvGbu+sF4SWGMIYh5EwxPPYimkIvj4aD+55t1ZqdSaMvFTn2B2lTkHYP8VJOQmCnrA lRg8KEUASQpPuD6nCuAocb+smjarmdwebrS0wI6y33fEdWiMvrLST5lgVz7X3Z1JjGef HcLlT06fdfMpedczbpOsqZGqnuFdK8d7KI/W24Jewp2lDkwBw8dGCCWFUvHA76HSP8Ro AZymwKHL0ZCXJqcOU3bJoVUIg8XjGfxSAV5BH1txlxTRSguWPNeahDVxYXhROVyPTWWw iKhQ== X-Gm-Message-State: AOAM5319mrkI+j2dUBPf+DikAisrOeoPL0YYGpaHBPtMs4eWLKux1bhJ eXuczViQ7rBoOA+Nan6chrBD5zpUxgPoMw== X-Google-Smtp-Source: ABdhPJyB83ywaqeTuUndg4i4PWhfEUdh8YtWzCISb9dE8bGAvd1RGvLLLzbgVfULs+D3XXYSstxOJg== X-Received: by 2002:a17:906:9448:: with SMTP id z8mr9483672ejx.105.1605857658703; Thu, 19 Nov 2020 23:34:18 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:17 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:41 +0100 Message-Id: <20201120073327.820745-17-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 116/162] avcodec/atrac9dec: Make tables used to initialize VLCs 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 ATRAC9 decoder uses VLCs which are currently initialized with static length tables of type uint8_t and code tables of type uint16_t. Furthermore, in one case the actually desired symbols are in the range -16..15 and in order to achieve this an ad-hoc symbols table of type int16_t is calculated. This commit modifies this process by replacing the codes tables by symbols tables and switching to ff_init_vlc_from_lengths(); the signed symbols are stored in the table after having been shifted by 16 to fit into an uint8_t and are shifted back when the VLC is created. This makes all symbols fit into an uint8_t, saving space. Furthermore, the earlier tables had holes in them (entries with length zero that were inserted because the actually used symbols were not contiguous); these holes are unnecessary in the new approach, leading to further saving. Finally, given that now both lengths as well as symbols are of the same type, they can be combined; this saves a pointer for each VLC. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac9dec.c | 31 +- libavcodec/atrac9tab.h | 2185 +++++++++++++++++++--------------------- 2 files changed, 1038 insertions(+), 1178 deletions(-) diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index 0477b304d2..9707077238 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -848,6 +848,7 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) GetBitContext gb; ATRAC9Context *s = avctx->priv_data; int version, block_config_idx, superframe_idx, alloc_c_len; + int ret; s->avctx = avctx; @@ -934,22 +935,25 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) for (int i = 1; i < 7; i++) { const HuffmanCodebook *hf = &at9_huffman_sf_unsigned[i]; - init_vlc(&s->sf_vlc[0][i], ATRAC9_SF_VLC_BITS, hf->size, - hf->bits, 1, 1, hf->codes, - 2, 2, 0); + ret = ff_init_vlc_from_lengths(&s->sf_vlc[0][i], ATRAC9_SF_VLC_BITS, + hf->size, &hf->tab[0][1], 2, + &hf->tab[0][0], 2, 1, 0, 0, avctx); + if (ret < 0) + return ret; } /* Signed scalefactor VLCs */ for (int i = 2; i < 6; i++) { const HuffmanCodebook *hf = &at9_huffman_sf_signed[i]; - int nums = hf->size; - int16_t sym[32]; - for (int j = 0; j < nums; j++) - sym[j] = sign_extend(j, hf->value_bits); - - ff_init_vlc_sparse(&s->sf_vlc[1][i], ATRAC9_SF_VLC_BITS, hf->size, hf->bits, 1, 1, - hf->codes, 2, 2, sym, sizeof(*sym), sizeof(*sym), 0); + /* The symbols are signed integers in the range -16..15; + * the values in the source table are offset by 16 to make + * them fit into an uint8_t; the -16 reverses this shift. */ + ret = ff_init_vlc_from_lengths(&s->sf_vlc[1][i], ATRAC9_SF_VLC_BITS, + hf->size, &hf->tab[0][1], 2, + &hf->tab[0][0], 2, 1, -16, 0, avctx); + if (ret < 0) + return ret; } /* Coefficient VLCs */ @@ -957,8 +961,11 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) for (int j = 0; j < 8; j++) { for (int k = 0; k < 4; k++) { const HuffmanCodebook *hf = &at9_huffman_coeffs[i][j][k]; - init_vlc(&s->coeff_vlc[i][j][k], 9, hf->size, hf->bits, 1, 1, - hf->codes, 2, 2, 0); + ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i][j][k], 9, + hf->size, &hf->tab[0][1], 2, + &hf->tab[0][0], 2, 1, 0, 0, avctx); + if (ret < 0) + return ret; } } } diff --git a/libavcodec/atrac9tab.h b/libavcodec/atrac9tab.h index c25d0e2744..c62b8070d0 100644 --- a/libavcodec/atrac9tab.h +++ b/libavcodec/atrac9tab.h @@ -373,105 +373,70 @@ static const uint8_t at9_tab_b_dist[] = { 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, }; -static const uint8_t huff_sfb_a1_bits[] = { - 1, 1, +static const uint8_t huff_sfb_a1_tab[2][2] = { + { 0, 1 }, { 1, 1 }, }; -static const uint16_t huff_sfb_a1_codes[] = { - 0x00, 0x01, +static const uint8_t huff_sfb_a2_tab[4][2] = { + { 0, 1 }, { 3, 2 }, { 1, 3 }, { 2, 3 }, }; -static const uint8_t huff_sfb_a2_bits[] = { - 1, 3, 3, 2, +static const uint8_t huff_sfb_a3_tab[8][2] = { + { 0, 2 }, { 1, 2 }, { 7, 2 }, { 6, 3 }, { 2, 4 }, { 5, 5 }, { 3, 6 }, + { 4, 6 }, }; -static const uint16_t huff_sfb_a2_codes[] = { - 0x00, 0x06, 0x07, 0x02, +static const uint8_t huff_sfb_a4_tab[16][2] = { + { 2, 4 }, { 14, 4 }, { 11, 8 }, { 10, 8 }, { 9, 8 }, { 6, 8 }, { 7, 8 }, + { 8, 8 }, { 5, 7 }, { 13, 5 }, { 3, 5 }, { 12, 6 }, { 4, 6 }, { 0, 2 }, + { 1, 2 }, { 15, 2 }, }; -static const uint8_t huff_sfb_a3_bits[] = { - 2, 2, 4, 6, 6, 5, 3, 2, +static const uint8_t huff_sfb_a5_tab[32][2] = { + { 31, 3 }, { 1, 3 }, { 26, 7 }, { 7, 7 }, { 20, 8 }, { 21, 8 }, { 23, 8 }, + { 22, 8 }, { 29, 5 }, { 30, 4 }, { 4, 5 }, { 11, 8 }, { 24, 8 }, { 9, 8 }, + { 10, 8 }, { 6, 6 }, { 25, 7 }, { 19, 8 }, { 12, 8 }, { 27, 6 }, { 18, 8 }, + { 13, 8 }, { 16, 8 }, { 17, 8 }, { 14, 8 }, { 15, 8 }, { 8, 7 }, { 0, 2 }, + { 5, 5 }, { 28, 5 }, { 3, 4 }, { 2, 3 }, }; -static const uint16_t huff_sfb_a3_codes[] = { - 0x00, 0x01, 0x0E, 0x3E, 0x3F, 0x1E, 0x06, 0x02, +static const uint8_t huff_sfb_a6_tab[64][2] = { + { 0, 3 }, { 1, 3 }, { 2, 4 }, { 3, 4 }, { 61, 4 }, { 62, 4 }, { 63, 4 }, + { 4, 5 }, { 5, 5 }, { 58, 5 }, { 59, 5 }, { 60, 5 }, { 6, 6 }, { 7, 6 }, + { 8, 6 }, { 56, 6 }, { 57, 6 }, { 9, 7 }, { 10, 7 }, { 53, 7 }, { 54, 7 }, + { 55, 7 }, { 11, 8 }, { 12, 8 }, { 13, 8 }, { 14, 8 }, { 15, 8 }, { 16, 8 }, + { 17, 8 }, { 18, 8 }, { 19, 8 }, { 20, 8 }, { 21, 8 }, { 22, 8 }, { 23, 8 }, + { 24, 8 }, { 25, 8 }, { 26, 8 }, { 27, 8 }, { 28, 8 }, { 29, 8 }, { 30, 8 }, + { 31, 8 }, { 32, 8 }, { 33, 8 }, { 34, 8 }, { 35, 8 }, { 36, 8 }, { 37, 8 }, + { 38, 8 }, { 39, 8 }, { 40, 8 }, { 41, 8 }, { 42, 8 }, { 43, 8 }, { 44, 8 }, + { 45, 8 }, { 46, 8 }, { 47, 8 }, { 48, 8 }, { 49, 8 }, { 50, 8 }, { 51, 8 }, + { 52, 8 }, }; -static const uint8_t huff_sfb_a4_bits[] = { - 2, 2, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 6, 5, 4, 2, +static const uint8_t huff_sfb_b2_tab[3][2] = { + { 16, 1 }, { 15, 2 }, { 17, 2 }, }; -static const uint16_t huff_sfb_a4_codes[] = { - 0x01, 0x02, 0x00, 0x06, 0x0F, 0x13, 0x23, 0x24, - 0x25, 0x22, 0x21, 0x20, 0x0E, 0x05, 0x01, 0x03, +static const uint8_t huff_sfb_b3_tab[7][2] = { + { 17, 3 }, { 18, 5 }, { 13, 6 }, { 19, 6 }, { 14, 4 }, { 15, 2 }, { 16, 1 }, }; -static const uint8_t huff_sfb_a5_bits[] = { - 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 6, 5, 5, 4, 3, +static const uint8_t huff_sfb_b4_tab[15][2] = { + { 15, 3 }, { 17, 3 }, { 18, 4 }, { 13, 6 }, { 12, 6 }, { 21, 7 }, { 22, 8 }, + { 10, 8 }, { 9, 8 }, { 23, 8 }, { 11, 7 }, { 14, 4 }, { 19, 5 }, { 20, 5 }, + { 16, 1 }, }; -static const uint16_t huff_sfb_a5_codes[] = { - 0x02, 0x01, 0x07, 0x0D, 0x0C, 0x18, 0x1B, 0x21, 0x3F, 0x6A, 0x6B, 0x68, - 0x73, 0x79, 0x7C, 0x7D, 0x7A, 0x7B, 0x78, 0x72, 0x44, 0x45, 0x47, 0x46, - 0x69, 0x38, 0x20, 0x1D, 0x19, 0x09, 0x05, 0x00, -}; - -static const uint8_t huff_sfb_a6_bits[] = { - 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 7, 7, 7, 6, 6, 5, 5, 5, 4, 4, 4, -}; - -static const uint16_t huff_sfb_a6_codes[] = { - 0x00, 0x01, 0x04, 0x05, 0x12, 0x13, 0x2E, 0x2F, 0x30, 0x66, 0x67, 0xD6, - 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0xE0, 0xE1, 0xE2, - 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, - 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, - 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, 0x68, 0x69, 0x6A, 0x31, 0x32, 0x14, 0x15, - 0x16, 0x06, 0x07, 0x08, -}; - -static const uint8_t huff_sfb_b2_bits[] = { - 1, 2, 0, 2, -}; - -static const uint16_t huff_sfb_b2_codes[] = { - 0x00, 0x03, 0x00, 0x02, -}; - -static const uint8_t huff_sfb_b3_bits[] = { - 1, 3, 5, 6, 0, 6, 4, 2, -}; - -static const uint16_t huff_sfb_b3_codes[] = { - 0x01, 0x00, 0x04, 0x0B, 0x00, 0x0A, 0x03, 0x01, -}; - -static const uint8_t huff_sfb_b4_bits[] = { - 1, 3, 4, 5, 5, 7, 8, 8, 0, 8, 8, 7, 6, 6, 4, 3, -}; - -static const uint16_t huff_sfb_b4_codes[] = { - 0x01, 0x01, 0x04, 0x0E, 0x0F, 0x2C, 0x5A, 0x5D, 0x00, 0x5C, 0x5B, 0x2F, - 0x15, 0x14, 0x06, 0x00, -}; - -static const uint8_t huff_sfb_b5_bits[] = { - 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 7, 7, 8, 8, - 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 3, -}; - -static const uint16_t huff_sfb_b5_codes[] = { - 0x00, 0x05, 0x07, 0x0C, 0x04, 0x02, 0x03, 0x05, 0x09, 0x10, 0x23, 0x33, - 0x36, 0x6E, 0x60, 0x65, 0x62, 0x61, 0x63, 0x64, 0x6F, 0x6D, 0x6C, 0x6B, - 0x6A, 0x68, 0x69, 0x45, 0x44, 0x37, 0x1A, 0x07, +static const uint8_t huff_sfb_b5_tab[32][2] = { + { 16, 3 }, { 21, 4 }, { 22, 4 }, { 20, 4 }, { 23, 4 }, { 30, 8 }, { 1, 8 }, + { 0, 8 }, { 2, 8 }, { 3, 8 }, { 31, 8 }, { 27, 7 }, { 14, 6 }, { 28, 7 }, + { 13, 7 }, { 18, 4 }, { 25, 5 }, { 12, 7 }, { 11, 7 }, { 26, 6 }, { 24, 4 }, + { 17, 3 }, { 19, 4 }, { 9, 7 }, { 10, 7 }, { 8, 7 }, { 7, 7 }, { 6, 7 }, + { 5, 7 }, { 29, 7 }, { 4, 7 }, { 15, 3 }, }; typedef struct HuffmanCodebook { - const uint8_t *bits; - const uint16_t *codes; + const uint8_t (*tab)[2]; const int size; const int value_cnt; const int value_cnt_pow; @@ -480,1057 +445,945 @@ typedef struct HuffmanCodebook { static const HuffmanCodebook at9_huffman_sf_unsigned[] = { { 0 }, - { huff_sfb_a1_bits, huff_sfb_a1_codes, 2, 1, 0, 1 }, - { huff_sfb_a2_bits, huff_sfb_a2_codes, 4, 1, 0, 2 }, - { huff_sfb_a3_bits, huff_sfb_a3_codes, 8, 1, 0, 3 }, - { huff_sfb_a4_bits, huff_sfb_a4_codes, 16, 1, 0, 4 }, - { huff_sfb_a5_bits, huff_sfb_a5_codes, 32, 1, 0, 5 }, - { huff_sfb_a6_bits, huff_sfb_a6_codes, 64, 1, 0, 6 }, + { huff_sfb_a1_tab, 2, 1, 0, 1 }, + { huff_sfb_a2_tab, 4, 1, 0, 2 }, + { huff_sfb_a3_tab, 8, 1, 0, 3 }, + { huff_sfb_a4_tab, 16, 1, 0, 4 }, + { huff_sfb_a5_tab, 32, 1, 0, 5 }, + { huff_sfb_a6_tab, 64, 1, 0, 6 }, }; static const HuffmanCodebook at9_huffman_sf_signed[] = { { 0 }, { 0 }, - { huff_sfb_b2_bits, huff_sfb_b2_codes, 4, 1, 0, 2 }, - { huff_sfb_b3_bits, huff_sfb_b3_codes, 8, 1, 0, 3 }, - { huff_sfb_b4_bits, huff_sfb_b4_codes, 16, 1, 0, 4 }, - { huff_sfb_b5_bits, huff_sfb_b5_codes, 32, 1, 0, 5 }, -}; - -static const uint8_t huff_spec_a21_bits[] = { - 0, 3, 0, 3, 3, 3, 0, 3, 0, 0, 0, 0, 3, 3, 0, 3, -}; - -static const uint16_t huff_spec_a21_codes[] = { - 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x06, -}; - -static const uint8_t huff_spec_a22_bits[] = { - 0, 4, 0, 4, 5, 6, 0, 6, 0, 0, 0, 0, 5, 6, 0, 6, - 5, 6, 0, 6, 6, 7, 0, 7, 0, 0, 0, 0, 6, 7, 0, 7, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 6, 0, 6, 6, 7, 0, 7, 0, 0, 0, 0, 6, 7, 0, 7, - 5, 6, 0, 6, 7, 7, 0, 7, 0, 0, 0, 0, 6, 7, 0, 7, - 6, 7, 0, 7, 7, 8, 0, 8, 0, 0, 0, 0, 7, 8, 0, 7, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 6, 7, 0, 7, 7, 8, 0, 8, 0, 0, 0, 0, 7, 7, 0, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 6, 0, 6, 6, 7, 0, 7, 0, 0, 0, 0, 7, 7, 0, 7, - 6, 7, 0, 7, 7, 8, 0, 7, 0, 0, 0, 0, 7, 8, 0, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 6, 7, 0, 7, 7, 7, 0, 8, 0, 0, 0, 0, 7, 8, 0, 8, -}; - -static const uint16_t huff_spec_a22_codes[] = { - 0x00, 0x02, 0x00, 0x03, 0x10, 0x3C, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x11, 0x3E, 0x00, 0x3D, - 0x0E, 0x00, 0x00, 0x39, 0x18, 0x26, 0x00, 0x75, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x24, 0x00, 0x6D, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0F, 0x38, 0x00, 0x01, 0x1A, 0x6C, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x19, 0x74, 0x00, 0x27, - 0x16, 0x14, 0x00, 0x17, 0x76, 0x06, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x35, 0x64, 0x00, 0x6F, - 0x26, 0x04, 0x00, 0x63, 0x22, 0xA2, 0x00, 0x97, 0x00, 0x00, 0x00, 0x00, 0x67, 0xA0, 0x00, 0x0D, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2B, 0x52, 0x00, 0x0B, 0x20, 0x92, 0x00, 0x91, 0x00, 0x00, 0x00, 0x00, 0x61, 0x0E, 0x00, 0x95, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x17, 0x16, 0x00, 0x15, 0x34, 0x6E, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x77, 0x08, 0x00, 0x07, - 0x2A, 0x0A, 0x00, 0x53, 0x60, 0x94, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x21, 0x90, 0x00, 0x93, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x27, 0x62, 0x00, 0x05, 0x66, 0x0C, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x23, 0x96, 0x00, 0xA3, -}; - -static const uint8_t huff_spec_a23_bits[] = { - 3, 4, 0, 4, 5, 6, 0, 6, 0, 0, 0, 0, 5, 6, 0, 6, - 5, 7, 0, 6, 6, 8, 0, 7, 0, 0, 0, 0, 6, 8, 0, 7, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 6, 0, 7, 6, 7, 0, 8, 0, 0, 0, 0, 6, 7, 0, 8, - 5, 6, 0, 6, 7, 8, 0, 8, 0, 0, 0, 0, 6, 7, 0, 7, - 6, 8, 0, 7, 8, 9, 0, 9, 0, 0, 0, 0, 7, 9, 0, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 6, 8, 0, 8, 8, 9, 0, 9, 0, 0, 0, 0, 7, 8, 0, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 6, 0, 6, 6, 7, 0, 7, 0, 0, 0, 0, 7, 8, 0, 8, - 6, 8, 0, 8, 7, 9, 0, 8, 0, 0, 0, 0, 8, 9, 0, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 6, 7, 0, 8, 7, 8, 0, 9, 0, 0, 0, 0, 8, 9, 0, 9, -}; - -static const uint16_t huff_spec_a23_codes[] = { - 0x006, 0x002, 0x000, 0x003, 0x016, 0x01E, 0x000, 0x021, 0x000, 0x000, 0x000, 0x000, - 0x017, 0x020, 0x000, 0x01F, 0x01C, 0x054, 0x000, 0x027, 0x010, 0x0A6, 0x000, 0x027, - 0x000, 0x000, 0x000, 0x000, 0x015, 0x0A4, 0x000, 0x02D, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x01D, 0x026, 0x000, 0x055, 0x014, 0x02C, 0x000, 0x0A5, 0x000, 0x000, 0x000, 0x000, - 0x011, 0x026, 0x000, 0x0A7, 0x01E, 0x000, 0x000, 0x003, 0x04A, 0x074, 0x000, 0x071, - 0x000, 0x000, 0x000, 0x000, 0x023, 0x00A, 0x000, 0x009, 0x018, 0x072, 0x000, 0x00D, - 0x0A2, 0x15A, 0x000, 0x123, 0x000, 0x000, 0x000, 0x000, 0x00F, 0x158, 0x000, 0x05D, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x01B, 0x0AE, 0x000, 0x077, 0x092, 0x140, 0x000, 0x121, - 0x000, 0x000, 0x000, 0x000, 0x025, 0x05E, 0x000, 0x143, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x01F, 0x002, 0x000, 0x001, 0x022, 0x008, 0x000, 0x00B, 0x000, 0x000, 0x000, 0x000, - 0x04B, 0x070, 0x000, 0x075, 0x01A, 0x076, 0x000, 0x0AF, 0x024, 0x142, 0x000, 0x05F, - 0x000, 0x000, 0x000, 0x000, 0x093, 0x120, 0x000, 0x141, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x019, 0x00C, 0x000, 0x073, 0x00E, 0x05C, 0x000, 0x159, 0x000, 0x000, 0x000, 0x000, - 0x0A3, 0x122, 0x000, 0x15B, -}; - -static const uint8_t huff_spec_a24_bits[] = { - 2, 4, 0, 4, 5, 6, 0, 6, 0, 0, 0, 0, 5, 6, 0, 6, - 5, 7, 0, 6, 6, 8, 0, 8, 0, 0, 0, 0, 6, 8, 0, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 6, 0, 7, 6, 8, 0, 8, 0, 0, 0, 0, 6, 8, 0, 8, - 5, 7, 0, 7, 7, 9, 0, 9, 0, 0, 0, 0, 6, 8, 0, 8, - 6, 9, 0, 8, 8, 10, 0, 10, 0, 0, 0, 0, 8, 10, 0, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 6, 8, 0, 9, 9, 10, 0, 10, 0, 0, 0, 0, 8, 9, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 7, 0, 7, 6, 8, 0, 8, 0, 0, 0, 0, 7, 9, 0, 9, - 6, 9, 0, 8, 8, 10, 0, 9, 0, 0, 0, 0, 9, 10, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 6, 8, 0, 9, 8, 9, 0, 10, 0, 0, 0, 0, 8, 10, 0, 10, -}; - -static const uint16_t huff_spec_a24_codes[] = { - 0x002, 0x002, 0x000, 0x003, 0x01E, 0x010, 0x000, 0x013, 0x000, 0x000, 0x000, 0x000, - 0x01F, 0x012, 0x000, 0x011, 0x01A, 0x030, 0x000, 0x01B, 0x000, 0x064, 0x000, 0x0C1, - 0x000, 0x000, 0x000, 0x000, 0x003, 0x052, 0x000, 0x07D, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x01B, 0x01A, 0x000, 0x031, 0x002, 0x07C, 0x000, 0x053, 0x000, 0x000, 0x000, 0x000, - 0x001, 0x0C0, 0x000, 0x065, 0x01C, 0x062, 0x000, 0x065, 0x02A, 0x198, 0x000, 0x19B, - 0x000, 0x000, 0x000, 0x000, 0x017, 0x078, 0x000, 0x07B, 0x004, 0x0FE, 0x000, 0x077, - 0x050, 0x33A, 0x000, 0x1F9, 0x000, 0x000, 0x000, 0x000, 0x073, 0x338, 0x000, 0x0E1, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x007, 0x066, 0x000, 0x187, 0x19E, 0x308, 0x000, 0x30B, - 0x000, 0x000, 0x000, 0x000, 0x075, 0x0E2, 0x000, 0x1FB, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x01D, 0x064, 0x000, 0x063, 0x016, 0x07A, 0x000, 0x079, 0x000, 0x000, 0x000, 0x000, - 0x02B, 0x19A, 0x000, 0x199, 0x006, 0x186, 0x000, 0x067, 0x074, 0x1FA, 0x000, 0x0E3, - 0x000, 0x000, 0x000, 0x000, 0x19F, 0x30A, 0x000, 0x309, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x005, 0x076, 0x000, 0x0FF, 0x072, 0x0E0, 0x000, 0x339, 0x000, 0x000, 0x000, 0x000, - 0x051, 0x1F8, 0x000, 0x33B, -}; - -static const uint8_t huff_spec_a31_bits[] = { - 0, 0, 4, 5, 0, 5, 4, 0, 0, 0, 5, 5, 0, 5, 5, 0, - 5, 5, 6, 6, 0, 6, 5, 5, 5, 6, 6, 7, 0, 7, 6, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 6, 7, 0, 7, 6, 6, - 5, 5, 5, 6, 0, 6, 6, 5, 0, 0, 5, 5, 0, 5, 5, 0, -}; - -static const uint16_t huff_spec_a31_codes[] = { - 0x00, 0x00, 0x02, 0x18, 0x00, 0x19, 0x03, 0x00, 0x00, 0x00, 0x12, 0x02, 0x00, 0x09, 0x15, 0x00, - 0x1A, 0x0A, 0x3E, 0x2C, 0x00, 0x2F, 0x01, 0x0D, 0x0E, 0x38, 0x20, 0x78, 0x00, 0x7B, 0x23, 0x3B, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x3A, 0x22, 0x7A, 0x00, 0x79, 0x21, 0x39, - 0x1B, 0x0C, 0x00, 0x2E, 0x00, 0x2D, 0x3F, 0x0B, 0x00, 0x00, 0x14, 0x08, 0x00, 0x03, 0x13, 0x00, -}; - -static const uint8_t huff_spec_a32_bits[] = { - 4, 5, 5, 6, 0, 6, 5, 5, 5, 6, 5, 6, 0, 6, 5, 5, - 5, 5, 6, 7, 0, 7, 6, 5, 6, 6, 7, 7, 0, 7, 7, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 7, 7, 0, 7, 7, 6, - 5, 5, 6, 7, 0, 7, 6, 5, 5, 5, 5, 6, 0, 6, 5, 6, -}; - -static const uint16_t huff_spec_a32_codes[] = { - 0x0D, 0x18, 0x16, 0x3A, 0x00, 0x3B, 0x17, 0x19, 0x12, 0x3E, 0x08, 0x1C, 0x00, 0x1B, 0x07, 0x01, - 0x10, 0x02, 0x28, 0x78, 0x00, 0x7B, 0x1F, 0x05, 0x2A, 0x16, 0x72, 0x2A, 0x00, 0x29, 0x71, 0x19, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x18, 0x70, 0x28, 0x00, 0x2B, 0x73, 0x17, - 0x11, 0x04, 0x1E, 0x7A, 0x00, 0x79, 0x29, 0x03, 0x13, 0x00, 0x06, 0x1A, 0x00, 0x1D, 0x09, 0x3F, -}; - -static const uint8_t huff_spec_a33_bits[] = { - 3, 4, 5, 6, 0, 6, 5, 4, 4, 5, 6, 7, 0, 7, 6, 5, - 5, 6, 6, 7, 0, 7, 6, 6, 6, 7, 8, 8, 0, 8, 8, 7, - 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 8, 0, 8, 8, 7, - 5, 6, 6, 7, 0, 7, 6, 6, 4, 5, 6, 7, 0, 7, 6, 5, -}; - -static const uint16_t huff_spec_a33_codes[] = { - 0x05, 0x06, 0x10, 0x08, 0x00, 0x09, 0x11, 0x07, 0x04, 0x12, 0x3E, 0x6A, 0x00, 0x6D, 0x3D, 0x19, - 0x06, 0x3A, 0x06, 0x02, 0x00, 0x01, 0x05, 0x39, 0x02, 0x16, 0xDC, 0x2A, 0x00, 0x29, 0xDF, 0x69, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x68, 0xDE, 0x28, 0x00, 0x2B, 0xDD, 0x17, - 0x07, 0x38, 0x04, 0x00, 0x00, 0x03, 0x07, 0x3B, 0x05, 0x18, 0x3C, 0x6C, 0x00, 0x6B, 0x3F, 0x13, -}; - -static const uint8_t huff_spec_a34_bits[] = { - 2, 4, 5, 7, 0, 7, 5, 4, 4, 5, 6, 8, 0, 8, 6, 5, - 5, 6, 7, 8, 0, 8, 7, 6, 7, 8, 8, 10, 0, 10, 9, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 0, 10, 8, 8, - 5, 6, 7, 8, 0, 8, 7, 6, 4, 5, 6, 8, 0, 8, 6, 5, -}; - -static const uint16_t huff_spec_a34_codes[] = { - 0x000, 0x00A, 0x00A, 0x034, 0x000, 0x035, 0x00B, 0x00B, 0x008, 0x01C, 0x032, 0x0DA, - 0x000, 0x0DD, 0x035, 0x01F, 0x008, 0x01E, 0x03A, 0x06C, 0x000, 0x063, 0x039, 0x031, - 0x032, 0x06E, 0x060, 0x37A, 0x000, 0x379, 0x1BF, 0x0D9, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x033, 0x0D8, 0x1BE, 0x378, 0x000, 0x37B, 0x061, 0x06F, - 0x009, 0x030, 0x038, 0x062, 0x000, 0x06D, 0x03B, 0x01F, 0x009, 0x01E, 0x034, 0x0DC, - 0x000, 0x0DB, 0x033, 0x01D, -}; - -static const uint8_t huff_spec_a41_bits[] = { - 0, 0, 0, 0, 6, 6, 7, 7, 0, 7, 7, 6, 6, 0, 0, 0, - 0, 0, 0, 0, 7, 7, 7, 7, 0, 7, 7, 7, 6, 0, 0, 0, - 0, 0, 0, 0, 7, 7, 7, 8, 0, 8, 7, 7, 7, 0, 0, 0, - 0, 0, 0, 0, 7, 7, 8, 8, 0, 8, 8, 7, 7, 0, 0, 0, - 7, 7, 7, 8, 7, 8, 8, 8, 0, 8, 8, 8, 7, 8, 7, 7, - 7, 7, 7, 7, 8, 8, 8, 9, 0, 8, 8, 8, 8, 7, 7, 7, - 7, 7, 8, 8, 8, 8, 9, 9, 0, 9, 8, 8, 8, 8, 8, 7, - 8, 8, 8, 8, 8, 9, 9, 9, 0, 9, 9, 9, 8, 8, 8, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 8, 8, 8, 8, 9, 9, 9, 0, 9, 9, 9, 8, 8, 8, 8, - 7, 7, 8, 8, 8, 8, 8, 9, 0, 9, 9, 8, 8, 8, 8, 7, - 7, 7, 7, 7, 8, 8, 8, 8, 0, 9, 8, 8, 8, 7, 7, 7, - 7, 7, 7, 8, 7, 8, 8, 8, 0, 8, 8, 8, 7, 8, 7, 7, - 0, 0, 0, 0, 7, 7, 8, 8, 0, 8, 8, 7, 7, 0, 0, 0, - 0, 0, 0, 0, 7, 7, 7, 8, 0, 8, 7, 7, 7, 0, 0, 0, - 0, 0, 0, 0, 6, 7, 7, 7, 0, 7, 7, 7, 7, 0, 0, 0, -}; - -static const uint16_t huff_spec_a41_codes[] = { - 0x000, 0x000, 0x000, 0x000, 0x018, 0x00E, 0x05E, 0x028, 0x000, 0x029, 0x05F, 0x00F, - 0x019, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x076, 0x06E, 0x03E, 0x004, - 0x000, 0x017, 0x045, 0x07B, 0x013, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x04A, 0x048, 0x010, 0x0CE, 0x000, 0x0E1, 0x023, 0x055, 0x053, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x008, 0x018, 0x0D6, 0x09E, 0x000, 0x09D, 0x0E5, 0x02B, - 0x01B, 0x000, 0x000, 0x000, 0x07C, 0x05C, 0x038, 0x0FC, 0x002, 0x0D2, 0x09A, 0x05C, - 0x000, 0x06B, 0x0A3, 0x0D9, 0x00F, 0x0FF, 0x03D, 0x061, 0x074, 0x056, 0x036, 0x000, - 0x0CC, 0x08C, 0x058, 0x1E2, 0x000, 0x00F, 0x05F, 0x0A1, 0x0D5, 0x00D, 0x03B, 0x059, - 0x040, 0x014, 0x0DA, 0x0B6, 0x084, 0x040, 0x1E0, 0x196, 0x000, 0x1A1, 0x00D, 0x043, - 0x087, 0x0C7, 0x0E3, 0x00B, 0x0F2, 0x0C4, 0x08E, 0x05A, 0x024, 0x1CC, 0x194, 0x168, - 0x000, 0x16B, 0x1A3, 0x1CF, 0x027, 0x069, 0x099, 0x0C9, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x0F3, 0x0C8, 0x098, 0x068, 0x026, 0x1CE, 0x1A2, 0x16A, 0x000, 0x169, 0x195, 0x1CD, - 0x025, 0x05B, 0x08F, 0x0C5, 0x041, 0x00A, 0x0E2, 0x0C6, 0x086, 0x042, 0x00C, 0x1A0, - 0x000, 0x197, 0x1E1, 0x041, 0x085, 0x0B7, 0x0DB, 0x015, 0x075, 0x058, 0x03A, 0x00C, - 0x0D4, 0x0A0, 0x05E, 0x00E, 0x000, 0x1E3, 0x059, 0x08D, 0x0CD, 0x001, 0x037, 0x057, - 0x07D, 0x060, 0x03C, 0x0FE, 0x00E, 0x0D8, 0x0A2, 0x06A, 0x000, 0x05D, 0x09B, 0x0D3, - 0x003, 0x0FD, 0x039, 0x05D, 0x000, 0x000, 0x000, 0x000, 0x01A, 0x02A, 0x0E4, 0x09C, - 0x000, 0x09F, 0x0D7, 0x019, 0x009, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x052, 0x054, 0x022, 0x0E0, 0x000, 0x0CF, 0x011, 0x049, 0x04B, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x012, 0x07A, 0x044, 0x016, 0x000, 0x005, 0x03F, 0x06F, - 0x077, 0x000, 0x000, 0x000, -}; - -static const uint8_t huff_spec_a42_bits[] = { - 5, 6, 7, 7, 7, 7, 8, 8, 0, 8, 8, 7, 7, 7, 7, 6, - 6, 7, 7, 8, 7, 7, 8, 8, 0, 8, 8, 7, 7, 8, 7, 7, - 7, 7, 8, 8, 7, 8, 8, 9, 0, 9, 8, 8, 7, 8, 8, 7, - 8, 8, 8, 8, 8, 8, 8, 9, 0, 9, 8, 8, 8, 8, 8, 8, - 7, 7, 7, 8, 8, 8, 9, 9, 0, 9, 9, 8, 8, 8, 7, 7, - 7, 7, 8, 8, 8, 9, 9, 9, 0, 9, 9, 9, 8, 8, 8, 7, - 8, 8, 8, 8, 9, 9, 9, 10, 0, 10, 9, 9, 9, 8, 8, 8, - 8, 8, 9, 9, 9, 9, 10, 10, 0, 10, 10, 9, 9, 9, 9, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 9, 9, 9, 9, 9, 10, 10, 0, 10, 10, 9, 9, 9, 9, 8, - 8, 8, 8, 8, 9, 9, 9, 10, 0, 10, 9, 9, 9, 8, 8, 8, - 7, 7, 8, 8, 8, 9, 9, 9, 0, 9, 9, 9, 8, 8, 8, 7, - 7, 7, 7, 8, 8, 8, 9, 9, 0, 9, 9, 8, 8, 8, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 9, 0, 9, 8, 8, 8, 8, 8, 8, - 7, 7, 8, 8, 7, 8, 8, 9, 0, 9, 8, 8, 7, 8, 8, 7, - 6, 7, 7, 8, 7, 7, 8, 8, 0, 8, 8, 7, 7, 8, 7, 7, -}; - -static const uint16_t huff_spec_a42_codes[] = { - 0x003, 0x018, 0x058, 0x000, 0x066, 0x03C, 0x0D6, 0x07C, 0x000, 0x07D, 0x0D7, 0x03D, - 0x067, 0x001, 0x059, 0x019, 0x002, 0x064, 0x036, 0x0DA, 0x04C, 0x01C, 0x0BE, 0x02C, - 0x000, 0x037, 0x0C5, 0x029, 0x04B, 0x0E7, 0x03B, 0x069, 0x044, 0x02E, 0x0FA, 0x092, - 0x020, 0x0F8, 0x086, 0x1FC, 0x000, 0x1E7, 0x07F, 0x0F5, 0x023, 0x0AD, 0x0FD, 0x02D, - 0x0F6, 0x0DC, 0x09C, 0x03E, 0x0F0, 0x0B6, 0x026, 0x186, 0x000, 0x18D, 0x02F, 0x0B5, - 0x0E1, 0x03D, 0x0AF, 0x0D9, 0x054, 0x040, 0x014, 0x0EC, 0x0BC, 0x054, 0x1C6, 0x108, - 0x000, 0x10B, 0x1C5, 0x069, 0x0B9, 0x0DF, 0x019, 0x047, 0x026, 0x008, 0x0E4, 0x0A2, - 0x056, 0x1DC, 0x142, 0x06A, 0x000, 0x091, 0x123, 0x1DF, 0x04B, 0x0A7, 0x0EB, 0x00B, - 0x0C0, 0x09E, 0x06A, 0x022, 0x1AA, 0x140, 0x092, 0x3CA, 0x000, 0x3A7, 0x04B, 0x121, - 0x18F, 0x007, 0x071, 0x0A5, 0x020, 0x004, 0x1A8, 0x174, 0x0E4, 0x068, 0x3A4, 0x2EE, - 0x000, 0x2ED, 0x3C9, 0x049, 0x0E7, 0x185, 0x1D1, 0x1FF, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x021, 0x1FE, 0x1D0, 0x184, 0x0E6, 0x048, 0x3C8, 0x2EC, 0x000, 0x2EF, 0x3A5, 0x069, - 0x0E5, 0x175, 0x1A9, 0x005, 0x0C1, 0x0A4, 0x070, 0x006, 0x18E, 0x120, 0x04A, 0x3A6, - 0x000, 0x3CB, 0x093, 0x141, 0x1AB, 0x023, 0x06B, 0x09F, 0x027, 0x00A, 0x0EA, 0x0A6, - 0x04A, 0x1DE, 0x122, 0x090, 0x000, 0x06B, 0x143, 0x1DD, 0x057, 0x0A3, 0x0E5, 0x009, - 0x055, 0x046, 0x018, 0x0DE, 0x0B8, 0x068, 0x1C4, 0x10A, 0x000, 0x109, 0x1C7, 0x055, - 0x0BD, 0x0ED, 0x015, 0x041, 0x0F7, 0x0D8, 0x0AE, 0x03C, 0x0E0, 0x0B4, 0x02E, 0x18C, - 0x000, 0x187, 0x027, 0x0B7, 0x0F1, 0x03F, 0x09D, 0x0DD, 0x045, 0x02C, 0x0FC, 0x0AC, - 0x022, 0x0F4, 0x07E, 0x1E6, 0x000, 0x1FD, 0x087, 0x0F9, 0x021, 0x093, 0x0FB, 0x02F, - 0x003, 0x068, 0x03A, 0x0E6, 0x04A, 0x028, 0x0C4, 0x036, 0x000, 0x02D, 0x0BF, 0x01D, - 0x04D, 0x0DB, 0x037, 0x065, -}; - -static const uint8_t huff_spec_a43_bits[] = { - 4, 6, 6, 7, 7, 8, 8, 9, 0, 9, 8, 8, 7, 7, 6, 6, - 5, 6, 7, 7, 7, 8, 8, 9, 0, 9, 8, 8, 7, 7, 7, 6, - 6, 7, 7, 7, 8, 8, 9, 9, 0, 9, 9, 8, 8, 7, 7, 7, - 7, 7, 7, 8, 8, 8, 9, 10, 0, 10, 9, 9, 8, 8, 7, 7, - 7, 7, 8, 8, 8, 9, 10, 10, 0, 10, 10, 9, 8, 8, 8, 7, - 8, 8, 8, 9, 9, 9, 10, 10, 0, 10, 10, 9, 9, 9, 8, 8, - 8, 9, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 9, - 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, - 8, 9, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 9, - 8, 8, 8, 9, 9, 9, 10, 10, 0, 10, 10, 9, 9, 9, 8, 8, - 7, 7, 8, 8, 8, 9, 10, 10, 0, 10, 10, 9, 8, 8, 8, 7, - 7, 7, 7, 8, 8, 9, 9, 10, 0, 10, 9, 8, 8, 8, 7, 7, - 6, 7, 7, 7, 8, 8, 9, 9, 0, 9, 9, 8, 8, 7, 7, 7, - 5, 6, 7, 7, 7, 8, 8, 9, 0, 9, 8, 8, 7, 7, 7, 6, -}; - -static const uint16_t huff_spec_a43_codes[] = { - 0x002, 0x03E, 0x016, 0x060, 0x04E, 0x0DC, 0x04A, 0x130, 0x000, 0x131, 0x04B, 0x0DD, - 0x04F, 0x061, 0x017, 0x03F, 0x002, 0x02C, 0x076, 0x042, 0x034, 0x0CE, 0x002, 0x0E8, - 0x000, 0x0CF, 0x001, 0x0D1, 0x037, 0x045, 0x07B, 0x02F, 0x014, 0x072, 0x052, 0x01A, - 0x0E0, 0x080, 0x198, 0x01E, 0x000, 0x01D, 0x19B, 0x083, 0x0DF, 0x019, 0x055, 0x079, - 0x050, 0x03C, 0x004, 0x0C4, 0x096, 0x00C, 0x0EA, 0x34A, 0x000, 0x34F, 0x0ED, 0x1D7, - 0x095, 0x0AF, 0x003, 0x03F, 0x046, 0x026, 0x0D6, 0x092, 0x046, 0x15A, 0x3A8, 0x108, - 0x000, 0x10F, 0x3A3, 0x135, 0x039, 0x091, 0x0D9, 0x031, 0x0D4, 0x0CA, 0x072, 0x1C6, - 0x136, 0x090, 0x2B2, 0x104, 0x000, 0x103, 0x111, 0x08B, 0x133, 0x1D3, 0x071, 0x0C9, - 0x03E, 0x1B4, 0x18C, 0x0CC, 0x38A, 0x2B0, 0x106, 0x0F2, 0x000, 0x0EF, 0x101, 0x113, - 0x3A1, 0x0CB, 0x18F, 0x1B7, 0x0EE, 0x092, 0x388, 0x348, 0x10A, 0x0F4, 0x0F0, 0x0EA, - 0x000, 0x0E9, 0x0ED, 0x0F7, 0x10D, 0x34D, 0x3AB, 0x0C9, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x0EF, 0x0C8, 0x3AA, 0x34C, 0x10C, 0x0F6, 0x0EC, 0x0E8, 0x000, 0x0EB, 0x0F1, 0x0F5, - 0x10B, 0x349, 0x389, 0x093, 0x03F, 0x1B6, 0x18E, 0x0CA, 0x3A0, 0x112, 0x100, 0x0EE, - 0x000, 0x0F3, 0x107, 0x2B1, 0x38B, 0x0CD, 0x18D, 0x1B5, 0x0D5, 0x0C8, 0x070, 0x1D2, - 0x132, 0x08A, 0x110, 0x102, 0x000, 0x105, 0x2B3, 0x091, 0x137, 0x1C7, 0x073, 0x0CB, - 0x047, 0x030, 0x0D8, 0x090, 0x038, 0x134, 0x3A2, 0x10E, 0x000, 0x109, 0x3A9, 0x15B, - 0x047, 0x093, 0x0D7, 0x027, 0x051, 0x03E, 0x002, 0x0AE, 0x094, 0x1D6, 0x0EC, 0x34E, - 0x000, 0x34B, 0x0EB, 0x00D, 0x097, 0x0C5, 0x005, 0x03D, 0x015, 0x078, 0x054, 0x018, - 0x0DE, 0x082, 0x19A, 0x01C, 0x000, 0x01F, 0x199, 0x081, 0x0E1, 0x01B, 0x053, 0x073, - 0x003, 0x02E, 0x07A, 0x044, 0x036, 0x0D0, 0x000, 0x0CE, 0x000, 0x0E9, 0x003, 0x0CF, - 0x035, 0x043, 0x077, 0x02D, -}; - -static const uint8_t huff_spec_a44_bits[] = { - 4, 5, 6, 7, 7, 8, 9, 10, 0, 10, 9, 8, 7, 7, 6, 5, - 5, 6, 6, 7, 7, 8, 9, 10, 0, 10, 9, 8, 7, 7, 6, 6, - 6, 6, 7, 7, 8, 9, 10, 10, 0, 10, 10, 9, 8, 7, 7, 6, - 7, 7, 7, 8, 8, 9, 10, 10, 0, 10, 10, 9, 8, 8, 7, 7, - 7, 8, 8, 8, 9, 10, 10, 10, 0, 10, 10, 10, 9, 8, 8, 7, - 8, 8, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 8, - 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, - 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, - 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, - 8, 8, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 8, - 7, 7, 8, 8, 9, 10, 10, 10, 0, 10, 10, 10, 9, 8, 8, 8, - 7, 7, 7, 8, 8, 9, 10, 10, 0, 10, 10, 9, 8, 8, 7, 7, - 6, 6, 7, 7, 8, 9, 10, 10, 0, 10, 10, 9, 8, 7, 7, 6, - 5, 6, 6, 7, 7, 8, 9, 10, 0, 10, 9, 8, 7, 7, 6, 6, -}; - -static const uint16_t huff_spec_a44_codes[] = { - 0x00A, 0x012, 0x030, 0x06E, 0x024, 0x074, 0x0EC, 0x07E, 0x000, 0x07F, 0x0ED, 0x075, - 0x025, 0x06F, 0x031, 0x013, 0x010, 0x03C, 0x018, 0x05A, 0x002, 0x046, 0x09E, 0x07C, - 0x000, 0x079, 0x0E5, 0x04D, 0x007, 0x065, 0x01B, 0x03F, 0x02E, 0x016, 0x072, 0x01A, - 0x0D6, 0x1C6, 0x3B4, 0x066, 0x000, 0x06B, 0x3B7, 0x1D9, 0x0D5, 0x021, 0x075, 0x015, - 0x06C, 0x03E, 0x01E, 0x0CC, 0x044, 0x0F2, 0x082, 0x05C, 0x000, 0x05F, 0x087, 0x0F5, - 0x031, 0x0CF, 0x017, 0x059, 0x01C, 0x0EE, 0x0D0, 0x024, 0x1C0, 0x08E, 0x06E, 0x048, - 0x000, 0x04D, 0x06D, 0x089, 0x0F7, 0x033, 0x0D3, 0x001, 0x070, 0x028, 0x1C2, 0x0F0, - 0x08A, 0x074, 0x054, 0x040, 0x000, 0x043, 0x053, 0x073, 0x099, 0x0EF, 0x1C5, 0x02B, - 0x0E6, 0x04E, 0x08C, 0x080, 0x068, 0x058, 0x046, 0x02A, 0x000, 0x029, 0x045, 0x051, - 0x065, 0x085, 0x09B, 0x09D, 0x07A, 0x076, 0x060, 0x056, 0x04E, 0x02C, 0x024, 0x022, - 0x000, 0x021, 0x027, 0x02F, 0x04B, 0x05B, 0x063, 0x071, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x07B, 0x070, 0x062, 0x05A, 0x04A, 0x02E, 0x026, 0x020, 0x000, 0x023, 0x025, 0x02D, - 0x04F, 0x057, 0x061, 0x077, 0x0E7, 0x09C, 0x09A, 0x084, 0x064, 0x050, 0x044, 0x028, - 0x000, 0x02B, 0x047, 0x059, 0x069, 0x081, 0x08D, 0x04F, 0x071, 0x02A, 0x1C4, 0x0EE, - 0x098, 0x072, 0x052, 0x042, 0x000, 0x041, 0x055, 0x075, 0x08B, 0x0F1, 0x1C3, 0x029, - 0x01D, 0x000, 0x0D2, 0x032, 0x0F6, 0x088, 0x06C, 0x04C, 0x000, 0x049, 0x06F, 0x08F, - 0x1C1, 0x025, 0x0D1, 0x0EF, 0x06D, 0x058, 0x016, 0x0CE, 0x030, 0x0F4, 0x086, 0x05E, - 0x000, 0x05D, 0x083, 0x0F3, 0x045, 0x0CD, 0x01F, 0x03F, 0x02F, 0x014, 0x074, 0x020, - 0x0D4, 0x1D8, 0x3B6, 0x06A, 0x000, 0x067, 0x3B5, 0x1C7, 0x0D7, 0x01B, 0x073, 0x017, - 0x011, 0x03E, 0x01A, 0x064, 0x006, 0x04C, 0x0E4, 0x078, 0x000, 0x07D, 0x09F, 0x047, - 0x003, 0x05B, 0x019, 0x03D, -}; - -static const uint8_t huff_spec_a51_bits[] = { - 5, 5, 5, 5, 5, 6, 6, 6, 4, 4, 5, 5, 5, 5, 5, 5, - 0, 5, 5, 5, 5, 5, 5, 4, 4, 6, 6, 6, 5, 5, 5, 5, -}; - -static const uint16_t huff_spec_a51_codes[] = { - 0x19, 0x16, 0x12, 0x0E, 0x06, 0x3A, 0x38, 0x30, 0x00, 0x04, 0x1E, 0x1A, - 0x14, 0x10, 0x0C, 0x04, 0x00, 0x05, 0x0D, 0x11, 0x15, 0x1B, 0x1F, 0x05, - 0x01, 0x31, 0x39, 0x3B, 0x07, 0x0F, 0x13, 0x17, -}; - -static const uint8_t huff_spec_a52_bits[] = { - 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, - 0, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, -}; - -static const uint16_t huff_spec_a52_codes[] = { - 0x09, 0x04, 0x00, 0x1E, 0x1A, 0x14, 0x0C, 0x06, 0x18, 0x16, 0x0E, 0x04, - 0x3A, 0x38, 0x22, 0x20, 0x00, 0x21, 0x23, 0x39, 0x3B, 0x05, 0x0F, 0x17, - 0x19, 0x07, 0x0D, 0x15, 0x1B, 0x1F, 0x01, 0x05, -}; - -static const uint8_t huff_spec_a53_bits[] = { - 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 7, 7, 7, 7, - 0, 7, 7, 7, 7, 6, 6, 5, 5, 5, 5, 5, 5, 4, 4, 4, -}; - -static const uint16_t huff_spec_a53_codes[] = { - 0x00, 0x0C, 0x08, 0x04, 0x1E, 0x16, 0x14, 0x06, 0x0C, 0x04, 0x38, 0x1E, - 0x76, 0x74, 0x3A, 0x38, 0x00, 0x39, 0x3B, 0x75, 0x77, 0x1F, 0x39, 0x05, - 0x0D, 0x07, 0x15, 0x17, 0x1F, 0x05, 0x09, 0x0D, -}; - -static const uint8_t huff_spec_a54_bits[] = { - 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, - 0, 8, 8, 7, 7, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, -}; - -static const uint16_t huff_spec_a54_codes[] = { - 0x02, 0x0E, 0x0A, 0x08, 0x02, 0x1A, 0x0E, 0x02, 0x00, 0x30, 0x18, 0x66, - 0x36, 0x34, 0xCA, 0xC8, 0x00, 0xC9, 0xCB, 0x35, 0x37, 0x67, 0x19, 0x31, - 0x01, 0x03, 0x0F, 0x1B, 0x03, 0x09, 0x0B, 0x0F, -}; - -static const uint8_t huff_spec_a61_bits[] = { - 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, - 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, - 5, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, -}; - -static const uint16_t huff_spec_a61_codes[] = { - 0x35, 0x30, 0x2A, 0x28, 0x24, 0x20, 0x18, 0x0E, 0x0C, 0x7E, 0x7C, 0x72, - 0x70, 0x68, 0x5E, 0x5C, 0x04, 0x0E, 0x08, 0x00, 0x3C, 0x3A, 0x36, 0x32, - 0x2C, 0x26, 0x22, 0x1A, 0x16, 0x14, 0x06, 0x04, 0x00, 0x05, 0x07, 0x15, - 0x17, 0x1B, 0x23, 0x27, 0x2D, 0x33, 0x37, 0x3B, 0x3D, 0x01, 0x09, 0x0F, - 0x05, 0x5D, 0x5F, 0x69, 0x71, 0x73, 0x7D, 0x7F, 0x0D, 0x0F, 0x19, 0x21, - 0x25, 0x29, 0x2B, 0x31, -}; - -static const uint8_t huff_spec_a62_bits[] = { - 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, - 0, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, -}; - -static const uint16_t huff_spec_a62_codes[] = { - 0x14, 0x0E, 0x08, 0x04, 0x02, 0x3E, 0x3C, 0x38, 0x34, 0x30, 0x2A, 0x24, - 0x1A, 0x18, 0x0E, 0x02, 0x32, 0x36, 0x2C, 0x26, 0x20, 0x16, 0x0C, 0x00, - 0x76, 0x74, 0x5E, 0x5C, 0x46, 0x44, 0x2A, 0x28, 0x00, 0x29, 0x2B, 0x45, - 0x47, 0x5D, 0x5F, 0x75, 0x77, 0x01, 0x0D, 0x17, 0x21, 0x27, 0x2D, 0x37, - 0x33, 0x03, 0x0F, 0x19, 0x1B, 0x25, 0x2B, 0x31, 0x35, 0x39, 0x3D, 0x3F, - 0x03, 0x05, 0x09, 0x0F, -}; - -static const uint8_t huff_spec_a63_bits[] = { - 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, - 0, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, -}; - -static const uint16_t huff_spec_a63_codes[] = { - 0x00, 0x1C, 0x18, 0x14, 0x10, 0x0A, 0x08, 0x02, 0x3E, 0x36, 0x2E, 0x2C, - 0x24, 0x1C, 0x0E, 0x08, 0x1E, 0x1A, 0x0C, 0x7A, 0x6A, 0x68, 0x4C, 0x32, - 0x16, 0x14, 0xF2, 0xF0, 0x9E, 0x9C, 0x62, 0x60, 0x00, 0x61, 0x63, 0x9D, - 0x9F, 0xF1, 0xF3, 0x15, 0x17, 0x33, 0x4D, 0x69, 0x6B, 0x7B, 0x0D, 0x1B, - 0x1F, 0x09, 0x0F, 0x1D, 0x25, 0x2D, 0x2F, 0x37, 0x3F, 0x03, 0x09, 0x0B, - 0x11, 0x15, 0x19, 0x1D, -}; - -static const uint8_t huff_spec_a64_bits[] = { - 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, - 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, - 0, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, - 6, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, -}; - -static const uint16_t huff_spec_a64_codes[] = { - 0x006, 0x002, 0x01C, 0x01A, 0x016, 0x012, 0x00E, 0x00A, 0x002, 0x03E, - 0x032, 0x02A, 0x022, 0x020, 0x010, 0x07A, 0x000, 0x078, 0x060, 0x050, - 0x024, 0x006, 0x0C6, 0x0C4, 0x0A4, 0x04E, 0x00A, 0x008, 0x14E, 0x14C, - 0x09A, 0x098, 0x000, 0x099, 0x09B, 0x14D, 0x14F, 0x009, 0x00B, 0x04F, - 0x0A5, 0x0C5, 0x0C7, 0x007, 0x025, 0x051, 0x061, 0x079, 0x001, 0x07B, - 0x011, 0x021, 0x023, 0x02B, 0x033, 0x03F, 0x003, 0x00B, 0x00F, 0x013, - 0x017, 0x01B, 0x01D, 0x003, -}; - -static const uint8_t huff_spec_a71_bits[] = { - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, - 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, -}; - -static const uint16_t huff_spec_a71_codes[] = { - 0x6C, 0x66, 0x62, 0x5C, 0x56, 0x50, 0x52, 0x4E, 0x48, 0x3E, 0x36, 0x34, 0x2A, 0x26, 0x1E, 0x16, - 0x0E, 0x08, 0x00, 0xF6, 0xF4, 0xEE, 0xEC, 0xE2, 0xE0, 0xDA, 0xD2, 0xD0, 0xBE, 0xBC, 0xB2, 0xB0, - 0x0C, 0x20, 0x1C, 0x16, 0x10, 0x08, 0x02, 0x7E, 0x7C, 0x78, 0x74, 0x72, 0x6E, 0x6A, 0x64, 0x60, - 0x5A, 0x54, 0x4C, 0x4A, 0x46, 0x44, 0x3C, 0x32, 0x30, 0x28, 0x24, 0x1C, 0x14, 0x0C, 0x0A, 0x02, - 0x00, 0x03, 0x0B, 0x0D, 0x15, 0x1D, 0x25, 0x29, 0x31, 0x33, 0x3D, 0x45, 0x47, 0x4B, 0x4D, 0x55, - 0x5B, 0x61, 0x65, 0x6B, 0x6F, 0x73, 0x75, 0x79, 0x7D, 0x7F, 0x03, 0x09, 0x11, 0x17, 0x1D, 0x21, - 0x0D, 0xB1, 0xB3, 0xBD, 0xBF, 0xD1, 0xD3, 0xDB, 0xE1, 0xE3, 0xED, 0xEF, 0xF5, 0xF7, 0x01, 0x09, - 0x0F, 0x17, 0x1F, 0x27, 0x2B, 0x35, 0x37, 0x3F, 0x49, 0x4F, 0x53, 0x51, 0x57, 0x5D, 0x63, 0x67, -}; - -static const uint8_t huff_spec_a72_bits[] = { - 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, -}; - -static const uint16_t huff_spec_a72_codes[] = { - 0x2A, 0x24, 0x1C, 0x18, 0x12, 0x0E, 0x0A, 0x06, 0x02, 0x7E, 0x7C, 0x7A, 0x76, 0x72, 0x70, 0x6A, - 0x68, 0x62, 0x5C, 0x5A, 0x52, 0x4E, 0x46, 0x42, 0x3C, 0x34, 0x2A, 0x28, 0x20, 0x12, 0x10, 0x08, - 0x66, 0x74, 0x6C, 0x64, 0x5E, 0x58, 0x50, 0x44, 0x40, 0x36, 0x2C, 0x22, 0x1A, 0x0A, 0x02, 0x00, - 0xF2, 0xF0, 0xDE, 0xDC, 0xC2, 0xC0, 0xAE, 0xAC, 0x9A, 0x98, 0x7E, 0x7C, 0x5E, 0x5C, 0x32, 0x30, - 0x00, 0x31, 0x33, 0x5D, 0x5F, 0x7D, 0x7F, 0x99, 0x9B, 0xAD, 0xAF, 0xC1, 0xC3, 0xDD, 0xDF, 0xF1, - 0xF3, 0x01, 0x03, 0x0B, 0x1B, 0x23, 0x2D, 0x37, 0x41, 0x45, 0x51, 0x59, 0x5F, 0x65, 0x6D, 0x75, - 0x67, 0x09, 0x11, 0x13, 0x21, 0x29, 0x2B, 0x35, 0x3D, 0x43, 0x47, 0x4F, 0x53, 0x5B, 0x5D, 0x63, - 0x69, 0x6B, 0x71, 0x73, 0x77, 0x7B, 0x7D, 0x7F, 0x03, 0x07, 0x0B, 0x0F, 0x13, 0x19, 0x1D, 0x25, -}; - -static const uint8_t huff_spec_a73_bits[] = { - 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, -}; - -static const uint16_t huff_spec_a73_codes[] = { - 0x003, 0x03E, 0x038, 0x034, 0x030, 0x02C, 0x028, 0x024, 0x020, 0x01C, 0x016, 0x014, - 0x00E, 0x00A, 0x004, 0x000, 0x07A, 0x076, 0x06E, 0x06C, 0x064, 0x05E, 0x056, 0x04E, - 0x04C, 0x044, 0x036, 0x030, 0x022, 0x018, 0x012, 0x004, 0x03C, 0x03E, 0x032, 0x024, - 0x020, 0x010, 0x0F2, 0x0F0, 0x0E8, 0x0CE, 0x0BA, 0x0B8, 0x0A8, 0x08C, 0x06A, 0x04E, - 0x04C, 0x034, 0x00E, 0x00C, 0x1D6, 0x1D4, 0x19A, 0x198, 0x156, 0x154, 0x11E, 0x11C, - 0x0D2, 0x0D0, 0x06E, 0x06C, 0x000, 0x06D, 0x06F, 0x0D1, 0x0D3, 0x11D, 0x11F, 0x155, - 0x157, 0x199, 0x19B, 0x1D5, 0x1D7, 0x00D, 0x00F, 0x035, 0x04D, 0x04F, 0x06B, 0x08D, - 0x0A9, 0x0B9, 0x0BB, 0x0CF, 0x0E9, 0x0F1, 0x0F3, 0x011, 0x021, 0x025, 0x033, 0x03F, - 0x03D, 0x005, 0x013, 0x019, 0x023, 0x031, 0x037, 0x045, 0x04D, 0x04F, 0x057, 0x05F, - 0x065, 0x06D, 0x06F, 0x077, 0x07B, 0x001, 0x005, 0x00B, 0x00F, 0x015, 0x017, 0x01D, - 0x021, 0x025, 0x029, 0x02D, 0x031, 0x035, 0x039, 0x03F, -}; - -static const uint8_t huff_spec_a74_bits[] = { - 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, - 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 7, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, -}; - -static const uint16_t huff_spec_a74_codes[] = { - 0x00D, 0x00A, 0x004, 0x000, 0x03A, 0x036, 0x032, 0x030, 0x02C, 0x028, 0x026, 0x022, - 0x01E, 0x018, 0x012, 0x00E, 0x006, 0x07E, 0x07A, 0x070, 0x06A, 0x05E, 0x056, 0x054, - 0x048, 0x040, 0x038, 0x022, 0x01A, 0x00A, 0x0F8, 0x0E6, 0x008, 0x0FA, 0x0F0, 0x0D2, - 0x0BA, 0x0B8, 0x094, 0x084, 0x074, 0x042, 0x032, 0x1E6, 0x1CA, 0x1C8, 0x1A2, 0x12E, - 0x10E, 0x10C, 0x0EC, 0x082, 0x062, 0x060, 0x3CA, 0x3C8, 0x342, 0x340, 0x25A, 0x258, - 0x1DE, 0x1DC, 0x102, 0x100, 0x000, 0x101, 0x103, 0x1DD, 0x1DF, 0x259, 0x25B, 0x341, - 0x343, 0x3C9, 0x3CB, 0x061, 0x063, 0x083, 0x0ED, 0x10D, 0x10F, 0x12F, 0x1A3, 0x1C9, - 0x1CB, 0x1E7, 0x033, 0x043, 0x075, 0x085, 0x095, 0x0B9, 0x0BB, 0x0D3, 0x0F1, 0x0FB, - 0x009, 0x0E7, 0x0F9, 0x00B, 0x01B, 0x023, 0x039, 0x041, 0x049, 0x055, 0x057, 0x05F, - 0x06B, 0x071, 0x07B, 0x07F, 0x007, 0x00F, 0x013, 0x019, 0x01F, 0x023, 0x027, 0x029, - 0x02D, 0x031, 0x033, 0x037, 0x03B, 0x001, 0x005, 0x00B, -}; - -static const uint8_t huff_spec_b22_bits[] = { - 0, 4, 0, 4, 4, 5, 0, 5, 0, 0, 0, 0, 4, 5, 0, 5, - 4, 7, 0, 6, 6, 9, 0, 7, 0, 0, 0, 0, 6, 9, 0, 7, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 6, 0, 7, 6, 7, 0, 9, 0, 0, 0, 0, 6, 7, 0, 9, - 4, 8, 0, 8, 8, 10, 0, 10, 0, 0, 0, 0, 6, 9, 0, 9, - 5, 10, 0, 9, 9, 10, 0, 10, 0, 0, 0, 0, 7, 10, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 6, 9, 0, 10, 9, 10, 0, 10, 0, 0, 0, 0, 7, 10, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 8, 0, 8, 6, 9, 0, 9, 0, 0, 0, 0, 8, 10, 0, 10, - 6, 10, 0, 9, 7, 10, 0, 10, 0, 0, 0, 0, 9, 10, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 9, 0, 10, 7, 10, 0, 10, 0, 0, 0, 0, 9, 10, 0, 10, -}; - -static const uint16_t huff_spec_b22_codes[] = { - 0x000, 0x00E, 0x000, 0x00F, 0x008, 0x006, 0x000, 0x00B, 0x000, 0x000, 0x000, 0x000, - 0x009, 0x00A, 0x000, 0x007, 0x006, 0x00A, 0x000, 0x029, 0x006, 0x158, 0x000, 0x023, - 0x000, 0x000, 0x000, 0x000, 0x013, 0x174, 0x000, 0x021, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x007, 0x028, 0x000, 0x00B, 0x012, 0x020, 0x000, 0x175, 0x000, 0x000, 0x000, 0x000, - 0x007, 0x022, 0x000, 0x159, 0x00C, 0x0BC, 0x000, 0x0BF, 0x022, 0x2B8, 0x000, 0x2BB, - 0x000, 0x000, 0x000, 0x000, 0x00B, 0x170, 0x000, 0x15B, 0x000, 0x04E, 0x000, 0x15F, - 0x042, 0x04A, 0x000, 0x041, 0x000, 0x000, 0x000, 0x000, 0x055, 0x044, 0x000, 0x04D, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x02D, 0x172, 0x000, 0x2ED, 0x040, 0x042, 0x000, 0x047, - 0x000, 0x000, 0x000, 0x000, 0x013, 0x2EE, 0x000, 0x049, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x00D, 0x0BE, 0x000, 0x0BD, 0x00A, 0x15A, 0x000, 0x171, 0x000, 0x000, 0x000, 0x000, - 0x023, 0x2BA, 0x000, 0x2B9, 0x02C, 0x2EC, 0x000, 0x173, 0x012, 0x048, 0x000, 0x2EF, - 0x000, 0x000, 0x000, 0x000, 0x041, 0x046, 0x000, 0x043, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x001, 0x15E, 0x000, 0x04F, 0x054, 0x04C, 0x000, 0x045, 0x000, 0x000, 0x000, 0x000, - 0x043, 0x040, 0x000, 0x04B, -}; - -static const uint8_t huff_spec_b23_bits[] = { - 2, 4, 0, 4, 4, 6, 0, 6, 0, 0, 0, 0, 4, 6, 0, 6, - 4, 9, 0, 7, 7, 9, 0, 8, 0, 0, 0, 0, 7, 9, 0, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 7, 0, 9, 7, 8, 0, 9, 0, 0, 0, 0, 7, 8, 0, 9, - 4, 8, 0, 8, 9, 10, 0, 10, 0, 0, 0, 0, 7, 10, 0, 10, - 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 9, 10, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 8, 10, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 8, 0, 8, 7, 10, 0, 10, 0, 0, 0, 0, 9, 10, 0, 10, - 7, 10, 0, 10, 8, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 7, 10, 0, 10, 9, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, -}; - -static const uint16_t huff_spec_b23_codes[] = { - 0x003, 0x008, 0x000, 0x009, 0x002, 0x018, 0x000, 0x01B, 0x000, 0x000, 0x000, 0x000, - 0x003, 0x01A, 0x000, 0x019, 0x000, 0x17C, 0x000, 0x055, 0x056, 0x0E8, 0x000, 0x07D, - 0x000, 0x000, 0x000, 0x000, 0x059, 0x0F6, 0x000, 0x07F, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x001, 0x054, 0x000, 0x17D, 0x058, 0x07E, 0x000, 0x0F7, 0x000, 0x000, 0x000, 0x000, - 0x057, 0x07C, 0x000, 0x0E9, 0x004, 0x0A2, 0x000, 0x0A1, 0x17A, 0x1DA, 0x000, 0x1D9, - 0x000, 0x000, 0x000, 0x000, 0x053, 0x1E8, 0x000, 0x2F3, 0x05C, 0x1D6, 0x000, 0x1E7, - 0x1EA, 0x1E2, 0x000, 0x1CF, 0x000, 0x000, 0x000, 0x000, 0x17F, 0x1CA, 0x000, 0x1DD, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x05B, 0x2F0, 0x000, 0x1DF, 0x1E4, 0x1CC, 0x000, 0x1D5, - 0x000, 0x000, 0x000, 0x000, 0x071, 0x1E0, 0x000, 0x1C9, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x005, 0x0A0, 0x000, 0x0A3, 0x052, 0x2F2, 0x000, 0x1E9, 0x000, 0x000, 0x000, 0x000, - 0x17B, 0x1D8, 0x000, 0x1DB, 0x05A, 0x1DE, 0x000, 0x2F1, 0x070, 0x1C8, 0x000, 0x1E1, - 0x000, 0x000, 0x000, 0x000, 0x1E5, 0x1D4, 0x000, 0x1CD, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x05D, 0x1E6, 0x000, 0x1D7, 0x17E, 0x1DC, 0x000, 0x1CB, 0x000, 0x000, 0x000, 0x000, - 0x1EB, 0x1CE, 0x000, 0x1E3, -}; - -static const uint8_t huff_spec_b24_bits[] = { - 1, 4, 0, 4, 5, 7, 0, 7, 0, 0, 0, 0, 5, 7, 0, 7, - 5, 9, 0, 7, 8, 10, 0, 9, 0, 0, 0, 0, 7, 10, 0, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 7, 0, 9, 7, 9, 0, 10, 0, 0, 0, 0, 8, 9, 0, 10, - 5, 9, 0, 8, 9, 10, 0, 10, 0, 0, 0, 0, 7, 10, 0, 10, - 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 8, 0, 9, 7, 10, 0, 10, 0, 0, 0, 0, 9, 10, 0, 10, - 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 7, 10, 0, 10, 10, 10, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, -}; - -static const uint16_t huff_spec_b24_codes[] = { - 0x001, 0x000, 0x000, 0x001, 0x00A, 0x01C, 0x000, 0x033, 0x000, 0x000, 0x000, 0x000, - 0x00B, 0x032, 0x000, 0x01D, 0x008, 0x0D8, 0x000, 0x031, 0x06E, 0x0FA, 0x000, 0x0D7, - 0x000, 0x000, 0x000, 0x000, 0x011, 0x0F4, 0x000, 0x0D5, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x009, 0x030, 0x000, 0x0D9, 0x010, 0x0D4, 0x000, 0x0F5, 0x000, 0x000, 0x000, 0x000, - 0x06F, 0x0D6, 0x000, 0x0FB, 0x00E, 0x0DA, 0x000, 0x025, 0x0D2, 0x0D4, 0x000, 0x0DB, - 0x000, 0x000, 0x000, 0x000, 0x017, 0x0FE, 0x000, 0x0FD, 0x014, 0x0DC, 0x000, 0x0F9, - 0x0F2, 0x0D6, 0x000, 0x09B, 0x000, 0x000, 0x000, 0x000, 0x1A3, 0x09C, 0x000, 0x0D3, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x019, 0x0F6, 0x000, 0x0D9, 0x0F0, 0x09E, 0x000, 0x0D1, - 0x000, 0x000, 0x000, 0x000, 0x1A1, 0x0DE, 0x000, 0x099, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x00F, 0x024, 0x000, 0x0DB, 0x016, 0x0FC, 0x000, 0x0FF, 0x000, 0x000, 0x000, 0x000, - 0x0D3, 0x0DA, 0x000, 0x0D5, 0x018, 0x0D8, 0x000, 0x0F7, 0x1A0, 0x098, 0x000, 0x0DF, - 0x000, 0x000, 0x000, 0x000, 0x0F1, 0x0D0, 0x000, 0x09F, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x015, 0x0F8, 0x000, 0x0DD, 0x1A2, 0x0D2, 0x000, 0x09D, 0x000, 0x000, 0x000, 0x000, - 0x0F3, 0x09A, 0x000, 0x0D7 -}; - -static const uint8_t huff_spec_b32_bits[] = { - 2, 4, 5, 6, 0, 6, 5, 4, 5, 6, 6, 7, 0, 6, 5, 6, - 5, 6, 7, 7, 0, 8, 7, 6, 6, 7, 8, 9, 0, 9, 8, 7, - 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 0, 9, 8, 7, - 5, 6, 7, 8, 0, 7, 7, 6, 5, 6, 5, 6, 0, 7, 6, 6, -}; - -static const uint16_t huff_spec_b32_codes[] = { - 0x001, 0x002, 0x01E, 0x02A, 0x000, 0x02B, 0x01F, 0x003, 0x016, 0x020, 0x03A, 0x064, - 0x000, 0x005, 0x001, 0x023, 0x01A, 0x026, 0x070, 0x00C, 0x000, 0x0CF, 0x073, 0x031, - 0x024, 0x00E, 0x0CC, 0x146, 0x000, 0x145, 0x0A1, 0x053, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x025, 0x052, 0x0A0, 0x144, 0x000, 0x147, 0x0CD, 0x00F, - 0x01B, 0x030, 0x072, 0x0CE, 0x000, 0x00D, 0x071, 0x027, 0x017, 0x022, 0x000, 0x004, - 0x000, 0x065, 0x03B, 0x021, -}; - -static const uint8_t huff_spec_b33_bits[] = { - 2, 4, 5, 7, 0, 7, 5, 4, 4, 5, 6, 8, 0, 7, 6, 5, - 5, 6, 7, 9, 0, 8, 7, 6, 7, 8, 9, 10, 0, 10, 9, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 0, 10, 9, 8, - 5, 6, 7, 8, 0, 9, 7, 6, 4, 5, 6, 7, 0, 8, 6, 5, -}; - -static const uint16_t huff_spec_b33_codes[] = { - 0x003, 0x008, 0x014, 0x05E, 0x000, 0x05F, 0x015, 0x009, 0x004, 0x002, 0x01C, 0x0BA, - 0x000, 0x011, 0x01F, 0x001, 0x00C, 0x00C, 0x014, 0x166, 0x000, 0x02D, 0x013, 0x00F, - 0x05A, 0x0B0, 0x05E, 0x0B8, 0x000, 0x0BB, 0x165, 0x0B9, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x05B, 0x0B8, 0x164, 0x0BA, 0x000, 0x0B9, 0x05F, 0x0B1, - 0x00D, 0x00E, 0x012, 0x02C, 0x000, 0x167, 0x015, 0x00D, 0x005, 0x000, 0x01E, 0x010, - 0x000, 0x0BB, 0x01D, 0x003 -}; - -static const uint8_t huff_spec_b34_bits[] = { - 1, 4, 6, 8, 0, 8, 6, 4, 4, 6, 7, 9, 0, 8, 7, 6, - 6, 7, 8, 10, 0, 10, 8, 7, 8, 9, 10, 10, 0, 10, 10, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 10, 0, 10, 10, 9, - 6, 7, 8, 10, 0, 10, 8, 7, 4, 6, 7, 8, 0, 9, 7, 6, -}; - -static const uint16_t huff_spec_b34_codes[] = { - 0x000, 0x00A, 0x038, 0x0EE, 0x000, 0x0EF, 0x039, 0x00B, 0x008, 0x03C, 0x06E, 0x1D8, - 0x000, 0x0C1, 0x075, 0x03F, 0x032, 0x068, 0x0C4, 0x358, 0x000, 0x30F, 0x0C7, 0x06D, - 0x0D4, 0x1AE, 0x30C, 0x308, 0x000, 0x30B, 0x35B, 0x1DB, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x0D5, 0x1DA, 0x35A, 0x30A, 0x000, 0x309, 0x30D, 0x1AF, - 0x033, 0x06C, 0x0C6, 0x30E, 0x000, 0x359, 0x0C5, 0x069, 0x009, 0x03E, 0x074, 0x0C0, - 0x000, 0x1D9, 0x06F, 0x03D, -}; - -static const uint8_t huff_spec_b42_bits[] = { - 4, 5, 6, 8, 6, 7, 8, 8, 0, 8, 8, 7, 6, 8, 6, 5, - 5, 6, 7, 8, 7, 7, 8, 9, 0, 8, 8, 7, 7, 8, 7, 6, - 7, 7, 8, 9, 7, 8, 9, 9, 0, 9, 9, 8, 7, 9, 8, 7, - 8, 9, 9, 10, 8, 8, 9, 10, 0, 10, 9, 8, 8, 10, 9, 8, - 6, 7, 8, 8, 9, 9, 10, 10, 0, 10, 10, 9, 9, 8, 8, 7, - 7, 7, 8, 9, 9, 10, 10, 10, 0, 10, 10, 10, 9, 9, 8, 7, - 8, 8, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 8, - 8, 9, 9, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 9, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 9, 9, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 9, 9, - 8, 8, 9, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 9, 8, - 7, 7, 8, 9, 9, 10, 10, 10, 0, 10, 10, 10, 9, 9, 8, 7, - 6, 7, 8, 8, 9, 9, 10, 10, 0, 10, 10, 9, 9, 8, 8, 7, - 8, 8, 9, 10, 8, 8, 9, 10, 0, 10, 9, 8, 8, 10, 9, 9, - 7, 7, 8, 9, 7, 8, 9, 9, 0, 9, 9, 8, 7, 9, 8, 7, - 5, 6, 7, 8, 7, 7, 8, 8, 0, 9, 8, 7, 7, 8, 7, 6, -}; - -static const uint16_t huff_spec_b42_codes[] = { - 0x00E, 0x018, 0x010, 0x0F0, 0x024, 0x05A, 0x0F6, 0x078, 0x000, 0x079, 0x0F7, 0x05B, - 0x025, 0x0F1, 0x011, 0x019, 0x00C, 0x014, 0x01C, 0x036, 0x05C, 0x012, 0x09E, 0x1E4, - 0x000, 0x00B, 0x0A9, 0x03B, 0x05F, 0x071, 0x019, 0x017, 0x06E, 0x000, 0x03E, 0x114, - 0x002, 0x0B0, 0x1AA, 0x07A, 0x000, 0x099, 0x1E7, 0x0B3, 0x00B, 0x131, 0x07F, 0x00D, - 0x0D8, 0x1FE, 0x112, 0x22E, 0x086, 0x010, 0x134, 0x35C, 0x000, 0x35F, 0x133, 0x013, - 0x081, 0x22D, 0x119, 0x07B, 0x00A, 0x050, 0x0F8, 0x04E, 0x1B4, 0x154, 0x3EC, 0x0D2, - 0x000, 0x0D7, 0x3D7, 0x137, 0x1FD, 0x073, 0x0FD, 0x057, 0x052, 0x010, 0x08E, 0x1E8, - 0x11A, 0x3EE, 0x0F2, 0x03C, 0x000, 0x03F, 0x0F1, 0x3D5, 0x111, 0x1F5, 0x09D, 0x025, - 0x0D2, 0x082, 0x1A0, 0x0F8, 0x36E, 0x0D4, 0x072, 0x03A, 0x000, 0x027, 0x071, 0x07D, - 0x36D, 0x0FB, 0x1AD, 0x085, 0x00C, 0x1A8, 0x03C, 0x346, 0x0D0, 0x076, 0x024, 0x020, - 0x000, 0x023, 0x039, 0x075, 0x07F, 0x345, 0x09B, 0x157, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x00D, 0x156, 0x09A, 0x344, 0x07E, 0x074, 0x038, 0x022, 0x000, 0x021, 0x025, 0x077, - 0x0D1, 0x347, 0x03D, 0x1A9, 0x0D3, 0x084, 0x1AC, 0x0FA, 0x36C, 0x07C, 0x070, 0x026, - 0x000, 0x03B, 0x073, 0x0D5, 0x36F, 0x0F9, 0x1A1, 0x083, 0x053, 0x024, 0x09C, 0x1F4, - 0x110, 0x3D4, 0x0F0, 0x03E, 0x000, 0x03D, 0x0F3, 0x3EF, 0x11B, 0x1E9, 0x08F, 0x011, - 0x00B, 0x056, 0x0FC, 0x072, 0x1FC, 0x136, 0x3D6, 0x0D6, 0x000, 0x0D3, 0x3ED, 0x155, - 0x1B5, 0x04F, 0x0F9, 0x051, 0x0D9, 0x07A, 0x118, 0x22C, 0x080, 0x012, 0x132, 0x35E, - 0x000, 0x35D, 0x135, 0x011, 0x087, 0x22F, 0x113, 0x1FF, 0x06F, 0x00C, 0x07E, 0x130, - 0x00A, 0x0B2, 0x1E6, 0x098, 0x000, 0x07B, 0x1AB, 0x0B1, 0x003, 0x115, 0x03F, 0x001, - 0x00D, 0x016, 0x018, 0x070, 0x05E, 0x03A, 0x0A8, 0x00A, 0x000, 0x1E5, 0x09F, 0x013, - 0x05D, 0x037, 0x01D, 0x015, -}; - -static const uint8_t huff_spec_b43_bits[] = { - 2, 5, 6, 7, 7, 8, 8, 9, 0, 9, 8, 8, 7, 7, 6, 5, - 5, 6, 7, 8, 7, 8, 9, 10, 0, 10, 9, 8, 7, 8, 7, 6, - 6, 7, 8, 9, 8, 9, 10, 10, 0, 10, 10, 9, 8, 9, 8, 7, - 7, 8, 9, 10, 9, 9, 10, 10, 0, 10, 10, 10, 9, 10, 9, 8, - 7, 8, 8, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 8, 7, - 8, 8, 9, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 9, 8, - 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, - 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, - 9, 9, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 9, - 8, 8, 9, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 9, 8, - 7, 7, 8, 9, 10, 10, 10, 10, 0, 10, 10, 10, 10, 9, 8, 8, - 7, 8, 9, 10, 9, 10, 10, 10, 0, 10, 10, 9, 9, 10, 9, 8, - 6, 7, 8, 9, 8, 9, 10, 10, 0, 10, 10, 9, 8, 9, 8, 7, - 5, 6, 7, 8, 7, 8, 9, 10, 0, 10, 9, 8, 7, 8, 7, 6, -}; - -static const uint16_t huff_spec_b43_codes[] = { - 0x001, 0x01E, 0x022, 0x018, 0x064, 0x0EC, 0x008, 0x100, 0x000, 0x101, 0x009, 0x0ED, - 0x065, 0x019, 0x023, 0x01F, 0x01A, 0x030, 0x056, 0x09A, 0x00A, 0x090, 0x12C, 0x0A6, - 0x000, 0x0A9, 0x12F, 0x093, 0x00F, 0x09F, 0x059, 0x039, 0x00E, 0x054, 0x0BC, 0x19E, - 0x082, 0x176, 0x0AC, 0x088, 0x000, 0x08B, 0x0AF, 0x19D, 0x095, 0x1D1, 0x0BF, 0x051, - 0x002, 0x098, 0x1D4, 0x0B8, 0x170, 0x046, 0x090, 0x060, 0x000, 0x067, 0x095, 0x0BD, - 0x173, 0x0B5, 0x1D3, 0x09D, 0x052, 0x0EE, 0x034, 0x174, 0x0BA, 0x09C, 0x080, 0x044, - 0x000, 0x047, 0x06D, 0x099, 0x0BF, 0x16F, 0x085, 0x001, 0x0CC, 0x036, 0x16C, 0x0B0, - 0x09A, 0x084, 0x04E, 0x03E, 0x000, 0x037, 0x04B, 0x06B, 0x0A1, 0x0B3, 0x16B, 0x087, - 0x1D6, 0x102, 0x0A4, 0x092, 0x068, 0x04C, 0x034, 0x030, 0x000, 0x02D, 0x03D, 0x049, - 0x083, 0x097, 0x0AB, 0x169, 0x0B6, 0x09E, 0x06E, 0x064, 0x040, 0x038, 0x02E, 0x02A, - 0x000, 0x029, 0x033, 0x03B, 0x043, 0x063, 0x087, 0x0A3, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x0B7, 0x0A2, 0x086, 0x062, 0x042, 0x03A, 0x032, 0x028, 0x000, 0x02B, 0x02F, 0x039, - 0x041, 0x065, 0x06F, 0x09F, 0x1D7, 0x168, 0x0AA, 0x096, 0x082, 0x048, 0x03C, 0x02C, - 0x000, 0x031, 0x035, 0x04D, 0x069, 0x093, 0x0A5, 0x103, 0x0CD, 0x086, 0x16A, 0x0B2, - 0x0A0, 0x06A, 0x04A, 0x036, 0x000, 0x03F, 0x04F, 0x085, 0x09B, 0x0B1, 0x16D, 0x037, - 0x053, 0x000, 0x084, 0x16E, 0x0BE, 0x098, 0x06C, 0x046, 0x000, 0x045, 0x081, 0x09D, - 0x0BB, 0x175, 0x035, 0x0EF, 0x003, 0x09C, 0x1D2, 0x0B4, 0x172, 0x0BC, 0x094, 0x066, - 0x000, 0x061, 0x091, 0x047, 0x171, 0x0B9, 0x1D5, 0x099, 0x00F, 0x050, 0x0BE, 0x1D0, - 0x094, 0x19C, 0x0AE, 0x08A, 0x000, 0x089, 0x0AD, 0x177, 0x083, 0x19F, 0x0BD, 0x055, - 0x01B, 0x038, 0x058, 0x09E, 0x00E, 0x092, 0x12E, 0x0A8, 0x000, 0x0A7, 0x12D, 0x091, - 0x00B, 0x09B, 0x057, 0x031, -}; - -static const uint8_t huff_spec_b44_bits[] = { - 2, 4, 6, 7, 7, 8, 10, 10, 0, 10, 10, 8, 7, 7, 6, 4, - 5, 5, 7, 8, 8, 10, 10, 10, 0, 10, 10, 10, 8, 8, 7, 5, - 6, 7, 8, 9, 9, 10, 10, 10, 0, 10, 10, 10, 10, 9, 8, 7, - 8, 8, 9, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 8, - 8, 8, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 8, - 9, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, - 9, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, - 8, 8, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 8, - 8, 8, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 9, 8, - 6, 7, 8, 9, 10, 10, 10, 10, 0, 10, 10, 10, 9, 9, 8, 7, - 5, 5, 7, 8, 8, 10, 10, 10, 0, 10, 10, 10, 8, 8, 7, 5, -}; - -static const uint16_t huff_spec_b44_codes[] = { - 0x002, 0x002, 0x030, 0x000, 0x002, 0x00C, 0x1D2, 0x1AE, 0x000, 0x1AF, 0x1D3, 0x00D, - 0x003, 0x001, 0x031, 0x003, 0x01E, 0x002, 0x070, 0x0C8, 0x07E, 0x1E8, 0x1C0, 0x176, - 0x000, 0x17F, 0x1C3, 0x1EB, 0x0CF, 0x0D3, 0x073, 0x009, 0x018, 0x06A, 0x0EC, 0x1DE, - 0x1A2, 0x1CA, 0x1AA, 0x164, 0x000, 0x16D, 0x1AD, 0x1D1, 0x1EF, 0x1DD, 0x0EB, 0x06D, - 0x0E8, 0x0CA, 0x1BE, 0x1CE, 0x1DA, 0x1B6, 0x170, 0x154, 0x000, 0x153, 0x173, 0x1B1, - 0x1D7, 0x1D5, 0x343, 0x0CD, 0x0DC, 0x078, 0x340, 0x1CC, 0x1BA, 0x1A8, 0x156, 0x148, - 0x000, 0x145, 0x15F, 0x1A1, 0x1BD, 0x1D9, 0x1ED, 0x07D, 0x1BC, 0x1DC, 0x1C4, 0x1B2, - 0x17C, 0x15A, 0x14A, 0x03A, 0x000, 0x039, 0x147, 0x16B, 0x17B, 0x1B5, 0x1C9, 0x1DF, - 0x1C6, 0x1B8, 0x1A2, 0x168, 0x160, 0x14C, 0x02E, 0x024, 0x000, 0x027, 0x03D, 0x151, - 0x15D, 0x16F, 0x1A7, 0x1BF, 0x1A4, 0x174, 0x162, 0x14E, 0x140, 0x02C, 0x02A, 0x022, - 0x000, 0x021, 0x029, 0x03F, 0x143, 0x159, 0x167, 0x179, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x1A5, 0x178, 0x166, 0x158, 0x142, 0x03E, 0x028, 0x020, 0x000, 0x023, 0x02B, 0x02D, - 0x141, 0x14F, 0x163, 0x175, 0x1C7, 0x1BE, 0x1A6, 0x16E, 0x15C, 0x150, 0x03C, 0x026, - 0x000, 0x025, 0x02F, 0x14D, 0x161, 0x169, 0x1A3, 0x1B9, 0x1BD, 0x1DE, 0x1C8, 0x1B4, - 0x17A, 0x16A, 0x146, 0x038, 0x000, 0x03B, 0x14B, 0x15B, 0x17D, 0x1B3, 0x1C5, 0x1DD, - 0x0DD, 0x07C, 0x1EC, 0x1D8, 0x1BC, 0x1A0, 0x15E, 0x144, 0x000, 0x149, 0x157, 0x1A9, - 0x1BB, 0x1CD, 0x341, 0x079, 0x0E9, 0x0CC, 0x342, 0x1D4, 0x1D6, 0x1B0, 0x172, 0x152, - 0x000, 0x155, 0x171, 0x1B7, 0x1DB, 0x1CF, 0x1BF, 0x0CB, 0x019, 0x06C, 0x0EA, 0x1DC, - 0x1EE, 0x1D0, 0x1AC, 0x16C, 0x000, 0x165, 0x1AB, 0x1CB, 0x1A3, 0x1DF, 0x0ED, 0x06B, - 0x01F, 0x008, 0x072, 0x0D2, 0x0CE, 0x1EA, 0x1C2, 0x17E, 0x000, 0x177, 0x1C1, 0x1E9, - 0x07F, 0x0C9, 0x071, 0x003, -}; - -static const uint8_t huff_spec_b52_bits[] = { - 3, 4, 4, 4, 5, 5, 6, 6, 5, 5, 5, 6, 6, 6, 7, 7, - 0, 7, 7, 6, 6, 6, 5, 5, 5, 6, 6, 5, 5, 4, 4, 4, -}; - -static const uint16_t huff_spec_b52_codes[] = { - 0x06, 0x0E, 0x06, 0x00, 0x0A, 0x04, 0x2C, 0x12, 0x14, 0x10, 0x06, 0x2E, 0x24, 0x10, 0x4E, 0x4C, - 0x00, 0x4D, 0x4F, 0x11, 0x25, 0x2F, 0x07, 0x11, 0x15, 0x13, 0x2D, 0x05, 0x0B, 0x01, 0x07, 0x0F, -}; - -static const uint8_t huff_spec_b53_bits[] = { - 2, 3, 4, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 8, 8, - 0, 8, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 4, 3, -}; - -static const uint16_t huff_spec_b53_codes[] = { - 0x02, 0x00, 0x06, 0x1C, 0x18, 0x3E, 0x16, 0x10, 0x3C, 0x36, 0x14, 0x6A, 0x26, 0x24, 0xD2, 0xD0, - 0x00, 0xD1, 0xD3, 0x25, 0x27, 0x6B, 0x15, 0x37, 0x3D, 0x11, 0x17, 0x3F, 0x19, 0x1D, 0x07, 0x01, -}; - -static const uint8_t huff_spec_b54_bits[] = { - 2, 3, 4, 4, 5, 6, 6, 7, 6, 6, 7, 8, 8, 8, 9, 9, - 0, 9, 9, 8, 8, 8, 7, 6, 6, 7, 6, 6, 5, 4, 4, 3, -}; - -static const uint16_t huff_spec_b54_codes[] = { - 0x003, 0x002, 0x008, 0x000, 0x014, 0x02E, 0x00E, 0x05A, 0x00A, 0x008, 0x01A, 0x0B2, - 0x032, 0x030, 0x162, 0x160, 0x000, 0x161, 0x163, 0x031, 0x033, 0x0B3, 0x01B, 0x009, - 0x00B, 0x05B, 0x00F, 0x02F, 0x015, 0x001, 0x009, 0x003, -}; - -static const uint8_t huff_spec_b62_bits[] = { - 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, - 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, - 0, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, - 6, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, -}; - -static const uint16_t huff_spec_b62_codes[] = { - 0x0D, 0x06, 0x1C, 0x14, 0x0A, 0x04, 0x3E, 0x2E, 0x22, 0x0E, 0x06, 0x00, 0x5A, 0x4E, 0x40, 0x20, - 0x30, 0x32, 0x24, 0x12, 0x0C, 0x02, 0x78, 0x58, 0x42, 0x22, 0x0A, 0x08, 0xF6, 0xF4, 0x9A, 0x98, - 0x00, 0x99, 0x9B, 0xF5, 0xF7, 0x09, 0x0B, 0x23, 0x43, 0x59, 0x79, 0x03, 0x0D, 0x13, 0x25, 0x33, - 0x31, 0x21, 0x41, 0x4F, 0x5B, 0x01, 0x07, 0x0F, 0x23, 0x2F, 0x3F, 0x05, 0x0B, 0x15, 0x1D, 0x07, -}; - -static const uint8_t huff_spec_b63_bits[] = { - 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, - 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, - 0, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 6, - 6, 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, -}; - -static const uint16_t huff_spec_b63_codes[] = { - 0x006, 0x00E, 0x004, 0x014, 0x010, 0x006, 0x000, 0x026, 0x01C, 0x018, 0x004, 0x05C, - 0x04A, 0x03C, 0x016, 0x0BC, 0x006, 0x008, 0x058, 0x03E, 0x036, 0x014, 0x0B6, 0x0B4, - 0x090, 0x068, 0x17E, 0x17C, 0x126, 0x124, 0x0D6, 0x0D4, 0x000, 0x0D5, 0x0D7, 0x125, - 0x127, 0x17D, 0x17F, 0x069, 0x091, 0x0B5, 0x0B7, 0x015, 0x037, 0x03F, 0x059, 0x009, - 0x007, 0x0BD, 0x017, 0x03D, 0x04B, 0x05D, 0x005, 0x019, 0x01D, 0x027, 0x001, 0x007, - 0x011, 0x015, 0x005, 0x00F, -}; - -static const uint8_t huff_spec_b64_bits[] = { - 3, 3, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, - 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, - 0, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 8, 8, 8, 7, 7, - 7, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 4, 3, -}; - -static const uint16_t huff_spec_b64_codes[] = { - 0x007, 0x000, 0x008, 0x01A, 0x014, 0x00C, 0x032, 0x02E, 0x01E, 0x014, 0x062, 0x05A, - 0x03A, 0x026, 0x020, 0x0B2, 0x038, 0x02C, 0x022, 0x0C0, 0x05E, 0x04A, 0x186, 0x184, - 0x160, 0x0BA, 0x092, 0x090, 0x2C6, 0x2C4, 0x172, 0x170, 0x000, 0x171, 0x173, 0x2C5, - 0x2C7, 0x091, 0x093, 0x0BB, 0x161, 0x185, 0x187, 0x04B, 0x05F, 0x0C1, 0x023, 0x02D, - 0x039, 0x0B3, 0x021, 0x027, 0x03B, 0x05B, 0x063, 0x015, 0x01F, 0x02F, 0x033, 0x00D, - 0x015, 0x01B, 0x009, 0x001, -}; - -static const uint8_t huff_spec_b72_bits[] = { - 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, -}; - -static const uint16_t huff_spec_b72_codes[] = { - 0x01E, 0x016, 0x00C, 0x000, 0x038, 0x032, 0x028, 0x022, 0x01C, 0x012, 0x00E, 0x006, - 0x076, 0x06C, 0x060, 0x04E, 0x03E, 0x02A, 0x022, 0x01A, 0x012, 0x00A, 0x0FC, 0x0DC, - 0x0C6, 0x0A8, 0x094, 0x086, 0x058, 0x042, 0x040, 0x02A, 0x068, 0x07C, 0x06A, 0x056, - 0x048, 0x040, 0x02E, 0x028, 0x016, 0x010, 0x008, 0x0EA, 0x0DE, 0x0AA, 0x09A, 0x096, - 0x07A, 0x078, 0x05A, 0x032, 0x030, 0x028, 0x1FE, 0x1FC, 0x1D2, 0x1D0, 0x18A, 0x188, - 0x132, 0x130, 0x10A, 0x108, 0x000, 0x109, 0x10B, 0x131, 0x133, 0x189, 0x18B, 0x1D1, - 0x1D3, 0x1FD, 0x1FF, 0x029, 0x031, 0x033, 0x05B, 0x079, 0x07B, 0x097, 0x09B, 0x0AB, - 0x0DF, 0x0EB, 0x009, 0x011, 0x017, 0x029, 0x02F, 0x041, 0x049, 0x057, 0x06B, 0x07D, - 0x069, 0x02B, 0x041, 0x043, 0x059, 0x087, 0x095, 0x0A9, 0x0C7, 0x0DD, 0x0FD, 0x00B, - 0x013, 0x01B, 0x023, 0x02B, 0x03F, 0x04F, 0x061, 0x06D, 0x077, 0x007, 0x00F, 0x013, - 0x01D, 0x023, 0x029, 0x033, 0x039, 0x001, 0x00D, 0x017, -}; - -static const uint8_t huff_spec_b73_bits[] = { - 3, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, - 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, - 8, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 4, -}; - -static const uint16_t huff_spec_b73_codes[] = { - 0x000, 0x006, 0x018, 0x010, 0x004, 0x03A, 0x034, 0x02A, 0x026, 0x014, 0x010, 0x07E, - 0x072, 0x06E, 0x05C, 0x052, 0x04A, 0x02C, 0x024, 0x018, 0x0F4, 0x0E0, 0x0DA, 0x0B6, - 0x0B2, 0x0A0, 0x05E, 0x04E, 0x038, 0x034, 0x1E6, 0x1B2, 0x0FA, 0x01E, 0x0F8, 0x0F0, - 0x0BE, 0x0B4, 0x0A2, 0x090, 0x04C, 0x03A, 0x1EE, 0x1E4, 0x1C6, 0x1B0, 0x178, 0x162, - 0x126, 0x124, 0x0B8, 0x06C, 0x3DA, 0x3D8, 0x38A, 0x388, 0x2F6, 0x2F4, 0x2C2, 0x2C0, - 0x176, 0x174, 0x0DC, 0x0DE, 0x000, 0x0DF, 0x0DD, 0x175, 0x177, 0x2C1, 0x2C3, 0x2F5, - 0x2F7, 0x389, 0x38B, 0x3D9, 0x3DB, 0x06D, 0x0B9, 0x125, 0x127, 0x163, 0x179, 0x1B1, - 0x1C7, 0x1E5, 0x1EF, 0x03B, 0x04D, 0x091, 0x0A3, 0x0B5, 0x0BF, 0x0F1, 0x0F9, 0x01F, - 0x0FB, 0x1B3, 0x1E7, 0x035, 0x039, 0x04F, 0x05F, 0x0A1, 0x0B3, 0x0B7, 0x0DB, 0x0E1, - 0x0F5, 0x019, 0x025, 0x02D, 0x04B, 0x053, 0x05D, 0x06F, 0x073, 0x07F, 0x011, 0x015, - 0x027, 0x02B, 0x035, 0x03B, 0x005, 0x011, 0x019, 0x007, -}; - -static const uint8_t huff_spec_b74_bits[] = { - 3, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, - 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, - 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, - 8, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, - 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, -}; - -static const uint16_t huff_spec_b74_codes[] = { - 0x001, 0x008, 0x01E, 0x018, 0x00C, 0x002, 0x03A, 0x034, 0x02C, 0x01E, 0x016, 0x012, - 0x072, 0x06E, 0x05E, 0x056, 0x050, 0x038, 0x022, 0x004, 0x0E2, 0x0DA, 0x0BA, 0x0A8, - 0x076, 0x054, 0x050, 0x002, 0x000, 0x1C0, 0x1B0, 0x156, 0x0A4, 0x0A6, 0x074, 0x052, - 0x004, 0x1C2, 0x1B2, 0x170, 0x154, 0x0AE, 0x0AC, 0x086, 0x2E6, 0x2E4, 0x10A, 0x108, - 0x106, 0x104, 0x102, 0x100, 0x03E, 0x03A, 0x03C, 0x038, 0x036, 0x034, 0x032, 0x030, - 0x01E, 0x01A, 0x01C, 0x018, 0x000, 0x019, 0x01D, 0x01B, 0x01F, 0x031, 0x033, 0x035, - 0x037, 0x039, 0x03D, 0x03B, 0x03F, 0x101, 0x103, 0x105, 0x107, 0x109, 0x10B, 0x2E5, - 0x2E7, 0x087, 0x0AD, 0x0AF, 0x155, 0x171, 0x1B3, 0x1C3, 0x005, 0x053, 0x075, 0x0A7, - 0x0A5, 0x157, 0x1B1, 0x1C1, 0x001, 0x003, 0x051, 0x055, 0x077, 0x0A9, 0x0BB, 0x0DB, - 0x0E3, 0x005, 0x023, 0x039, 0x051, 0x057, 0x05F, 0x06F, 0x073, 0x013, 0x017, 0x01F, - 0x02D, 0x035, 0x03B, 0x003, 0x00D, 0x019, 0x01F, 0x009, + { huff_sfb_b2_tab, 3, 1, 0, 2 }, + { huff_sfb_b3_tab, 7, 1, 0, 3 }, + { huff_sfb_b4_tab, 15, 1, 0, 4 }, + { huff_sfb_b5_tab, 32, 1, 0, 5 }, +}; + +static const uint8_t huff_spec_a21_tab[8][2] = { + { 1, 3 }, { 3, 3 }, { 12, 3 }, { 4, 3 }, { 7, 3 }, + { 13, 3 }, { 15, 3 }, { 5, 3 }, +}; + +static const uint8_t huff_spec_a22_tab[80][2] = { + { 17, 6 }, { 51, 6 }, { 81, 7 }, { 243, 7 }, { 69, 7 }, + { 207, 7 }, { 205, 7 }, { 71, 7 }, { 209, 7 }, { 115, 7 }, + { 245, 7 }, { 95, 7 }, { 125, 7 }, { 215, 7 }, { 1, 4 }, + { 3, 4 }, { 116, 7 }, { 220, 7 }, { 84, 7 }, { 252, 7 }, + { 29, 7 }, { 55, 7 }, { 21, 7 }, { 63, 7 }, { 65, 6 }, + { 195, 6 }, { 193, 6 }, { 67, 6 }, { 20, 6 }, { 60, 6 }, + { 52, 6 }, { 28, 6 }, { 16, 5 }, { 48, 5 }, { 4, 5 }, + { 12, 5 }, { 221, 8 }, { 119, 8 }, { 117, 8 }, { 223, 8 }, + { 213, 8 }, { 127, 8 }, { 253, 8 }, { 87, 8 }, { 80, 6 }, + { 240, 6 }, { 93, 8 }, { 247, 8 }, { 85, 8 }, { 255, 8 }, + { 113, 7 }, { 211, 7 }, { 208, 6 }, { 112, 6 }, { 64, 5 }, + { 192, 5 }, { 212, 7 }, { 124, 7 }, { 241, 7 }, { 83, 7 }, + { 77, 7 }, { 199, 7 }, { 244, 7 }, { 92, 7 }, { 196, 6 }, + { 76, 6 }, { 53, 7 }, { 31, 7 }, { 197, 7 }, { 79, 7 }, + { 49, 6 }, { 19, 6 }, { 61, 7 }, { 23, 7 }, { 68, 7 }, + { 204, 7 }, { 5, 6 }, { 15, 6 }, { 13, 6 }, { 7, 6 }, +}; + +static const uint8_t huff_spec_a23_tab[81][2] = { + { 65, 6 }, { 195, 6 }, { 193, 6 }, { 67, 6 }, { 197, 7 }, + { 79, 7 }, { 77, 7 }, { 199, 7 }, { 241, 7 }, { 83, 7 }, + { 244, 7 }, { 92, 7 }, { 1, 4 }, { 3, 4 }, { 20, 6 }, + { 60, 6 }, { 212, 7 }, { 124, 7 }, { 61, 7 }, { 23, 7 }, + { 52, 6 }, { 28, 6 }, { 53, 7 }, { 31, 7 }, { 245, 8 }, + { 95, 8 }, { 125, 8 }, { 215, 8 }, { 80, 6 }, { 240, 6 }, + { 208, 6 }, { 112, 6 }, { 205, 8 }, { 71, 8 }, { 81, 8 }, + { 243, 8 }, { 69, 8 }, { 207, 8 }, { 209, 8 }, { 115, 8 }, + { 5, 6 }, { 15, 6 }, { 13, 6 }, { 7, 6 }, { 196, 6 }, + { 76, 6 }, { 221, 9 }, { 119, 9 }, { 253, 9 }, { 87, 9 }, + { 116, 8 }, { 220, 8 }, { 68, 7 }, { 204, 7 }, { 49, 6 }, + { 19, 6 }, { 117, 9 }, { 223, 9 }, { 213, 9 }, { 127, 9 }, + { 84, 8 }, { 252, 8 }, { 29, 8 }, { 55, 8 }, { 21, 8 }, + { 63, 8 }, { 17, 7 }, { 51, 7 }, { 93, 9 }, { 247, 9 }, + { 85, 9 }, { 255, 9 }, { 113, 8 }, { 211, 8 }, { 4, 5 }, + { 12, 5 }, { 0, 3 }, { 16, 5 }, { 48, 5 }, { 64, 5 }, + { 192, 5 }, +}; + +static const uint8_t huff_spec_a24_tab[81][2] = { + { 20, 6 }, { 60, 6 }, { 52, 6 }, { 28, 6 }, { 80, 6 }, + { 240, 6 }, { 208, 6 }, { 112, 6 }, { 1, 4 }, { 3, 4 }, + { 5, 6 }, { 15, 6 }, { 13, 6 }, { 7, 6 }, { 84, 8 }, + { 252, 8 }, { 29, 8 }, { 55, 8 }, { 68, 7 }, { 204, 7 }, + { 196, 6 }, { 76, 6 }, { 17, 7 }, { 51, 7 }, { 21, 8 }, + { 63, 8 }, { 113, 8 }, { 211, 8 }, { 49, 6 }, { 19, 6 }, + { 245, 9 }, { 95, 9 }, { 125, 9 }, { 215, 9 }, { 244, 8 }, + { 92, 8 }, { 212, 8 }, { 124, 8 }, { 241, 8 }, { 83, 8 }, + { 77, 8 }, { 199, 8 }, { 197, 8 }, { 79, 8 }, { 53, 8 }, + { 31, 8 }, { 253, 10 }, { 87, 10 }, { 213, 10 }, { 127, 10 }, + { 81, 9 }, { 243, 9 }, { 0, 2 }, { 61, 8 }, { 23, 8 }, + { 117, 10 }, { 223, 10 }, { 221, 10 }, { 119, 10 }, { 209, 9 }, + { 115, 9 }, { 65, 7 }, { 195, 7 }, { 193, 7 }, { 67, 7 }, + { 69, 9 }, { 207, 9 }, { 205, 9 }, { 71, 9 }, { 93, 10 }, + { 247, 10 }, { 85, 10 }, { 255, 10 }, { 116, 9 }, { 220, 9 }, + { 16, 5 }, { 48, 5 }, { 64, 5 }, { 192, 5 }, { 4, 5 }, + { 12, 5 }, +}; + +static const uint8_t huff_spec_a31_tab[40][2] = { + { 50, 5 }, { 22, 5 }, { 11, 5 }, { 61, 5 }, { 2, 4 }, + { 6, 4 }, { 59, 5 }, { 13, 5 }, { 17, 5 }, { 55, 5 }, + { 49, 5 }, { 23, 5 }, { 24, 5 }, { 40, 5 }, { 26, 6 }, + { 46, 6 }, { 42, 6 }, { 30, 6 }, { 10, 5 }, { 62, 5 }, + { 58, 5 }, { 14, 5 }, { 19, 6 }, { 53, 6 }, { 51, 6 }, + { 21, 6 }, { 3, 5 }, { 5, 5 }, { 16, 5 }, { 48, 5 }, + { 25, 6 }, { 47, 6 }, { 41, 6 }, { 31, 6 }, { 27, 7 }, + { 45, 7 }, { 43, 7 }, { 29, 7 }, { 18, 6 }, { 54, 6 }, +}; + +static const uint8_t huff_spec_a32_tab[49][2] = { + { 57, 5 }, { 15, 5 }, { 17, 5 }, { 55, 5 }, { 49, 5 }, + { 23, 5 }, { 58, 5 }, { 14, 5 }, { 10, 5 }, { 62, 5 }, + { 43, 7 }, { 29, 7 }, { 27, 7 }, { 45, 7 }, { 25, 6 }, + { 47, 6 }, { 41, 6 }, { 31, 6 }, { 59, 6 }, { 13, 6 }, + { 11, 6 }, { 61, 6 }, { 50, 6 }, { 22, 6 }, { 16, 5 }, + { 48, 5 }, { 8, 5 }, { 56, 5 }, { 18, 6 }, { 54, 6 }, + { 24, 6 }, { 40, 6 }, { 2, 5 }, { 6, 5 }, { 1, 5 }, + { 7, 5 }, { 0, 4 }, { 42, 7 }, { 30, 7 }, { 26, 7 }, + { 46, 7 }, { 3, 6 }, { 5, 6 }, { 19, 7 }, { 53, 7 }, + { 51, 7 }, { 21, 7 }, { 9, 6 }, { 63, 6 }, +}; + +static const uint8_t huff_spec_a33_tab[49][2] = { + { 51, 7 }, { 21, 7 }, { 19, 7 }, { 53, 7 }, { 24, 6 }, + { 40, 6 }, { 50, 6 }, { 22, 6 }, { 18, 6 }, { 54, 6 }, + { 3, 6 }, { 5, 6 }, { 43, 8 }, { 29, 8 }, { 27, 8 }, + { 45, 8 }, { 25, 7 }, { 47, 7 }, { 16, 5 }, { 48, 5 }, + { 8, 4 }, { 56, 4 }, { 1, 4 }, { 7, 4 }, { 2, 5 }, + { 6, 5 }, { 9, 5 }, { 63, 5 }, { 0, 3 }, { 57, 5 }, + { 15, 5 }, { 41, 7 }, { 31, 7 }, { 11, 7 }, { 61, 7 }, + { 59, 7 }, { 13, 7 }, { 26, 8 }, { 46, 8 }, { 42, 8 }, + { 30, 8 }, { 49, 6 }, { 23, 6 }, { 17, 6 }, { 55, 6 }, + { 58, 6 }, { 14, 6 }, { 10, 6 }, { 62, 6 }, +}; + +static const uint8_t huff_spec_a34_tab[49][2] = { + { 0, 2 }, { 16, 5 }, { 48, 5 }, { 2, 5 }, { 6, 5 }, + { 26, 8 }, { 46, 8 }, { 51, 8 }, { 21, 8 }, { 24, 7 }, + { 40, 7 }, { 3, 7 }, { 5, 7 }, { 19, 8 }, { 53, 8 }, + { 25, 8 }, { 47, 8 }, { 50, 7 }, { 22, 7 }, { 18, 7 }, + { 54, 7 }, { 17, 6 }, { 55, 6 }, { 8, 4 }, { 56, 4 }, + { 1, 4 }, { 7, 4 }, { 49, 6 }, { 23, 6 }, { 10, 6 }, + { 62, 6 }, { 58, 6 }, { 14, 6 }, { 41, 8 }, { 31, 8 }, + { 11, 8 }, { 61, 8 }, { 59, 8 }, { 13, 8 }, { 43, 10 }, + { 29, 10 }, { 27, 10 }, { 45, 10 }, { 42, 9 }, { 30, 9 }, + { 9, 5 }, { 63, 5 }, { 57, 5 }, { 15, 5 }, +}; + +static const uint8_t huff_spec_a41_tab[176][2] = { + { 83, 7 }, { 189, 7 }, { 68, 7 }, { 204, 7 }, { 23, 7 }, + { 249, 7 }, { 166, 8 }, { 106, 8 }, { 183, 8 }, { 89, 8 }, + { 52, 7 }, { 220, 7 }, { 161, 7 }, { 111, 7 }, { 179, 7 }, + { 93, 7 }, { 196, 7 }, { 76, 7 }, { 38, 7 }, { 234, 7 }, + { 116, 8 }, { 156, 8 }, { 148, 8 }, { 124, 8 }, { 97, 7 }, + { 175, 7 }, { 247, 7 }, { 25, 7 }, { 53, 7 }, { 219, 7 }, + { 212, 7 }, { 60, 7 }, { 5, 6 }, { 11, 6 }, { 101, 8 }, + { 171, 8 }, { 165, 8 }, { 107, 8 }, { 230, 7 }, { 42, 7 }, + { 244, 6 }, { 28, 6 }, { 7, 7 }, { 9, 7 }, { 213, 7 }, + { 59, 7 }, { 86, 8 }, { 186, 8 }, { 115, 8 }, { 157, 8 }, + { 71, 8 }, { 201, 8 }, { 182, 8 }, { 90, 8 }, { 4, 6 }, + { 12, 6 }, { 147, 8 }, { 125, 8 }, { 199, 8 }, { 73, 8 }, + { 82, 7 }, { 190, 7 }, { 66, 7 }, { 206, 7 }, { 178, 7 }, + { 94, 7 }, { 194, 7 }, { 78, 7 }, { 22, 7 }, { 250, 7 }, + { 96, 7 }, { 160, 7 }, { 100, 8 }, { 172, 8 }, { 164, 8 }, + { 108, 8 }, { 246, 7 }, { 26, 7 }, { 85, 8 }, { 187, 8 }, + { 114, 8 }, { 158, 8 }, { 37, 7 }, { 235, 7 }, { 36, 7 }, + { 236, 7 }, { 146, 8 }, { 126, 8 }, { 70, 8 }, { 202, 8 }, + { 215, 8 }, { 57, 8 }, { 55, 8 }, { 217, 8 }, { 181, 8 }, + { 91, 8 }, { 198, 8 }, { 74, 8 }, { 228, 7 }, { 44, 7 }, + { 229, 7 }, { 43, 7 }, { 81, 7 }, { 191, 7 }, { 177, 7 }, + { 95, 7 }, { 119, 9 }, { 153, 9 }, { 151, 9 }, { 121, 9 }, + { 99, 8 }, { 173, 8 }, { 65, 7 }, { 207, 7 }, { 6, 7 }, + { 10, 7 }, { 193, 7 }, { 79, 7 }, { 113, 8 }, { 159, 8 }, + { 163, 8 }, { 109, 8 }, { 145, 8 }, { 127, 8 }, { 118, 9 }, + { 154, 9 }, { 103, 9 }, { 169, 9 }, { 84, 8 }, { 188, 8 }, + { 39, 8 }, { 233, 8 }, { 167, 9 }, { 105, 9 }, { 150, 9 }, + { 122, 9 }, { 69, 8 }, { 203, 8 }, { 180, 8 }, { 92, 8 }, + { 54, 8 }, { 218, 8 }, { 197, 8 }, { 75, 8 }, { 98, 8 }, + { 174, 8 }, { 21, 7 }, { 251, 7 }, { 231, 8 }, { 41, 8 }, + { 162, 8 }, { 110, 8 }, { 214, 8 }, { 58, 8 }, { 117, 9 }, + { 155, 9 }, { 149, 9 }, { 123, 9 }, { 80, 7 }, { 176, 7 }, + { 20, 7 }, { 252, 7 }, { 102, 9 }, { 170, 9 }, { 87, 9 }, + { 185, 9 }, { 112, 8 }, { 144, 8 }, { 245, 7 }, { 27, 7 }, + { 64, 7 }, { 192, 7 }, { 67, 8 }, { 205, 8 }, { 195, 8 }, + { 77, 8 }, +}; + +static const uint8_t huff_spec_a42_tab[225][2] = { + { 3, 7 }, { 13, 7 }, { 113, 8 }, { 159, 8 }, { 163, 8 }, + { 109, 8 }, { 16, 6 }, { 240, 6 }, { 81, 7 }, { 191, 7 }, + { 177, 7 }, { 95, 7 }, { 0, 5 }, { 112, 8 }, { 144, 8 }, + { 99, 8 }, { 173, 8 }, { 149, 9 }, { 123, 9 }, { 166, 9 }, + { 106, 9 }, { 54, 8 }, { 218, 8 }, { 66, 7 }, { 206, 7 }, + { 23, 8 }, { 249, 8 }, { 214, 8 }, { 58, 8 }, { 194, 7 }, + { 78, 7 }, { 117, 9 }, { 155, 9 }, { 87, 9 }, { 185, 9 }, + { 247, 8 }, { 25, 8 }, { 21, 7 }, { 251, 7 }, { 211, 8 }, + { 61, 8 }, { 51, 8 }, { 221, 8 }, { 36, 7 }, { 236, 7 }, + { 228, 7 }, { 44, 7 }, { 183, 9 }, { 89, 9 }, { 102, 9 }, + { 170, 9 }, { 180, 8 }, { 92, 8 }, { 80, 7 }, { 176, 7 }, + { 245, 7 }, { 27, 7 }, { 69, 8 }, { 203, 8 }, { 84, 8 }, + { 188, 8 }, { 225, 7 }, { 47, 7 }, { 33, 7 }, { 239, 7 }, + { 1, 6 }, { 15, 6 }, { 197, 8 }, { 75, 8 }, { 98, 8 }, + { 174, 8 }, { 18, 7 }, { 254, 7 }, { 162, 8 }, { 110, 8 }, + { 116, 9 }, { 156, 9 }, { 148, 9 }, { 124, 9 }, { 242, 7 }, + { 30, 7 }, { 5, 7 }, { 11, 7 }, { 7, 8 }, { 9, 8 }, + { 230, 8 }, { 42, 8 }, { 65, 7 }, { 207, 7 }, { 71, 9 }, + { 201, 9 }, { 199, 9 }, { 73, 9 }, { 38, 8 }, { 234, 8 }, + { 32, 7 }, { 224, 7 }, { 193, 7 }, { 79, 7 }, { 165, 9 }, + { 107, 9 }, { 182, 9 }, { 90, 9 }, { 35, 8 }, { 237, 8 }, + { 244, 7 }, { 28, 7 }, { 20, 7 }, { 252, 7 }, { 50, 8 }, + { 222, 8 }, { 97, 8 }, { 175, 8 }, { 101, 9 }, { 171, 9 }, + { 86, 9 }, { 186, 9 }, { 83, 8 }, { 189, 8 }, { 161, 8 }, + { 111, 8 }, { 179, 8 }, { 93, 8 }, { 64, 7 }, { 192, 7 }, + { 227, 8 }, { 45, 8 }, { 210, 8 }, { 62, 8 }, { 2, 7 }, + { 14, 7 }, { 213, 8 }, { 59, 8 }, { 53, 8 }, { 219, 8 }, + { 196, 8 }, { 76, 8 }, { 115, 9 }, { 157, 9 }, { 151, 10 }, + { 121, 10 }, { 119, 10 }, { 153, 10 }, { 68, 8 }, { 204, 8 }, + { 22, 8 }, { 250, 8 }, { 96, 8 }, { 160, 8 }, { 147, 9 }, + { 125, 9 }, { 55, 9 }, { 217, 9 }, { 246, 8 }, { 26, 8 }, + { 215, 9 }, { 57, 9 }, { 164, 9 }, { 108, 9 }, { 17, 7 }, + { 255, 7 }, { 4, 7 }, { 12, 7 }, { 241, 7 }, { 31, 7 }, + { 114, 9 }, { 158, 9 }, { 100, 9 }, { 172, 9 }, { 6, 8 }, + { 10, 8 }, { 209, 8 }, { 63, 8 }, { 19, 8 }, { 253, 8 }, + { 49, 8 }, { 223, 8 }, { 195, 8 }, { 77, 8 }, { 212, 8 }, + { 60, 8 }, { 198, 9 }, { 74, 9 }, { 70, 9 }, { 202, 9 }, + { 82, 8 }, { 190, 8 }, { 243, 8 }, { 29, 8 }, { 146, 9 }, + { 126, 9 }, { 118, 10 }, { 154, 10 }, { 167, 10 }, { 105, 10 }, + { 178, 8 }, { 94, 8 }, { 67, 8 }, { 205, 8 }, { 85, 9 }, + { 187, 9 }, { 181, 9 }, { 91, 9 }, { 52, 8 }, { 220, 8 }, + { 150, 10 }, { 122, 10 }, { 103, 10 }, { 169, 10 }, { 231, 9 }, + { 41, 9 }, { 229, 8 }, { 43, 8 }, { 48, 8 }, { 208, 8 }, + { 37, 8 }, { 235, 8 }, { 34, 8 }, { 238, 8 }, { 226, 8 }, + { 46, 8 }, { 39, 9 }, { 233, 9 }, { 145, 9 }, { 127, 9 }, +}; + +static const uint8_t huff_spec_a43_tab[225][2] = { + { 246, 8 }, { 26, 8 }, { 22, 8 }, { 250, 8 }, { 210, 7 }, + { 62, 7 }, { 50, 7 }, { 222, 7 }, { 53, 8 }, { 219, 8 }, + { 231, 9 }, { 41, 9 }, { 39, 9 }, { 233, 9 }, { 16, 5 }, + { 240, 5 }, { 0, 4 }, { 227, 7 }, { 45, 7 }, { 35, 7 }, + { 237, 7 }, { 196, 8 }, { 76, 8 }, { 151, 10 }, { 121, 10 }, + { 119, 10 }, { 153, 10 }, { 150, 10 }, { 122, 10 }, { 167, 10 }, + { 105, 10 }, { 118, 10 }, { 154, 10 }, { 103, 10 }, { 169, 10 }, + { 117, 10 }, { 155, 10 }, { 149, 10 }, { 123, 10 }, { 96, 8 }, + { 160, 8 }, { 166, 10 }, { 106, 10 }, { 183, 10 }, { 89, 10 }, + { 87, 10 }, { 185, 10 }, { 102, 10 }, { 170, 10 }, { 71, 10 }, + { 201, 10 }, { 116, 10 }, { 156, 10 }, { 148, 10 }, { 124, 10 }, + { 199, 10 }, { 73, 10 }, { 182, 10 }, { 90, 10 }, { 165, 10 }, + { 107, 10 }, { 181, 9 }, { 91, 9 }, { 68, 8 }, { 204, 8 }, + { 85, 9 }, { 187, 9 }, { 113, 9 }, { 159, 9 }, { 6, 8 }, + { 10, 8 }, { 65, 7 }, { 207, 7 }, { 32, 6 }, { 224, 6 }, + { 2, 6 }, { 14, 6 }, { 193, 7 }, { 79, 7 }, { 145, 9 }, + { 127, 9 }, { 163, 9 }, { 109, 9 }, { 99, 9 }, { 173, 9 }, + { 247, 9 }, { 25, 9 }, { 20, 7 }, { 252, 7 }, { 244, 7 }, + { 28, 7 }, { 178, 8 }, { 94, 8 }, { 82, 8 }, { 190, 8 }, + { 23, 9 }, { 249, 9 }, { 54, 9 }, { 218, 9 }, { 214, 9 }, + { 58, 9 }, { 112, 9 }, { 144, 9 }, { 49, 7 }, { 223, 7 }, + { 209, 7 }, { 63, 7 }, { 37, 8 }, { 235, 8 }, { 229, 8 }, + { 43, 8 }, { 19, 7 }, { 253, 7 }, { 243, 7 }, { 29, 7 }, + { 64, 7 }, { 192, 7 }, { 195, 8 }, { 77, 8 }, { 67, 8 }, + { 205, 8 }, { 212, 8 }, { 60, 8 }, { 52, 8 }, { 220, 8 }, + { 7, 9 }, { 9, 9 }, { 180, 9 }, { 92, 9 }, { 197, 9 }, + { 75, 9 }, { 84, 9 }, { 188, 9 }, { 4, 7 }, { 12, 7 }, + { 48, 7 }, { 208, 7 }, { 34, 7 }, { 238, 7 }, { 226, 7 }, + { 46, 7 }, { 101, 10 }, { 171, 10 }, { 86, 10 }, { 186, 10 }, + { 69, 9 }, { 203, 9 }, { 211, 8 }, { 61, 8 }, { 17, 6 }, + { 255, 6 }, { 241, 6 }, { 31, 6 }, { 3, 7 }, { 13, 7 }, + { 51, 8 }, { 221, 8 }, { 98, 9 }, { 174, 9 }, { 162, 9 }, + { 110, 9 }, { 177, 8 }, { 95, 8 }, { 81, 8 }, { 191, 8 }, + { 38, 9 }, { 234, 9 }, { 230, 9 }, { 42, 9 }, { 21, 8 }, + { 251, 8 }, { 245, 8 }, { 27, 8 }, { 115, 10 }, { 157, 10 }, + { 55, 10 }, { 217, 10 }, { 147, 10 }, { 125, 10 }, { 215, 10 }, + { 57, 10 }, { 80, 8 }, { 176, 8 }, { 66, 8 }, { 206, 8 }, + { 194, 8 }, { 78, 8 }, { 97, 9 }, { 175, 9 }, { 161, 9 }, + { 111, 9 }, { 5, 8 }, { 11, 8 }, { 228, 8 }, { 44, 8 }, + { 36, 8 }, { 236, 8 }, { 114, 10 }, { 158, 10 }, { 100, 10 }, + { 172, 10 }, { 83, 9 }, { 189, 9 }, { 33, 7 }, { 239, 7 }, + { 164, 10 }, { 108, 10 }, { 198, 10 }, { 74, 10 }, { 179, 9 }, + { 93, 9 }, { 70, 10 }, { 202, 10 }, { 146, 10 }, { 126, 10 }, + { 213, 9 }, { 59, 9 }, { 18, 7 }, { 254, 7 }, { 225, 7 }, + { 47, 7 }, { 242, 7 }, { 30, 7 }, { 1, 6 }, { 15, 6 }, +}; + +static const uint8_t huff_spec_a44_tab[225][2] = { + { 193, 7 }, { 79, 7 }, { 20, 7 }, { 252, 7 }, { 151, 10 }, + { 121, 10 }, { 119, 10 }, { 153, 10 }, { 118, 10 }, { 154, 10 }, + { 150, 10 }, { 122, 10 }, { 167, 10 }, { 105, 10 }, { 103, 10 }, + { 169, 10 }, { 117, 10 }, { 155, 10 }, { 149, 10 }, { 123, 10 }, + { 244, 7 }, { 28, 7 }, { 87, 10 }, { 185, 10 }, { 183, 10 }, + { 89, 10 }, { 166, 10 }, { 106, 10 }, { 102, 10 }, { 170, 10 }, + { 71, 10 }, { 201, 10 }, { 148, 10 }, { 124, 10 }, { 199, 10 }, + { 73, 10 }, { 116, 10 }, { 156, 10 }, { 165, 10 }, { 107, 10 }, + { 182, 10 }, { 90, 10 }, { 86, 10 }, { 186, 10 }, { 115, 10 }, + { 157, 10 }, { 101, 10 }, { 171, 10 }, { 147, 10 }, { 125, 10 }, + { 55, 10 }, { 217, 10 }, { 215, 10 }, { 57, 10 }, { 114, 10 }, + { 158, 10 }, { 146, 10 }, { 126, 10 }, { 164, 10 }, { 108, 10 }, + { 39, 10 }, { 233, 10 }, { 100, 10 }, { 172, 10 }, { 231, 10 }, + { 41, 10 }, { 198, 10 }, { 74, 10 }, { 70, 10 }, { 202, 10 }, + { 145, 10 }, { 127, 10 }, { 181, 10 }, { 91, 10 }, { 85, 10 }, + { 187, 10 }, { 113, 10 }, { 159, 10 }, { 247, 10 }, { 25, 10 }, + { 112, 10 }, { 144, 10 }, { 23, 10 }, { 249, 10 }, { 7, 10 }, + { 9, 10 }, { 99, 10 }, { 173, 10 }, { 54, 10 }, { 218, 10 }, + { 163, 10 }, { 109, 10 }, { 214, 10 }, { 58, 10 }, { 197, 10 }, + { 75, 10 }, { 84, 10 }, { 188, 10 }, { 98, 10 }, { 174, 10 }, + { 69, 10 }, { 203, 10 }, { 67, 8 }, { 205, 8 }, { 180, 10 }, + { 92, 10 }, { 162, 10 }, { 110, 10 }, { 97, 9 }, { 175, 9 }, + { 81, 8 }, { 191, 8 }, { 177, 8 }, { 95, 8 }, { 210, 7 }, + { 62, 7 }, { 212, 8 }, { 60, 8 }, { 195, 8 }, { 77, 8 }, + { 35, 7 }, { 237, 7 }, { 64, 7 }, { 192, 7 }, { 50, 7 }, + { 222, 7 }, { 227, 7 }, { 45, 7 }, { 52, 8 }, { 220, 8 }, + { 21, 8 }, { 251, 8 }, { 4, 7 }, { 12, 7 }, { 245, 8 }, + { 27, 8 }, { 161, 9 }, { 111, 9 }, { 22, 9 }, { 250, 9 }, + { 225, 6 }, { 47, 6 }, { 33, 6 }, { 239, 6 }, { 18, 6 }, + { 254, 6 }, { 242, 6 }, { 30, 6 }, { 80, 8 }, { 176, 8 }, + { 246, 9 }, { 26, 9 }, { 96, 9 }, { 160, 9 }, { 5, 8 }, + { 11, 8 }, { 6, 9 }, { 10, 9 }, { 179, 9 }, { 93, 9 }, + { 83, 9 }, { 189, 9 }, { 53, 9 }, { 219, 9 }, { 213, 9 }, + { 59, 9 }, { 196, 9 }, { 76, 9 }, { 49, 7 }, { 223, 7 }, + { 16, 5 }, { 240, 5 }, { 1, 5 }, { 15, 5 }, { 0, 4 }, + { 209, 7 }, { 63, 7 }, { 19, 7 }, { 253, 7 }, { 32, 6 }, + { 224, 6 }, { 2, 6 }, { 14, 6 }, { 243, 7 }, { 29, 7 }, + { 51, 8 }, { 221, 8 }, { 211, 8 }, { 61, 8 }, { 66, 8 }, + { 206, 8 }, { 194, 8 }, { 78, 8 }, { 228, 8 }, { 44, 8 }, + { 36, 8 }, { 236, 8 }, { 48, 7 }, { 208, 7 }, { 3, 7 }, + { 13, 7 }, { 68, 9 }, { 204, 9 }, { 82, 9 }, { 190, 9 }, + { 178, 9 }, { 94, 9 }, { 37, 9 }, { 235, 9 }, { 34, 7 }, + { 238, 7 }, { 226, 7 }, { 46, 7 }, { 229, 9 }, { 43, 9 }, + { 38, 10 }, { 234, 10 }, { 230, 10 }, { 42, 10 }, { 65, 8 }, + { 207, 8 }, { 17, 6 }, { 255, 6 }, { 241, 6 }, { 31, 6 }, +}; + +static const uint8_t huff_spec_a51_tab[31][2] = { + { 8, 4 }, { 24, 4 }, { 15, 5 }, { 17, 5 }, { 4, 5 }, + { 28, 5 }, { 9, 4 }, { 23, 4 }, { 14, 5 }, { 18, 5 }, + { 3, 5 }, { 29, 5 }, { 13, 5 }, { 19, 5 }, { 2, 5 }, + { 30, 5 }, { 12, 5 }, { 20, 5 }, { 1, 5 }, { 31, 5 }, + { 7, 6 }, { 25, 6 }, { 0, 5 }, { 11, 5 }, { 21, 5 }, + { 6, 6 }, { 26, 6 }, { 5, 6 }, { 27, 6 }, { 10, 5 }, + { 22, 5 }, +}; + +static const uint8_t huff_spec_a52_tab[31][2] = { + { 2, 4 }, { 30, 4 }, { 11, 5 }, { 21, 5 }, { 7, 5 }, + { 25, 5 }, { 1, 4 }, { 31, 4 }, { 6, 5 }, { 26, 5 }, + { 10, 5 }, { 22, 5 }, { 15, 6 }, { 17, 6 }, { 14, 6 }, + { 18, 6 }, { 0, 4 }, { 5, 5 }, { 27, 5 }, { 9, 5 }, + { 23, 5 }, { 8, 5 }, { 24, 5 }, { 4, 5 }, { 28, 5 }, + { 13, 6 }, { 19, 6 }, { 12, 6 }, { 20, 6 }, { 3, 5 }, + { 29, 5 }, +}; + +static const uint8_t huff_spec_a53_tab[31][2] = { + { 0, 3 }, { 9, 5 }, { 23, 5 }, { 7, 5 }, { 25, 5 }, + { 3, 4 }, { 29, 4 }, { 8, 5 }, { 24, 5 }, { 15, 7 }, + { 17, 7 }, { 14, 7 }, { 18, 7 }, { 11, 6 }, { 21, 6 }, + { 2, 4 }, { 30, 4 }, { 6, 5 }, { 26, 5 }, { 5, 5 }, + { 27, 5 }, { 1, 4 }, { 31, 4 }, { 10, 6 }, { 22, 6 }, + { 13, 7 }, { 19, 7 }, { 12, 7 }, { 20, 7 }, { 4, 5 }, + { 28, 5 }, +}; + +static const uint8_t huff_spec_a54_tab[31][2] = { + { 8, 5 }, { 24, 5 }, { 7, 5 }, { 25, 5 }, { 4, 4 }, + { 28, 4 }, { 0, 3 }, { 10, 6 }, { 22, 6 }, { 13, 7 }, + { 19, 7 }, { 12, 7 }, { 20, 7 }, { 6, 5 }, { 26, 5 }, + { 3, 4 }, { 29, 4 }, { 2, 4 }, { 30, 4 }, { 9, 6 }, + { 23, 6 }, { 15, 8 }, { 17, 8 }, { 14, 8 }, { 18, 8 }, + { 11, 7 }, { 21, 7 }, { 5, 5 }, { 27, 5 }, { 1, 4 }, + { 31, 4 }, +}; + +static const uint8_t huff_spec_a61_tab[63][2] = { + { 19, 5 }, { 45, 5 }, { 31, 6 }, { 33, 6 }, { 30, 6 }, + { 34, 6 }, { 16, 5 }, { 48, 5 }, { 8, 6 }, { 56, 6 }, + { 7, 6 }, { 57, 6 }, { 18, 5 }, { 46, 5 }, { 29, 6 }, + { 35, 6 }, { 28, 6 }, { 36, 6 }, { 6, 6 }, { 58, 6 }, + { 27, 6 }, { 37, 6 }, { 17, 5 }, { 47, 5 }, { 5, 6 }, + { 59, 6 }, { 26, 6 }, { 38, 6 }, { 4, 6 }, { 60, 6 }, + { 25, 6 }, { 39, 6 }, { 3, 6 }, { 61, 6 }, { 2, 6 }, + { 62, 6 }, { 24, 6 }, { 40, 6 }, { 15, 7 }, { 49, 7 }, + { 14, 7 }, { 50, 7 }, { 1, 6 }, { 63, 6 }, { 23, 6 }, + { 41, 6 }, { 13, 7 }, { 51, 7 }, { 0, 6 }, { 22, 6 }, + { 42, 6 }, { 12, 7 }, { 52, 7 }, { 11, 7 }, { 53, 7 }, + { 21, 6 }, { 43, 6 }, { 20, 6 }, { 44, 6 }, { 10, 7 }, + { 54, 7 }, { 9, 7 }, { 55, 7 }, +}; + +static const uint8_t huff_spec_a62_tab[63][2] = { + { 23, 6 }, { 41, 6 }, { 15, 6 }, { 49, 6 }, { 4, 5 }, + { 60, 5 }, { 3, 5 }, { 61, 5 }, { 22, 6 }, { 42, 6 }, + { 14, 6 }, { 50, 6 }, { 2, 5 }, { 62, 5 }, { 31, 7 }, + { 33, 7 }, { 30, 7 }, { 34, 7 }, { 21, 6 }, { 43, 6 }, + { 13, 6 }, { 51, 6 }, { 12, 6 }, { 52, 6 }, { 1, 5 }, + { 63, 5 }, { 20, 6 }, { 44, 6 }, { 29, 7 }, { 35, 7 }, + { 28, 7 }, { 36, 7 }, { 11, 6 }, { 53, 6 }, { 19, 6 }, + { 45, 6 }, { 0, 5 }, { 10, 6 }, { 54, 6 }, { 18, 6 }, + { 46, 6 }, { 27, 7 }, { 37, 7 }, { 26, 7 }, { 38, 7 }, + { 9, 6 }, { 55, 6 }, { 16, 6 }, { 48, 6 }, { 8, 6 }, + { 56, 6 }, { 17, 6 }, { 47, 6 }, { 7, 6 }, { 57, 6 }, + { 25, 7 }, { 39, 7 }, { 24, 7 }, { 40, 7 }, { 6, 6 }, + { 58, 6 }, { 5, 6 }, { 59, 6 }, +}; + +static const uint8_t huff_spec_a63_tab[63][2] = { + { 0, 4 }, { 7, 5 }, { 57, 5 }, { 15, 6 }, { 49, 6 }, + { 25, 7 }, { 39, 7 }, { 24, 7 }, { 40, 7 }, { 18, 6 }, + { 46, 6 }, { 14, 6 }, { 50, 6 }, { 6, 5 }, { 58, 5 }, + { 5, 5 }, { 59, 5 }, { 31, 8 }, { 33, 8 }, { 30, 8 }, + { 34, 8 }, { 23, 7 }, { 41, 7 }, { 17, 6 }, { 47, 6 }, + { 13, 6 }, { 51, 6 }, { 16, 6 }, { 48, 6 }, { 4, 5 }, + { 60, 5 }, { 12, 6 }, { 52, 6 }, { 22, 7 }, { 42, 7 }, + { 29, 8 }, { 35, 8 }, { 28, 8 }, { 36, 8 }, { 3, 5 }, + { 61, 5 }, { 11, 6 }, { 53, 6 }, { 10, 6 }, { 54, 6 }, + { 2, 5 }, { 62, 5 }, { 21, 7 }, { 43, 7 }, { 20, 7 }, + { 44, 7 }, { 9, 6 }, { 55, 6 }, { 1, 5 }, { 63, 5 }, + { 27, 8 }, { 37, 8 }, { 26, 8 }, { 38, 8 }, { 19, 7 }, + { 45, 7 }, { 8, 6 }, { 56, 6 }, +}; + +static const uint8_t huff_spec_a64_tab[63][2] = { + { 16, 6 }, { 48, 6 }, { 27, 8 }, { 37, 8 }, { 26, 8 }, + { 38, 8 }, { 21, 7 }, { 43, 7 }, { 8, 5 }, { 56, 5 }, + { 1, 4 }, { 63, 4 }, { 14, 6 }, { 50, 6 }, { 20, 7 }, + { 44, 7 }, { 31, 9 }, { 33, 9 }, { 30, 9 }, { 34, 9 }, + { 25, 8 }, { 39, 8 }, { 7, 5 }, { 57, 5 }, { 0, 4 }, + { 6, 5 }, { 58, 5 }, { 13, 6 }, { 51, 6 }, { 12, 6 }, + { 52, 6 }, { 5, 5 }, { 59, 5 }, { 19, 7 }, { 45, 7 }, + { 24, 8 }, { 40, 8 }, { 29, 9 }, { 35, 9 }, { 28, 9 }, + { 36, 9 }, { 11, 6 }, { 53, 6 }, { 4, 5 }, { 60, 5 }, + { 18, 7 }, { 46, 7 }, { 23, 8 }, { 41, 8 }, { 22, 8 }, + { 42, 8 }, { 10, 6 }, { 54, 6 }, { 3, 5 }, { 61, 5 }, + { 2, 5 }, { 62, 5 }, { 17, 7 }, { 47, 7 }, { 15, 7 }, + { 49, 7 }, { 9, 6 }, { 55, 6 }, +}; + +static const uint8_t huff_spec_a71_tab[127][2] = { + { 18, 7 }, { 110, 7 }, { 63, 7 }, { 65, 7 }, { 38, 6 }, + { 90, 6 }, { 17, 7 }, { 111, 7 }, { 62, 7 }, { 66, 7 }, + { 61, 7 }, { 67, 7 }, { 16, 7 }, { 112, 7 }, { 37, 6 }, + { 91, 6 }, { 60, 7 }, { 68, 7 }, { 15, 7 }, { 113, 7 }, + { 32, 6 }, { 96, 6 }, { 59, 7 }, { 69, 7 }, { 14, 7 }, + { 114, 7 }, { 36, 6 }, { 92, 6 }, { 58, 7 }, { 70, 7 }, + { 13, 7 }, { 115, 7 }, { 57, 7 }, { 71, 7 }, { 12, 7 }, + { 116, 7 }, { 35, 6 }, { 93, 6 }, { 56, 7 }, { 72, 7 }, + { 55, 7 }, { 73, 7 }, { 11, 7 }, { 117, 7 }, { 10, 7 }, + { 118, 7 }, { 34, 6 }, { 94, 6 }, { 54, 7 }, { 74, 7 }, + { 9, 7 }, { 119, 7 }, { 33, 6 }, { 95, 6 }, { 53, 7 }, + { 75, 7 }, { 52, 7 }, { 76, 7 }, { 8, 7 }, { 120, 7 }, + { 51, 7 }, { 77, 7 }, { 50, 7 }, { 78, 7 }, { 7, 7 }, + { 121, 7 }, { 5, 7 }, { 123, 7 }, { 6, 7 }, { 122, 7 }, + { 49, 7 }, { 79, 7 }, { 4, 7 }, { 124, 7 }, { 31, 8 }, + { 97, 8 }, { 30, 8 }, { 98, 8 }, { 48, 7 }, { 80, 7 }, + { 3, 7 }, { 125, 7 }, { 29, 8 }, { 99, 8 }, { 28, 8 }, + { 100, 8 }, { 47, 7 }, { 81, 7 }, { 2, 7 }, { 126, 7 }, + { 46, 7 }, { 82, 7 }, { 1, 7 }, { 127, 7 }, { 27, 8 }, + { 101, 8 }, { 26, 8 }, { 102, 8 }, { 45, 7 }, { 83, 7 }, + { 0, 7 }, { 25, 8 }, { 103, 8 }, { 44, 7 }, { 84, 7 }, + { 24, 8 }, { 104, 8 }, { 23, 8 }, { 105, 8 }, { 43, 7 }, + { 85, 7 }, { 42, 7 }, { 86, 7 }, { 22, 8 }, { 106, 8 }, + { 21, 8 }, { 107, 8 }, { 41, 7 }, { 87, 7 }, { 20, 8 }, + { 108, 8 }, { 19, 8 }, { 109, 8 }, { 40, 7 }, { 88, 7 }, + { 39, 7 }, { 89, 7 }, +}; + +static const uint8_t huff_spec_a72_tab[127][2] = { + { 47, 7 }, { 81, 7 }, { 46, 7 }, { 82, 7 }, { 8, 6 }, + { 120, 6 }, { 31, 7 }, { 97, 7 }, { 45, 7 }, { 83, 7 }, + { 7, 6 }, { 121, 6 }, { 30, 7 }, { 98, 7 }, { 29, 7 }, + { 99, 7 }, { 6, 6 }, { 122, 6 }, { 63, 8 }, { 65, 8 }, + { 62, 8 }, { 66, 8 }, { 44, 7 }, { 84, 7 }, { 5, 6 }, + { 123, 6 }, { 28, 7 }, { 100, 7 }, { 43, 7 }, { 85, 7 }, + { 4, 6 }, { 124, 6 }, { 27, 7 }, { 101, 7 }, { 26, 7 }, + { 102, 7 }, { 42, 7 }, { 86, 7 }, { 61, 8 }, { 67, 8 }, + { 60, 8 }, { 68, 8 }, { 3, 6 }, { 125, 6 }, { 25, 7 }, + { 103, 7 }, { 41, 7 }, { 87, 7 }, { 2, 6 }, { 126, 6 }, + { 24, 7 }, { 104, 7 }, { 59, 8 }, { 69, 8 }, { 58, 8 }, + { 70, 8 }, { 40, 7 }, { 88, 7 }, { 23, 7 }, { 105, 7 }, + { 39, 7 }, { 89, 7 }, { 22, 7 }, { 106, 7 }, { 1, 6 }, + { 127, 6 }, { 57, 8 }, { 71, 8 }, { 56, 8 }, { 72, 8 }, + { 21, 7 }, { 107, 7 }, { 38, 7 }, { 90, 7 }, { 20, 7 }, + { 108, 7 }, { 0, 6 }, { 55, 8 }, { 73, 8 }, { 54, 8 }, + { 74, 8 }, { 37, 7 }, { 91, 7 }, { 19, 7 }, { 109, 7 }, + { 18, 7 }, { 110, 7 }, { 36, 7 }, { 92, 7 }, { 53, 8 }, + { 75, 8 }, { 52, 8 }, { 76, 8 }, { 17, 7 }, { 111, 7 }, + { 35, 7 }, { 93, 7 }, { 32, 7 }, { 96, 7 }, { 16, 7 }, + { 112, 7 }, { 15, 7 }, { 113, 7 }, { 34, 7 }, { 94, 7 }, + { 51, 8 }, { 77, 8 }, { 50, 8 }, { 78, 8 }, { 14, 7 }, + { 114, 7 }, { 13, 7 }, { 115, 7 }, { 33, 7 }, { 95, 7 }, + { 12, 7 }, { 116, 7 }, { 49, 8 }, { 79, 8 }, { 48, 8 }, + { 80, 8 }, { 11, 7 }, { 117, 7 }, { 10, 7 }, { 118, 7 }, + { 9, 7 }, { 119, 7 }, +}; + +static const uint8_t huff_spec_a73_tab[127][2] = { + { 15, 6 }, { 113, 6 }, { 31, 7 }, { 97, 7 }, { 51, 8 }, + { 77, 8 }, { 50, 8 }, { 78, 8 }, { 14, 6 }, { 114, 6 }, + { 0, 5 }, { 37, 7 }, { 91, 7 }, { 30, 7 }, { 98, 7 }, + { 13, 6 }, { 115, 6 }, { 29, 7 }, { 99, 7 }, { 49, 8 }, + { 79, 8 }, { 63, 9 }, { 65, 9 }, { 62, 9 }, { 66, 9 }, + { 12, 6 }, { 116, 6 }, { 36, 7 }, { 92, 7 }, { 28, 7 }, + { 100, 7 }, { 35, 7 }, { 93, 7 }, { 48, 8 }, { 80, 8 }, + { 47, 8 }, { 81, 8 }, { 11, 6 }, { 117, 6 }, { 10, 6 }, + { 118, 6 }, { 27, 7 }, { 101, 7 }, { 34, 7 }, { 94, 7 }, + { 61, 9 }, { 67, 9 }, { 60, 9 }, { 68, 9 }, { 46, 8 }, + { 82, 8 }, { 26, 7 }, { 102, 7 }, { 9, 6 }, { 119, 6 }, + { 32, 7 }, { 96, 7 }, { 33, 7 }, { 95, 7 }, { 8, 6 }, + { 120, 6 }, { 25, 7 }, { 103, 7 }, { 45, 8 }, { 83, 8 }, + { 59, 9 }, { 69, 9 }, { 58, 9 }, { 70, 9 }, { 7, 6 }, + { 121, 6 }, { 24, 7 }, { 104, 7 }, { 23, 7 }, { 105, 7 }, + { 6, 6 }, { 122, 6 }, { 44, 8 }, { 84, 8 }, { 57, 9 }, + { 71, 9 }, { 56, 9 }, { 72, 9 }, { 22, 7 }, { 106, 7 }, + { 5, 6 }, { 123, 6 }, { 43, 8 }, { 85, 8 }, { 42, 8 }, + { 86, 8 }, { 21, 7 }, { 107, 7 }, { 4, 6 }, { 124, 6 }, + { 20, 7 }, { 108, 7 }, { 55, 9 }, { 73, 9 }, { 54, 9 }, + { 74, 9 }, { 41, 8 }, { 87, 8 }, { 3, 6 }, { 125, 6 }, + { 19, 7 }, { 109, 7 }, { 18, 7 }, { 110, 7 }, { 2, 6 }, + { 126, 6 }, { 40, 8 }, { 88, 8 }, { 53, 9 }, { 75, 9 }, + { 52, 9 }, { 76, 9 }, { 17, 7 }, { 111, 7 }, { 39, 8 }, + { 89, 8 }, { 38, 8 }, { 90, 8 }, { 16, 7 }, { 112, 7 }, + { 1, 6 }, { 127, 6 }, +}; + +static const uint8_t huff_spec_a74_tab[127][2] = { + { 3, 5 }, { 125, 5 }, { 32, 7 }, { 96, 7 }, { 29, 7 }, + { 99, 7 }, { 16, 6 }, { 112, 6 }, { 2, 5 }, { 126, 5 }, + { 53, 9 }, { 75, 9 }, { 52, 9 }, { 76, 9 }, { 42, 8 }, + { 86, 8 }, { 28, 7 }, { 100, 7 }, { 15, 6 }, { 113, 6 }, + { 63, 10 }, { 65, 10 }, { 62, 10 }, { 66, 10 }, { 51, 9 }, + { 77, 9 }, { 41, 8 }, { 87, 8 }, { 27, 7 }, { 101, 7 }, + { 14, 6 }, { 114, 6 }, { 1, 5 }, { 127, 5 }, { 13, 6 }, + { 115, 6 }, { 0, 5 }, { 26, 7 }, { 102, 7 }, { 40, 8 }, + { 88, 8 }, { 50, 9 }, { 78, 9 }, { 61, 10 }, { 67, 10 }, + { 60, 10 }, { 68, 10 }, { 12, 6 }, { 116, 6 }, { 25, 7 }, + { 103, 7 }, { 39, 8 }, { 89, 8 }, { 49, 9 }, { 79, 9 }, + { 48, 9 }, { 80, 9 }, { 11, 6 }, { 117, 6 }, { 24, 7 }, + { 104, 7 }, { 38, 8 }, { 90, 8 }, { 59, 10 }, { 69, 10 }, + { 58, 10 }, { 70, 10 }, { 47, 9 }, { 81, 9 }, { 10, 6 }, + { 118, 6 }, { 9, 6 }, { 119, 6 }, { 23, 7 }, { 105, 7 }, + { 22, 7 }, { 106, 7 }, { 8, 6 }, { 120, 6 }, { 37, 8 }, + { 91, 8 }, { 36, 8 }, { 92, 8 }, { 21, 7 }, { 107, 7 }, + { 7, 6 }, { 121, 6 }, { 6, 6 }, { 122, 6 }, { 57, 10 }, + { 71, 10 }, { 56, 10 }, { 72, 10 }, { 46, 9 }, { 82, 9 }, + { 35, 8 }, { 93, 8 }, { 20, 7 }, { 108, 7 }, { 5, 6 }, + { 123, 6 }, { 19, 7 }, { 109, 7 }, { 45, 9 }, { 83, 9 }, + { 44, 9 }, { 84, 9 }, { 31, 8 }, { 97, 8 }, { 4, 6 }, + { 124, 6 }, { 34, 8 }, { 94, 8 }, { 55, 10 }, { 73, 10 }, + { 54, 10 }, { 74, 10 }, { 43, 9 }, { 85, 9 }, { 18, 7 }, + { 110, 7 }, { 30, 8 }, { 98, 8 }, { 33, 8 }, { 95, 8 }, + { 17, 7 }, { 111, 7 }, +}; + +static const uint8_t huff_spec_b22_tab[80][2] = { + { 80, 5 }, { 240, 5 }, { 253, 10 }, { 87, 10 }, { 117, 10 }, + { 223, 10 }, { 93, 10 }, { 247, 10 }, { 221, 10 }, { 119, 10 }, + { 213, 10 }, { 127, 10 }, { 85, 10 }, { 255, 10 }, { 245, 10 }, + { 95, 10 }, { 81, 10 }, { 243, 10 }, { 17, 7 }, { 51, 7 }, + { 20, 6 }, { 60, 6 }, { 116, 9 }, { 220, 9 }, { 84, 9 }, + { 252, 9 }, { 68, 8 }, { 204, 8 }, { 212, 7 }, { 124, 7 }, + { 196, 6 }, { 76, 6 }, { 5, 5 }, { 15, 5 }, { 53, 7 }, + { 31, 7 }, { 61, 7 }, { 23, 7 }, { 52, 6 }, { 28, 6 }, + { 13, 5 }, { 7, 5 }, { 16, 4 }, { 48, 4 }, { 4, 4 }, + { 12, 4 }, { 49, 6 }, { 19, 6 }, { 244, 7 }, { 92, 7 }, + { 21, 9 }, { 63, 9 }, { 197, 9 }, { 79, 9 }, { 69, 10 }, + { 207, 10 }, { 205, 10 }, { 71, 10 }, { 241, 9 }, { 83, 9 }, + { 208, 6 }, { 112, 6 }, { 77, 9 }, { 199, 9 }, { 113, 9 }, + { 211, 9 }, { 29, 9 }, { 55, 9 }, { 209, 10 }, { 115, 10 }, + { 125, 10 }, { 215, 10 }, { 65, 8 }, { 195, 8 }, { 193, 8 }, + { 67, 8 }, { 64, 4 }, { 192, 4 }, { 1, 4 }, { 3, 4 }, +}; + +static const uint8_t huff_spec_b23_tab[81][2] = { + { 16, 4 }, { 48, 4 }, { 4, 4 }, { 12, 4 }, { 64, 4 }, + { 192, 4 }, { 5, 6 }, { 15, 6 }, { 13, 6 }, { 7, 6 }, + { 212, 8 }, { 124, 8 }, { 213, 10 }, { 127, 10 }, { 93, 10 }, + { 247, 10 }, { 117, 10 }, { 223, 10 }, { 253, 10 }, { 87, 10 }, + { 21, 9 }, { 63, 9 }, { 221, 10 }, { 119, 10 }, { 81, 10 }, + { 243, 10 }, { 205, 10 }, { 71, 10 }, { 69, 10 }, { 207, 10 }, + { 245, 10 }, { 95, 10 }, { 209, 10 }, { 115, 10 }, { 125, 10 }, + { 215, 10 }, { 85, 10 }, { 255, 10 }, { 116, 10 }, { 220, 10 }, + { 241, 10 }, { 83, 10 }, { 77, 10 }, { 199, 10 }, { 84, 10 }, + { 252, 10 }, { 29, 9 }, { 55, 9 }, { 61, 8 }, { 23, 8 }, + { 53, 8 }, { 31, 8 }, { 1, 4 }, { 3, 4 }, { 193, 8 }, + { 67, 8 }, { 65, 8 }, { 195, 8 }, { 196, 7 }, { 76, 7 }, + { 49, 7 }, { 19, 7 }, { 20, 7 }, { 60, 7 }, { 52, 7 }, + { 28, 7 }, { 208, 7 }, { 112, 7 }, { 80, 7 }, { 240, 7 }, + { 113, 10 }, { 211, 10 }, { 197, 10 }, { 79, 10 }, { 68, 9 }, + { 204, 9 }, { 17, 9 }, { 51, 9 }, { 244, 9 }, { 92, 9 }, + { 0, 2 }, +}; + +static const uint8_t huff_spec_b24_tab[81][2] = { + { 1, 4 }, { 3, 4 }, { 52, 7 }, { 28, 7 }, { 193, 8 }, + { 67, 8 }, { 213, 10 }, { 127, 10 }, { 253, 10 }, { 87, 10 }, + { 93, 10 }, { 247, 10 }, { 117, 10 }, { 223, 10 }, { 80, 7 }, + { 240, 7 }, { 196, 7 }, { 76, 7 }, { 208, 7 }, { 112, 7 }, + { 221, 10 }, { 119, 10 }, { 245, 10 }, { 95, 10 }, { 69, 10 }, + { 207, 10 }, { 85, 10 }, { 255, 10 }, { 209, 10 }, { 115, 10 }, + { 205, 10 }, { 71, 10 }, { 81, 10 }, { 243, 10 }, { 125, 10 }, + { 215, 10 }, { 5, 7 }, { 15, 7 }, { 116, 10 }, { 220, 10 }, + { 84, 10 }, { 252, 10 }, { 29, 10 }, { 55, 10 }, { 113, 10 }, + { 211, 10 }, { 241, 10 }, { 83, 10 }, { 21, 10 }, { 63, 10 }, + { 197, 10 }, { 79, 10 }, { 77, 10 }, { 199, 10 }, { 16, 5 }, + { 48, 5 }, { 4, 5 }, { 12, 5 }, { 49, 7 }, { 19, 7 }, + { 13, 7 }, { 7, 7 }, { 212, 10 }, { 124, 10 }, { 244, 10 }, + { 92, 10 }, { 68, 9 }, { 204, 9 }, { 53, 9 }, { 31, 9 }, + { 61, 9 }, { 23, 9 }, { 17, 9 }, { 51, 9 }, { 65, 9 }, + { 195, 9 }, { 20, 8 }, { 60, 8 }, { 64, 5 }, { 192, 5 }, + { 0, 1 }, +}; + +static const uint8_t huff_spec_b32_tab[49][2] = { + { 58, 5 }, { 14, 5 }, { 59, 6 }, { 13, 6 }, { 19, 7 }, + { 53, 7 }, { 25, 7 }, { 47, 7 }, { 1, 4 }, { 7, 4 }, + { 0, 2 }, { 9, 6 }, { 63, 6 }, { 57, 6 }, { 15, 6 }, + { 24, 6 }, { 40, 6 }, { 17, 6 }, { 55, 6 }, { 42, 8 }, + { 30, 8 }, { 43, 9 }, { 29, 9 }, { 27, 9 }, { 45, 9 }, + { 41, 7 }, { 31, 7 }, { 3, 6 }, { 5, 6 }, { 8, 5 }, + { 56, 5 }, { 49, 6 }, { 23, 6 }, { 11, 7 }, { 61, 7 }, + { 26, 8 }, { 46, 8 }, { 51, 8 }, { 21, 8 }, { 16, 5 }, + { 48, 5 }, { 18, 7 }, { 54, 7 }, { 50, 7 }, { 22, 7 }, + { 10, 6 }, { 62, 6 }, { 2, 5 }, { 6, 5 }, +}; + +static const uint8_t huff_spec_b33_tab[49][2] = { + { 57, 5 }, { 15, 5 }, { 9, 5 }, { 63, 5 }, { 59, 7 }, + { 13, 7 }, { 50, 7 }, { 22, 7 }, { 18, 7 }, { 54, 7 }, + { 51, 8 }, { 21, 8 }, { 27, 10 }, { 45, 10 }, { 43, 10 }, + { 29, 10 }, { 26, 9 }, { 46, 9 }, { 17, 6 }, { 55, 6 }, + { 49, 6 }, { 23, 6 }, { 8, 4 }, { 56, 4 }, { 16, 5 }, + { 48, 5 }, { 10, 6 }, { 62, 6 }, { 58, 6 }, { 14, 6 }, + { 1, 4 }, { 7, 4 }, { 2, 5 }, { 6, 5 }, { 25, 8 }, + { 47, 8 }, { 42, 9 }, { 30, 9 }, { 19, 9 }, { 53, 9 }, + { 24, 7 }, { 40, 7 }, { 41, 8 }, { 31, 8 }, { 11, 8 }, + { 61, 8 }, { 3, 7 }, { 5, 7 }, { 0, 2 }, +}; + +static const uint8_t huff_spec_b34_tab[49][2] = { + { 0, 1 }, { 8, 4 }, { 56, 4 }, { 1, 4 }, { 7, 4 }, + { 59, 8 }, { 13, 8 }, { 27, 10 }, { 45, 10 }, { 43, 10 }, + { 29, 10 }, { 26, 10 }, { 46, 10 }, { 51, 10 }, { 21, 10 }, + { 18, 8 }, { 54, 8 }, { 50, 8 }, { 22, 8 }, { 16, 6 }, + { 48, 6 }, { 17, 7 }, { 55, 7 }, { 24, 8 }, { 40, 8 }, + { 19, 10 }, { 53, 10 }, { 42, 10 }, { 30, 10 }, { 25, 9 }, + { 47, 9 }, { 49, 7 }, { 23, 7 }, { 10, 7 }, { 62, 7 }, + { 2, 6 }, { 6, 6 }, { 58, 7 }, { 14, 7 }, { 11, 9 }, + { 61, 9 }, { 41, 9 }, { 31, 9 }, { 3, 8 }, { 5, 8 }, + { 9, 6 }, { 63, 6 }, { 57, 6 }, { 15, 6 }, +}; + +static const uint8_t huff_spec_b42_tab[225][2] = { + { 33, 7 }, { 239, 7 }, { 36, 7 }, { 236, 7 }, { 119, 10 }, + { 153, 10 }, { 151, 10 }, { 121, 10 }, { 118, 10 }, { 154, 10 }, + { 167, 10 }, { 105, 10 }, { 247, 8 }, { 25, 8 }, { 112, 8 }, + { 144, 8 }, { 150, 10 }, { 122, 10 }, { 103, 10 }, { 169, 10 }, + { 87, 10 }, { 185, 10 }, { 183, 10 }, { 89, 10 }, { 53, 8 }, + { 219, 8 }, { 213, 8 }, { 59, 8 }, { 228, 7 }, { 44, 7 }, + { 225, 7 }, { 47, 7 }, { 166, 10 }, { 106, 10 }, { 102, 10 }, + { 170, 10 }, { 149, 10 }, { 123, 10 }, { 117, 10 }, { 155, 10 }, + { 114, 9 }, { 158, 9 }, { 165, 10 }, { 107, 10 }, { 148, 10 }, + { 124, 10 }, { 81, 7 }, { 191, 7 }, { 21, 7 }, { 251, 7 }, + { 64, 6 }, { 192, 6 }, { 242, 7 }, { 30, 7 }, { 116, 10 }, + { 156, 10 }, { 71, 10 }, { 201, 10 }, { 101, 10 }, { 171, 10 }, + { 199, 10 }, { 73, 10 }, { 19, 8 }, { 253, 8 }, { 18, 7 }, + { 254, 7 }, { 182, 10 }, { 90, 10 }, { 86, 10 }, { 186, 10 }, + { 39, 9 }, { 233, 9 }, { 34, 8 }, { 238, 8 }, { 2, 6 }, + { 14, 6 }, { 177, 7 }, { 95, 7 }, { 231, 9 }, { 41, 9 }, + { 146, 9 }, { 126, 9 }, { 67, 8 }, { 205, 8 }, { 17, 6 }, + { 255, 6 }, { 241, 6 }, { 31, 6 }, { 16, 5 }, { 240, 5 }, + { 243, 8 }, { 29, 8 }, { 195, 8 }, { 77, 8 }, { 245, 7 }, + { 27, 7 }, { 7, 8 }, { 9, 8 }, { 209, 8 }, { 63, 8 }, + { 99, 9 }, { 173, 9 }, { 163, 9 }, { 109, 9 }, { 226, 8 }, + { 46, 8 }, { 212, 8 }, { 60, 8 }, { 97, 8 }, { 175, 8 }, + { 161, 8 }, { 111, 8 }, { 52, 8 }, { 220, 8 }, { 180, 9 }, + { 92, 9 }, { 50, 9 }, { 222, 9 }, { 35, 9 }, { 237, 9 }, + { 211, 10 }, { 61, 10 }, { 51, 10 }, { 221, 10 }, { 210, 9 }, + { 62, 9 }, { 84, 9 }, { 188, 9 }, { 82, 8 }, { 190, 8 }, + { 4, 6 }, { 12, 6 }, { 227, 9 }, { 45, 9 }, { 214, 9 }, + { 58, 9 }, { 54, 9 }, { 218, 9 }, { 197, 9 }, { 75, 9 }, + { 178, 8 }, { 94, 8 }, { 22, 8 }, { 250, 8 }, { 65, 7 }, + { 207, 7 }, { 80, 7 }, { 176, 7 }, { 246, 8 }, { 26, 8 }, + { 69, 9 }, { 203, 9 }, { 145, 9 }, { 127, 9 }, { 193, 7 }, + { 79, 7 }, { 37, 8 }, { 235, 8 }, { 229, 8 }, { 43, 8 }, + { 5, 7 }, { 11, 7 }, { 20, 7 }, { 252, 7 }, { 244, 7 }, + { 28, 7 }, { 1, 5 }, { 15, 5 }, { 98, 9 }, { 174, 9 }, + { 147, 10 }, { 125, 10 }, { 115, 10 }, { 157, 10 }, { 96, 8 }, + { 160, 8 }, { 113, 9 }, { 159, 9 }, { 38, 9 }, { 234, 9 }, + { 162, 9 }, { 110, 9 }, { 55, 10 }, { 217, 10 }, { 215, 10 }, + { 57, 10 }, { 48, 8 }, { 208, 8 }, { 68, 9 }, { 204, 9 }, + { 164, 10 }, { 108, 10 }, { 100, 10 }, { 172, 10 }, { 32, 7 }, + { 224, 7 }, { 0, 4 }, { 3, 8 }, { 13, 8 }, { 23, 9 }, + { 249, 9 }, { 230, 9 }, { 42, 9 }, { 83, 9 }, { 189, 9 }, + { 181, 10 }, { 91, 10 }, { 198, 10 }, { 74, 10 }, { 6, 8 }, + { 10, 8 }, { 66, 8 }, { 206, 8 }, { 179, 9 }, { 93, 9 }, + { 70, 10 }, { 202, 10 }, { 85, 10 }, { 187, 10 }, { 194, 8 }, + { 78, 8 }, { 196, 9 }, { 76, 9 }, { 49, 9 }, { 223, 9 }, +}; + +static const uint8_t huff_spec_b43_tab[225][2] = { + { 193, 7 }, { 79, 7 }, { 48, 7 }, { 208, 7 }, { 6, 8 }, + { 10, 8 }, { 151, 10 }, { 121, 10 }, { 119, 10 }, { 153, 10 }, + { 167, 10 }, { 105, 10 }, { 118, 10 }, { 154, 10 }, { 103, 10 }, + { 169, 10 }, { 150, 10 }, { 122, 10 }, { 102, 10 }, { 170, 10 }, + { 183, 10 }, { 89, 10 }, { 117, 10 }, { 155, 10 }, { 149, 10 }, + { 123, 10 }, { 166, 10 }, { 106, 10 }, { 87, 10 }, { 185, 10 }, + { 116, 10 }, { 156, 10 }, { 148, 10 }, { 124, 10 }, { 71, 10 }, + { 201, 10 }, { 199, 10 }, { 73, 10 }, { 165, 10 }, { 107, 10 }, + { 182, 10 }, { 90, 10 }, { 101, 10 }, { 171, 10 }, { 86, 10 }, + { 186, 10 }, { 20, 7 }, { 252, 7 }, { 55, 10 }, { 217, 10 }, + { 147, 10 }, { 125, 10 }, { 115, 10 }, { 157, 10 }, { 215, 10 }, + { 57, 10 }, { 100, 10 }, { 172, 10 }, { 181, 10 }, { 91, 10 }, + { 198, 10 }, { 74, 10 }, { 114, 10 }, { 158, 10 }, { 244, 7 }, + { 28, 7 }, { 70, 10 }, { 202, 10 }, { 164, 10 }, { 108, 10 }, + { 85, 10 }, { 187, 10 }, { 146, 10 }, { 126, 10 }, { 39, 10 }, + { 233, 10 }, { 231, 10 }, { 41, 10 }, { 53, 9 }, { 219, 9 }, + { 54, 10 }, { 218, 10 }, { 99, 10 }, { 173, 10 }, { 214, 10 }, + { 58, 10 }, { 163, 10 }, { 109, 10 }, { 197, 10 }, { 75, 10 }, + { 84, 10 }, { 188, 10 }, { 69, 10 }, { 203, 10 }, { 113, 10 }, + { 159, 10 }, { 180, 10 }, { 92, 10 }, { 145, 10 }, { 127, 10 }, + { 98, 10 }, { 174, 10 }, { 23, 10 }, { 249, 10 }, { 247, 10 }, + { 25, 10 }, { 162, 10 }, { 110, 10 }, { 38, 10 }, { 234, 10 }, + { 230, 10 }, { 42, 10 }, { 83, 10 }, { 189, 10 }, { 179, 10 }, + { 93, 10 }, { 211, 10 }, { 61, 10 }, { 112, 10 }, { 144, 10 }, + { 51, 10 }, { 221, 10 }, { 68, 10 }, { 204, 10 }, { 213, 10 }, + { 59, 10 }, { 196, 10 }, { 76, 10 }, { 3, 7 }, { 13, 7 }, + { 66, 8 }, { 206, 8 }, { 81, 8 }, { 191, 8 }, { 32, 6 }, + { 224, 6 }, { 0, 2 }, { 7, 9 }, { 9, 9 }, { 97, 9 }, + { 175, 9 }, { 36, 8 }, { 236, 8 }, { 194, 8 }, { 78, 8 }, + { 177, 8 }, { 95, 8 }, { 2, 6 }, { 14, 6 }, { 21, 8 }, + { 251, 8 }, { 245, 8 }, { 27, 8 }, { 228, 8 }, { 44, 8 }, + { 22, 9 }, { 250, 9 }, { 246, 9 }, { 26, 9 }, { 49, 8 }, + { 223, 8 }, { 19, 8 }, { 253, 8 }, { 209, 8 }, { 63, 8 }, + { 243, 8 }, { 29, 8 }, { 225, 7 }, { 47, 7 }, { 64, 7 }, + { 192, 7 }, { 33, 7 }, { 239, 7 }, { 18, 7 }, { 254, 7 }, + { 242, 7 }, { 30, 7 }, { 161, 9 }, { 111, 9 }, { 178, 9 }, + { 94, 9 }, { 82, 9 }, { 190, 9 }, { 195, 9 }, { 77, 9 }, + { 52, 9 }, { 220, 9 }, { 212, 9 }, { 60, 9 }, { 67, 9 }, + { 205, 9 }, { 37, 9 }, { 235, 9 }, { 34, 8 }, { 238, 8 }, + { 226, 8 }, { 46, 8 }, { 17, 6 }, { 255, 6 }, { 4, 7 }, + { 12, 7 }, { 80, 8 }, { 176, 8 }, { 229, 9 }, { 43, 9 }, + { 35, 9 }, { 237, 9 }, { 16, 5 }, { 240, 5 }, { 241, 6 }, + { 31, 6 }, { 227, 9 }, { 45, 9 }, { 210, 9 }, { 62, 9 }, + { 50, 9 }, { 222, 9 }, { 96, 9 }, { 160, 9 }, { 5, 8 }, + { 11, 8 }, { 65, 8 }, { 207, 8 }, { 1, 5 }, { 15, 5 }, +}; + +static const uint8_t huff_spec_b44_tab[225][2] = { + { 3, 7 }, { 13, 7 }, { 4, 7 }, { 12, 7 }, { 151, 10 }, + { 121, 10 }, { 119, 10 }, { 153, 10 }, { 103, 10 }, { 169, 10 }, + { 167, 10 }, { 105, 10 }, { 150, 10 }, { 122, 10 }, { 118, 10 }, + { 154, 10 }, { 117, 10 }, { 155, 10 }, { 102, 10 }, { 170, 10 }, + { 5, 8 }, { 11, 8 }, { 183, 10 }, { 89, 10 }, { 87, 10 }, + { 185, 10 }, { 166, 10 }, { 106, 10 }, { 149, 10 }, { 123, 10 }, + { 17, 5 }, { 255, 5 }, { 1, 4 }, { 15, 4 }, { 241, 5 }, + { 31, 5 }, { 116, 10 }, { 156, 10 }, { 148, 10 }, { 124, 10 }, + { 199, 10 }, { 73, 10 }, { 182, 10 }, { 90, 10 }, { 71, 10 }, + { 201, 10 }, { 86, 10 }, { 186, 10 }, { 101, 10 }, { 171, 10 }, + { 115, 10 }, { 157, 10 }, { 165, 10 }, { 107, 10 }, { 215, 10 }, + { 57, 10 }, { 55, 10 }, { 217, 10 }, { 70, 10 }, { 202, 10 }, + { 147, 10 }, { 125, 10 }, { 85, 10 }, { 187, 10 }, { 164, 10 }, + { 108, 10 }, { 198, 10 }, { 74, 10 }, { 100, 10 }, { 172, 10 }, + { 114, 10 }, { 158, 10 }, { 39, 10 }, { 233, 10 }, { 146, 10 }, + { 126, 10 }, { 99, 10 }, { 173, 10 }, { 181, 10 }, { 91, 10 }, + { 231, 10 }, { 41, 10 }, { 163, 10 }, { 109, 10 }, { 54, 10 }, + { 218, 10 }, { 214, 10 }, { 58, 10 }, { 113, 10 }, { 159, 10 }, + { 23, 10 }, { 249, 10 }, { 145, 10 }, { 127, 10 }, { 180, 10 }, + { 92, 10 }, { 84, 10 }, { 188, 10 }, { 247, 10 }, { 25, 10 }, + { 32, 6 }, { 224, 6 }, { 197, 10 }, { 75, 10 }, { 98, 10 }, + { 174, 10 }, { 112, 10 }, { 144, 10 }, { 162, 10 }, { 110, 10 }, + { 69, 10 }, { 203, 10 }, { 38, 10 }, { 234, 10 }, { 230, 10 }, + { 42, 10 }, { 7, 10 }, { 9, 10 }, { 213, 10 }, { 59, 10 }, + { 83, 10 }, { 189, 10 }, { 179, 10 }, { 93, 10 }, { 53, 10 }, + { 219, 10 }, { 97, 10 }, { 175, 10 }, { 68, 10 }, { 204, 10 }, + { 196, 10 }, { 76, 10 }, { 161, 10 }, { 111, 10 }, { 22, 10 }, + { 250, 10 }, { 246, 10 }, { 26, 10 }, { 82, 10 }, { 190, 10 }, + { 96, 10 }, { 160, 10 }, { 178, 10 }, { 94, 10 }, { 37, 10 }, + { 235, 10 }, { 67, 10 }, { 205, 10 }, { 51, 10 }, { 221, 10 }, + { 229, 10 }, { 43, 10 }, { 6, 10 }, { 10, 10 }, { 211, 10 }, + { 61, 10 }, { 212, 10 }, { 60, 10 }, { 195, 10 }, { 77, 10 }, + { 52, 10 }, { 220, 10 }, { 81, 10 }, { 191, 10 }, { 177, 10 }, + { 95, 10 }, { 65, 8 }, { 207, 8 }, { 21, 10 }, { 251, 10 }, + { 245, 10 }, { 27, 10 }, { 194, 10 }, { 78, 10 }, { 228, 10 }, + { 44, 10 }, { 193, 8 }, { 79, 8 }, { 20, 8 }, { 252, 8 }, + { 0, 2 }, { 2, 6 }, { 14, 6 }, { 19, 8 }, { 253, 8 }, + { 49, 8 }, { 223, 8 }, { 209, 8 }, { 63, 8 }, { 244, 8 }, + { 28, 8 }, { 66, 10 }, { 206, 10 }, { 210, 10 }, { 62, 10 }, + { 36, 9 }, { 236, 9 }, { 243, 8 }, { 29, 8 }, { 33, 7 }, + { 239, 7 }, { 225, 7 }, { 47, 7 }, { 64, 8 }, { 192, 8 }, + { 80, 9 }, { 176, 9 }, { 50, 9 }, { 222, 9 }, { 18, 7 }, + { 254, 7 }, { 242, 7 }, { 30, 7 }, { 48, 8 }, { 208, 8 }, + { 226, 8 }, { 46, 8 }, { 34, 8 }, { 238, 8 }, { 227, 9 }, + { 45, 9 }, { 35, 9 }, { 237, 9 }, { 16, 5 }, { 240, 5 }, +}; + +static const uint8_t huff_spec_b52_tab[31][2] = { + { 3, 4 }, { 29, 4 }, { 5, 5 }, { 27, 5 }, { 10, 5 }, + { 22, 5 }, { 13, 6 }, { 19, 6 }, { 7, 6 }, { 25, 6 }, + { 4, 5 }, { 28, 5 }, { 2, 4 }, { 30, 4 }, { 9, 5 }, + { 23, 5 }, { 12, 6 }, { 20, 6 }, { 15, 7 }, { 17, 7 }, + { 14, 7 }, { 18, 7 }, { 8, 5 }, { 24, 5 }, { 6, 6 }, + { 26, 6 }, { 11, 6 }, { 21, 6 }, { 0, 3 }, { 1, 4 }, + { 31, 4 }, +}; + +static const uint8_t huff_spec_b53_tab[31][2] = { + { 1, 3 }, { 31, 3 }, { 7, 6 }, { 25, 6 }, { 13, 7 }, + { 19, 7 }, { 12, 7 }, { 20, 7 }, { 10, 6 }, { 22, 6 }, + { 6, 6 }, { 26, 6 }, { 2, 4 }, { 30, 4 }, { 0, 2 }, + { 4, 5 }, { 28, 5 }, { 15, 8 }, { 17, 8 }, { 14, 8 }, + { 18, 8 }, { 11, 7 }, { 21, 7 }, { 9, 6 }, { 23, 6 }, + { 3, 5 }, { 29, 5 }, { 8, 6 }, { 24, 6 }, { 5, 6 }, + { 27, 6 }, +}; + +static const uint8_t huff_spec_b54_tab[31][2] = { + { 3, 4 }, { 29, 4 }, { 9, 6 }, { 23, 6 }, { 8, 6 }, + { 24, 6 }, { 13, 8 }, { 19, 8 }, { 12, 8 }, { 20, 8 }, + { 10, 7 }, { 22, 7 }, { 6, 6 }, { 26, 6 }, { 1, 3 }, + { 31, 3 }, { 2, 4 }, { 30, 4 }, { 4, 5 }, { 28, 5 }, + { 15, 9 }, { 17, 9 }, { 14, 9 }, { 18, 9 }, { 11, 8 }, + { 21, 8 }, { 7, 7 }, { 25, 7 }, { 5, 6 }, { 27, 6 }, + { 0, 2 }, +}; + +static const uint8_t huff_spec_b62_tab[63][2] = { + { 11, 6 }, { 53, 6 }, { 21, 6 }, { 43, 6 }, { 27, 7 }, + { 37, 7 }, { 26, 7 }, { 38, 7 }, { 10, 6 }, { 54, 6 }, + { 5, 5 }, { 59, 5 }, { 20, 6 }, { 44, 6 }, { 9, 6 }, + { 55, 6 }, { 15, 7 }, { 49, 7 }, { 25, 7 }, { 39, 7 }, + { 19, 6 }, { 45, 6 }, { 4, 5 }, { 60, 5 }, { 1, 4 }, + { 63, 4 }, { 14, 7 }, { 50, 7 }, { 24, 7 }, { 40, 7 }, + { 8, 6 }, { 56, 6 }, { 18, 6 }, { 46, 6 }, { 31, 8 }, + { 33, 8 }, { 30, 8 }, { 34, 8 }, { 13, 7 }, { 51, 7 }, + { 3, 5 }, { 61, 5 }, { 23, 7 }, { 41, 7 }, { 12, 7 }, + { 52, 7 }, { 7, 6 }, { 57, 6 }, { 16, 6 }, { 48, 6 }, + { 17, 6 }, { 47, 6 }, { 0, 4 }, { 2, 5 }, { 62, 5 }, + { 22, 7 }, { 42, 7 }, { 29, 8 }, { 35, 8 }, { 28, 8 }, + { 36, 8 }, { 6, 6 }, { 58, 6 }, +}; + +static const uint8_t huff_spec_b63_tab[63][2] = { + { 6, 5 }, { 58, 5 }, { 10, 6 }, { 54, 6 }, { 16, 6 }, + { 48, 6 }, { 17, 6 }, { 47, 6 }, { 21, 7 }, { 43, 7 }, + { 14, 7 }, { 50, 7 }, { 5, 5 }, { 59, 5 }, { 2, 4 }, + { 62, 4 }, { 9, 6 }, { 55, 6 }, { 25, 8 }, { 39, 8 }, + { 31, 9 }, { 33, 9 }, { 30, 9 }, { 34, 9 }, { 20, 7 }, + { 44, 7 }, { 8, 6 }, { 56, 6 }, { 13, 7 }, { 51, 7 }, + { 19, 7 }, { 45, 7 }, { 4, 5 }, { 60, 5 }, { 24, 8 }, + { 40, 8 }, { 29, 9 }, { 35, 9 }, { 28, 9 }, { 36, 9 }, + { 12, 7 }, { 52, 7 }, { 7, 6 }, { 57, 6 }, { 3, 5 }, + { 61, 5 }, { 18, 7 }, { 46, 7 }, { 23, 8 }, { 41, 8 }, + { 22, 8 }, { 42, 8 }, { 11, 7 }, { 53, 7 }, { 15, 8 }, + { 49, 8 }, { 27, 9 }, { 37, 9 }, { 26, 9 }, { 38, 9 }, + { 0, 3 }, { 1, 4 }, { 63, 4 }, +}; + +static const uint8_t huff_spec_b64_tab[63][2] = { + { 1, 3 }, { 63, 3 }, { 14, 7 }, { 50, 7 }, { 18, 7 }, + { 46, 7 }, { 27, 9 }, { 37, 9 }, { 26, 9 }, { 38, 9 }, + { 21, 8 }, { 43, 8 }, { 13, 7 }, { 51, 7 }, { 9, 6 }, + { 55, 6 }, { 17, 7 }, { 47, 7 }, { 31, 10 }, { 33, 10 }, + { 30, 10 }, { 34, 10 }, { 25, 9 }, { 39, 9 }, { 20, 8 }, + { 44, 8 }, { 5, 5 }, { 59, 5 }, { 16, 7 }, { 48, 7 }, + { 12, 7 }, { 52, 7 }, { 8, 6 }, { 56, 6 }, { 2, 4 }, + { 62, 4 }, { 4, 5 }, { 60, 5 }, { 24, 9 }, { 40, 9 }, + { 29, 10 }, { 35, 10 }, { 28, 10 }, { 36, 10 }, { 15, 8 }, + { 49, 8 }, { 11, 7 }, { 53, 7 }, { 7, 6 }, { 57, 6 }, + { 19, 8 }, { 45, 8 }, { 23, 9 }, { 41, 9 }, { 22, 9 }, + { 42, 9 }, { 10, 7 }, { 54, 7 }, { 6, 6 }, { 58, 6 }, + { 3, 5 }, { 61, 5 }, { 0, 3 }, +}; + +static const uint8_t huff_spec_b72_tab[127][2] = { + { 3, 5 }, { 125, 5 }, { 42, 7 }, { 86, 7 }, { 21, 7 }, + { 107, 7 }, { 11, 6 }, { 117, 6 }, { 41, 7 }, { 87, 7 }, + { 20, 7 }, { 108, 7 }, { 53, 8 }, { 75, 8 }, { 31, 8 }, + { 97, 8 }, { 40, 7 }, { 88, 7 }, { 52, 8 }, { 76, 8 }, + { 51, 8 }, { 77, 8 }, { 19, 7 }, { 109, 7 }, { 10, 6 }, + { 118, 6 }, { 30, 8 }, { 98, 8 }, { 29, 8 }, { 99, 8 }, + { 18, 7 }, { 110, 7 }, { 9, 6 }, { 119, 6 }, { 39, 7 }, + { 89, 7 }, { 17, 7 }, { 111, 7 }, { 28, 8 }, { 100, 8 }, + { 50, 8 }, { 78, 8 }, { 38, 7 }, { 90, 7 }, { 2, 5 }, + { 126, 5 }, { 8, 6 }, { 120, 6 }, { 49, 8 }, { 79, 8 }, + { 48, 8 }, { 80, 8 }, { 16, 7 }, { 112, 7 }, { 37, 7 }, + { 91, 7 }, { 63, 9 }, { 65, 9 }, { 62, 9 }, { 66, 9 }, + { 27, 8 }, { 101, 8 }, { 7, 6 }, { 121, 6 }, { 36, 7 }, + { 92, 7 }, { 26, 8 }, { 102, 8 }, { 47, 8 }, { 81, 8 }, + { 61, 9 }, { 67, 9 }, { 60, 9 }, { 68, 9 }, { 46, 8 }, + { 82, 8 }, { 15, 7 }, { 113, 7 }, { 6, 6 }, { 122, 6 }, + { 25, 8 }, { 103, 8 }, { 45, 8 }, { 83, 8 }, { 35, 7 }, + { 93, 7 }, { 1, 5 }, { 127, 5 }, { 14, 7 }, { 114, 7 }, + { 59, 9 }, { 69, 9 }, { 58, 9 }, { 70, 9 }, { 24, 8 }, + { 104, 8 }, { 5, 6 }, { 123, 6 }, { 32, 7 }, { 96, 7 }, + { 34, 7 }, { 94, 7 }, { 13, 7 }, { 115, 7 }, { 23, 8 }, + { 105, 8 }, { 44, 8 }, { 84, 8 }, { 4, 6 }, { 124, 6 }, + { 57, 9 }, { 71, 9 }, { 56, 9 }, { 72, 9 }, { 43, 8 }, + { 85, 8 }, { 12, 7 }, { 116, 7 }, { 0, 5 }, { 33, 7 }, + { 95, 7 }, { 22, 8 }, { 106, 8 }, { 55, 9 }, { 73, 9 }, + { 54, 9 }, { 74, 9 }, +}; + +static const uint8_t huff_spec_b73_tab[127][2] = { + { 0, 3 }, { 4, 5 }, { 124, 5 }, { 19, 7 }, { 109, 7 }, + { 29, 8 }, { 99, 8 }, { 51, 9 }, { 77, 9 }, { 62, 10 }, + { 66, 10 }, { 63, 10 }, { 65, 10 }, { 28, 8 }, { 100, 8 }, + { 41, 8 }, { 87, 8 }, { 33, 7 }, { 95, 7 }, { 10, 6 }, + { 118, 6 }, { 18, 7 }, { 110, 7 }, { 40, 8 }, { 88, 8 }, + { 27, 8 }, { 101, 8 }, { 9, 6 }, { 119, 6 }, { 17, 7 }, + { 111, 7 }, { 50, 9 }, { 78, 9 }, { 61, 10 }, { 67, 10 }, + { 60, 10 }, { 68, 10 }, { 26, 8 }, { 102, 8 }, { 1, 4 }, + { 127, 4 }, { 3, 5 }, { 125, 5 }, { 39, 8 }, { 89, 8 }, + { 49, 9 }, { 79, 9 }, { 48, 9 }, { 80, 9 }, { 16, 7 }, + { 112, 7 }, { 8, 6 }, { 120, 6 }, { 25, 8 }, { 103, 8 }, + { 38, 8 }, { 90, 8 }, { 15, 7 }, { 113, 7 }, { 7, 6 }, + { 121, 6 }, { 59, 10 }, { 69, 10 }, { 58, 10 }, { 70, 10 }, + { 47, 9 }, { 81, 9 }, { 24, 8 }, { 104, 8 }, { 37, 8 }, + { 91, 8 }, { 23, 8 }, { 105, 8 }, { 14, 7 }, { 114, 7 }, + { 46, 9 }, { 82, 9 }, { 57, 10 }, { 71, 10 }, { 56, 10 }, + { 72, 10 }, { 36, 8 }, { 92, 8 }, { 2, 5 }, { 126, 5 }, + { 6, 6 }, { 122, 6 }, { 45, 9 }, { 83, 9 }, { 31, 9 }, + { 97, 9 }, { 22, 8 }, { 106, 8 }, { 13, 7 }, { 115, 7 }, + { 21, 8 }, { 107, 8 }, { 55, 10 }, { 73, 10 }, { 54, 10 }, + { 74, 10 }, { 44, 9 }, { 84, 9 }, { 12, 7 }, { 116, 7 }, + { 5, 6 }, { 123, 6 }, { 35, 8 }, { 93, 8 }, { 43, 9 }, + { 85, 9 }, { 30, 9 }, { 98, 9 }, { 20, 8 }, { 108, 8 }, + { 53, 10 }, { 75, 10 }, { 52, 10 }, { 76, 10 }, { 42, 9 }, + { 86, 9 }, { 34, 8 }, { 94, 8 }, { 32, 8 }, { 96, 8 }, + { 11, 7 }, { 117, 7 }, +}; + +static const uint8_t huff_spec_b74_tab[127][2] = { + { 28, 8 }, { 100, 8 }, { 27, 8 }, { 101, 8 }, { 36, 8 }, + { 92, 8 }, { 63, 10 }, { 65, 10 }, { 61, 10 }, { 67, 10 }, + { 62, 10 }, { 66, 10 }, { 60, 10 }, { 68, 10 }, { 19, 7 }, + { 109, 7 }, { 59, 10 }, { 69, 10 }, { 58, 10 }, { 70, 10 }, + { 57, 10 }, { 71, 10 }, { 56, 10 }, { 72, 10 }, { 55, 10 }, + { 73, 10 }, { 53, 10 }, { 75, 10 }, { 54, 10 }, { 74, 10 }, + { 52, 10 }, { 76, 10 }, { 5, 5 }, { 123, 5 }, { 0, 3 }, + { 51, 10 }, { 77, 10 }, { 50, 10 }, { 78, 10 }, { 49, 10 }, + { 79, 10 }, { 48, 10 }, { 80, 10 }, { 47, 10 }, { 81, 10 }, + { 46, 10 }, { 82, 10 }, { 43, 9 }, { 85, 9 }, { 18, 7 }, + { 110, 7 }, { 11, 6 }, { 117, 6 }, { 26, 8 }, { 102, 8 }, + { 35, 8 }, { 93, 8 }, { 25, 8 }, { 103, 8 }, { 42, 9 }, + { 86, 9 }, { 41, 9 }, { 87, 9 }, { 10, 6 }, { 118, 6 }, + { 4, 5 }, { 124, 5 }, { 17, 7 }, { 111, 7 }, { 34, 8 }, + { 94, 8 }, { 24, 8 }, { 104, 8 }, { 9, 6 }, { 119, 6 }, + { 1, 4 }, { 127, 4 }, { 16, 7 }, { 112, 7 }, { 32, 8 }, + { 96, 8 }, { 33, 8 }, { 95, 8 }, { 23, 8 }, { 105, 8 }, + { 40, 9 }, { 88, 9 }, { 31, 9 }, { 97, 9 }, { 15, 7 }, + { 113, 7 }, { 8, 6 }, { 120, 6 }, { 39, 9 }, { 89, 9 }, + { 45, 10 }, { 83, 10 }, { 44, 10 }, { 84, 10 }, { 22, 8 }, + { 106, 8 }, { 14, 7 }, { 114, 7 }, { 3, 5 }, { 125, 5 }, + { 7, 6 }, { 121, 6 }, { 30, 9 }, { 98, 9 }, { 38, 9 }, + { 90, 9 }, { 21, 8 }, { 107, 8 }, { 13, 7 }, { 115, 7 }, + { 29, 9 }, { 99, 9 }, { 37, 9 }, { 91, 9 }, { 20, 8 }, + { 108, 8 }, { 12, 7 }, { 116, 7 }, { 6, 6 }, { 122, 6 }, + { 2, 5 }, { 126, 5 }, }; static const HuffmanCodebook at9_huffman_coeffs[][8][4] = { @@ -1538,40 +1391,40 @@ static const HuffmanCodebook at9_huffman_coeffs[][8][4] = { { { 0 } }, { { 0 } }, { - { huff_spec_a21_bits, huff_spec_a21_codes, 16, 2, 1, 2 }, - { huff_spec_a22_bits, huff_spec_a22_codes, 256, 4, 2, 2 }, - { huff_spec_a23_bits, huff_spec_a23_codes, 256, 4, 2, 2 }, - { huff_spec_a24_bits, huff_spec_a24_codes, 256, 4, 2, 2 }, + { huff_spec_a21_tab, 8, 2, 1, 2 }, + { huff_spec_a22_tab, 80, 4, 2, 2 }, + { huff_spec_a23_tab, 81, 4, 2, 2 }, + { huff_spec_a24_tab, 81, 4, 2, 2 }, }, { - { huff_spec_a31_bits, huff_spec_a31_codes, 64, 2, 1, 3 }, - { huff_spec_a32_bits, huff_spec_a32_codes, 64, 2, 1, 3 }, - { huff_spec_a33_bits, huff_spec_a33_codes, 64, 2, 1, 3 }, - { huff_spec_a34_bits, huff_spec_a34_codes, 64, 2, 1, 3 }, + { huff_spec_a31_tab, 40, 2, 1, 3 }, + { huff_spec_a32_tab, 49, 2, 1, 3 }, + { huff_spec_a33_tab, 49, 2, 1, 3 }, + { huff_spec_a34_tab, 49, 2, 1, 3 }, }, { - { huff_spec_a41_bits, huff_spec_a41_codes, 256, 2, 1, 4 }, - { huff_spec_a42_bits, huff_spec_a42_codes, 256, 2, 1, 4 }, - { huff_spec_a43_bits, huff_spec_a43_codes, 256, 2, 1, 4 }, - { huff_spec_a44_bits, huff_spec_a44_codes, 256, 2, 1, 4 }, + { huff_spec_a41_tab, 176, 2, 1, 4 }, + { huff_spec_a42_tab, 225, 2, 1, 4 }, + { huff_spec_a43_tab, 225, 2, 1, 4 }, + { huff_spec_a44_tab, 225, 2, 1, 4 }, }, { - { huff_spec_a51_bits, huff_spec_a51_codes, 32, 1, 0, 5 }, - { huff_spec_a52_bits, huff_spec_a52_codes, 32, 1, 0, 5 }, - { huff_spec_a53_bits, huff_spec_a53_codes, 32, 1, 0, 5 }, - { huff_spec_a54_bits, huff_spec_a54_codes, 32, 1, 0, 5 }, + { huff_spec_a51_tab, 31, 1, 0, 5 }, + { huff_spec_a52_tab, 31, 1, 0, 5 }, + { huff_spec_a53_tab, 31, 1, 0, 5 }, + { huff_spec_a54_tab, 31, 1, 0, 5 }, }, { - { huff_spec_a61_bits, huff_spec_a61_codes, 64, 1, 0, 6 }, - { huff_spec_a62_bits, huff_spec_a62_codes, 64, 1, 0, 6 }, - { huff_spec_a63_bits, huff_spec_a63_codes, 64, 1, 0, 6 }, - { huff_spec_a64_bits, huff_spec_a64_codes, 64, 1, 0, 6 }, + { huff_spec_a61_tab, 63, 1, 0, 6 }, + { huff_spec_a62_tab, 63, 1, 0, 6 }, + { huff_spec_a63_tab, 63, 1, 0, 6 }, + { huff_spec_a64_tab, 63, 1, 0, 6 }, }, { - { huff_spec_a71_bits, huff_spec_a71_codes, 128, 1, 0, 7 }, - { huff_spec_a72_bits, huff_spec_a72_codes, 128, 1, 0, 7 }, - { huff_spec_a73_bits, huff_spec_a73_codes, 128, 1, 0, 7 }, - { huff_spec_a74_bits, huff_spec_a74_codes, 128, 1, 0, 7 }, + { huff_spec_a71_tab, 127, 1, 0, 7 }, + { huff_spec_a72_tab, 127, 1, 0, 7 }, + { huff_spec_a73_tab, 127, 1, 0, 7 }, + { huff_spec_a74_tab, 127, 1, 0, 7 }, }, }, { @@ -1579,39 +1432,39 @@ static const HuffmanCodebook at9_huffman_coeffs[][8][4] = { { { 0 } }, { { 0 }, - { huff_spec_b22_bits, huff_spec_b22_codes, 256, 4, 2, 2 }, - { huff_spec_b23_bits, huff_spec_b23_codes, 256, 4, 2, 2 }, - { huff_spec_b24_bits, huff_spec_b24_codes, 256, 4, 2, 2 }, + { huff_spec_b22_tab, 80, 4, 2, 2 }, + { huff_spec_b23_tab, 81, 4, 2, 2 }, + { huff_spec_b24_tab, 81, 4, 2, 2 }, }, { { 0 }, - { huff_spec_b32_bits, huff_spec_b32_codes, 64, 2, 1, 3 }, - { huff_spec_b33_bits, huff_spec_b33_codes, 64, 2, 1, 3 }, - { huff_spec_b34_bits, huff_spec_b34_codes, 64, 2, 1, 3 }, + { huff_spec_b32_tab, 49, 2, 1, 3 }, + { huff_spec_b33_tab, 49, 2, 1, 3 }, + { huff_spec_b34_tab, 49, 2, 1, 3 }, }, { { 0 }, - { huff_spec_b42_bits, huff_spec_b42_codes, 256, 2, 1, 4 }, - { huff_spec_b43_bits, huff_spec_b43_codes, 256, 2, 1, 4 }, - { huff_spec_b44_bits, huff_spec_b44_codes, 256, 2, 1, 4 }, + { huff_spec_b42_tab, 225, 2, 1, 4 }, + { huff_spec_b43_tab, 225, 2, 1, 4 }, + { huff_spec_b44_tab, 225, 2, 1, 4 }, }, { { 0 }, - { huff_spec_b52_bits, huff_spec_b52_codes, 32, 1, 0, 5 }, - { huff_spec_b53_bits, huff_spec_b53_codes, 32, 1, 0, 5 }, - { huff_spec_b54_bits, huff_spec_b54_codes, 32, 1, 0, 5 }, + { huff_spec_b52_tab, 31, 1, 0, 5 }, + { huff_spec_b53_tab, 31, 1, 0, 5 }, + { huff_spec_b54_tab, 31, 1, 0, 5 }, }, { { 0 }, - { huff_spec_b62_bits, huff_spec_b62_codes, 64, 1, 0, 6 }, - { huff_spec_b63_bits, huff_spec_b63_codes, 64, 1, 0, 6 }, - { huff_spec_b64_bits, huff_spec_b64_codes, 64, 1, 0, 6 }, + { huff_spec_b62_tab, 63, 1, 0, 6 }, + { huff_spec_b63_tab, 63, 1, 0, 6 }, + { huff_spec_b64_tab, 63, 1, 0, 6 }, }, { { 0 }, - { huff_spec_b72_bits, huff_spec_b72_codes, 128, 1, 0, 7 }, - { huff_spec_b73_bits, huff_spec_b73_codes, 128, 1, 0, 7 }, - { huff_spec_b74_bits, huff_spec_b74_codes, 128, 1, 0, 7 }, + { huff_spec_b72_tab, 127, 1, 0, 7 }, + { huff_spec_b73_tab, 127, 1, 0, 7 }, + { huff_spec_b74_tab, 127, 1, 0, 7 }, }, }, }; From patchwork Fri Nov 20 07:32:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23865 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 1418B44B2D5 for ; Fri, 20 Nov 2020 09:47:00 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 69C0568BCE1; Fri, 20 Nov 2020 09:34:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1F3B268BC9C for ; Fri, 20 Nov 2020 09:34:22 +0200 (EET) Received: by mail-ej1-f48.google.com with SMTP id lv15so5670108ejb.12 for ; Thu, 19 Nov 2020 23:34:22 -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=uTm/8FfSqQv3YWiEyccGUQACIBGED+kuZhtogsKSgwM=; b=veleykGz+BxlpK4tG7OlPsEKNoNWRLa+Hwxl09/ka7Xdhw1XENWPlcJeD341hvtYlD Vj4f+c5+knH4lYU0bkzZVN6mq0Z/kS/IKqKpMtetC1WAN2Z/kICdaaMKNujxtL3AzYc5 kb8r7Jc1HUwZHwc9gLrDIA7LX01MOXfpU50gkqd4xsFrzZdtfQM+Fiw796DhcCBj4EuL 8WhnDPuNJPiHdC63Yt6TtOe44IhzdVOfL+yzIqpAPwPqR1eveTPlKxQf+54sTSV0i4DU /b2vz9WJfGGPD12X779LkcWMs8QvPoGXGEFj1MunnFBDCA9PYP3MMMl/skXhg8wm8UKf YMjg== 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=uTm/8FfSqQv3YWiEyccGUQACIBGED+kuZhtogsKSgwM=; b=OkypxB1e83QsftVZtNI0kL0bp7Jx8gW2blPFQh4Y1w+6mMBzeJgwXLpcFTF6T6C8ZD rwVfYW7zbTKpAjjfDhCb41IGpvGxYAVFcTdoPIdsQjJfC9TR6RWJWAe/GrJMTscwqnLD WYxJKj8eeCC1sBlcy63AacHjYsioC1aJ7sG1W1Gi5pTBic0Rv7gY5YQCyzsPE5ppFCh5 x3TMMKIOwbMEERwl+6Taze9TxG3EFh98f2pTVSe67KY8W9l0Mj5Z1MJVUK1K5+Pm2J7b RnAUV6DWJDVw4agpMLAMjIw0Cd3Eodj2WyOG9nrgaFSJCF6JyMvnC8NQd9pgh0VcRRdg +qtQ== X-Gm-Message-State: AOAM531CLY3E62U/gCzDX0e3UQbDpc/7jHSpdYiPplCZJmW3Pc1u/CrO YwXccd0wKVIGnwh7wubYx+lzUMmfghginQ== X-Google-Smtp-Source: ABdhPJzB44andDxD5OtPvZKJdwtUX0wobcP17iBIe1X+Y5IgmRsISq/K/xFR6gETtxRE6sVpx6gSOw== X-Received: by 2002:a17:906:bc43:: with SMTP id s3mr6496856ejv.411.1605857659674; Thu, 19 Nov 2020 23:34:19 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:19 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:42 +0100 Message-Id: <20201120073327.820745-18-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 117/162] avcodec/atrac9tab: Unify tables used to initialize 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" Using separate tables has the downside that one needs a big number of pointers to the separate tables (currently 77); unifying them avoids this. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac9dec.c | 19 ++- libavcodec/atrac9tab.h | 310 ++++++++++++++--------------------------- 2 files changed, 120 insertions(+), 209 deletions(-) diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index 9707077238..4814beb112 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -848,6 +848,7 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) GetBitContext gb; ATRAC9Context *s = avctx->priv_data; int version, block_config_idx, superframe_idx, alloc_c_len; + const uint8_t (*tab)[2]; int ret; s->avctx = avctx; @@ -932,17 +933,20 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) s->alloc_curve[i - 1][j] = at9_tab_b_dist[(j * alloc_c_len) / i]; /* Unsigned scalefactor VLCs */ + tab = at9_sfb_a_tab; for (int i = 1; i < 7; i++) { const HuffmanCodebook *hf = &at9_huffman_sf_unsigned[i]; ret = ff_init_vlc_from_lengths(&s->sf_vlc[0][i], ATRAC9_SF_VLC_BITS, - hf->size, &hf->tab[0][1], 2, - &hf->tab[0][0], 2, 1, 0, 0, avctx); + hf->size, &tab[0][1], 2, + &tab[0][0], 2, 1, 0, 0, avctx); if (ret < 0) return ret; + tab += hf->size; } /* Signed scalefactor VLCs */ + tab = at9_sfb_b_tab; for (int i = 2; i < 6; i++) { const HuffmanCodebook *hf = &at9_huffman_sf_signed[i]; @@ -950,22 +954,25 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) * the values in the source table are offset by 16 to make * them fit into an uint8_t; the -16 reverses this shift. */ ret = ff_init_vlc_from_lengths(&s->sf_vlc[1][i], ATRAC9_SF_VLC_BITS, - hf->size, &hf->tab[0][1], 2, - &hf->tab[0][0], 2, 1, -16, 0, avctx); + hf->size, &tab[0][1], 2, + &tab[0][0], 2, 1, -16, 0, avctx); if (ret < 0) return ret; + tab += hf->size; } /* Coefficient VLCs */ + tab = at9_coeffs_tab; for (int i = 0; i < 2; i++) { for (int j = 0; j < 8; j++) { for (int k = 0; k < 4; k++) { const HuffmanCodebook *hf = &at9_huffman_coeffs[i][j][k]; ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i][j][k], 9, - hf->size, &hf->tab[0][1], 2, - &hf->tab[0][0], 2, 1, 0, 0, avctx); + hf->size, &tab[0][1], 2, + &tab[0][0], 2, 1, 0, 0, avctx); if (ret < 0) return ret; + tab += hf->size; } } } diff --git a/libavcodec/atrac9tab.h b/libavcodec/atrac9tab.h index c62b8070d0..1882bf9f43 100644 --- a/libavcodec/atrac9tab.h +++ b/libavcodec/atrac9tab.h @@ -373,34 +373,25 @@ static const uint8_t at9_tab_b_dist[] = { 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, }; -static const uint8_t huff_sfb_a1_tab[2][2] = { +static const uint8_t at9_sfb_a_tab[][2] = { + /* Unsigned scalefactor table 1 - 2 entries */ { 0, 1 }, { 1, 1 }, -}; - -static const uint8_t huff_sfb_a2_tab[4][2] = { + /* Unsigned scalefactor table 2 - 4 entries */ { 0, 1 }, { 3, 2 }, { 1, 3 }, { 2, 3 }, -}; - -static const uint8_t huff_sfb_a3_tab[8][2] = { + /* Unsigned scalefactor table 3 - 8 entries */ { 0, 2 }, { 1, 2 }, { 7, 2 }, { 6, 3 }, { 2, 4 }, { 5, 5 }, { 3, 6 }, { 4, 6 }, -}; - -static const uint8_t huff_sfb_a4_tab[16][2] = { + /* Unsigned scalefactor table 4 - 16 entries */ { 2, 4 }, { 14, 4 }, { 11, 8 }, { 10, 8 }, { 9, 8 }, { 6, 8 }, { 7, 8 }, { 8, 8 }, { 5, 7 }, { 13, 5 }, { 3, 5 }, { 12, 6 }, { 4, 6 }, { 0, 2 }, { 1, 2 }, { 15, 2 }, -}; - -static const uint8_t huff_sfb_a5_tab[32][2] = { + /* Unsigned scalefactor table 5 - 32 entries */ { 31, 3 }, { 1, 3 }, { 26, 7 }, { 7, 7 }, { 20, 8 }, { 21, 8 }, { 23, 8 }, { 22, 8 }, { 29, 5 }, { 30, 4 }, { 4, 5 }, { 11, 8 }, { 24, 8 }, { 9, 8 }, { 10, 8 }, { 6, 6 }, { 25, 7 }, { 19, 8 }, { 12, 8 }, { 27, 6 }, { 18, 8 }, { 13, 8 }, { 16, 8 }, { 17, 8 }, { 14, 8 }, { 15, 8 }, { 8, 7 }, { 0, 2 }, { 5, 5 }, { 28, 5 }, { 3, 4 }, { 2, 3 }, -}; - -static const uint8_t huff_sfb_a6_tab[64][2] = { + /* Unsigned scalefactor table 6 - 64 entries */ { 0, 3 }, { 1, 3 }, { 2, 4 }, { 3, 4 }, { 61, 4 }, { 62, 4 }, { 63, 4 }, { 4, 5 }, { 5, 5 }, { 58, 5 }, { 59, 5 }, { 60, 5 }, { 6, 6 }, { 7, 6 }, { 8, 6 }, { 56, 6 }, { 57, 6 }, { 9, 7 }, { 10, 7 }, { 53, 7 }, { 54, 7 }, @@ -413,21 +404,16 @@ static const uint8_t huff_sfb_a6_tab[64][2] = { { 52, 8 }, }; -static const uint8_t huff_sfb_b2_tab[3][2] = { +static const uint8_t at9_sfb_b_tab[][2] = { + /* Signed scalefactor table 2 - 3 entries */ { 16, 1 }, { 15, 2 }, { 17, 2 }, -}; - -static const uint8_t huff_sfb_b3_tab[7][2] = { + /* Signed scalefactor table 3 - 7 entries */ { 17, 3 }, { 18, 5 }, { 13, 6 }, { 19, 6 }, { 14, 4 }, { 15, 2 }, { 16, 1 }, -}; - -static const uint8_t huff_sfb_b4_tab[15][2] = { + /* Signed scalefactor table 4 - 15 entries */ { 15, 3 }, { 17, 3 }, { 18, 4 }, { 13, 6 }, { 12, 6 }, { 21, 7 }, { 22, 8 }, { 10, 8 }, { 9, 8 }, { 23, 8 }, { 11, 7 }, { 14, 4 }, { 19, 5 }, { 20, 5 }, { 16, 1 }, -}; - -static const uint8_t huff_sfb_b5_tab[32][2] = { + /* Signed scalefactor table 5 - 32 entries */ { 16, 3 }, { 21, 4 }, { 22, 4 }, { 20, 4 }, { 23, 4 }, { 30, 8 }, { 1, 8 }, { 0, 8 }, { 2, 8 }, { 3, 8 }, { 31, 8 }, { 27, 7 }, { 14, 6 }, { 28, 7 }, { 13, 7 }, { 18, 4 }, { 25, 5 }, { 12, 7 }, { 11, 7 }, { 26, 6 }, { 24, 4 }, @@ -436,7 +422,6 @@ static const uint8_t huff_sfb_b5_tab[32][2] = { }; typedef struct HuffmanCodebook { - const uint8_t (*tab)[2]; const int size; const int value_cnt; const int value_cnt_pow; @@ -445,29 +430,28 @@ typedef struct HuffmanCodebook { static const HuffmanCodebook at9_huffman_sf_unsigned[] = { { 0 }, - { huff_sfb_a1_tab, 2, 1, 0, 1 }, - { huff_sfb_a2_tab, 4, 1, 0, 2 }, - { huff_sfb_a3_tab, 8, 1, 0, 3 }, - { huff_sfb_a4_tab, 16, 1, 0, 4 }, - { huff_sfb_a5_tab, 32, 1, 0, 5 }, - { huff_sfb_a6_tab, 64, 1, 0, 6 }, + { 2, 1, 0, 1 }, + { 4, 1, 0, 2 }, + { 8, 1, 0, 3 }, + { 16, 1, 0, 4 }, + { 32, 1, 0, 5 }, + { 64, 1, 0, 6 }, }; static const HuffmanCodebook at9_huffman_sf_signed[] = { { 0 }, { 0 }, - { huff_sfb_b2_tab, 3, 1, 0, 2 }, - { huff_sfb_b3_tab, 7, 1, 0, 3 }, - { huff_sfb_b4_tab, 15, 1, 0, 4 }, - { huff_sfb_b5_tab, 32, 1, 0, 5 }, + { 3, 1, 0, 2 }, + { 7, 1, 0, 3 }, + { 15, 1, 0, 4 }, + { 32, 1, 0, 5 }, }; -static const uint8_t huff_spec_a21_tab[8][2] = { +static const uint8_t at9_coeffs_tab[][2] = { + /* Coefficient table A.2.1 - 8 entries */ { 1, 3 }, { 3, 3 }, { 12, 3 }, { 4, 3 }, { 7, 3 }, { 13, 3 }, { 15, 3 }, { 5, 3 }, -}; - -static const uint8_t huff_spec_a22_tab[80][2] = { + /* Coefficient table A.2.2 - 80 entries */ { 17, 6 }, { 51, 6 }, { 81, 7 }, { 243, 7 }, { 69, 7 }, { 207, 7 }, { 205, 7 }, { 71, 7 }, { 209, 7 }, { 115, 7 }, { 245, 7 }, { 95, 7 }, { 125, 7 }, { 215, 7 }, { 1, 4 }, @@ -484,9 +468,7 @@ static const uint8_t huff_spec_a22_tab[80][2] = { { 76, 6 }, { 53, 7 }, { 31, 7 }, { 197, 7 }, { 79, 7 }, { 49, 6 }, { 19, 6 }, { 61, 7 }, { 23, 7 }, { 68, 7 }, { 204, 7 }, { 5, 6 }, { 15, 6 }, { 13, 6 }, { 7, 6 }, -}; - -static const uint8_t huff_spec_a23_tab[81][2] = { + /* Coefficient table A.2.3 - 81 entries */ { 65, 6 }, { 195, 6 }, { 193, 6 }, { 67, 6 }, { 197, 7 }, { 79, 7 }, { 77, 7 }, { 199, 7 }, { 241, 7 }, { 83, 7 }, { 244, 7 }, { 92, 7 }, { 1, 4 }, { 3, 4 }, { 20, 6 }, @@ -504,9 +486,7 @@ static const uint8_t huff_spec_a23_tab[81][2] = { { 85, 9 }, { 255, 9 }, { 113, 8 }, { 211, 8 }, { 4, 5 }, { 12, 5 }, { 0, 3 }, { 16, 5 }, { 48, 5 }, { 64, 5 }, { 192, 5 }, -}; - -static const uint8_t huff_spec_a24_tab[81][2] = { + /* Coefficient table A.2.4 - 81 entries */ { 20, 6 }, { 60, 6 }, { 52, 6 }, { 28, 6 }, { 80, 6 }, { 240, 6 }, { 208, 6 }, { 112, 6 }, { 1, 4 }, { 3, 4 }, { 5, 6 }, { 15, 6 }, { 13, 6 }, { 7, 6 }, { 84, 8 }, @@ -524,9 +504,7 @@ static const uint8_t huff_spec_a24_tab[81][2] = { { 247, 10 }, { 85, 10 }, { 255, 10 }, { 116, 9 }, { 220, 9 }, { 16, 5 }, { 48, 5 }, { 64, 5 }, { 192, 5 }, { 4, 5 }, { 12, 5 }, -}; - -static const uint8_t huff_spec_a31_tab[40][2] = { + /* Coefficient table A.3.1 - 40 entries */ { 50, 5 }, { 22, 5 }, { 11, 5 }, { 61, 5 }, { 2, 4 }, { 6, 4 }, { 59, 5 }, { 13, 5 }, { 17, 5 }, { 55, 5 }, { 49, 5 }, { 23, 5 }, { 24, 5 }, { 40, 5 }, { 26, 6 }, @@ -535,9 +513,7 @@ static const uint8_t huff_spec_a31_tab[40][2] = { { 21, 6 }, { 3, 5 }, { 5, 5 }, { 16, 5 }, { 48, 5 }, { 25, 6 }, { 47, 6 }, { 41, 6 }, { 31, 6 }, { 27, 7 }, { 45, 7 }, { 43, 7 }, { 29, 7 }, { 18, 6 }, { 54, 6 }, -}; - -static const uint8_t huff_spec_a32_tab[49][2] = { + /* Coefficient table A.3.2 - 49 entries */ { 57, 5 }, { 15, 5 }, { 17, 5 }, { 55, 5 }, { 49, 5 }, { 23, 5 }, { 58, 5 }, { 14, 5 }, { 10, 5 }, { 62, 5 }, { 43, 7 }, { 29, 7 }, { 27, 7 }, { 45, 7 }, { 25, 6 }, @@ -548,9 +524,7 @@ static const uint8_t huff_spec_a32_tab[49][2] = { { 7, 5 }, { 0, 4 }, { 42, 7 }, { 30, 7 }, { 26, 7 }, { 46, 7 }, { 3, 6 }, { 5, 6 }, { 19, 7 }, { 53, 7 }, { 51, 7 }, { 21, 7 }, { 9, 6 }, { 63, 6 }, -}; - -static const uint8_t huff_spec_a33_tab[49][2] = { + /* Coefficient table A.3.3 - 49 entries */ { 51, 7 }, { 21, 7 }, { 19, 7 }, { 53, 7 }, { 24, 6 }, { 40, 6 }, { 50, 6 }, { 22, 6 }, { 18, 6 }, { 54, 6 }, { 3, 6 }, { 5, 6 }, { 43, 8 }, { 29, 8 }, { 27, 8 }, @@ -561,9 +535,7 @@ static const uint8_t huff_spec_a33_tab[49][2] = { { 59, 7 }, { 13, 7 }, { 26, 8 }, { 46, 8 }, { 42, 8 }, { 30, 8 }, { 49, 6 }, { 23, 6 }, { 17, 6 }, { 55, 6 }, { 58, 6 }, { 14, 6 }, { 10, 6 }, { 62, 6 }, -}; - -static const uint8_t huff_spec_a34_tab[49][2] = { + /* Coefficient table A.3.4 - 49 entries */ { 0, 2 }, { 16, 5 }, { 48, 5 }, { 2, 5 }, { 6, 5 }, { 26, 8 }, { 46, 8 }, { 51, 8 }, { 21, 8 }, { 24, 7 }, { 40, 7 }, { 3, 7 }, { 5, 7 }, { 19, 8 }, { 53, 8 }, @@ -574,9 +546,7 @@ static const uint8_t huff_spec_a34_tab[49][2] = { { 11, 8 }, { 61, 8 }, { 59, 8 }, { 13, 8 }, { 43, 10 }, { 29, 10 }, { 27, 10 }, { 45, 10 }, { 42, 9 }, { 30, 9 }, { 9, 5 }, { 63, 5 }, { 57, 5 }, { 15, 5 }, -}; - -static const uint8_t huff_spec_a41_tab[176][2] = { + /* Coefficient table A.4.1 - 176 entries */ { 83, 7 }, { 189, 7 }, { 68, 7 }, { 204, 7 }, { 23, 7 }, { 249, 7 }, { 166, 8 }, { 106, 8 }, { 183, 8 }, { 89, 8 }, { 52, 7 }, { 220, 7 }, { 161, 7 }, { 111, 7 }, { 179, 7 }, @@ -613,9 +583,7 @@ static const uint8_t huff_spec_a41_tab[176][2] = { { 185, 9 }, { 112, 8 }, { 144, 8 }, { 245, 7 }, { 27, 7 }, { 64, 7 }, { 192, 7 }, { 67, 8 }, { 205, 8 }, { 195, 8 }, { 77, 8 }, -}; - -static const uint8_t huff_spec_a42_tab[225][2] = { + /* Coefficient table A.4.2 - 225 entries */ { 3, 7 }, { 13, 7 }, { 113, 8 }, { 159, 8 }, { 163, 8 }, { 109, 8 }, { 16, 6 }, { 240, 6 }, { 81, 7 }, { 191, 7 }, { 177, 7 }, { 95, 7 }, { 0, 5 }, { 112, 8 }, { 144, 8 }, @@ -661,9 +629,7 @@ static const uint8_t huff_spec_a42_tab[225][2] = { { 41, 9 }, { 229, 8 }, { 43, 8 }, { 48, 8 }, { 208, 8 }, { 37, 8 }, { 235, 8 }, { 34, 8 }, { 238, 8 }, { 226, 8 }, { 46, 8 }, { 39, 9 }, { 233, 9 }, { 145, 9 }, { 127, 9 }, -}; - -static const uint8_t huff_spec_a43_tab[225][2] = { + /* Coefficient table A.4.3 - 225 entries */ { 246, 8 }, { 26, 8 }, { 22, 8 }, { 250, 8 }, { 210, 7 }, { 62, 7 }, { 50, 7 }, { 222, 7 }, { 53, 8 }, { 219, 8 }, { 231, 9 }, { 41, 9 }, { 39, 9 }, { 233, 9 }, { 16, 5 }, @@ -709,9 +675,7 @@ static const uint8_t huff_spec_a43_tab[225][2] = { { 93, 9 }, { 70, 10 }, { 202, 10 }, { 146, 10 }, { 126, 10 }, { 213, 9 }, { 59, 9 }, { 18, 7 }, { 254, 7 }, { 225, 7 }, { 47, 7 }, { 242, 7 }, { 30, 7 }, { 1, 6 }, { 15, 6 }, -}; - -static const uint8_t huff_spec_a44_tab[225][2] = { + /* Coefficient table A.4.4 - 225 entries */ { 193, 7 }, { 79, 7 }, { 20, 7 }, { 252, 7 }, { 151, 10 }, { 121, 10 }, { 119, 10 }, { 153, 10 }, { 118, 10 }, { 154, 10 }, { 150, 10 }, { 122, 10 }, { 167, 10 }, { 105, 10 }, { 103, 10 }, @@ -757,9 +721,7 @@ static const uint8_t huff_spec_a44_tab[225][2] = { { 238, 7 }, { 226, 7 }, { 46, 7 }, { 229, 9 }, { 43, 9 }, { 38, 10 }, { 234, 10 }, { 230, 10 }, { 42, 10 }, { 65, 8 }, { 207, 8 }, { 17, 6 }, { 255, 6 }, { 241, 6 }, { 31, 6 }, -}; - -static const uint8_t huff_spec_a51_tab[31][2] = { + /* Coefficient table A.5.1 - 31 entries */ { 8, 4 }, { 24, 4 }, { 15, 5 }, { 17, 5 }, { 4, 5 }, { 28, 5 }, { 9, 4 }, { 23, 4 }, { 14, 5 }, { 18, 5 }, { 3, 5 }, { 29, 5 }, { 13, 5 }, { 19, 5 }, { 2, 5 }, @@ -767,9 +729,7 @@ static const uint8_t huff_spec_a51_tab[31][2] = { { 7, 6 }, { 25, 6 }, { 0, 5 }, { 11, 5 }, { 21, 5 }, { 6, 6 }, { 26, 6 }, { 5, 6 }, { 27, 6 }, { 10, 5 }, { 22, 5 }, -}; - -static const uint8_t huff_spec_a52_tab[31][2] = { + /* Coefficient table A.5.2 - 31 entries */ { 2, 4 }, { 30, 4 }, { 11, 5 }, { 21, 5 }, { 7, 5 }, { 25, 5 }, { 1, 4 }, { 31, 4 }, { 6, 5 }, { 26, 5 }, { 10, 5 }, { 22, 5 }, { 15, 6 }, { 17, 6 }, { 14, 6 }, @@ -777,9 +737,7 @@ static const uint8_t huff_spec_a52_tab[31][2] = { { 23, 5 }, { 8, 5 }, { 24, 5 }, { 4, 5 }, { 28, 5 }, { 13, 6 }, { 19, 6 }, { 12, 6 }, { 20, 6 }, { 3, 5 }, { 29, 5 }, -}; - -static const uint8_t huff_spec_a53_tab[31][2] = { + /* Coefficient table A.5.3 - 31 entries */ { 0, 3 }, { 9, 5 }, { 23, 5 }, { 7, 5 }, { 25, 5 }, { 3, 4 }, { 29, 4 }, { 8, 5 }, { 24, 5 }, { 15, 7 }, { 17, 7 }, { 14, 7 }, { 18, 7 }, { 11, 6 }, { 21, 6 }, @@ -787,9 +745,7 @@ static const uint8_t huff_spec_a53_tab[31][2] = { { 27, 5 }, { 1, 4 }, { 31, 4 }, { 10, 6 }, { 22, 6 }, { 13, 7 }, { 19, 7 }, { 12, 7 }, { 20, 7 }, { 4, 5 }, { 28, 5 }, -}; - -static const uint8_t huff_spec_a54_tab[31][2] = { + /* Coefficient table A.5.4 - 31 entries */ { 8, 5 }, { 24, 5 }, { 7, 5 }, { 25, 5 }, { 4, 4 }, { 28, 4 }, { 0, 3 }, { 10, 6 }, { 22, 6 }, { 13, 7 }, { 19, 7 }, { 12, 7 }, { 20, 7 }, { 6, 5 }, { 26, 5 }, @@ -797,9 +753,7 @@ static const uint8_t huff_spec_a54_tab[31][2] = { { 23, 6 }, { 15, 8 }, { 17, 8 }, { 14, 8 }, { 18, 8 }, { 11, 7 }, { 21, 7 }, { 5, 5 }, { 27, 5 }, { 1, 4 }, { 31, 4 }, -}; - -static const uint8_t huff_spec_a61_tab[63][2] = { + /* Coefficient table A.6.1 - 63 entries */ { 19, 5 }, { 45, 5 }, { 31, 6 }, { 33, 6 }, { 30, 6 }, { 34, 6 }, { 16, 5 }, { 48, 5 }, { 8, 6 }, { 56, 6 }, { 7, 6 }, { 57, 6 }, { 18, 5 }, { 46, 5 }, { 29, 6 }, @@ -813,9 +767,7 @@ static const uint8_t huff_spec_a61_tab[63][2] = { { 42, 6 }, { 12, 7 }, { 52, 7 }, { 11, 7 }, { 53, 7 }, { 21, 6 }, { 43, 6 }, { 20, 6 }, { 44, 6 }, { 10, 7 }, { 54, 7 }, { 9, 7 }, { 55, 7 }, -}; - -static const uint8_t huff_spec_a62_tab[63][2] = { + /* Coefficient table A.6.2 - 63 entries */ { 23, 6 }, { 41, 6 }, { 15, 6 }, { 49, 6 }, { 4, 5 }, { 60, 5 }, { 3, 5 }, { 61, 5 }, { 22, 6 }, { 42, 6 }, { 14, 6 }, { 50, 6 }, { 2, 5 }, { 62, 5 }, { 31, 7 }, @@ -829,9 +781,7 @@ static const uint8_t huff_spec_a62_tab[63][2] = { { 56, 6 }, { 17, 6 }, { 47, 6 }, { 7, 6 }, { 57, 6 }, { 25, 7 }, { 39, 7 }, { 24, 7 }, { 40, 7 }, { 6, 6 }, { 58, 6 }, { 5, 6 }, { 59, 6 }, -}; - -static const uint8_t huff_spec_a63_tab[63][2] = { + /* Coefficient table A.6.3 - 63 entries */ { 0, 4 }, { 7, 5 }, { 57, 5 }, { 15, 6 }, { 49, 6 }, { 25, 7 }, { 39, 7 }, { 24, 7 }, { 40, 7 }, { 18, 6 }, { 46, 6 }, { 14, 6 }, { 50, 6 }, { 6, 5 }, { 58, 5 }, @@ -845,9 +795,7 @@ static const uint8_t huff_spec_a63_tab[63][2] = { { 44, 7 }, { 9, 6 }, { 55, 6 }, { 1, 5 }, { 63, 5 }, { 27, 8 }, { 37, 8 }, { 26, 8 }, { 38, 8 }, { 19, 7 }, { 45, 7 }, { 8, 6 }, { 56, 6 }, -}; - -static const uint8_t huff_spec_a64_tab[63][2] = { + /* Coefficient table A.6.4 - 63 entries */ { 16, 6 }, { 48, 6 }, { 27, 8 }, { 37, 8 }, { 26, 8 }, { 38, 8 }, { 21, 7 }, { 43, 7 }, { 8, 5 }, { 56, 5 }, { 1, 4 }, { 63, 4 }, { 14, 6 }, { 50, 6 }, { 20, 7 }, @@ -861,9 +809,7 @@ static const uint8_t huff_spec_a64_tab[63][2] = { { 42, 8 }, { 10, 6 }, { 54, 6 }, { 3, 5 }, { 61, 5 }, { 2, 5 }, { 62, 5 }, { 17, 7 }, { 47, 7 }, { 15, 7 }, { 49, 7 }, { 9, 6 }, { 55, 6 }, -}; - -static const uint8_t huff_spec_a71_tab[127][2] = { + /* Coefficient table A.7.1 - 127 entries */ { 18, 7 }, { 110, 7 }, { 63, 7 }, { 65, 7 }, { 38, 6 }, { 90, 6 }, { 17, 7 }, { 111, 7 }, { 62, 7 }, { 66, 7 }, { 61, 7 }, { 67, 7 }, { 16, 7 }, { 112, 7 }, { 37, 6 }, @@ -890,9 +836,7 @@ static const uint8_t huff_spec_a71_tab[127][2] = { { 21, 8 }, { 107, 8 }, { 41, 7 }, { 87, 7 }, { 20, 8 }, { 108, 8 }, { 19, 8 }, { 109, 8 }, { 40, 7 }, { 88, 7 }, { 39, 7 }, { 89, 7 }, -}; - -static const uint8_t huff_spec_a72_tab[127][2] = { + /* Coefficient table A.7.2 - 127 entries */ { 47, 7 }, { 81, 7 }, { 46, 7 }, { 82, 7 }, { 8, 6 }, { 120, 6 }, { 31, 7 }, { 97, 7 }, { 45, 7 }, { 83, 7 }, { 7, 6 }, { 121, 6 }, { 30, 7 }, { 98, 7 }, { 29, 7 }, @@ -919,9 +863,7 @@ static const uint8_t huff_spec_a72_tab[127][2] = { { 12, 7 }, { 116, 7 }, { 49, 8 }, { 79, 8 }, { 48, 8 }, { 80, 8 }, { 11, 7 }, { 117, 7 }, { 10, 7 }, { 118, 7 }, { 9, 7 }, { 119, 7 }, -}; - -static const uint8_t huff_spec_a73_tab[127][2] = { + /* Coefficient table A.7.3 - 127 entries */ { 15, 6 }, { 113, 6 }, { 31, 7 }, { 97, 7 }, { 51, 8 }, { 77, 8 }, { 50, 8 }, { 78, 8 }, { 14, 6 }, { 114, 6 }, { 0, 5 }, { 37, 7 }, { 91, 7 }, { 30, 7 }, { 98, 7 }, @@ -948,9 +890,7 @@ static const uint8_t huff_spec_a73_tab[127][2] = { { 52, 9 }, { 76, 9 }, { 17, 7 }, { 111, 7 }, { 39, 8 }, { 89, 8 }, { 38, 8 }, { 90, 8 }, { 16, 7 }, { 112, 7 }, { 1, 6 }, { 127, 6 }, -}; - -static const uint8_t huff_spec_a74_tab[127][2] = { + /* Coefficient table A.7.4 - 127 entries */ { 3, 5 }, { 125, 5 }, { 32, 7 }, { 96, 7 }, { 29, 7 }, { 99, 7 }, { 16, 6 }, { 112, 6 }, { 2, 5 }, { 126, 5 }, { 53, 9 }, { 75, 9 }, { 52, 9 }, { 76, 9 }, { 42, 8 }, @@ -977,9 +917,7 @@ static const uint8_t huff_spec_a74_tab[127][2] = { { 54, 10 }, { 74, 10 }, { 43, 9 }, { 85, 9 }, { 18, 7 }, { 110, 7 }, { 30, 8 }, { 98, 8 }, { 33, 8 }, { 95, 8 }, { 17, 7 }, { 111, 7 }, -}; - -static const uint8_t huff_spec_b22_tab[80][2] = { + /* Coefficient table B.2.2 - 80 entries */ { 80, 5 }, { 240, 5 }, { 253, 10 }, { 87, 10 }, { 117, 10 }, { 223, 10 }, { 93, 10 }, { 247, 10 }, { 221, 10 }, { 119, 10 }, { 213, 10 }, { 127, 10 }, { 85, 10 }, { 255, 10 }, { 245, 10 }, @@ -996,9 +934,7 @@ static const uint8_t huff_spec_b22_tab[80][2] = { { 211, 9 }, { 29, 9 }, { 55, 9 }, { 209, 10 }, { 115, 10 }, { 125, 10 }, { 215, 10 }, { 65, 8 }, { 195, 8 }, { 193, 8 }, { 67, 8 }, { 64, 4 }, { 192, 4 }, { 1, 4 }, { 3, 4 }, -}; - -static const uint8_t huff_spec_b23_tab[81][2] = { + /* Coefficient table B.2.3 - 81 entries */ { 16, 4 }, { 48, 4 }, { 4, 4 }, { 12, 4 }, { 64, 4 }, { 192, 4 }, { 5, 6 }, { 15, 6 }, { 13, 6 }, { 7, 6 }, { 212, 8 }, { 124, 8 }, { 213, 10 }, { 127, 10 }, { 93, 10 }, @@ -1016,9 +952,7 @@ static const uint8_t huff_spec_b23_tab[81][2] = { { 113, 10 }, { 211, 10 }, { 197, 10 }, { 79, 10 }, { 68, 9 }, { 204, 9 }, { 17, 9 }, { 51, 9 }, { 244, 9 }, { 92, 9 }, { 0, 2 }, -}; - -static const uint8_t huff_spec_b24_tab[81][2] = { + /* Coefficient table B.2.4 - 81 entries */ { 1, 4 }, { 3, 4 }, { 52, 7 }, { 28, 7 }, { 193, 8 }, { 67, 8 }, { 213, 10 }, { 127, 10 }, { 253, 10 }, { 87, 10 }, { 93, 10 }, { 247, 10 }, { 117, 10 }, { 223, 10 }, { 80, 7 }, @@ -1036,9 +970,7 @@ static const uint8_t huff_spec_b24_tab[81][2] = { { 61, 9 }, { 23, 9 }, { 17, 9 }, { 51, 9 }, { 65, 9 }, { 195, 9 }, { 20, 8 }, { 60, 8 }, { 64, 5 }, { 192, 5 }, { 0, 1 }, -}; - -static const uint8_t huff_spec_b32_tab[49][2] = { + /* Coefficient table B.3.2 - 49 entries */ { 58, 5 }, { 14, 5 }, { 59, 6 }, { 13, 6 }, { 19, 7 }, { 53, 7 }, { 25, 7 }, { 47, 7 }, { 1, 4 }, { 7, 4 }, { 0, 2 }, { 9, 6 }, { 63, 6 }, { 57, 6 }, { 15, 6 }, @@ -1049,9 +981,7 @@ static const uint8_t huff_spec_b32_tab[49][2] = { { 26, 8 }, { 46, 8 }, { 51, 8 }, { 21, 8 }, { 16, 5 }, { 48, 5 }, { 18, 7 }, { 54, 7 }, { 50, 7 }, { 22, 7 }, { 10, 6 }, { 62, 6 }, { 2, 5 }, { 6, 5 }, -}; - -static const uint8_t huff_spec_b33_tab[49][2] = { + /* Coefficient table B.3.3 - 49 entries */ { 57, 5 }, { 15, 5 }, { 9, 5 }, { 63, 5 }, { 59, 7 }, { 13, 7 }, { 50, 7 }, { 22, 7 }, { 18, 7 }, { 54, 7 }, { 51, 8 }, { 21, 8 }, { 27, 10 }, { 45, 10 }, { 43, 10 }, @@ -1062,9 +992,7 @@ static const uint8_t huff_spec_b33_tab[49][2] = { { 47, 8 }, { 42, 9 }, { 30, 9 }, { 19, 9 }, { 53, 9 }, { 24, 7 }, { 40, 7 }, { 41, 8 }, { 31, 8 }, { 11, 8 }, { 61, 8 }, { 3, 7 }, { 5, 7 }, { 0, 2 }, -}; - -static const uint8_t huff_spec_b34_tab[49][2] = { + /* Coefficient table B.3.4 - 49 entries */ { 0, 1 }, { 8, 4 }, { 56, 4 }, { 1, 4 }, { 7, 4 }, { 59, 8 }, { 13, 8 }, { 27, 10 }, { 45, 10 }, { 43, 10 }, { 29, 10 }, { 26, 10 }, { 46, 10 }, { 51, 10 }, { 21, 10 }, @@ -1075,9 +1003,7 @@ static const uint8_t huff_spec_b34_tab[49][2] = { { 2, 6 }, { 6, 6 }, { 58, 7 }, { 14, 7 }, { 11, 9 }, { 61, 9 }, { 41, 9 }, { 31, 9 }, { 3, 8 }, { 5, 8 }, { 9, 6 }, { 63, 6 }, { 57, 6 }, { 15, 6 }, -}; - -static const uint8_t huff_spec_b42_tab[225][2] = { + /* Coefficient table B.4.2 - 225 entries */ { 33, 7 }, { 239, 7 }, { 36, 7 }, { 236, 7 }, { 119, 10 }, { 153, 10 }, { 151, 10 }, { 121, 10 }, { 118, 10 }, { 154, 10 }, { 167, 10 }, { 105, 10 }, { 247, 8 }, { 25, 8 }, { 112, 8 }, @@ -1123,9 +1049,7 @@ static const uint8_t huff_spec_b42_tab[225][2] = { { 10, 8 }, { 66, 8 }, { 206, 8 }, { 179, 9 }, { 93, 9 }, { 70, 10 }, { 202, 10 }, { 85, 10 }, { 187, 10 }, { 194, 8 }, { 78, 8 }, { 196, 9 }, { 76, 9 }, { 49, 9 }, { 223, 9 }, -}; - -static const uint8_t huff_spec_b43_tab[225][2] = { + /* Coefficient table B.4.3 - 225 entries */ { 193, 7 }, { 79, 7 }, { 48, 7 }, { 208, 7 }, { 6, 8 }, { 10, 8 }, { 151, 10 }, { 121, 10 }, { 119, 10 }, { 153, 10 }, { 167, 10 }, { 105, 10 }, { 118, 10 }, { 154, 10 }, { 103, 10 }, @@ -1171,9 +1095,7 @@ static const uint8_t huff_spec_b43_tab[225][2] = { { 31, 6 }, { 227, 9 }, { 45, 9 }, { 210, 9 }, { 62, 9 }, { 50, 9 }, { 222, 9 }, { 96, 9 }, { 160, 9 }, { 5, 8 }, { 11, 8 }, { 65, 8 }, { 207, 8 }, { 1, 5 }, { 15, 5 }, -}; - -static const uint8_t huff_spec_b44_tab[225][2] = { + /* Coefficient table B.4.4 - 225 entries */ { 3, 7 }, { 13, 7 }, { 4, 7 }, { 12, 7 }, { 151, 10 }, { 121, 10 }, { 119, 10 }, { 153, 10 }, { 103, 10 }, { 169, 10 }, { 167, 10 }, { 105, 10 }, { 150, 10 }, { 122, 10 }, { 118, 10 }, @@ -1219,9 +1141,7 @@ static const uint8_t huff_spec_b44_tab[225][2] = { { 254, 7 }, { 242, 7 }, { 30, 7 }, { 48, 8 }, { 208, 8 }, { 226, 8 }, { 46, 8 }, { 34, 8 }, { 238, 8 }, { 227, 9 }, { 45, 9 }, { 35, 9 }, { 237, 9 }, { 16, 5 }, { 240, 5 }, -}; - -static const uint8_t huff_spec_b52_tab[31][2] = { + /* Coefficient table B.5.2 - 31 entries */ { 3, 4 }, { 29, 4 }, { 5, 5 }, { 27, 5 }, { 10, 5 }, { 22, 5 }, { 13, 6 }, { 19, 6 }, { 7, 6 }, { 25, 6 }, { 4, 5 }, { 28, 5 }, { 2, 4 }, { 30, 4 }, { 9, 5 }, @@ -1229,9 +1149,7 @@ static const uint8_t huff_spec_b52_tab[31][2] = { { 14, 7 }, { 18, 7 }, { 8, 5 }, { 24, 5 }, { 6, 6 }, { 26, 6 }, { 11, 6 }, { 21, 6 }, { 0, 3 }, { 1, 4 }, { 31, 4 }, -}; - -static const uint8_t huff_spec_b53_tab[31][2] = { + /* Coefficient table B.5.3 - 31 entries */ { 1, 3 }, { 31, 3 }, { 7, 6 }, { 25, 6 }, { 13, 7 }, { 19, 7 }, { 12, 7 }, { 20, 7 }, { 10, 6 }, { 22, 6 }, { 6, 6 }, { 26, 6 }, { 2, 4 }, { 30, 4 }, { 0, 2 }, @@ -1239,9 +1157,7 @@ static const uint8_t huff_spec_b53_tab[31][2] = { { 18, 8 }, { 11, 7 }, { 21, 7 }, { 9, 6 }, { 23, 6 }, { 3, 5 }, { 29, 5 }, { 8, 6 }, { 24, 6 }, { 5, 6 }, { 27, 6 }, -}; - -static const uint8_t huff_spec_b54_tab[31][2] = { + /* Coefficient table B.5.4 - 31 entries */ { 3, 4 }, { 29, 4 }, { 9, 6 }, { 23, 6 }, { 8, 6 }, { 24, 6 }, { 13, 8 }, { 19, 8 }, { 12, 8 }, { 20, 8 }, { 10, 7 }, { 22, 7 }, { 6, 6 }, { 26, 6 }, { 1, 3 }, @@ -1249,9 +1165,7 @@ static const uint8_t huff_spec_b54_tab[31][2] = { { 15, 9 }, { 17, 9 }, { 14, 9 }, { 18, 9 }, { 11, 8 }, { 21, 8 }, { 7, 7 }, { 25, 7 }, { 5, 6 }, { 27, 6 }, { 0, 2 }, -}; - -static const uint8_t huff_spec_b62_tab[63][2] = { + /* Coefficient table B.6.2 - 63 entries */ { 11, 6 }, { 53, 6 }, { 21, 6 }, { 43, 6 }, { 27, 7 }, { 37, 7 }, { 26, 7 }, { 38, 7 }, { 10, 6 }, { 54, 6 }, { 5, 5 }, { 59, 5 }, { 20, 6 }, { 44, 6 }, { 9, 6 }, @@ -1265,9 +1179,7 @@ static const uint8_t huff_spec_b62_tab[63][2] = { { 17, 6 }, { 47, 6 }, { 0, 4 }, { 2, 5 }, { 62, 5 }, { 22, 7 }, { 42, 7 }, { 29, 8 }, { 35, 8 }, { 28, 8 }, { 36, 8 }, { 6, 6 }, { 58, 6 }, -}; - -static const uint8_t huff_spec_b63_tab[63][2] = { + /* Coefficient table B.6.3 - 63 entries */ { 6, 5 }, { 58, 5 }, { 10, 6 }, { 54, 6 }, { 16, 6 }, { 48, 6 }, { 17, 6 }, { 47, 6 }, { 21, 7 }, { 43, 7 }, { 14, 7 }, { 50, 7 }, { 5, 5 }, { 59, 5 }, { 2, 4 }, @@ -1281,9 +1193,7 @@ static const uint8_t huff_spec_b63_tab[63][2] = { { 22, 8 }, { 42, 8 }, { 11, 7 }, { 53, 7 }, { 15, 8 }, { 49, 8 }, { 27, 9 }, { 37, 9 }, { 26, 9 }, { 38, 9 }, { 0, 3 }, { 1, 4 }, { 63, 4 }, -}; - -static const uint8_t huff_spec_b64_tab[63][2] = { + /* Coefficient table B.6.4 - 63 entries */ { 1, 3 }, { 63, 3 }, { 14, 7 }, { 50, 7 }, { 18, 7 }, { 46, 7 }, { 27, 9 }, { 37, 9 }, { 26, 9 }, { 38, 9 }, { 21, 8 }, { 43, 8 }, { 13, 7 }, { 51, 7 }, { 9, 6 }, @@ -1297,9 +1207,7 @@ static const uint8_t huff_spec_b64_tab[63][2] = { { 19, 8 }, { 45, 8 }, { 23, 9 }, { 41, 9 }, { 22, 9 }, { 42, 9 }, { 10, 7 }, { 54, 7 }, { 6, 6 }, { 58, 6 }, { 3, 5 }, { 61, 5 }, { 0, 3 }, -}; - -static const uint8_t huff_spec_b72_tab[127][2] = { + /* Coefficient table B.7.2 - 127 entries */ { 3, 5 }, { 125, 5 }, { 42, 7 }, { 86, 7 }, { 21, 7 }, { 107, 7 }, { 11, 6 }, { 117, 6 }, { 41, 7 }, { 87, 7 }, { 20, 7 }, { 108, 7 }, { 53, 8 }, { 75, 8 }, { 31, 8 }, @@ -1326,9 +1234,7 @@ static const uint8_t huff_spec_b72_tab[127][2] = { { 85, 8 }, { 12, 7 }, { 116, 7 }, { 0, 5 }, { 33, 7 }, { 95, 7 }, { 22, 8 }, { 106, 8 }, { 55, 9 }, { 73, 9 }, { 54, 9 }, { 74, 9 }, -}; - -static const uint8_t huff_spec_b73_tab[127][2] = { + /* Coefficient table B.7.3 - 127 entries */ { 0, 3 }, { 4, 5 }, { 124, 5 }, { 19, 7 }, { 109, 7 }, { 29, 8 }, { 99, 8 }, { 51, 9 }, { 77, 9 }, { 62, 10 }, { 66, 10 }, { 63, 10 }, { 65, 10 }, { 28, 8 }, { 100, 8 }, @@ -1355,9 +1261,7 @@ static const uint8_t huff_spec_b73_tab[127][2] = { { 53, 10 }, { 75, 10 }, { 52, 10 }, { 76, 10 }, { 42, 9 }, { 86, 9 }, { 34, 8 }, { 94, 8 }, { 32, 8 }, { 96, 8 }, { 11, 7 }, { 117, 7 }, -}; - -static const uint8_t huff_spec_b74_tab[127][2] = { + /* Coefficient table B.7.4 - 127 entries */ { 28, 8 }, { 100, 8 }, { 27, 8 }, { 101, 8 }, { 36, 8 }, { 92, 8 }, { 63, 10 }, { 65, 10 }, { 61, 10 }, { 67, 10 }, { 62, 10 }, { 66, 10 }, { 60, 10 }, { 68, 10 }, { 19, 7 }, @@ -1391,40 +1295,40 @@ static const HuffmanCodebook at9_huffman_coeffs[][8][4] = { { { 0 } }, { { 0 } }, { - { huff_spec_a21_tab, 8, 2, 1, 2 }, - { huff_spec_a22_tab, 80, 4, 2, 2 }, - { huff_spec_a23_tab, 81, 4, 2, 2 }, - { huff_spec_a24_tab, 81, 4, 2, 2 }, + { 8, 2, 1, 2 }, + { 80, 4, 2, 2 }, + { 81, 4, 2, 2 }, + { 81, 4, 2, 2 }, }, { - { huff_spec_a31_tab, 40, 2, 1, 3 }, - { huff_spec_a32_tab, 49, 2, 1, 3 }, - { huff_spec_a33_tab, 49, 2, 1, 3 }, - { huff_spec_a34_tab, 49, 2, 1, 3 }, + { 40, 2, 1, 3 }, + { 49, 2, 1, 3 }, + { 49, 2, 1, 3 }, + { 49, 2, 1, 3 }, }, { - { huff_spec_a41_tab, 176, 2, 1, 4 }, - { huff_spec_a42_tab, 225, 2, 1, 4 }, - { huff_spec_a43_tab, 225, 2, 1, 4 }, - { huff_spec_a44_tab, 225, 2, 1, 4 }, + { 176, 2, 1, 4 }, + { 225, 2, 1, 4 }, + { 225, 2, 1, 4 }, + { 225, 2, 1, 4 }, }, { - { huff_spec_a51_tab, 31, 1, 0, 5 }, - { huff_spec_a52_tab, 31, 1, 0, 5 }, - { huff_spec_a53_tab, 31, 1, 0, 5 }, - { huff_spec_a54_tab, 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, }, { - { huff_spec_a61_tab, 63, 1, 0, 6 }, - { huff_spec_a62_tab, 63, 1, 0, 6 }, - { huff_spec_a63_tab, 63, 1, 0, 6 }, - { huff_spec_a64_tab, 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, }, { - { huff_spec_a71_tab, 127, 1, 0, 7 }, - { huff_spec_a72_tab, 127, 1, 0, 7 }, - { huff_spec_a73_tab, 127, 1, 0, 7 }, - { huff_spec_a74_tab, 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, }, }, { @@ -1432,39 +1336,39 @@ static const HuffmanCodebook at9_huffman_coeffs[][8][4] = { { { 0 } }, { { 0 }, - { huff_spec_b22_tab, 80, 4, 2, 2 }, - { huff_spec_b23_tab, 81, 4, 2, 2 }, - { huff_spec_b24_tab, 81, 4, 2, 2 }, + { 80, 4, 2, 2 }, + { 81, 4, 2, 2 }, + { 81, 4, 2, 2 }, }, { { 0 }, - { huff_spec_b32_tab, 49, 2, 1, 3 }, - { huff_spec_b33_tab, 49, 2, 1, 3 }, - { huff_spec_b34_tab, 49, 2, 1, 3 }, + { 49, 2, 1, 3 }, + { 49, 2, 1, 3 }, + { 49, 2, 1, 3 }, }, { { 0 }, - { huff_spec_b42_tab, 225, 2, 1, 4 }, - { huff_spec_b43_tab, 225, 2, 1, 4 }, - { huff_spec_b44_tab, 225, 2, 1, 4 }, + { 225, 2, 1, 4 }, + { 225, 2, 1, 4 }, + { 225, 2, 1, 4 }, }, { { 0 }, - { huff_spec_b52_tab, 31, 1, 0, 5 }, - { huff_spec_b53_tab, 31, 1, 0, 5 }, - { huff_spec_b54_tab, 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, }, { { 0 }, - { huff_spec_b62_tab, 63, 1, 0, 6 }, - { huff_spec_b63_tab, 63, 1, 0, 6 }, - { huff_spec_b64_tab, 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, }, { { 0 }, - { huff_spec_b72_tab, 127, 1, 0, 7 }, - { huff_spec_b73_tab, 127, 1, 0, 7 }, - { huff_spec_b74_tab, 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, }, }, }; From patchwork Fri Nov 20 07:32:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23863 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 8184744B2D5 for ; Fri, 20 Nov 2020 09:46:38 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CE39368BCD5; Fri, 20 Nov 2020 09:34:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4D4A168BC9C for ; Fri, 20 Nov 2020 09:34:21 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id bo9so5775594ejb.13 for ; Thu, 19 Nov 2020 23:34: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:reply-to :mime-version:content-transfer-encoding; bh=iDl1FqIR5Yp3Nw2h2JU2JVPuehSzxF19mTwoOHxV5Pc=; b=AswM9uPwYd0lFCkpG6kyLpGGiQd9+/k+69ocZALCuES69J6uHvHmH26aloTMCFyHX2 iBdW3SAFWewLfr4m3a0Dt9XZLpDYKR8wle4sgNeORVHAPeYYWYo7sF6ipti+85yiNED4 eFX05bMLaEUqtdnj2qLoq6Dc7FHJnMpD/FAGVKdnNz3ft3D0uXpNBY5Lru0TXwzyxkZ5 bT+5fT2hwZem2WH+cN+EMWPSrNXvJxsNBcATOBtAOUTqek7EIttPdWqxU7Tnz0gINyyb 9pYHw721hX7U9FDFGA84rZSB2k7ABMI1dX1i7KYyuGl2QlgKx413bktdLkeB+EjHtDA+ PvdA== 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=iDl1FqIR5Yp3Nw2h2JU2JVPuehSzxF19mTwoOHxV5Pc=; b=HxFbQjFmOKFuiBIY8hMPukO6gp1pTw0goy0KzQfFGr6hDJBis5Q6kKdAyp2fEn6Jyq S2wpfVLbVEAgH4kvU1wrYJ+YX++FcrSl1ZMyekRVCpw7kmv9k+cDN6j5wiqczG0+Pv+s pjJV4AssYBktc6X+1QLrPoXehCil3dM5QnwDvAZz5NR/o0+YUgDkmujANluvwGSRm4/B W+/UP0XRZCZfnX+7ab/UOWcSIUaWCbl/YnUgvnjJrsq2xFHY93a/Kp+VvCPfWQ8i8WtR LUwYcrz/ika/1L56/SPqUFU05H9wGa1bk/CCJi3IMy8ixB9QlkdblvhfCdcrmgc0GSCQ XVJQ== X-Gm-Message-State: AOAM530EZmDxyETc0U52v3uSMp6EKy4/4vfdHREgKAMBS27WySo/Dhur oJlxg0I1j3aUv+m0mkvoUsROovR00iJs9g== X-Google-Smtp-Source: ABdhPJzk/I5wKY5JbqdctoaT9anBdK7oB3p+UPYJbSsf4k8ZXPS5B6M3bcCWDhW01m8OpzpypIprvA== X-Received: by 2002:a17:906:3153:: with SMTP id e19mr5460320eje.17.1605857660525; Thu, 19 Nov 2020 23:34:20 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:20 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:43 +0100 Message-Id: <20201120073327.820745-19-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 118/162] avcodec/atrac9dec: Don't create VLCs that are never used 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 ATRAC9 decoder creates VLCs with parameters contained in HuffmanCodebooks; some of these HuffmanCodebooks are empty and yet VLCs (that were completely unused*) were created from them. Said VLC contained a single table with 512 VLC_TYPE[2] entries, each of which indicated that this is an invalid code. This commit stops creating said VLCs. *: read_coeffs_coarse() uses the HuffmanCodebook at9_huffman_coeffs[cb][prec][cbi]. prec is c->precision_coarse[i] + 1 and every precision_coarse entry is in the 1..15 range after calc_precision(), so prec is >= 2 (all codebooks with prec < 2 are empty). The remaining empty codebooks are those with cb == 1 and cbi == 0, yet this is impossible, too: cb is given by c->codebookset[i] and this is always 0 if i < 8 (because those are never set to anything else in calc_codebook_idx()) and cbi is given by at9_q_unit_to_codebookidx[i] which is never zero if i >= 8. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac9dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index 4814beb112..b5f819985a 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -964,8 +964,8 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) /* Coefficient VLCs */ tab = at9_coeffs_tab; for (int i = 0; i < 2; i++) { - for (int j = 0; j < 8; j++) { - for (int k = 0; k < 4; k++) { + for (int j = 2; j < 8; j++) { + for (int k = i; k < 4; k++) { const HuffmanCodebook *hf = &at9_huffman_coeffs[i][j][k]; ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i][j][k], 9, hf->size, &tab[0][1], 2, From patchwork Fri Nov 20 07:32:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23867 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 8C6194400A0 for ; Fri, 20 Nov 2020 09:47:13 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C80068BCE8; Fri, 20 Nov 2020 09:34:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6C50B68BCC2 for ; Fri, 20 Nov 2020 09:34:22 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id f20so11518743ejz.4 for ; Thu, 19 Nov 2020 23:34:22 -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=nEPgpZVMK5OkSL2QqbXAytYnjna17tWlaq5joIIeJDY=; b=SYRNgHMlTYAHg/scDjJYFR814YsGidFlffDc3ry9k5+w1RYDKIRyZornY6OvtIiuEg m6f8MHOPzDLr//TtMut1RZafhIsm/y5hcNtzUoRvDJBSQoc9t5ccvlmwdNaPx1F3KNAy 0AqqtDHYM/pkRZa32PfiaeslNinYWtNQPJPvjqQPtVXZhNBBwGMJNiLwc2dBO9UPzbnA Kk7AzT8QkE3P7ofcsOyHYIQkrxwjQhz/Tn09dRUDFwjRi8H+4Zj1MSm4kPKSSubpwxV7 eh9mg22OiPP4B/ezD6jDkL5ylG0nqpG37XzFw0LgOowE2ApLn8hFehoV7sp2EncH4NBt d4xQ== 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=nEPgpZVMK5OkSL2QqbXAytYnjna17tWlaq5joIIeJDY=; b=f0YTbuxlWXkbcoMqL3Ar7tb2HnpK/eG7RyNibEoSnoPPcpGLb+MY6T8D9UomCX1hwg EmBRfR0SKBruh8zaVq+/31IF+ejTrza6We9eFQW2Lt8ALwMwY8W+/IgxwLhzLZxXls03 xzFh8RXxeGaHETjuzgIzTcalINM+et5Np08+Ep0G3KrKgbEktUqSLh9gWIjUScYYeCzR xCr2iz/mr7S03n4IxWbtsb8OAhrrPs4u0iWIBrUuYWzYO9Vtp5hEo4vmgOivjhztF30c HgQqRbcCBx81WNK15W+3nV0wdIw+Nkm3YhykyTBQ5k8zJfFR9RFiG2HMz4gl/LfuI2SY dEsQ== X-Gm-Message-State: AOAM533xGvXc0VDVAVHxWKrzAyo9MI45hdsD/liK7b9Vp8013nDuPttk zE1fW6/TP2+m9KwX79hXrBibD4z6Nl6wjA== X-Google-Smtp-Source: ABdhPJy+G2KnBnBqUnPy1Xd4+fFZY3hdDb8JcWnlbVZnIXnGFfnrW4cPQEf2s3FsSKKn4bhqgizasg== X-Received: by 2002:a17:906:3547:: with SMTP id s7mr30757551eja.70.1605857661378; Thu, 19 Nov 2020 23:34:21 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:20 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:44 +0100 Message-Id: <20201120073327.820745-20-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 119/162] avcodec/atrac9dec: Make VLCs static 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" Also remove code duplication and use a named constant for the number of VLC bits while just at it. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac9dec.c | 129 +++++++++++++++++++++-------------------- 1 file changed, 67 insertions(+), 62 deletions(-) diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index b5f819985a..6849296ac0 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/thread.h" + #include "internal.h" #include "get_bits.h" #include "fft.h" @@ -27,6 +29,7 @@ #include "libavutil/float_dsp.h" #define ATRAC9_SF_VLC_BITS 8 +#define ATRAC9_COEFF_VLC_BITS 9 typedef struct ATRAC9ChannelData { int band_ext; @@ -92,14 +95,15 @@ typedef struct ATRAC9Context { const ATRAC9BlockConfig *block_config; /* Generated on init */ - VLC sf_vlc[2][8]; /* Signed/unsigned, length */ - VLC coeff_vlc[2][8][4]; /* Cookbook, precision, cookbook index */ uint8_t alloc_curve[48][48]; DECLARE_ALIGNED(32, float, imdct_win)[256]; DECLARE_ALIGNED(32, float, temp)[256]; } ATRAC9Context; +static VLC sf_vlc[2][8]; /* Signed/unsigned, length */ +static VLC coeff_vlc[2][8][4]; /* Cookbook, precision, cookbook index */ + static inline int parse_gradient(ATRAC9Context *s, ATRAC9BlockData *b, GetBitContext *gb) { @@ -269,7 +273,7 @@ static inline int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, const uint8_t *sf_weights = at9_tab_sf_weights[get_bits(gb, 3)]; const int base = get_bits(gb, 5); const int len = get_bits(gb, 2) + 3; - const VLC *tab = &s->sf_vlc[0][len]; + const VLC *tab = &sf_vlc[0][len]; c->scalefactors[0] = get_bits(gb, len); @@ -302,7 +306,7 @@ static inline int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, const int len = get_bits(gb, 2) + 2; const int unit_cnt = FFMIN(b->band_ext_q_unit, baseline_len); - const VLC *tab = &s->sf_vlc[1][len]; + const VLC *tab = &sf_vlc[1][len]; for (int i = 0; i < unit_cnt; i++) { int dist = get_vlc2(gb, tab->table, ATRAC9_SF_VLC_BITS, 1); @@ -323,7 +327,7 @@ static inline int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, const int base = get_bits(gb, 5) - (1 << (5 - 1)); const int len = get_bits(gb, 2) + 1; const int unit_cnt = FFMIN(b->band_ext_q_unit, baseline_len); - const VLC *tab = &s->sf_vlc[0][len]; + const VLC *tab = &sf_vlc[0][len]; c->scalefactors[0] = get_bits(gb, len); @@ -410,12 +414,12 @@ static inline void read_coeffs_coarse(ATRAC9Context *s, ATRAC9BlockData *b, if (prec <= max_prec) { const int cb = c->codebookset[i]; const int cbi = at9_q_unit_to_codebookidx[i]; - const VLC *tab = &s->coeff_vlc[cb][prec][cbi]; + const VLC *tab = &coeff_vlc[cb][prec][cbi]; const HuffmanCodebook *huff = &at9_huffman_coeffs[cb][prec][cbi]; const int groups = bands >> huff->value_cnt_pow; for (int j = 0; j < groups; j++) { - uint16_t val = get_vlc2(gb, tab->table, 9, 2); + uint16_t val = get_vlc2(gb, tab->table, ATRAC9_COEFF_VLC_BITS, 2); for (int k = 0; k < huff->value_cnt; k++) { coeffs[k] = sign_extend(val, huff->value_bits); @@ -828,28 +832,72 @@ static av_cold int atrac9_decode_close(AVCodecContext *avctx) { ATRAC9Context *s = avctx->priv_data; - for (int i = 1; i < 7; i++) - ff_free_vlc(&s->sf_vlc[0][i]); - for (int i = 2; i < 6; i++) - ff_free_vlc(&s->sf_vlc[1][i]); - for (int i = 0; i < 2; i++) - for (int j = 0; j < 8; j++) - for (int k = 0; k < 4; k++) - ff_free_vlc(&s->coeff_vlc[i][j][k]); - ff_mdct_end(&s->imdct); av_free(s->fdsp); return 0; } +static av_cold void atrac9_init_vlc(VLC *vlc, int nb_bits, int nb_codes, + const uint8_t (**tab)[2], + unsigned *buf_offset, int offset) +{ + static VLC_TYPE vlc_buf[24812][2]; + + vlc->table = &vlc_buf[*buf_offset]; + vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *buf_offset; + ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + &(*tab)[0][1], 2, &(*tab)[0][0], 2, 1, + offset, INIT_VLC_STATIC_OVERLONG, NULL); + *buf_offset += vlc->table_size; + *tab += nb_codes; +} + +static av_cold void atrac9_init_static(void) +{ + const uint8_t (*tab)[2]; + unsigned offset = 0; + + /* Unsigned scalefactor VLCs */ + tab = at9_sfb_a_tab; + for (int i = 1; i < 7; i++) { + const HuffmanCodebook *hf = &at9_huffman_sf_unsigned[i]; + + atrac9_init_vlc(&sf_vlc[0][i], ATRAC9_SF_VLC_BITS, + hf->size, &tab, &offset, 0); + } + + /* Signed scalefactor VLCs */ + tab = at9_sfb_b_tab; + for (int i = 2; i < 6; i++) { + const HuffmanCodebook *hf = &at9_huffman_sf_signed[i]; + + /* The symbols are signed integers in the range -16..15; + * the values in the source table are offset by 16 to make + * them fit into an uint8_t; the -16 reverses this shift. */ + atrac9_init_vlc(&sf_vlc[1][i], ATRAC9_SF_VLC_BITS, + hf->size, &tab, &offset, -16); + } + + /* Coefficient VLCs */ + tab = at9_coeffs_tab; + for (int i = 0; i < 2; i++) { + for (int j = 2; j < 8; j++) { + for (int k = i; k < 4; k++) { + const HuffmanCodebook *hf = &at9_huffman_coeffs[i][j][k]; + atrac9_init_vlc(&coeff_vlc[i][j][k], ATRAC9_COEFF_VLC_BITS, + hf->size, &tab, &offset, 0); + } + } + } +} + static av_cold int atrac9_decode_init(AVCodecContext *avctx) { + static AVOnce static_table_init = AV_ONCE_INIT; GetBitContext gb; ATRAC9Context *s = avctx->priv_data; int version, block_config_idx, superframe_idx, alloc_c_len; - const uint8_t (*tab)[2]; - int ret; s->avctx = avctx; @@ -932,50 +980,7 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) for (int j = 0; j < i; j++) s->alloc_curve[i - 1][j] = at9_tab_b_dist[(j * alloc_c_len) / i]; - /* Unsigned scalefactor VLCs */ - tab = at9_sfb_a_tab; - for (int i = 1; i < 7; i++) { - const HuffmanCodebook *hf = &at9_huffman_sf_unsigned[i]; - - ret = ff_init_vlc_from_lengths(&s->sf_vlc[0][i], ATRAC9_SF_VLC_BITS, - hf->size, &tab[0][1], 2, - &tab[0][0], 2, 1, 0, 0, avctx); - if (ret < 0) - return ret; - tab += hf->size; - } - - /* Signed scalefactor VLCs */ - tab = at9_sfb_b_tab; - for (int i = 2; i < 6; i++) { - const HuffmanCodebook *hf = &at9_huffman_sf_signed[i]; - - /* The symbols are signed integers in the range -16..15; - * the values in the source table are offset by 16 to make - * them fit into an uint8_t; the -16 reverses this shift. */ - ret = ff_init_vlc_from_lengths(&s->sf_vlc[1][i], ATRAC9_SF_VLC_BITS, - hf->size, &tab[0][1], 2, - &tab[0][0], 2, 1, -16, 0, avctx); - if (ret < 0) - return ret; - tab += hf->size; - } - - /* Coefficient VLCs */ - tab = at9_coeffs_tab; - for (int i = 0; i < 2; i++) { - for (int j = 2; j < 8; j++) { - for (int k = i; k < 4; k++) { - const HuffmanCodebook *hf = &at9_huffman_coeffs[i][j][k]; - ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i][j][k], 9, - hf->size, &tab[0][1], 2, - &tab[0][0], 2, 1, 0, 0, avctx); - if (ret < 0) - return ret; - tab += hf->size; - } - } - } + ff_thread_once(&static_table_init, atrac9_init_static); return 0; } From patchwork Fri Nov 20 07:32: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: 23868 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 274F3448F87 for ; Fri, 20 Nov 2020 09:47:26 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2EFDE68BB59; Fri, 20 Nov 2020 09:34:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1835D68BCC6 for ; Fri, 20 Nov 2020 09:34:23 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id i19so11500102ejx.9 for ; Thu, 19 Nov 2020 23:34:23 -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=jjeESV9NiMrj33GbtoCIEWbt+9uSjTjeXKz1vebZnwk=; b=GkV5twSKs/ixyFcI7YQRUn10EaITF+mvNUqqx327TwzupkP+QBmPYKS2wuJuJ3d0oP bTGgEW6iSSqdXOUay0aO8XSjiZaZ3XjTz3iv1VwKDfcD/NuTM4k/n84hjT6f2qEB52Cj sjjxvg0Nv5VspghfxCjN0OUfmSMGYKUozlpnbNtYuie2a7W+D+CLrcUrtehJKzBUGsBz R+xAqqMxIMEJMKj9E0KIVSB6/bMndGBkIVQcjVVSrjpiv5B2b5s39d7JEJLv+qAG03DC KYzOjOqxyaxj5W29pRBaMRwAo/e7hI63UNTKYdUo53jBfqydiy+AWGP+9UZnzUbeXCxI iVYw== 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=jjeESV9NiMrj33GbtoCIEWbt+9uSjTjeXKz1vebZnwk=; b=CaD9t2r0FO18stqijj40zukKCZpJoRKl6Y/R6EXi4gJ7jPA0GH0Rwg9UgyWJgECDpu IBqpQ85sOhjiq5ixDCcAK7DPpdFygIPuca6xjQHLnsg7u++fUXDGbMSGPYY7NS0LL15a rL2gsS0kPi7yxnafEs4N1bbhVXbfzPhGgEzPm8CMcoRxulmWeIrr2TxV3TufNfHURqi1 uh9BQh2e6IWdxCvnbzyFXwRI1QFZSKOWgS6PsCM/7TEKqIPg9ZmyeiGSF0RkbSp66sxj 73Bm4W4E2/b/sWFrWhUFi1c1IbBW3pPLA/BpaBWCwW/ZvqlsoeoMhMvaD9cINPkDJ28X rPgA== X-Gm-Message-State: AOAM53093c0LlSZDsgo/jj0QrYqUzJvB82Tyy1J+692enMMIG/CCeuby RdFEAwBuZfbGczjDUa1xjV/nkmHkbNyzZw== X-Google-Smtp-Source: ABdhPJwcmJlG1qya4aPNNr9Cjqr0o/EtCTkEgiwGHNANqjEf04218MJvxJKUvxgsE2yYZvBfbrs+Mw== X-Received: by 2002:a17:906:ce2a:: with SMTP id sd10mr13481206ejb.21.1605857662403; Thu, 19 Nov 2020 23:34:22 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:21 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:45 +0100 Message-Id: <20201120073327.820745-21-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 120/162] avcodec/atrac9dec: Replace av_free() by av_freep() in close function 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/atrac9dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index 6849296ac0..f0fcd0cb13 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -833,7 +833,7 @@ static av_cold int atrac9_decode_close(AVCodecContext *avctx) ATRAC9Context *s = avctx->priv_data; ff_mdct_end(&s->imdct); - av_free(s->fdsp); + av_freep(&s->fdsp); return 0; } From patchwork Fri Nov 20 07:32:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23870 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 50CF6448F87 for ; Fri, 20 Nov 2020 09:47:53 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A259668BD00; Fri, 20 Nov 2020 09:34:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 92DBA68BCA8 for ; Fri, 20 Nov 2020 09:34:24 +0200 (EET) Received: by mail-ed1-f46.google.com with SMTP id v22so8486370edt.9 for ; Thu, 19 Nov 2020 23:34:24 -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=X03fJfdwsw7/GvaGfOxnDtKWXEC8jwSAjyQ9c7he7BE=; b=f8rN4KwJ3sGsUabFSu9j0NytAdpSv13hs9/GyFB0MBKb7FJxU08rZWV2N63CRFDwKo jLTK67INw2CQAYan6KB8wCKwV1SyeYjNNCPJXVTGeS43otHVYehhqAsVrsyBr3K+0HEt jxIAvWaqLcMVAoSgSziUw5ZrmrvNX11ZqDpsWNBaou0HJuvzrIr53Zg26r5jCEUTjyjG T/aVdidAUkIXkHcQgFISnUo3YKyi9fysq0MLAIbh3chRjZy72gc2Ah8rS1gaHqO25pb7 LI/JnbVSitdFgGoGU5xSa5xFg2CayW23nKYJXujgrALNl3X6bk/SGjMUdtn+scAT2WCL mmkQ== 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=X03fJfdwsw7/GvaGfOxnDtKWXEC8jwSAjyQ9c7he7BE=; b=jisM2Hh4O0/a96e9dxd2mFdfSDKl04c72d5AjRH8NJ0PCbnhUuFzNs3j0BixGBLCSb fzF9Tkt+0dzHfDi99JKiH5I/4dfVacJG4ttGTsAR7McJyMFqx7473PJmfJcCvH3wCJe4 mywGLBH98dW1psCoUqo9L3H9HOox+NYH5BY4s8hH+XXWt5Ls7yGoBqxuJNwPdJ1Kik29 xkCWzalCWz9z/kqbvoB/IalcmFv545kBKOoTaJAh1mtz6X155GytxN5yNZiEHLC7Oa/6 uILKohgmy4a3igjnDNBjpCWJ+K5kdodmBjAjBqnWSC/Ksf5K/NW8EJ27idXmuiQqdoUO gUIA== X-Gm-Message-State: AOAM53399lM51FpF8H66UH5K5CndG27s8nK7Yur4Ayo/LA6Ze65UpU2t gfS3+y58cJ4J54+pBhO5ZoMlIrmuWrIcrw== X-Google-Smtp-Source: ABdhPJwS47cmN4OC9f445lG0pF+txhjv4LTGVE5DFYwpEhjTK90/QTjKjmnQrRkYdBFw/49uR3rflQ== X-Received: by 2002:a05:6402:2208:: with SMTP id cq8mr15616984edb.182.1605857663435; Thu, 19 Nov 2020 23:34:23 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:22 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:46 +0100 Message-Id: <20201120073327.820745-22-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 121/162] avcodec/atrac9tab: Add missing static to internal 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/atrac9tab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/atrac9tab.h b/libavcodec/atrac9tab.h index 1882bf9f43..b169035aad 100644 --- a/libavcodec/atrac9tab.h +++ b/libavcodec/atrac9tab.h @@ -104,7 +104,7 @@ static const int at9_q_unit_to_coeff_idx[] = { 72, 80, 88, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256 }; -const uint8_t at9_q_unit_to_codebookidx[] = { +static const uint8_t at9_q_unit_to_codebookidx[] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, }; From patchwork Fri Nov 20 07:32:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23871 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 38B0D448F87 for ; Fri, 20 Nov 2020 09:48:06 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7007868BD07; Fri, 20 Nov 2020 09:34:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 73D0F68BC27 for ; Fri, 20 Nov 2020 09:34:26 +0200 (EET) Received: by mail-ed1-f66.google.com with SMTP id m16so8520441edr.3 for ; Thu, 19 Nov 2020 23:34: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=bAuuKK4Tp2udtClfOJQF1BsItwBZWbtL6oFq+jjaqTc=; b=ffc0Ah1xmaognuc5f9fjlBUN4oRhREiNEHKGv14q3i3a9EHTHVaWE0CFQi8+FXh6Uy In5C6Vo1vg7jgocvP5yy/jgoR0tgrWW5/IMzVeS8P0Ff33io0Z2XUeFHWIGUAlUvDww8 epzUzGCi7+3B7IJvbWssPAOFHsOxWY5hJbf6DF8DV1UKU6ZUOY9lw21IWfpor/U80Q1Q ycDrrOs+uWwbH84Epwn4SnBUw0V+lS3L14i8HVEDdSo0HQS/DprER9uAvtz7v+eFI6fM PFw2pMlM2EksE7Vhx8qWUd4cHACnXesJDwDHet+Caf6BGg2cC1EgPXhsNtVD1VfDpWWa YyBw== 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=bAuuKK4Tp2udtClfOJQF1BsItwBZWbtL6oFq+jjaqTc=; b=bIOnDZPbD57GJ99miR2pTG+OH2nqQmZfFZiJr4PnjxjyRHjCxOOldFtxfrxXbW4nu9 hvZrA5BlljlF25TIGDQ+hrJm322IuwQs0wzyz5fp5B1lCh8ZKUbZ1loETqFrHX+ebYWz oUtA4JMxZMRtJAuxqT2+WtRP/p2eQraB2IQ4AG4fcZ9tZZ4WFuEfUC4OFekOiqn6p3r6 XO8zosyWxqAF8D01hwI5lNEGlVAMk4r88GWOm9dnnQFCwWlT21dIRLnIfk5zA913P5An 3I/R+z5DpM/hofBy4/qHQbYmg8W9dV/EWO+VzluPhozOxmoyKYDTve0X/fBI/3mcfpX6 s6mA== X-Gm-Message-State: AOAM530Cb0BRR7BSflKu6chx0MGaLcTlEZFyLZCQu246GAUXbfBYY060 sXAeC1czLSUbmhl1ItSp9EhVKolwEHe1LQ== X-Google-Smtp-Source: ABdhPJwuV8JsimgzQjDimzasw/dQHPHAkUAwcNhmOG/35qOIVex2Q7lhlXjZ7/3OoB/mc4+J2xjelQ== X-Received: by 2002:aa7:d709:: with SMTP id t9mr35853373edq.305.1605857664432; Thu, 19 Nov 2020 23:34:24 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:23 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:47 +0100 Message-Id: <20201120073327.820745-23-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 122/162] avcodec/vp3: Apply VLC offset during init 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" By switching to ff_init_vlc_from_lengths() one can apply both positive as well as negative offsets for free; in this case it even saves space because one replaces codes tables that don't fit into an uint8_t by symbols tables that fit into an uint8_t or can even be completely avoided as they are trivial. Signed-off-by: Andreas Rheinhardt --- libavcodec/vp3.c | 31 ++-- libavcodec/vp3data.h | 24 +-- libavcodec/vp4data.h | 412 +++++++++++++++++++------------------------ 3 files changed, 210 insertions(+), 257 deletions(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index c4ad43a299..34c48f8725 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -48,6 +48,9 @@ #include "vp3dsp.h" #include "xiph.h" +#define VP4_MV_VLC_BITS 6 +#define SUPERBLOCK_VLC_BITS 6 + #define FRAGMENT_PIXELS 8 // FIXME split things out into their own arrays @@ -489,7 +492,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) bit ^= 1; current_run = get_vlc2(gb, s->superblock_run_length_vlc.table, - 6, 2) + 1; + SUPERBLOCK_VLC_BITS, 2); if (current_run == 34) current_run += get_bits(gb, 12); @@ -523,7 +526,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) bit ^= 1; current_run = get_vlc2(gb, s->superblock_run_length_vlc.table, - 6, 2) + 1; + SUPERBLOCK_VLC_BITS, 2); if (current_run == 34) current_run += get_bits(gb, 12); @@ -885,7 +888,8 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) static int vp4_get_mv(Vp3DecodeContext *s, GetBitContext *gb, int axis, int last_motion) { - int v = get_vlc2(gb, s->vp4_mv_vlc[axis][vp4_mv_table_selector[FFABS(last_motion)]].table, 6, 2) - 31; + int v = get_vlc2(gb, s->vp4_mv_vlc[axis][vp4_mv_table_selector[FFABS(last_motion)]].table, + VP4_MV_VLC_BITS, 2); return last_motion < 0 ? -v : v; } @@ -1104,7 +1108,8 @@ static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb) else bit ^= 1; - run_length = get_vlc2(gb, s->superblock_run_length_vlc.table, 6, 2) + 1; + run_length = get_vlc2(gb, s->superblock_run_length_vlc.table, + SUPERBLOCK_VLC_BITS, 2); if (run_length == 34) run_length += get_bits(gb, 12); blocks_decoded += run_length; @@ -2452,9 +2457,10 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) } } - if ((ret = init_vlc(&s->superblock_run_length_vlc, 6, 34, - &superblock_run_length_vlc_table[0][1], 4, 2, - &superblock_run_length_vlc_table[0][0], 4, 2, 0)) < 0) + ret = ff_init_vlc_from_lengths(&s->superblock_run_length_vlc, SUPERBLOCK_VLC_BITS, 34, + superblock_run_length_vlc_lens, 1, + NULL, 0, 0, 1, 0, avctx); + if (ret < 0) return ret; if ((ret = init_vlc(&s->fragment_run_length_vlc, 5, 30, @@ -2474,11 +2480,14 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) #if CONFIG_VP4_DECODER for (j = 0; j < 2; j++) - for (i = 0; i < 7; i++) - if ((ret = init_vlc(&s->vp4_mv_vlc[j][i], 6, 63, - &vp4_mv_vlc[j][i][0][1], 4, 2, - &vp4_mv_vlc[j][i][0][0], 4, 2, 0)) < 0) + for (i = 0; i < 7; i++) { + ret = ff_init_vlc_from_lengths(&s->vp4_mv_vlc[j][i], VP4_MV_VLC_BITS, 63, + &vp4_mv_vlc[j][i][0][1], 2, + &vp4_mv_vlc[j][i][0][0], 2, 1, -31, + 0, avctx); + if (ret < 0) return ret; + } /* version >= 2 */ for (i = 0; i < 2; i++) diff --git a/libavcodec/vp3data.h b/libavcodec/vp3data.h index a1366788c5..4dc20c5f29 100644 --- a/libavcodec/vp3data.h +++ b/libavcodec/vp3data.h @@ -95,25 +95,11 @@ static const uint8_t vp31_filter_limit_values[64] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static const uint16_t superblock_run_length_vlc_table[34][2] = { - { 0, 1 }, - - { 4, 3 }, { 5, 3 }, - - { 0xC, 4 }, { 0xD, 4 }, - - { 0x38, 6 }, { 0x39, 6 }, { 0x3A, 6 }, { 0x3B, 6 }, - - { 0xF0, 8 }, { 0xF1, 8 }, { 0xF2, 8 }, { 0xF3, 8 }, - { 0xF4, 8 }, { 0xF5, 8 }, { 0xF6, 8 }, { 0xF7, 8 }, - - { 0x3E0, 10 }, { 0x3E1, 10 }, { 0x3E2, 10 }, { 0x3E3, 10 }, - { 0x3E4, 10 }, { 0x3E5, 10 }, { 0x3E6, 10 }, { 0x3E7, 10 }, - { 0x3E8, 10 }, { 0x3E9, 10 }, { 0x3EA, 10 }, { 0x3EB, 10 }, - { 0x3EC, 10 }, { 0x3ED, 10 }, { 0x3EE, 10 }, { 0x3EF, 10 }, - - { 0x3F, 6 } /* this last VLC is a special case for reading 12 more - * bits from stream and adding the value 34 */ +static const uint8_t superblock_run_length_vlc_lens[34] = { + 1, 3, 3, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 6, /* This last value is a special case for reading 12 more + * bits from the stream and adding the value 34. */ }; static const uint16_t fragment_run_length_vlc_table[30][2] = { diff --git a/libavcodec/vp4data.h b/libavcodec/vp4data.h index f711d16240..13c7b7cd5e 100644 --- a/libavcodec/vp4data.h +++ b/libavcodec/vp4data.h @@ -109,262 +109,220 @@ static const uint8_t vp4_mv_table_selector[32] = { 6, 6, 6, 6, 6, 6, 6, 6, }; -static const uint16_t vp4_mv_vlc[2][7][63][2] = { +static const uint8_t vp4_mv_vlc[2][7][63][2] = { { /* x-axis tables */ { - { 0x6A, 7 }, { 0x11A, 9 }, { 0x18E, 9 }, { 0x237, 10 }, - { 0x4A, 8 }, { 0x236, 10 }, { 0x7A, 8 }, { 0xD6, 9 }, - { 0x7E, 8 }, { 0x1FD, 10 }, { 0x8C, 8 }, { 0xD7, 9 }, - { 0x87, 8 }, { 0x183, 9 }, { 0x3C, 7 }, { 0x61, 7 }, - { 0x47, 7 }, { 0x69, 8 }, { 0x40, 7 }, { 0x48, 8 }, - { 0x49, 7 }, { 0x86, 8 }, { 0x13, 6 }, { 0xD2, 8 }, - { 0x1C, 6 }, { 0x42, 7 }, { 0x25, 6 }, { 0x1B, 6 }, - { 0x13, 5 }, { 0x5, 4 }, { 0x0, 2 }, { 0x7, 3 }, - { 0x5, 3 }, { 0x1B, 5 }, { 0x19, 5 }, { 0x19, 6 }, - { 0x8, 5 }, { 0x45, 7 }, { 0x1D, 6 }, { 0xC6, 8 }, - { 0x68, 7 }, { 0x90, 8 }, { 0x41, 7 }, { 0x4B, 8 }, - { 0x31, 7 }, { 0x18F, 9 }, { 0x62, 7 }, { 0x3E, 7 }, - { 0x44, 7 }, { 0x68, 8 }, { 0x30, 7 }, { 0x182, 9 }, - { 0xC0, 8 }, { 0x1A7, 9 }, { 0x91, 8 }, { 0x92, 9 }, - { 0x7B, 8 }, { 0xFF, 9 }, { 0x1A6, 9 }, { 0x1FC, 10 }, - { 0x6A, 8 }, { 0x93, 9 }, { 0x6B, 7 } + { 30, 2 }, { 36, 5 }, { 19, 8 }, { 55, 9 }, { 61, 9 }, + { 4, 8 }, { 43, 8 }, { 22, 6 }, { 29, 4 }, { 50, 7 }, + { 44, 7 }, { 35, 6 }, { 49, 8 }, { 17, 8 }, { 60, 8 }, + { 7, 9 }, { 11, 9 }, { 27, 6 }, { 24, 6 }, { 38, 6 }, + { 14, 7 }, { 6, 8 }, { 56, 8 }, { 47, 7 }, { 8, 8 }, + { 59, 10 }, { 9, 10 }, { 57, 9 }, { 18, 7 }, { 42, 7 }, + { 25, 7 }, { 21, 8 }, { 12, 8 }, { 48, 7 }, { 37, 7 }, + { 10, 8 }, { 1, 9 }, { 5, 10 }, { 3, 10 }, { 16, 7 }, + { 41, 8 }, { 54, 8 }, { 20, 7 }, { 26, 6 }, { 28, 5 }, + { 32, 3 }, { 52, 8 }, { 51, 9 }, { 13, 9 }, { 15, 7 }, + { 46, 7 }, { 39, 8 }, { 2, 9 }, { 45, 9 }, { 34, 5 }, + { 40, 7 }, { 23, 8 }, { 58, 9 }, { 53, 9 }, { 0, 7 }, + { 62, 7 }, { 33, 5 }, { 31, 3 }, }, { - { 0x39, 7 }, { 0x259, 10 }, { 0x1B, 8 }, { 0x1D1, 10 }, - { 0x137, 9 }, { 0x1D0, 10 }, { 0x1A, 8 }, { 0x1B5, 10 }, - { 0x1D, 8 }, { 0x4BC, 11 }, { 0x6C, 8 }, { 0x38, 9 }, - { 0x71, 8 }, { 0x2D, 9 }, { 0x7D, 8 }, { 0x75, 8 }, - { 0x19, 7 }, { 0xE9, 9 }, { 0x37, 7 }, { 0x15, 8 }, - { 0x1E, 7 }, { 0xDB, 9 }, { 0x4C, 7 }, { 0x70, 8 }, - { 0xD, 6 }, { 0xC, 7 }, { 0x27, 6 }, { 0x4, 6 }, - { 0x2, 4 }, { 0x0, 4 }, { 0x5, 3 }, { 0x7, 3 }, - { 0x6, 3 }, { 0x2, 3 }, { 0x8, 4 }, { 0x24, 6 }, - { 0xC, 5 }, { 0x3B, 7 }, { 0x1E, 6 }, { 0x9A, 8 }, - { 0xE, 6 }, { 0x69, 8 }, { 0x4A, 7 }, { 0x12D, 9 }, - { 0x35, 7 }, { 0xF9, 9 }, { 0x18, 7 }, { 0x7F, 8 }, - { 0xF, 7 }, { 0xF8, 9 }, { 0x7E, 8 }, { 0x25F, 10 }, - { 0x68, 8 }, { 0x2C, 9 }, { 0x14, 8 }, { 0x258, 10 }, - { 0x136, 9 }, { 0x4BD, 11 }, { 0x12E, 9 }, { 0x1B4, 10 }, - { 0x17, 8 }, { 0x39, 9 }, { 0x1F, 7 } + { 29, 4 }, { 27, 6 }, { 54, 8 }, { 19, 8 }, { 53, 9 }, + { 13, 9 }, { 60, 8 }, { 25, 7 }, { 6, 8 }, { 2, 8 }, + { 11, 9 }, { 61, 9 }, { 8, 8 }, { 48, 7 }, { 28, 4 }, + { 46, 7 }, { 16, 7 }, { 24, 6 }, { 40, 6 }, { 20, 7 }, + { 62, 7 }, { 33, 3 }, { 36, 5 }, { 52, 8 }, { 41, 8 }, + { 44, 7 }, { 10, 8 }, { 59, 10 }, { 7, 10 }, { 21, 9 }, + { 18, 7 }, { 23, 8 }, { 12, 8 }, { 0, 7 }, { 5, 10 }, + { 3, 10 }, { 17, 9 }, { 15, 8 }, { 37, 7 }, { 38, 6 }, + { 49, 9 }, { 45, 9 }, { 14, 8 }, { 50, 8 }, { 47, 8 }, + { 34, 4 }, { 35, 6 }, { 42, 7 }, { 55, 10 }, { 1, 10 }, + { 43, 9 }, { 58, 9 }, { 9, 11 }, { 57, 11 }, { 51, 10 }, + { 22, 7 }, { 39, 8 }, { 56, 9 }, { 4, 9 }, { 26, 6 }, + { 30, 3 }, { 32, 3 }, { 31, 3 }, }, { - { 0x29, 7 }, { 0x3CB, 10 }, { 0x1F5, 9 }, { 0x263, 10 }, - { 0x1F4, 9 }, { 0x3DA, 10 }, { 0x50, 8 }, { 0x260, 10 }, - { 0x1EC, 9 }, { 0x3D3, 10 }, { 0x109, 9 }, { 0x3D2, 10 }, - { 0x51, 8 }, { 0x792, 11 }, { 0xF3, 8 }, { 0x9A, 8 }, - { 0xF7, 8 }, { 0x132, 9 }, { 0xC1, 8 }, { 0x1E8, 9 }, - { 0x2A, 7 }, { 0x85, 8 }, { 0x61, 7 }, { 0x1F7, 9 }, - { 0x78, 7 }, { 0xC7, 8 }, { 0x23, 6 }, { 0x7C, 7 }, - { 0x12, 5 }, { 0xB, 5 }, { 0xE, 4 }, { 0xD, 4 }, - { 0x0, 2 }, { 0x5, 3 }, { 0x3, 3 }, { 0x4, 4 }, - { 0x19, 5 }, { 0x20, 6 }, { 0x3F, 6 }, { 0x43, 7 }, - { 0x62, 7 }, { 0x9F, 8 }, { 0x4E, 7 }, { 0x181, 9 }, - { 0x2B, 7 }, { 0x137, 9 }, { 0xF5, 8 }, { 0x89, 8 }, - { 0xC6, 8 }, { 0x262, 10 }, { 0x88, 8 }, { 0x3C8, 10 }, - { 0x1F6, 9 }, { 0x3CA, 10 }, { 0x9E, 8 }, { 0x261, 10 }, - { 0x136, 9 }, { 0x108, 9 }, { 0x133, 9 }, { 0x793, 11 }, - { 0x180, 9 }, { 0x3DB, 10 }, { 0x45, 7 } + { 32, 2 }, { 35, 4 }, { 6, 8 }, { 12, 8 }, { 0, 7 }, + { 20, 7 }, { 44, 7 }, { 29, 5 }, { 34, 3 }, { 37, 6 }, + { 57, 9 }, { 10, 9 }, { 21, 8 }, { 39, 7 }, { 50, 8 }, + { 47, 8 }, { 62, 7 }, { 26, 6 }, { 28, 5 }, { 7, 10 }, + { 55, 10 }, { 49, 10 }, { 3, 10 }, { 17, 9 }, { 58, 9 }, + { 15, 8 }, { 56, 9 }, { 45, 9 }, { 42, 7 }, { 54, 8 }, + { 41, 8 }, { 33, 3 }, { 60, 9 }, { 43, 9 }, { 18, 8 }, + { 22, 7 }, { 40, 7 }, { 48, 8 }, { 25, 8 }, { 36, 5 }, + { 31, 4 }, { 30, 4 }, { 24, 7 }, { 51, 10 }, { 13, 11 }, + { 59, 11 }, { 53, 10 }, { 1, 10 }, { 14, 8 }, { 19, 9 }, + { 11, 10 }, { 9, 10 }, { 46, 8 }, { 8, 9 }, { 5, 10 }, + { 61, 10 }, { 16, 8 }, { 27, 7 }, { 4, 9 }, { 2, 9 }, + { 52, 9 }, { 23, 9 }, { 38, 6 }, }, { - { 0x1, 6 }, { 0x1C7, 9 }, { 0x67, 8 }, { 0xB5, 9 }, - { 0x66, 8 }, { 0x139, 9 }, { 0x99, 8 }, { 0xB4, 9 }, - { 0xC3, 8 }, { 0x130, 9 }, { 0x0, 7 }, { 0x131, 9 }, - { 0x9E, 8 }, { 0xB7, 9 }, { 0x2C, 7 }, { 0x1, 7 }, - { 0x28, 7 }, { 0x138, 9 }, { 0x4B, 7 }, { 0x31, 8 }, - { 0x60, 7 }, { 0x91, 8 }, { 0x3, 6 }, { 0x9D, 8 }, - { 0x17, 6 }, { 0x4D, 7 }, { 0x31, 6 }, { 0x70, 7 }, - { 0x7, 5 }, { 0x3A, 6 }, { 0x7, 4 }, { 0x2, 4 }, - { 0xB, 4 }, { 0x1, 4 }, { 0xF, 4 }, { 0x8, 4 }, - { 0xD, 4 }, { 0x4, 4 }, { 0xA, 4 }, { 0xD, 5 }, - { 0x19, 5 }, { 0x2, 6 }, { 0x3B, 6 }, { 0x4A, 7 }, - { 0x15, 6 }, { 0xC2, 8 }, { 0x18, 6 }, { 0x32, 7 }, - { 0x72, 7 }, { 0x1C6, 9 }, { 0x29, 7 }, { 0x1C5, 9 }, - { 0x49, 7 }, { 0x121, 9 }, { 0x1B, 7 }, { 0x30, 8 }, - { 0x1A, 7 }, { 0x1C4, 9 }, { 0x9F, 8 }, { 0xB6, 9 }, - { 0x19, 7 }, { 0x120, 9 }, { 0x73, 7 } + { 10, 7 }, { 15, 7 }, { 0, 6 }, { 41, 6 }, { 22, 6 }, + { 33, 4 }, { 31, 4 }, { 55, 8 }, { 19, 8 }, { 60, 7 }, + { 56, 7 }, { 54, 7 }, { 28, 5 }, { 37, 4 }, { 16, 7 }, + { 50, 7 }, { 44, 6 }, { 14, 7 }, { 7, 9 }, { 3, 9 }, + { 59, 9 }, { 13, 9 }, { 24, 6 }, { 46, 6 }, { 47, 7 }, + { 4, 8 }, { 2, 8 }, { 39, 5 }, { 30, 4 }, { 35, 4 }, + { 61, 9 }, { 53, 9 }, { 21, 8 }, { 52, 7 }, { 43, 7 }, + { 18, 7 }, { 9, 9 }, { 11, 9 }, { 6, 8 }, { 25, 7 }, + { 17, 9 }, { 5, 9 }, { 23, 8 }, { 12, 8 }, { 58, 8 }, + { 38, 4 }, { 32, 4 }, { 20, 7 }, { 45, 8 }, { 8, 8 }, + { 26, 6 }, { 40, 5 }, { 36, 4 }, { 27, 7 }, { 57, 9 }, + { 51, 9 }, { 49, 9 }, { 1, 9 }, { 48, 7 }, { 62, 7 }, + { 29, 6 }, { 42, 6 }, { 34, 4 }, }, { - { 0x23, 6 }, { 0x1C8, 9 }, { 0x43, 8 }, { 0x110, 9 }, - { 0xC, 7 }, { 0x153, 9 }, { 0x22, 7 }, { 0x111, 9 }, - { 0xF, 7 }, { 0x42, 8 }, { 0x23, 7 }, { 0x1C9, 9 }, - { 0x2A, 7 }, { 0x1B, 8 }, { 0x73, 7 }, { 0x45, 7 }, - { 0x6E, 7 }, { 0x89, 8 }, { 0x6C, 7 }, { 0x1A, 8 }, - { 0x6F, 7 }, { 0xB6, 8 }, { 0xB, 6 }, { 0xE5, 8 }, - { 0x25, 6 }, { 0x20, 7 }, { 0x29, 6 }, { 0x4D, 7 }, - { 0x2, 5 }, { 0x14, 6 }, { 0x1A, 5 }, { 0x17, 5 }, - { 0x1E, 5 }, { 0x27, 6 }, { 0x18, 5 }, { 0x28, 6 }, - { 0x1F, 5 }, { 0x0, 5 }, { 0x6, 4 }, { 0x10, 5 }, - { 0x7, 4 }, { 0xB, 5 }, { 0x3, 4 }, { 0x4, 5 }, - { 0x1D, 5 }, { 0x2C, 6 }, { 0x19, 5 }, { 0x2B, 6 }, - { 0x9, 5 }, { 0x55, 7 }, { 0x38, 6 }, { 0xE, 7 }, - { 0x24, 6 }, { 0xA8, 8 }, { 0xA, 6 }, { 0x99, 8 }, - { 0x5A, 7 }, { 0x98, 8 }, { 0x6D, 7 }, { 0x152, 9 }, - { 0x2B, 7 }, { 0xB7, 8 }, { 0x1, 5 } + { 37, 5 }, { 62, 5 }, { 28, 5 }, { 4, 7 }, { 19, 8 }, + { 13, 8 }, { 51, 7 }, { 8, 7 }, { 43, 5 }, { 54, 6 }, + { 22, 6 }, { 42, 4 }, { 25, 7 }, { 9, 8 }, { 2, 8 }, + { 6, 7 }, { 10, 7 }, { 48, 5 }, { 29, 6 }, { 12, 7 }, + { 60, 7 }, { 41, 5 }, { 38, 4 }, { 40, 4 }, { 39, 5 }, + { 3, 9 }, { 7, 9 }, { 17, 8 }, { 15, 7 }, { 0, 6 }, + { 52, 6 }, { 24, 6 }, { 57, 8 }, { 55, 8 }, { 27, 7 }, + { 33, 6 }, { 35, 6 }, { 26, 6 }, { 53, 8 }, { 59, 9 }, + { 5, 9 }, { 49, 7 }, { 47, 6 }, { 45, 6 }, { 56, 7 }, + { 21, 8 }, { 61, 8 }, { 31, 5 }, { 34, 5 }, { 46, 5 }, + { 30, 5 }, { 18, 7 }, { 58, 7 }, { 16, 7 }, { 20, 7 }, + { 50, 6 }, { 1, 9 }, { 11, 9 }, { 23, 8 }, { 14, 7 }, + { 44, 5 }, { 32, 5 }, { 36, 5 }, }, { - { 0x3D, 6 }, { 0xB1, 8 }, { 0xDD, 8 }, { 0x1F6, 9 }, - { 0xC5, 8 }, { 0x188, 9 }, { 0x37, 7 }, { 0x3F, 8 }, - { 0x1E, 7 }, { 0x189, 9 }, { 0xF, 7 }, { 0x3E, 8 }, - { 0x6A, 7 }, { 0x1F7, 9 }, { 0x61, 7 }, { 0x79, 7 }, - { 0x18, 6 }, { 0xB0, 8 }, { 0xE, 6 }, { 0xB3, 8 }, - { 0xC, 6 }, { 0xDF, 8 }, { 0x6, 6 }, { 0xDC, 8 }, - { 0x19, 6 }, { 0xDE, 8 }, { 0x27, 6 }, { 0xE, 7 }, - { 0x1A, 6 }, { 0x63, 7 }, { 0xF, 5 }, { 0xE, 5 }, - { 0x14, 5 }, { 0x7C, 7 }, { 0x36, 6 }, { 0x6B, 7 }, - { 0x3F, 6 }, { 0x60, 7 }, { 0x8, 5 }, { 0x74, 7 }, - { 0x9, 5 }, { 0x78, 7 }, { 0x12, 5 }, { 0xD, 6 }, - { 0x15, 5 }, { 0x2D, 6 }, { 0x2, 4 }, { 0x1C, 5 }, - { 0x5, 4 }, { 0x3B, 6 }, { 0x0, 4 }, { 0x34, 6 }, - { 0x19, 5 }, { 0x26, 6 }, { 0x10, 5 }, { 0x75, 7 }, - { 0x2, 5 }, { 0x36, 7 }, { 0x23, 6 }, { 0xB2, 8 }, - { 0x22, 6 }, { 0xFA, 8 }, { 0x17, 5 } + { 50, 4 }, { 56, 5 }, { 22, 6 }, { 27, 7 }, { 10, 7 }, + { 46, 4 }, { 20, 6 }, { 43, 6 }, { 18, 6 }, { 8, 7 }, + { 11, 8 }, { 7, 8 }, { 38, 5 }, { 40, 5 }, { 48, 4 }, + { 16, 6 }, { 24, 6 }, { 28, 6 }, { 57, 7 }, { 6, 7 }, + { 31, 5 }, { 30, 5 }, { 54, 5 }, { 60, 6 }, { 58, 6 }, + { 42, 5 }, { 53, 6 }, { 26, 6 }, { 32, 5 }, { 44, 5 }, + { 17, 8 }, { 1, 8 }, { 59, 8 }, { 19, 8 }, { 45, 6 }, + { 62, 5 }, { 37, 7 }, { 14, 7 }, { 5, 9 }, { 9, 9 }, + { 4, 8 }, { 29, 7 }, { 52, 5 }, { 51, 6 }, { 12, 7 }, + { 35, 7 }, { 34, 6 }, { 23, 8 }, { 2, 8 }, { 25, 8 }, + { 21, 8 }, { 47, 5 }, { 39, 7 }, { 55, 7 }, { 49, 6 }, + { 41, 7 }, { 15, 7 }, { 0, 6 }, { 33, 7 }, { 61, 8 }, + { 3, 9 }, { 13, 9 }, { 36, 6 }, }, { - { 0x15, 5 }, { 0xDD, 8 }, { 0x3E, 7 }, { 0x16E, 9 }, - { 0x4C, 7 }, { 0x12, 8 }, { 0x5D, 7 }, { 0xB6, 8 }, - { 0x6F, 7 }, { 0x1F1, 9 }, { 0x69, 7 }, { 0x1F0, 9 }, - { 0x1D, 7 }, { 0x16F, 9 }, { 0x2, 6 }, { 0x6B, 7 }, - { 0xC, 6 }, { 0xDC, 8 }, { 0x68, 7 }, { 0x9B, 8 }, - { 0x7D, 7 }, { 0x9A, 8 }, { 0xD, 6 }, { 0x13, 8 }, - { 0x8, 6 }, { 0xF9, 8 }, { 0x2C, 6 }, { 0x12, 7 }, - { 0x33, 6 }, { 0x4F, 7 }, { 0xD, 5 }, { 0x5, 5 }, - { 0x12, 5 }, { 0x3F, 7 }, { 0x32, 6 }, { 0x13, 7 }, - { 0x3B, 6 }, { 0x5, 6 }, { 0x2F, 6 }, { 0x5A, 7 }, - { 0x3F, 6 }, { 0x1C, 7 }, { 0x3A, 6 }, { 0x8, 7 }, - { 0x36, 6 }, { 0x5C, 7 }, { 0x10, 5 }, { 0x0, 5 }, - { 0xC, 5 }, { 0x4E, 7 }, { 0x3, 5 }, { 0x6A, 7 }, - { 0xE, 5 }, { 0x3, 6 }, { 0x14, 5 }, { 0x1E, 6 }, - { 0x1C, 5 }, { 0xF, 6 }, { 0x18, 5 }, { 0x23, 6 }, - { 0x1E, 5 }, { 0x22, 6 }, { 0x2, 3 } - } + { 47, 5 }, { 14, 6 }, { 53, 6 }, { 43, 7 }, { 5, 8 }, + { 23, 8 }, { 37, 6 }, { 50, 5 }, { 24, 6 }, { 27, 7 }, + { 35, 7 }, { 31, 5 }, { 16, 6 }, { 22, 6 }, { 41, 7 }, + { 12, 7 }, { 57, 6 }, { 62, 3 }, { 48, 5 }, { 30, 5 }, + { 52, 5 }, { 55, 6 }, { 2, 7 }, { 33, 7 }, { 46, 5 }, + { 61, 6 }, { 59, 6 }, { 32, 5 }, { 4, 7 }, { 21, 8 }, + { 19, 8 }, { 49, 7 }, { 29, 7 }, { 54, 5 }, { 0, 5 }, + { 26, 6 }, { 39, 7 }, { 7, 8 }, { 3, 9 }, { 13, 9 }, + { 45, 7 }, { 6, 7 }, { 38, 6 }, { 58, 5 }, { 34, 6 }, + { 28, 6 }, { 18, 7 }, { 10, 7 }, { 51, 7 }, { 15, 7 }, + { 44, 6 }, { 17, 8 }, { 1, 8 }, { 8, 7 }, { 56, 5 }, + { 42, 6 }, { 36, 6 }, { 60, 5 }, { 11, 9 }, { 9, 9 }, + { 25, 8 }, { 20, 7 }, { 40, 6 }, + }, }, { /* y-axis tables */ { - { 0x52, 7 }, { 0x14C, 9 }, { 0x1FA, 9 }, { 0x124, 9 }, - { 0x82, 8 }, { 0x29E, 10 }, { 0x8E, 8 }, { 0x24B, 10 }, - { 0x9C, 8 }, { 0x3F7, 10 }, { 0x86, 8 }, { 0x114, 9 }, - { 0x83, 8 }, { 0x3A5, 10 }, { 0xFA, 8 }, { 0x4F, 7 }, - { 0xFB, 8 }, { 0x13B, 9 }, { 0xFC, 8 }, { 0x172, 9 }, - { 0x44, 7 }, { 0x173, 9 }, { 0x51, 7 }, { 0x87, 8 }, - { 0x5F, 7 }, { 0xBA, 8 }, { 0x26, 6 }, { 0x5E, 7 }, - { 0x16, 5 }, { 0x15, 5 }, { 0x6, 3 }, { 0x1, 2 }, - { 0x0, 2 }, { 0x1C, 5 }, { 0x1E, 5 }, { 0x75, 7 }, - { 0x3B, 6 }, { 0xFF, 8 }, { 0x25, 6 }, { 0xBB, 8 }, - { 0x7C, 7 }, { 0x8B, 8 }, { 0x48, 7 }, { 0x171, 9 }, - { 0x42, 7 }, { 0x14E, 9 }, { 0x46, 7 }, { 0xFE, 8 }, - { 0x40, 7 }, { 0x13A, 9 }, { 0x93, 8 }, { 0x115, 9 }, - { 0x8F, 8 }, { 0x3F6, 10 }, { 0x170, 9 }, { 0x29F, 10 }, - { 0x1D1, 9 }, { 0x24A, 10 }, { 0x1D3, 9 }, { 0x3A4, 10 }, - { 0x1D0, 9 }, { 0x14D, 9 }, { 0x50, 7 } + { 32, 2 }, { 31, 2 }, { 48, 7 }, { 4, 8 }, { 12, 8 }, + { 44, 7 }, { 10, 8 }, { 23, 8 }, { 20, 7 }, { 11, 9 }, + { 51, 9 }, { 41, 8 }, { 46, 7 }, { 6, 8 }, { 52, 8 }, + { 42, 7 }, { 3, 9 }, { 57, 10 }, { 7, 10 }, { 50, 8 }, + { 38, 6 }, { 26, 6 }, { 8, 8 }, { 49, 9 }, { 17, 9 }, + { 15, 7 }, { 62, 7 }, { 22, 7 }, { 0, 7 }, { 1, 9 }, + { 61, 9 }, { 45, 9 }, { 5, 10 }, { 55, 10 }, { 29, 5 }, + { 28, 5 }, { 54, 9 }, { 43, 9 }, { 19, 9 }, { 21, 9 }, + { 25, 8 }, { 39, 8 }, { 27, 7 }, { 24, 7 }, { 30, 3 }, + { 33, 5 }, { 60, 9 }, { 56, 9 }, { 59, 10 }, { 13, 10 }, + { 58, 9 }, { 35, 7 }, { 36, 6 }, { 34, 5 }, { 40, 7 }, + { 14, 8 }, { 16, 8 }, { 18, 8 }, { 2, 9 }, { 53, 10 }, + { 9, 10 }, { 47, 8 }, { 37, 8 }, }, { - { 0xDE, 8 }, { 0x223, 10 }, { 0x136, 9 }, { 0x7C5, 11 }, - { 0x12F, 9 }, { 0x4A1, 11 }, { 0x3D7, 10 }, { 0x7AC, 11 }, - { 0x133, 9 }, { 0x7C4, 11 }, { 0x1B8, 9 }, { 0x222, 10 }, - { 0x96, 8 }, { 0x251, 10 }, { 0x95, 8 }, { 0x1F0, 9 }, - { 0xDA, 8 }, { 0x110, 9 }, { 0x9A, 8 }, { 0x360, 10 }, - { 0xDD, 8 }, { 0x12E, 9 }, { 0x48, 7 }, { 0x92, 8 }, - { 0x78, 7 }, { 0x98, 8 }, { 0x27, 6 }, { 0x45, 7 }, - { 0x1A, 5 }, { 0x10, 5 }, { 0x5, 3 }, { 0x0, 2 }, - { 0x1, 2 }, { 0xE, 4 }, { 0xC, 4 }, { 0x23, 6 }, - { 0x3F, 6 }, { 0xF4, 8 }, { 0x7D, 7 }, { 0x89, 8 }, - { 0x7B, 7 }, { 0x1BE, 9 }, { 0xF9, 8 }, { 0x3E3, 10 }, - { 0xF3, 8 }, { 0x127, 9 }, { 0xDB, 8 }, { 0x1EA, 9 }, - { 0xD9, 8 }, { 0x6E7, 11 }, { 0x1BF, 9 }, { 0x4A0, 11 }, - { 0x1B1, 9 }, { 0x6E6, 11 }, { 0x137, 9 }, { 0x7AD, 11 }, - { 0x126, 9 }, { 0x6C2, 11 }, { 0x132, 9 }, { 0x6C3, 11 }, - { 0x129, 9 }, { 0x372, 10 }, { 0xF2, 8 } + { 31, 2 }, { 32, 2 }, { 29, 5 }, { 17, 9 }, { 11, 10 }, + { 1, 10 }, { 39, 8 }, { 27, 7 }, { 35, 6 }, { 22, 7 }, + { 23, 8 }, { 56, 9 }, { 45, 9 }, { 51, 11 }, { 5, 11 }, + { 13, 10 }, { 60, 9 }, { 14, 8 }, { 12, 8 }, { 21, 9 }, + { 4, 9 }, { 25, 8 }, { 58, 9 }, { 8, 9 }, { 18, 8 }, + { 2, 9 }, { 54, 9 }, { 26, 6 }, { 30, 3 }, { 34, 4 }, + { 28, 5 }, { 19, 10 }, { 57, 11 }, { 59, 11 }, { 52, 9 }, + { 48, 8 }, { 16, 8 }, { 46, 8 }, { 10, 9 }, { 61, 10 }, + { 53, 11 }, { 49, 11 }, { 20, 8 }, { 0, 8 }, { 41, 9 }, + { 50, 9 }, { 33, 4 }, { 24, 7 }, { 62, 8 }, { 44, 8 }, + { 37, 8 }, { 47, 9 }, { 7, 11 }, { 55, 11 }, { 6, 10 }, + { 40, 7 }, { 15, 9 }, { 9, 11 }, { 3, 11 }, { 43, 10 }, + { 42, 8 }, { 38, 7 }, { 36, 6 }, }, { - { 0x16, 7 }, { 0x9C, 9 }, { 0x13C, 9 }, { 0x9E, 10 }, - { 0x12B, 9 }, { 0xBA, 10 }, { 0x181, 9 }, { 0x317, 10 }, - { 0x84, 8 }, { 0x4E, 9 }, { 0x26, 8 }, { 0x316, 10 }, - { 0x180, 9 }, { 0x5C, 9 }, { 0xC1, 8 }, { 0x2F, 8 }, - { 0x10, 7 }, { 0x45, 9 }, { 0x12, 7 }, { 0x189, 9 }, - { 0x24, 7 }, { 0x13D, 9 }, { 0x66, 7 }, { 0x23, 8 }, - { 0x67, 7 }, { 0xC6, 8 }, { 0x24, 6 }, { 0x4B, 7 }, - { 0x11, 5 }, { 0x32, 6 }, { 0xD, 4 }, { 0x0, 3 }, - { 0x7, 3 }, { 0x5, 3 }, { 0x3, 3 }, { 0x3, 4 }, - { 0x5, 4 }, { 0x20, 6 }, { 0x8, 5 }, { 0x25, 7 }, - { 0x26, 6 }, { 0x4F, 8 }, { 0x61, 7 }, { 0x2B, 8 }, - { 0x4E, 7 }, { 0x18A, 9 }, { 0x43, 7 }, { 0x9F, 8 }, - { 0x14, 7 }, { 0x254, 10 }, { 0x94, 8 }, { 0x310, 10 }, - { 0x85, 8 }, { 0x311, 10 }, { 0x2A, 8 }, { 0xBB, 10 }, - { 0x18F, 9 }, { 0x255, 10 }, { 0x9D, 9 }, { 0x9F, 10 }, - { 0x18E, 9 }, { 0x44, 9 }, { 0x26, 7 } + { 31, 3 }, { 16, 7 }, { 61, 9 }, { 17, 9 }, { 23, 8 }, + { 18, 7 }, { 10, 8 }, { 9, 9 }, { 3, 10 }, { 59, 10 }, + { 48, 7 }, { 54, 8 }, { 43, 8 }, { 0, 7 }, { 13, 9 }, + { 5, 10 }, { 55, 10 }, { 15, 8 }, { 35, 4 }, { 38, 5 }, + { 20, 7 }, { 39, 7 }, { 62, 7 }, { 1, 9 }, { 58, 9 }, + { 41, 8 }, { 36, 4 }, { 34, 3 }, { 37, 6 }, { 8, 8 }, + { 52, 8 }, { 46, 7 }, { 28, 5 }, { 26, 6 }, { 50, 8 }, + { 49, 10 }, { 57, 10 }, { 4, 9 }, { 27, 7 }, { 40, 6 }, + { 44, 7 }, { 2, 9 }, { 21, 9 }, { 47, 8 }, { 33, 3 }, + { 12, 9 }, { 6, 9 }, { 14, 8 }, { 42, 7 }, { 51, 10 }, + { 53, 10 }, { 19, 9 }, { 45, 9 }, { 11, 10 }, { 7, 10 }, + { 25, 8 }, { 60, 9 }, { 56, 9 }, { 29, 6 }, { 22, 7 }, + { 24, 7 }, { 30, 4 }, { 32, 3 }, }, { - { 0x61, 7 }, { 0x12A, 9 }, { 0xD, 8 }, { 0x3BD, 10 }, - { 0x89, 8 }, { 0x109, 9 }, { 0x18E, 9 }, { 0x210, 10 }, - { 0x1D3, 9 }, { 0x211, 10 }, { 0x88, 8 }, { 0x19, 9 }, - { 0x85, 8 }, { 0x18, 9 }, { 0xE8, 8 }, { 0xCE, 8 }, - { 0x40, 7 }, { 0x119, 9 }, { 0x45, 7 }, { 0x1D2, 9 }, - { 0x4B, 7 }, { 0x1DD, 9 }, { 0x62, 7 }, { 0x94, 8 }, - { 0x75, 7 }, { 0xC, 7 }, { 0x27, 6 }, { 0xD, 7 }, - { 0x2, 5 }, { 0x26, 6 }, { 0x6, 4 }, { 0x1E, 5 }, - { 0xD, 4 }, { 0x1F, 5 }, { 0x1, 3 }, { 0xA, 4 }, - { 0x2, 3 }, { 0x7, 4 }, { 0xB, 4 }, { 0x0, 5 }, - { 0x1C, 5 }, { 0x76, 7 }, { 0x32, 6 }, { 0x7, 7 }, - { 0x24, 6 }, { 0xC0, 8 }, { 0x7, 6 }, { 0x41, 7 }, - { 0x2, 6 }, { 0x18F, 9 }, { 0x47, 7 }, { 0x1DC, 9 }, - { 0x43, 7 }, { 0x12B, 9 }, { 0xCF, 8 }, { 0x118, 9 }, - { 0xC6, 8 }, { 0x3BC, 10 }, { 0x8D, 8 }, { 0x3BF, 10 }, - { 0xC1, 8 }, { 0x3BE, 10 }, { 0x66, 7 } + { 39, 5 }, { 48, 6 }, { 13, 9 }, { 11, 9 }, { 2, 8 }, + { 43, 7 }, { 28, 5 }, { 25, 7 }, { 27, 7 }, { 46, 6 }, + { 34, 3 }, { 36, 3 }, { 30, 4 }, { 37, 4 }, { 16, 7 }, + { 47, 7 }, { 7, 10 }, { 9, 10 }, { 5, 9 }, { 12, 8 }, + { 52, 7 }, { 10, 8 }, { 4, 8 }, { 18, 7 }, { 55, 9 }, + { 17, 9 }, { 58, 8 }, { 50, 7 }, { 44, 6 }, { 23, 8 }, + { 1, 9 }, { 53, 9 }, { 20, 7 }, { 29, 6 }, { 26, 6 }, + { 35, 4 }, { 38, 4 }, { 45, 8 }, { 60, 8 }, { 0, 7 }, + { 22, 7 }, { 56, 8 }, { 6, 9 }, { 49, 9 }, { 42, 6 }, + { 62, 7 }, { 15, 8 }, { 54, 8 }, { 32, 4 }, { 40, 5 }, + { 14, 8 }, { 19, 9 }, { 8, 9 }, { 24, 7 }, { 41, 7 }, + { 51, 9 }, { 21, 9 }, { 57, 10 }, { 3, 10 }, { 61, 10 }, + { 59, 10 }, { 31, 5 }, { 33, 5 }, }, { - { 0x7, 6 }, { 0x14D, 9 }, { 0xA0, 8 }, { 0x9E, 9 }, - { 0xCF, 8 }, { 0x39C, 10 }, { 0xA1, 8 }, { 0x39D, 10 }, - { 0xAB, 8 }, { 0x1C5, 9 }, { 0x26, 7 }, { 0x14C, 9 }, - { 0x25, 7 }, { 0x19C, 9 }, { 0x3F, 7 }, { 0xE1, 8 }, - { 0x66, 7 }, { 0x1CF, 9 }, { 0x3E, 7 }, { 0x1C4, 9 }, - { 0x72, 7 }, { 0x4E, 8 }, { 0x6, 6 }, { 0xAA, 8 }, - { 0x1C, 6 }, { 0xE6, 8 }, { 0x32, 6 }, { 0x51, 7 }, - { 0x3B, 6 }, { 0x5, 6 }, { 0x1F, 5 }, { 0x18, 5 }, - { 0x2, 4 }, { 0x3A, 6 }, { 0x0, 4 }, { 0x36, 6 }, - { 0x5, 4 }, { 0x8, 5 }, { 0x8, 4 }, { 0x16, 5 }, - { 0x9, 4 }, { 0xD, 5 }, { 0x3, 4 }, { 0x2F, 6 }, - { 0x1E, 5 }, { 0x2E, 6 }, { 0x1A, 5 }, { 0x2B, 6 }, - { 0xC, 5 }, { 0x24, 7 }, { 0x1E, 6 }, { 0xE0, 8 }, - { 0x4, 6 }, { 0xA7, 8 }, { 0x54, 7 }, { 0x1C7, 9 }, - { 0x52, 7 }, { 0x19D, 9 }, { 0x3A, 7 }, { 0x9F, 9 }, - { 0x3B, 7 }, { 0x1C6, 9 }, { 0x37, 6 } + { 34, 4 }, { 52, 6 }, { 29, 6 }, { 22, 6 }, { 0, 6 }, + { 32, 4 }, { 42, 4 }, { 37, 5 }, { 49, 7 }, { 12, 7 }, + { 10, 7 }, { 21, 8 }, { 3, 9 }, { 59, 9 }, { 36, 4 }, + { 48, 5 }, { 41, 5 }, { 24, 6 }, { 58, 7 }, { 60, 7 }, + { 50, 6 }, { 18, 7 }, { 14, 7 }, { 38, 4 }, { 40, 4 }, + { 2, 8 }, { 6, 8 }, { 27, 7 }, { 56, 7 }, { 11, 9 }, + { 1, 9 }, { 53, 8 }, { 54, 7 }, { 23, 8 }, { 8, 8 }, + { 47, 6 }, { 39, 5 }, { 45, 6 }, { 43, 6 }, { 31, 5 }, + { 26, 6 }, { 16, 7 }, { 13, 9 }, { 57, 9 }, { 4, 8 }, + { 46, 5 }, { 35, 6 }, { 62, 6 }, { 51, 8 }, { 15, 8 }, + { 19, 9 }, { 9, 9 }, { 61, 9 }, { 55, 9 }, { 20, 7 }, + { 25, 8 }, { 5, 10 }, { 7, 10 }, { 17, 9 }, { 33, 6 }, + { 28, 6 }, { 44, 5 }, { 30, 5 }, }, { - { 0x2A, 6 }, { 0x39, 8 }, { 0x25, 7 }, { 0x115, 9 }, - { 0x24, 7 }, { 0x1FA, 9 }, { 0x2F, 7 }, { 0x114, 9 }, - { 0x75, 7 }, { 0x38, 8 }, { 0xFC, 8 }, { 0x36, 8 }, - { 0x1E, 7 }, { 0x1FB, 9 }, { 0x7F, 7 }, { 0x68, 7 }, - { 0x16, 6 }, { 0x37, 8 }, { 0x1F, 7 }, { 0x5C, 8 }, - { 0x13, 6 }, { 0x8B, 8 }, { 0x1, 6 }, { 0xFB, 8 }, - { 0x21, 6 }, { 0x44, 7 }, { 0x2B, 6 }, { 0x6B, 7 }, - { 0x3B, 6 }, { 0xC, 6 }, { 0x1C, 5 }, { 0x19, 5 }, - { 0x1, 4 }, { 0x20, 6 }, { 0x16, 5 }, { 0x7C, 7 }, - { 0xC, 5 }, { 0x74, 7 }, { 0xA, 5 }, { 0x1C, 6 }, - { 0x12, 5 }, { 0x69, 7 }, { 0xF, 5 }, { 0x6A, 7 }, - { 0x14, 5 }, { 0x11, 6 }, { 0x1E, 5 }, { 0x17, 5 }, - { 0x2, 4 }, { 0x31, 6 }, { 0x1B, 5 }, { 0x30, 6 }, - { 0xD, 5 }, { 0x0, 6 }, { 0x1, 5 }, { 0x1D, 7 }, - { 0x23, 6 }, { 0x1A, 7 }, { 0x1D, 6 }, { 0x5D, 8 }, - { 0x10, 6 }, { 0xFA, 8 }, { 0x13, 5 } + { 53, 6 }, { 22, 6 }, { 54, 5 }, { 32, 4 }, { 48, 4 }, + { 29, 6 }, { 57, 7 }, { 11, 8 }, { 17, 8 }, { 9, 8 }, + { 1, 8 }, { 55, 7 }, { 12, 7 }, { 18, 7 }, { 60, 6 }, + { 45, 6 }, { 4, 7 }, { 2, 7 }, { 20, 6 }, { 38, 5 }, + { 16, 6 }, { 19, 8 }, { 59, 8 }, { 6, 7 }, { 36, 5 }, + { 52, 5 }, { 39, 6 }, { 58, 6 }, { 42, 5 }, { 33, 6 }, + { 24, 6 }, { 25, 7 }, { 7, 9 }, { 3, 9 }, { 21, 8 }, + { 56, 6 }, { 40, 5 }, { 62, 5 }, { 44, 5 }, { 0, 6 }, + { 26, 6 }, { 34, 5 }, { 47, 5 }, { 51, 6 }, { 49, 6 }, + { 31, 5 }, { 15, 7 }, { 41, 7 }, { 43, 7 }, { 27, 7 }, + { 50, 5 }, { 30, 5 }, { 37, 7 }, { 8, 7 }, { 28, 6 }, + { 46, 5 }, { 35, 7 }, { 61, 8 }, { 23, 8 }, { 10, 8 }, + { 5, 9 }, { 13, 9 }, { 14, 7 }, }, { - { 0x12, 5 }, { 0x26, 7 }, { 0x41, 7 }, { 0x22, 8 }, - { 0x1A, 7 }, { 0xA9, 8 }, { 0x4C, 7 }, { 0x1B2, 9 }, - { 0x5C, 7 }, { 0xA8, 8 }, { 0x58, 7 }, { 0x1B3, 9 }, - { 0x40, 7 }, { 0x79, 8 }, { 0xC, 6 }, { 0x55, 7 }, - { 0x1F, 6 }, { 0xD8, 8 }, { 0x76, 7 }, { 0x23, 8 }, - { 0x5F, 7 }, { 0x78, 8 }, { 0xB, 6 }, { 0x1B, 7 }, - { 0x2D, 6 }, { 0x10, 7 }, { 0x37, 6 }, { 0x6D, 7 }, - { 0x32, 6 }, { 0xA, 6 }, { 0x1A, 5 }, { 0x1E, 5 }, - { 0x1F, 5 }, { 0x2B, 6 }, { 0xD, 5 }, { 0x77, 7 }, - { 0x31, 6 }, { 0x5D, 7 }, { 0x38, 6 }, { 0x27, 7 }, - { 0xC, 5 }, { 0xE9, 8 }, { 0x33, 6 }, { 0x5E, 7 }, - { 0x30, 6 }, { 0x4D, 7 }, { 0xA, 5 }, { 0x21, 6 }, - { 0x7, 5 }, { 0x3D, 7 }, { 0x39, 6 }, { 0xE8, 8 }, - { 0xB, 5 }, { 0x59, 7 }, { 0x14, 5 }, { 0x27, 6 }, - { 0x11, 5 }, { 0x75, 7 }, { 0xE, 5 }, { 0x9, 6 }, - { 0x8, 5 }, { 0x12, 6 }, { 0x0, 3 } - } + { 62, 3 }, { 25, 7 }, { 3, 8 }, { 19, 8 }, { 59, 6 }, + { 29, 6 }, { 22, 6 }, { 14, 6 }, { 4, 7 }, { 23, 7 }, + { 48, 5 }, { 60, 5 }, { 61, 6 }, { 1, 7 }, { 39, 7 }, + { 46, 5 }, { 52, 5 }, { 40, 5 }, { 34, 5 }, { 58, 5 }, + { 21, 8 }, { 13, 8 }, { 49, 7 }, { 16, 6 }, { 12, 7 }, + { 2, 7 }, { 47, 6 }, { 56, 5 }, { 0, 5 }, { 6, 7 }, + { 45, 7 }, { 55, 6 }, { 54, 5 }, { 9, 8 }, { 5, 8 }, + { 15, 7 }, { 33, 6 }, { 10, 7 }, { 53, 7 }, { 24, 6 }, + { 8, 7 }, { 37, 7 }, { 43, 7 }, { 20, 7 }, { 44, 6 }, + { 36, 6 }, { 28, 6 }, { 42, 6 }, { 30, 5 }, { 17, 8 }, + { 7, 9 }, { 11, 9 }, { 27, 7 }, { 26, 6 }, { 38, 6 }, + { 50, 6 }, { 51, 8 }, { 41, 8 }, { 57, 7 }, { 18, 7 }, + { 35, 7 }, { 31, 5 }, { 32, 5 }, + }, } }; From patchwork Fri Nov 20 07:32:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23874 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 6ECAC449167 for ; Fri, 20 Nov 2020 09:48:43 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6B0B268BCE0; Fri, 20 Nov 2020 09:34:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2235B68BCE6 for ; Fri, 20 Nov 2020 09:34:30 +0200 (EET) Received: by mail-ej1-f48.google.com with SMTP id gj5so11526988ejb.8 for ; Thu, 19 Nov 2020 23:34:30 -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=nxwtQagve6aCW0xkB9W//+qYcY/ITsEQdP+aK8tuhGQ=; b=U2RlhHb5xovLa1Rm+4Al8nOe6wVMsviThydldEel8C5wxaI8Zd4wek1IhkheRsCfRF p3eBZqJJihyfn0+qFjk3apPtDghBV702r9uvvPm8vTh7WQNgxQ1Z5bS63Jw3ja5/UZS+ rj4/RpjHYVJlyhSsdfhAE0ofKc+Ndpgqa/KGwIdsDfUwwV8Z6oe/PLYzpQ5uVLtwb/56 GYmoVvXIla6q5i1CqZGMr3qvLBgTYn2uhL5hu5bWpQ/EKk2VO7pxZNfYRF3TJaLWGmPL fbTLe8EJMhq70icVnCm9YsI06qNmAOgMrvhYiODJnhEVgX9F2nOoTgNKZwW+8xiKkIJc YkTg== 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=nxwtQagve6aCW0xkB9W//+qYcY/ITsEQdP+aK8tuhGQ=; b=HVI9SldvMXrEqw7QLtJSWtbFcnCx+y8W+96tIk/ouToc8n2onQWt9RmbaG3HqhzmzP 5fgpRidYSf9PP940vCfAoCV9K3RhWTnNXToVwgmRcEANiYrazSWHWuysDNbdb+anc1XK ewyRnfD7Nvqb+YOPsc8+rxtpdPwZVCG4mJhkYMVsPst5GBJlGCl6NkSqB8hb4nATcD1s T9bEI/7IeYAt0stjMGxMqC+raxDvVS7HJegyj+1KbtBaYlbXvXVjfyvOYdB1fmrqq/WP Nc8LQ+/q6lJAg6/ZdVMjM0aYJtpoEhMRIevHD8us9L4fhxS0wFtZ0PlpkrdjxtVfwoSW X+Xw== X-Gm-Message-State: AOAM532A1+kbRj1dgqtFGSZHZbw/eAn1aV7UYdihb9wxvh13AkPmtuZZ UdmBb18IAUD48SFcLiFbOV42RgsvhRItOw== X-Google-Smtp-Source: ABdhPJyfAF9kZhE3R+AXtF6Xdb3qMW+YSjwNSX/fhF0vt9qGD34ClZpqWtccO4EGg6jc9rY1KD+R4Q== X-Received: by 2002:a17:906:7f95:: with SMTP id f21mr30695813ejr.340.1605857666660; Thu, 19 Nov 2020 23:34:26 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:25 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:48 +0100 Message-Id: <20201120073327.820745-24-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 123/162] avcodec/vp3: Make tables used to initialize VLCs 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" This is possible by switching to ff_init_vlc_from_lengths() because it allows to replace codes of type uint16_t by symbols of type uint8_t; in some cases (like here) it also allows to replace explicitly coded codes by implicitly coded symbols. Signed-off-by: Andreas Rheinhardt --- libavcodec/vp3.c | 30 +- libavcodec/vp3data.h | 3077 +++++++----------------------------------- libavcodec/vp4data.h | 1124 +++++++-------- 3 files changed, 987 insertions(+), 3244 deletions(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 34c48f8725..7d1d2411ab 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2434,17 +2434,21 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) /* init VLC tables */ if (s->version < 2) { for (i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { - if ((ret = init_vlc(&s->coeff_vlc[i], 11, 32, - &vp3_bias[i][0][1], 4, 2, - &vp3_bias[i][0][0], 4, 2, 0)) < 0) + ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i], 11, 32, + &vp3_bias[i][0][1], 2, + &vp3_bias[i][0][0], 2, 1, + 0, 0, avctx); + if (ret < 0) return ret; } #if CONFIG_VP4_DECODER } else { /* version >= 2 */ for (i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { - if ((ret = init_vlc(&s->coeff_vlc[i], 11, 32, - &vp4_bias[i][0][1], 4, 2, - &vp4_bias[i][0][0], 4, 2, 0)) < 0) + ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i], 11, 32, + &vp4_bias[i][0][1], 2, + &vp4_bias[i][0][0], 2, 1, + 0, 0, avctx); + if (ret < 0) return ret; } #endif @@ -2463,14 +2467,16 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) if (ret < 0) return ret; - if ((ret = init_vlc(&s->fragment_run_length_vlc, 5, 30, - &fragment_run_length_vlc_table[0][1], 4, 2, - &fragment_run_length_vlc_table[0][0], 4, 2, 0)) < 0) + ret = ff_init_vlc_from_lengths(&s->fragment_run_length_vlc, 5, 30, + fragment_run_length_vlc_len, 1, + NULL, 0, 0, 0, 0, avctx); + if (ret < 0) return ret; - if ((ret = init_vlc(&s->mode_code_vlc, 3, 8, - &mode_code_vlc_table[0][1], 2, 1, - &mode_code_vlc_table[0][0], 2, 1, 0)) < 0) + ret = ff_init_vlc_from_lengths(&s->mode_code_vlc, 3, 8, + mode_code_vlc_len, 1, + NULL, 0, 0, 0, 0, avctx); + if (ret < 0) return ret; if ((ret = init_vlc(&s->motion_vector_vlc, 6, 63, diff --git a/libavcodec/vp3data.h b/libavcodec/vp3data.h index 4dc20c5f29..ae2b44f533 100644 --- a/libavcodec/vp3data.h +++ b/libavcodec/vp3data.h @@ -102,36 +102,13 @@ static const uint8_t superblock_run_length_vlc_lens[34] = { * bits from the stream and adding the value 34. */ }; -static const uint16_t fragment_run_length_vlc_table[30][2] = { - /* 1 -> 2 */ - { 0x0, 2 }, { 0x1, 2 }, - - /* 3 -> 4 */ - { 0x4, 3 }, { 0x5, 3 }, - - /* 5 -> 6 */ - { 0xC, 4 }, { 0xD, 4 }, - - /* 7 -> 10 */ - { 0x38, 6 }, { 0x39, 6 }, - { 0x3A, 6 }, { 0x3B, 6 }, - - /* 11 -> 14 */ - { 0x78, 7 }, { 0x79, 7 }, - { 0x7A, 7 }, { 0x7B, 7 }, - - /* 15 -> 30 */ - { 0x1F0, 9 }, { 0x1F1, 9 }, { 0x1F2, 9 }, { 0x1F3, 9 }, - { 0x1F4, 9 }, { 0x1F5, 9 }, { 0x1F6, 9 }, { 0x1F7, 9 }, - { 0x1F8, 9 }, { 0x1F9, 9 }, { 0x1FA, 9 }, { 0x1FB, 9 }, - { 0x1FC, 9 }, { 0x1FD, 9 }, { 0x1FE, 9 }, { 0x1FF, 9 } +static const uint8_t fragment_run_length_vlc_len[30] = { + 2, 2, 3, 3, 4, 4, 6, 6, 6, 6, 7, 7, 7, 7, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, }; -static const uint8_t mode_code_vlc_table[8][2] = { - { 0, 1 }, { 2, 2 }, - { 6, 3 }, { 14, 4 }, - { 30, 5 }, { 62, 6 }, - { 126, 7 }, { 127, 7 } +static const uint8_t mode_code_vlc_len[8] = { + 1, 2, 3, 4, 5, 6, 7, 7, }; static const uint8_t motion_vector_vlc_table[63][2] = { @@ -428,2727 +405,647 @@ static const int16_t *const coeff_tables[32] = { coeff_table_token_31 }; -static const uint16_t vp3_bias[5 * 16][32][2] = { +static const uint8_t vp3_bias[5 * 16][32][2] = { { /* DC bias table 0 */ - { 0x2D, 6 }, - { 0x26, 7 }, - { 0x166, 9 }, - { 0x4E, 8 }, - { 0x2CE, 10 }, - { 0x59E, 11 }, - { 0x27D, 11 }, - { 0x8, 5 }, - { 0x4F9, 12 }, - { 0xF, 4 }, - { 0xE, 4 }, - { 0x1B, 5 }, - { 0x6, 4 }, - { 0x8, 4 }, - { 0x5, 4 }, - { 0x1A, 5 }, - { 0x15, 5 }, - { 0x7, 4 }, - { 0xC, 4 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0x9, 4 }, - { 0x17, 5 }, - { 0x29, 6 }, - { 0x28, 6 }, - { 0xB2, 8 }, - { 0x4F8, 12 }, - { 0x59F, 11 }, - { 0x9E, 9 }, - { 0x13F, 10 }, - { 0x12, 6 }, - { 0x58, 7 } + { 20, 3 }, { 19, 3 }, { 7, 5 }, { 30, 6 }, { 1, 7 }, { 3, 8 }, + { 28, 9 }, { 26, 12 }, { 8, 12 }, { 6, 11 }, { 29, 10 }, { 14, 4 }, + { 12, 4 }, { 17, 4 }, { 13, 4 }, { 21, 4 }, { 24, 6 }, { 23, 6 }, + { 16, 5 }, { 31, 7 }, { 25, 8 }, { 2, 9 }, { 4, 10 }, { 5, 11 }, + { 27, 11 }, { 0, 6 }, { 22, 5 }, { 18, 4 }, { 15, 5 }, { 11, 5 }, + { 10, 4 }, { 9, 4 }, }, { /* DC bias table 1 */ - { 0x10, 5 }, - { 0x47, 7 }, - { 0x1FF, 9 }, - { 0x8C, 8 }, - { 0x3FC, 10 }, - { 0x46A, 11 }, - { 0x469, 11 }, - { 0x22, 6 }, - { 0x11A1, 13 }, - { 0xE, 4 }, - { 0xD, 4 }, - { 0x4, 4 }, - { 0x5, 4 }, - { 0x9, 4 }, - { 0x6, 4 }, - { 0x1E, 5 }, - { 0x16, 5 }, - { 0x7, 4 }, - { 0xC, 4 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0xA, 4 }, - { 0x17, 5 }, - { 0x7D, 7 }, - { 0x7E, 7 }, - { 0x11B, 9 }, - { 0x8D1, 12 }, - { 0x3FD, 10 }, - { 0x46B, 11 }, - { 0x11A0, 13 }, - { 0x7C, 7 }, - { 0xFE, 8 } + { 20, 3 }, { 19, 3 }, { 11, 4 }, { 12, 4 }, { 14, 4 }, { 17, 4 }, + { 0, 5 }, { 7, 6 }, { 3, 8 }, { 29, 13 }, { 8, 13 }, { 26, 12 }, + { 6, 11 }, { 5, 11 }, { 28, 11 }, { 25, 9 }, { 1, 7 }, { 13, 4 }, + { 21, 4 }, { 16, 5 }, { 22, 5 }, { 18, 4 }, { 10, 4 }, { 9, 4 }, + { 15, 5 }, { 30, 7 }, { 23, 7 }, { 24, 7 }, { 31, 8 }, { 4, 10 }, + { 27, 10 }, { 2, 9 }, }, { /* DC bias table 2 */ - { 0x16, 5 }, - { 0x20, 6 }, - { 0x86, 8 }, - { 0x87, 8 }, - { 0x367, 10 }, - { 0x6CC, 11 }, - { 0x6CB, 11 }, - { 0x6E, 7 }, - { 0x366D, 14 }, - { 0xF, 4 }, - { 0xE, 4 }, - { 0x4, 4 }, - { 0x5, 4 }, - { 0xA, 4 }, - { 0x6, 4 }, - { 0x1A, 5 }, - { 0x11, 5 }, - { 0x7, 4 }, - { 0xC, 4 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0x9, 4 }, - { 0x17, 5 }, - { 0x6F, 7 }, - { 0x6D, 7 }, - { 0x364, 10 }, - { 0xD9A, 12 }, - { 0x6CA, 11 }, - { 0x1B37, 13 }, - { 0x366C, 14 }, - { 0x42, 7 }, - { 0xD8, 8 } + { 20, 3 }, { 19, 3 }, { 11, 4 }, { 12, 4 }, { 14, 4 }, { 17, 4 }, + { 1, 6 }, { 30, 7 }, { 2, 8 }, { 3, 8 }, { 16, 5 }, { 21, 4 }, + { 13, 4 }, { 0, 5 }, { 22, 5 }, { 18, 4 }, { 15, 5 }, { 31, 8 }, + { 25, 10 }, { 27, 11 }, { 6, 11 }, { 5, 11 }, { 26, 12 }, { 29, 14 }, + { 8, 14 }, { 28, 13 }, { 4, 10 }, { 24, 7 }, { 7, 7 }, { 23, 7 }, + { 10, 4 }, { 9, 4 }, }, { /* DC bias table 3 */ - { 0x0, 4 }, - { 0x2D, 6 }, - { 0xF7, 8 }, - { 0x58, 7 }, - { 0x167, 9 }, - { 0x2CB, 10 }, - { 0x2CA, 10 }, - { 0xE, 6 }, - { 0x1661, 13 }, - { 0x3, 3 }, - { 0x2, 3 }, - { 0x8, 4 }, - { 0x9, 4 }, - { 0xD, 4 }, - { 0x2, 4 }, - { 0x1F, 5 }, - { 0x17, 5 }, - { 0x1, 4 }, - { 0xC, 4 }, - { 0xE, 4 }, - { 0xA, 4 }, - { 0x6, 5 }, - { 0x78, 7 }, - { 0xF, 6 }, - { 0x7A, 7 }, - { 0x164, 9 }, - { 0x599, 11 }, - { 0x2CD, 10 }, - { 0xB31, 12 }, - { 0x1660, 13 }, - { 0x79, 7 }, - { 0xF6, 8 } + { 0, 4 }, { 17, 4 }, { 14, 4 }, { 21, 5 }, { 7, 6 }, { 23, 6 }, + { 10, 3 }, { 9, 3 }, { 11, 4 }, { 12, 4 }, { 20, 4 }, { 3, 7 }, + { 25, 9 }, { 6, 10 }, { 5, 10 }, { 29, 13 }, { 8, 13 }, { 28, 12 }, + { 26, 11 }, { 27, 10 }, { 4, 9 }, { 1, 6 }, { 16, 5 }, { 18, 4 }, + { 13, 4 }, { 19, 4 }, { 22, 7 }, { 30, 7 }, { 24, 7 }, { 31, 8 }, + { 2, 8 }, { 15, 5 }, }, { /* DC bias table 4 */ - { 0x3, 4 }, - { 0x3C, 6 }, - { 0xF, 7 }, - { 0x7A, 7 }, - { 0x1D, 8 }, - { 0x20, 9 }, - { 0x72, 10 }, - { 0x6, 6 }, - { 0x399, 13 }, - { 0x4, 3 }, - { 0x5, 3 }, - { 0x5, 4 }, - { 0x6, 4 }, - { 0xE, 4 }, - { 0x4, 4 }, - { 0x0, 4 }, - { 0x19, 5 }, - { 0x2, 4 }, - { 0xD, 4 }, - { 0x7, 4 }, - { 0x1F, 5 }, - { 0x30, 6 }, - { 0x11, 8 }, - { 0x31, 6 }, - { 0x5, 6 }, - { 0x21, 9 }, - { 0xE7, 11 }, - { 0x38, 9 }, - { 0x1CD, 12 }, - { 0x398, 13 }, - { 0x7B, 7 }, - { 0x9, 7 } + { 15, 4 }, { 5, 9 }, { 25, 9 }, { 22, 8 }, { 31, 7 }, { 24, 6 }, + { 7, 6 }, { 27, 9 }, { 6, 10 }, { 29, 13 }, { 8, 13 }, { 28, 12 }, + { 26, 11 }, { 4, 8 }, { 2, 7 }, { 17, 4 }, { 0, 4 }, { 14, 4 }, + { 11, 4 }, { 12, 4 }, { 19, 4 }, { 9, 3 }, { 10, 3 }, { 21, 6 }, + { 23, 6 }, { 16, 5 }, { 18, 4 }, { 13, 4 }, { 1, 6 }, { 3, 7 }, + { 30, 7 }, { 20, 5 }, }, { /* DC bias table 5 */ - { 0x9, 4 }, - { 0x2, 5 }, - { 0x74, 7 }, - { 0x7, 6 }, - { 0xEC, 8 }, - { 0xD1, 9 }, - { 0x1A6, 10 }, - { 0x6, 6 }, - { 0xD21, 13 }, - { 0x5, 3 }, - { 0x6, 3 }, - { 0x8, 4 }, - { 0x7, 4 }, - { 0xF, 4 }, - { 0x4, 4 }, - { 0x0, 4 }, - { 0x1C, 5 }, - { 0x2, 4 }, - { 0x5, 4 }, - { 0x3, 4 }, - { 0xC, 5 }, - { 0x35, 7 }, - { 0x1A7, 10 }, - { 0x1B, 6 }, - { 0x77, 7 }, - { 0x1A5, 10 }, - { 0x349, 11 }, - { 0xD0, 9 }, - { 0x691, 12 }, - { 0xD20, 13 }, - { 0x75, 7 }, - { 0xED, 8 } + { 15, 4 }, { 1, 5 }, { 7, 6 }, { 3, 6 }, { 17, 4 }, { 19, 4 }, + { 14, 4 }, { 18, 4 }, { 20, 5 }, { 27, 9 }, { 5, 9 }, { 29, 13 }, + { 8, 13 }, { 28, 12 }, { 26, 11 }, { 25, 10 }, { 6, 10 }, { 22, 10 }, + { 21, 7 }, { 23, 6 }, { 12, 4 }, { 11, 4 }, { 0, 4 }, { 9, 3 }, + { 10, 3 }, { 16, 5 }, { 2, 7 }, { 30, 7 }, { 4, 8 }, { 31, 8 }, + { 24, 7 }, { 13, 4 }, }, { /* DC bias table 6 */ - { 0xA, 4 }, - { 0xC, 5 }, - { 0x12, 6 }, - { 0x1B, 6 }, - { 0xB7, 8 }, - { 0x16C, 9 }, - { 0x99, 9 }, - { 0x5A, 7 }, - { 0x16D8, 13 }, - { 0x7, 3 }, - { 0x6, 3 }, - { 0x9, 4 }, - { 0x8, 4 }, - { 0x0, 3 }, - { 0x5, 4 }, - { 0x17, 5 }, - { 0xE, 5 }, - { 0x2, 4 }, - { 0x3, 4 }, - { 0xF, 5 }, - { 0x1A, 6 }, - { 0x4D, 8 }, - { 0x2DB3, 14 }, - { 0x2C, 6 }, - { 0x11, 6 }, - { 0x2DA, 10 }, - { 0x5B7, 11 }, - { 0x98, 9 }, - { 0xB6D, 12 }, - { 0x2DB2, 14 }, - { 0x10, 6 }, - { 0x27, 7 } + { 13, 3 }, { 17, 4 }, { 18, 4 }, { 30, 6 }, { 24, 6 }, { 2, 6 }, + { 27, 9 }, { 6, 9 }, { 21, 8 }, { 31, 7 }, { 14, 4 }, { 1, 5 }, + { 20, 6 }, { 3, 6 }, { 16, 5 }, { 19, 5 }, { 12, 4 }, { 11, 4 }, + { 0, 4 }, { 23, 6 }, { 7, 7 }, { 5, 9 }, { 25, 10 }, { 8, 13 }, + { 29, 14 }, { 22, 14 }, { 28, 12 }, { 26, 11 }, { 4, 8 }, { 15, 5 }, + { 10, 3 }, { 9, 3 }, }, { /* DC bias table 7 */ - { 0xD, 4 }, - { 0xF, 5 }, - { 0x1D, 6 }, - { 0x8, 5 }, - { 0x51, 7 }, - { 0x56, 8 }, - { 0xAF, 9 }, - { 0x2A, 7 }, - { 0x148A, 13 }, - { 0x7, 3 }, - { 0x0, 2 }, - { 0x8, 4 }, - { 0x9, 4 }, - { 0xC, 4 }, - { 0x6, 4 }, - { 0x17, 5 }, - { 0xB, 5 }, - { 0x16, 5 }, - { 0x15, 5 }, - { 0x9, 5 }, - { 0x50, 7 }, - { 0xAE, 9 }, - { 0x2917, 14 }, - { 0x1C, 6 }, - { 0x14, 6 }, - { 0x290, 10 }, - { 0x523, 11 }, - { 0x149, 9 }, - { 0xA44, 12 }, - { 0x2916, 14 }, - { 0x53, 7 }, - { 0xA5, 8 } + { 10, 2 }, { 3, 5 }, { 19, 5 }, { 24, 6 }, { 7, 7 }, { 5, 8 }, + { 21, 9 }, { 6, 9 }, { 16, 5 }, { 14, 4 }, { 23, 6 }, { 2, 6 }, + { 1, 5 }, { 11, 4 }, { 12, 4 }, { 20, 7 }, { 4, 7 }, { 25, 10 }, + { 28, 12 }, { 8, 13 }, { 29, 14 }, { 22, 14 }, { 26, 11 }, { 27, 9 }, + { 31, 8 }, { 30, 7 }, { 18, 5 }, { 17, 5 }, { 15, 5 }, { 13, 4 }, + { 0, 4 }, { 9, 3 }, }, { /* DC bias table 8 */ - { 0x1, 4 }, - { 0x1D, 6 }, - { 0xF5, 8 }, - { 0xF4, 8 }, - { 0x24D, 10 }, - { 0x499, 11 }, - { 0x498, 11 }, - { 0x1, 5 }, - { 0x21, 6 }, - { 0x6, 3 }, - { 0x5, 3 }, - { 0x6, 4 }, - { 0x5, 4 }, - { 0x2, 4 }, - { 0x7, 5 }, - { 0x25, 6 }, - { 0x7B, 7 }, - { 0x1C, 6 }, - { 0x20, 6 }, - { 0xD, 6 }, - { 0x48, 7 }, - { 0x92, 8 }, - { 0x127, 9 }, - { 0xE, 4 }, - { 0x4, 4 }, - { 0x11, 5 }, - { 0xC, 6 }, - { 0x3C, 6 }, - { 0xF, 5 }, - { 0x0, 5 }, - { 0x1F, 5 }, - { 0x13, 5 } + { 29, 5 }, { 7, 5 }, { 0, 4 }, { 13, 4 }, { 26, 6 }, { 19, 6 }, + { 14, 5 }, { 24, 4 }, { 12, 4 }, { 11, 4 }, { 17, 6 }, { 1, 6 }, + { 28, 5 }, { 18, 6 }, { 8, 6 }, { 25, 5 }, { 20, 7 }, { 21, 8 }, + { 6, 11 }, { 5, 11 }, { 4, 10 }, { 22, 9 }, { 15, 6 }, { 31, 5 }, + { 10, 3 }, { 9, 3 }, { 23, 4 }, { 27, 6 }, { 3, 8 }, { 2, 8 }, + { 16, 7 }, { 30, 5 }, }, { /* DC bias table 9 */ - { 0x5, 4 }, - { 0x3C, 6 }, - { 0x40, 7 }, - { 0xD, 7 }, - { 0x31, 9 }, - { 0x61, 10 }, - { 0x60, 10 }, - { 0x2, 5 }, - { 0xF5, 8 }, - { 0x6, 3 }, - { 0x5, 3 }, - { 0x7, 4 }, - { 0x6, 4 }, - { 0x2, 4 }, - { 0x9, 5 }, - { 0x25, 6 }, - { 0x7, 6 }, - { 0x21, 6 }, - { 0x24, 6 }, - { 0x10, 6 }, - { 0x41, 7 }, - { 0xF4, 8 }, - { 0x19, 8 }, - { 0xE, 4 }, - { 0x3, 4 }, - { 0x11, 5 }, - { 0x11, 6 }, - { 0x3F, 6 }, - { 0x3E, 6 }, - { 0x7B, 7 }, - { 0x0, 4 }, - { 0x13, 5 } + { 30, 4 }, { 7, 5 }, { 6, 10 }, { 5, 10 }, { 4, 9 }, { 22, 8 }, + { 3, 7 }, { 16, 6 }, { 13, 4 }, { 24, 4 }, { 19, 6 }, { 26, 6 }, + { 14, 5 }, { 0, 4 }, { 12, 4 }, { 11, 4 }, { 2, 7 }, { 20, 7 }, + { 17, 6 }, { 25, 5 }, { 18, 6 }, { 15, 6 }, { 31, 5 }, { 10, 3 }, + { 9, 3 }, { 23, 4 }, { 1, 6 }, { 21, 8 }, { 8, 8 }, { 29, 7 }, + { 28, 6 }, { 27, 6 }, }, { /* DC bias table 10 */ - { 0xA, 4 }, - { 0x7, 5 }, - { 0x1, 6 }, - { 0x9, 6 }, - { 0x131, 9 }, - { 0x261, 10 }, - { 0x260, 10 }, - { 0x15, 6 }, - { 0x1, 7 }, - { 0x7, 3 }, - { 0x6, 3 }, - { 0x8, 4 }, - { 0x7, 4 }, - { 0x6, 4 }, - { 0x12, 5 }, - { 0x2F, 6 }, - { 0x14, 6 }, - { 0x27, 6 }, - { 0x2D, 6 }, - { 0x16, 6 }, - { 0x4D, 7 }, - { 0x99, 8 }, - { 0x0, 7 }, - { 0x4, 4 }, - { 0x1, 4 }, - { 0x5, 5 }, - { 0x17, 6 }, - { 0x2E, 6 }, - { 0x2C, 6 }, - { 0x8, 6 }, - { 0x6, 5 }, - { 0x1, 5 } + { 22, 7 }, { 8, 7 }, { 2, 6 }, { 31, 5 }, { 24, 4 }, { 29, 6 }, + { 3, 6 }, { 25, 5 }, { 30, 5 }, { 1, 5 }, { 23, 4 }, { 16, 6 }, + { 7, 6 }, { 19, 6 }, { 26, 6 }, { 13, 4 }, { 12, 4 }, { 11, 4 }, + { 14, 5 }, { 6, 10 }, { 5, 10 }, { 4, 9 }, { 21, 8 }, { 20, 7 }, + { 17, 6 }, { 0, 4 }, { 28, 6 }, { 18, 6 }, { 27, 6 }, { 15, 6 }, + { 10, 3 }, { 9, 3 }, }, { /* DC bias table 11 */ - { 0x0, 3 }, - { 0xE, 5 }, - { 0x17, 6 }, - { 0x2A, 6 }, - { 0x10, 7 }, - { 0xF9, 10 }, - { 0xF8, 10 }, - { 0x1E, 7 }, - { 0x3F, 8 }, - { 0x7, 3 }, - { 0x6, 3 }, - { 0x9, 4 }, - { 0x8, 4 }, - { 0x6, 4 }, - { 0xF, 5 }, - { 0x5, 5 }, - { 0x16, 6 }, - { 0x29, 6 }, - { 0x2B, 6 }, - { 0x15, 6 }, - { 0x50, 7 }, - { 0x11, 7 }, - { 0x7D, 9 }, - { 0x4, 4 }, - { 0x17, 5 }, - { 0x6, 5 }, - { 0x14, 6 }, - { 0x2C, 6 }, - { 0x2D, 6 }, - { 0xE, 6 }, - { 0x9, 6 }, - { 0x51, 7 } + { 0, 3 }, { 4, 7 }, { 21, 7 }, { 30, 6 }, { 15, 5 }, { 25, 5 }, + { 29, 6 }, { 7, 7 }, { 6, 10 }, { 5, 10 }, { 22, 9 }, { 8, 8 }, + { 23, 4 }, { 26, 6 }, { 19, 6 }, { 16, 6 }, { 2, 6 }, { 13, 4 }, + { 1, 5 }, { 14, 5 }, { 12, 4 }, { 11, 4 }, { 20, 7 }, { 31, 7 }, + { 17, 6 }, { 3, 6 }, { 18, 6 }, { 27, 6 }, { 28, 6 }, { 24, 5 }, + { 10, 3 }, { 9, 3 }, }, { /* DC bias table 12 */ - { 0x2, 3 }, - { 0x18, 5 }, - { 0x2F, 6 }, - { 0xD, 5 }, - { 0x53, 7 }, - { 0x295, 10 }, - { 0x294, 10 }, - { 0xA4, 8 }, - { 0x7C, 8 }, - { 0x0, 2 }, - { 0x7, 3 }, - { 0x9, 4 }, - { 0x8, 4 }, - { 0x1B, 5 }, - { 0xC, 5 }, - { 0x28, 6 }, - { 0x6A, 7 }, - { 0x1E, 6 }, - { 0x1D, 6 }, - { 0x69, 7 }, - { 0xD7, 8 }, - { 0x7D, 8 }, - { 0x14B, 9 }, - { 0x19, 5 }, - { 0x16, 5 }, - { 0x2E, 6 }, - { 0x1C, 6 }, - { 0x2B, 6 }, - { 0x2A, 6 }, - { 0x68, 7 }, - { 0x3F, 7 }, - { 0xD6, 8 } + { 9, 2 }, { 0, 3 }, { 14, 5 }, { 3, 5 }, { 26, 6 }, { 18, 6 }, + { 17, 6 }, { 8, 8 }, { 21, 8 }, { 30, 7 }, { 12, 4 }, { 11, 4 }, + { 15, 6 }, { 7, 8 }, { 6, 10 }, { 5, 10 }, { 22, 9 }, { 4, 7 }, + { 28, 6 }, { 27, 6 }, { 24, 5 }, { 25, 6 }, { 2, 6 }, { 1, 5 }, + { 23, 5 }, { 29, 7 }, { 19, 7 }, { 16, 7 }, { 31, 8 }, { 20, 8 }, + { 13, 5 }, { 10, 3 }, }, { /* DC bias table 13 */ - { 0x2, 3 }, - { 0x1B, 5 }, - { 0xC, 5 }, - { 0x18, 5 }, - { 0x29, 6 }, - { 0x7F, 8 }, - { 0x2F0, 10 }, - { 0x198, 9 }, - { 0x179, 9 }, - { 0x0, 2 }, - { 0x7, 3 }, - { 0x9, 4 }, - { 0x8, 4 }, - { 0x1A, 5 }, - { 0xD, 5 }, - { 0x2A, 6 }, - { 0x64, 7 }, - { 0x1E, 6 }, - { 0x67, 7 }, - { 0x5F, 7 }, - { 0xCD, 8 }, - { 0x7E, 8 }, - { 0x2F1, 10 }, - { 0x16, 5 }, - { 0xE, 5 }, - { 0x2E, 6 }, - { 0x65, 7 }, - { 0x2B, 6 }, - { 0x28, 6 }, - { 0x3E, 7 }, - { 0xBD, 8 }, - { 0x199, 9 } + { 9, 2 }, { 0, 3 }, { 2, 5 }, { 14, 5 }, { 24, 5 }, { 17, 6 }, + { 29, 7 }, { 21, 8 }, { 5, 8 }, { 12, 4 }, { 11, 4 }, { 28, 6 }, + { 4, 6 }, { 15, 6 }, { 27, 6 }, { 23, 5 }, { 25, 6 }, { 6, 10 }, + { 22, 10 }, { 8, 9 }, { 30, 8 }, { 19, 7 }, { 3, 5 }, { 16, 7 }, + { 26, 7 }, { 7, 9 }, { 31, 9 }, { 20, 8 }, { 18, 7 }, { 13, 5 }, + { 1, 5 }, { 10, 3 }, }, { /* DC bias table 14 */ - { 0x2, 3 }, - { 0x7, 4 }, - { 0x16, 5 }, - { 0x6, 4 }, - { 0x36, 6 }, - { 0x5C, 7 }, - { 0x15D, 9 }, - { 0x15C, 9 }, - { 0x2BF, 10 }, - { 0x0, 2 }, - { 0x7, 3 }, - { 0x9, 4 }, - { 0x8, 4 }, - { 0x18, 5 }, - { 0x34, 6 }, - { 0x2A, 6 }, - { 0x5E, 7 }, - { 0x6A, 7 }, - { 0x64, 7 }, - { 0x5D, 7 }, - { 0xCB, 8 }, - { 0xAD, 8 }, - { 0x2BE, 10 }, - { 0x14, 5 }, - { 0x33, 6 }, - { 0x6E, 7 }, - { 0x5F, 7 }, - { 0x6F, 7 }, - { 0x6B, 7 }, - { 0xCA, 8 }, - { 0xAC, 8 }, - { 0x15E, 9 } + { 9, 2 }, { 0, 3 }, { 3, 4 }, { 1, 4 }, { 12, 4 }, { 11, 4 }, + { 23, 5 }, { 15, 6 }, { 30, 8 }, { 21, 8 }, { 7, 9 }, { 6, 9 }, + { 31, 9 }, { 22, 10 }, { 8, 10 }, { 2, 5 }, { 5, 7 }, { 19, 7 }, + { 16, 7 }, { 26, 7 }, { 13, 5 }, { 18, 7 }, { 29, 8 }, { 20, 8 }, + { 24, 6 }, { 14, 6 }, { 17, 7 }, { 28, 7 }, { 4, 6 }, { 25, 7 }, + { 27, 7 }, { 10, 3 }, }, { /* DC bias table 15 */ - { 0xF, 4 }, - { 0x1D, 5 }, - { 0x18, 5 }, - { 0xB, 4 }, - { 0x19, 5 }, - { 0x29, 6 }, - { 0xD6, 8 }, - { 0x551, 11 }, - { 0xAA1, 12 }, - { 0x1, 2 }, - { 0x0, 2 }, - { 0x9, 4 }, - { 0x8, 4 }, - { 0x1B, 5 }, - { 0x38, 6 }, - { 0x28, 6 }, - { 0x57, 7 }, - { 0x6A, 7 }, - { 0x68, 7 }, - { 0x56, 7 }, - { 0xE5, 8 }, - { 0x155, 9 }, - { 0xAA0, 12 }, - { 0x73, 7 }, - { 0x69, 7 }, - { 0xD7, 8 }, - { 0xAB, 8 }, - { 0xE4, 8 }, - { 0xA9, 8 }, - { 0x151, 9 }, - { 0x150, 9 }, - { 0x2A9, 10 } + { 10, 2 }, { 9, 2 }, { 12, 4 }, { 11, 4 }, { 15, 6 }, { 5, 6 }, + { 30, 9 }, { 29, 9 }, { 28, 8 }, { 22, 12 }, { 8, 12 }, { 7, 11 }, + { 31, 10 }, { 21, 9 }, { 26, 8 }, { 19, 7 }, { 16, 7 }, { 3, 4 }, + { 2, 5 }, { 4, 5 }, { 18, 7 }, { 24, 7 }, { 17, 7 }, { 6, 8 }, + { 25, 8 }, { 13, 5 }, { 14, 6 }, { 27, 8 }, { 20, 8 }, { 23, 7 }, + { 1, 5 }, { 0, 4 }, }, { /* AC bias group 1, table 0 */ - { 0x8, 5 }, - { 0x25, 7 }, - { 0x17A, 9 }, - { 0x2F7, 10 }, - { 0xBDB, 12 }, - { 0x17B4, 13 }, - { 0x2F6B, 14 }, - { 0x1D, 5 }, - { 0x2F6A, 14 }, - { 0x8, 4 }, - { 0x7, 4 }, - { 0x1, 4 }, - { 0x2, 4 }, - { 0xA, 4 }, - { 0x6, 4 }, - { 0x0, 4 }, - { 0x1C, 5 }, - { 0x9, 4 }, - { 0xD, 4 }, - { 0xF, 4 }, - { 0xC, 4 }, - { 0x3, 4 }, - { 0xA, 5 }, - { 0x16, 5 }, - { 0x13, 6 }, - { 0x5D, 7 }, - { 0x24, 7 }, - { 0xBC, 8 }, - { 0x5C, 7 }, - { 0x5EC, 11 }, - { 0xB, 5 }, - { 0x5F, 7 } + { 15, 4 }, { 11, 4 }, { 12, 4 }, { 21, 4 }, { 0, 5 }, { 26, 7 }, + { 1, 7 }, { 24, 6 }, { 22, 5 }, { 30, 5 }, { 14, 4 }, { 10, 4 }, + { 9, 4 }, { 17, 4 }, { 13, 4 }, { 23, 5 }, { 28, 7 }, { 25, 7 }, + { 27, 8 }, { 2, 9 }, { 29, 11 }, { 5, 13 }, { 8, 14 }, { 6, 14 }, + { 4, 12 }, { 3, 10 }, { 31, 7 }, { 20, 4 }, { 18, 4 }, { 16, 5 }, + { 7, 5 }, { 19, 4 }, }, { /* AC bias group 1, table 1 */ - { 0xF, 5 }, - { 0x10, 6 }, - { 0x4B, 8 }, - { 0xC6, 8 }, - { 0x31D, 10 }, - { 0xC71, 12 }, - { 0xC70, 12 }, - { 0x1, 4 }, - { 0xC73, 12 }, - { 0x8, 4 }, - { 0x9, 4 }, - { 0x2, 4 }, - { 0x3, 4 }, - { 0xB, 4 }, - { 0x6, 4 }, - { 0x0, 4 }, - { 0x1C, 5 }, - { 0x5, 4 }, - { 0xD, 4 }, - { 0xF, 4 }, - { 0xA, 4 }, - { 0x19, 5 }, - { 0x13, 6 }, - { 0x1D, 5 }, - { 0x30, 6 }, - { 0x62, 7 }, - { 0x24, 7 }, - { 0x4A, 8 }, - { 0x18F, 9 }, - { 0xC72, 12 }, - { 0xE, 5 }, - { 0x11, 6 } + { 15, 4 }, { 7, 4 }, { 11, 4 }, { 12, 4 }, { 1, 6 }, { 31, 6 }, + { 26, 7 }, { 27, 8 }, { 2, 8 }, { 22, 6 }, { 17, 4 }, { 14, 4 }, + { 30, 5 }, { 0, 5 }, { 9, 4 }, { 10, 4 }, { 20, 4 }, { 13, 4 }, + { 24, 6 }, { 25, 7 }, { 3, 8 }, { 6, 12 }, { 5, 12 }, { 29, 12 }, + { 8, 12 }, { 4, 10 }, { 28, 9 }, { 21, 5 }, { 18, 4 }, { 16, 5 }, + { 23, 5 }, { 19, 4 }, }, { /* AC bias group 1, table 2 */ - { 0x1B, 5 }, - { 0x3, 6 }, - { 0x8D, 8 }, - { 0x40, 7 }, - { 0x239, 10 }, - { 0x471, 11 }, - { 0x8E0, 12 }, - { 0x3, 4 }, - { 0x11C3, 13 }, - { 0xA, 4 }, - { 0x9, 4 }, - { 0x4, 4 }, - { 0x5, 4 }, - { 0xE, 4 }, - { 0x7, 4 }, - { 0x1, 4 }, - { 0x1E, 5 }, - { 0x6, 4 }, - { 0xC, 4 }, - { 0xB, 4 }, - { 0x2, 4 }, - { 0x0, 5 }, - { 0x41, 7 }, - { 0x1F, 5 }, - { 0x22, 6 }, - { 0x2, 6 }, - { 0x8F, 8 }, - { 0x8C, 8 }, - { 0x11D, 9 }, - { 0x11C2, 13 }, - { 0x1A, 5 }, - { 0x21, 6 } + { 21, 5 }, { 25, 6 }, { 1, 6 }, { 15, 4 }, { 20, 4 }, { 7, 4 }, + { 11, 4 }, { 12, 4 }, { 17, 4 }, { 14, 4 }, { 3, 7 }, { 22, 7 }, + { 31, 6 }, { 24, 6 }, { 27, 8 }, { 2, 8 }, { 6, 12 }, { 29, 13 }, + { 8, 13 }, { 5, 11 }, { 4, 10 }, { 28, 9 }, { 26, 8 }, { 10, 4 }, + { 9, 4 }, { 19, 4 }, { 18, 4 }, { 30, 5 }, { 0, 5 }, { 13, 4 }, + { 16, 5 }, { 23, 5 }, }, { /* AC bias group 1, table 3 */ - { 0x1F, 5 }, - { 0x3, 6 }, - { 0x3, 7 }, - { 0x43, 7 }, - { 0xB, 9 }, - { 0x15, 10 }, - { 0x51, 12 }, - { 0x3, 4 }, - { 0x50, 12 }, - { 0xD, 4 }, - { 0xC, 4 }, - { 0x4, 4 }, - { 0x6, 4 }, - { 0xE, 4 }, - { 0xA, 4 }, - { 0x1, 4 }, - { 0x1E, 5 }, - { 0x5, 4 }, - { 0x9, 4 }, - { 0x7, 4 }, - { 0x11, 5 }, - { 0x2, 6 }, - { 0x4, 8 }, - { 0x2, 4 }, - { 0x2D, 6 }, - { 0x20, 6 }, - { 0x42, 7 }, - { 0x1, 7 }, - { 0x0, 7 }, - { 0x29, 11 }, - { 0x17, 5 }, - { 0x2C, 6 } + { 28, 7 }, { 27, 7 }, { 22, 8 }, { 8, 12 }, { 6, 12 }, { 29, 11 }, + { 5, 10 }, { 4, 9 }, { 2, 7 }, { 21, 6 }, { 1, 6 }, { 15, 4 }, + { 23, 4 }, { 7, 4 }, { 11, 4 }, { 17, 4 }, { 12, 4 }, { 19, 4 }, + { 25, 6 }, { 26, 7 }, { 3, 7 }, { 20, 5 }, { 18, 4 }, { 14, 4 }, + { 31, 6 }, { 24, 6 }, { 30, 5 }, { 10, 4 }, { 9, 4 }, { 13, 4 }, + { 16, 5 }, { 0, 5 }, }, { /* AC bias group 1, table 4 */ - { 0x3, 4 }, - { 0x1F, 6 }, - { 0x3A, 7 }, - { 0x5D, 7 }, - { 0x173, 9 }, - { 0x2E4, 10 }, - { 0x172D, 13 }, - { 0x4, 4 }, - { 0x172C, 13 }, - { 0xF, 4 }, - { 0xE, 4 }, - { 0x9, 4 }, - { 0x8, 4 }, - { 0xC, 4 }, - { 0xA, 4 }, - { 0x1, 4 }, - { 0x16, 5 }, - { 0x2, 4 }, - { 0x5, 4 }, - { 0x1A, 5 }, - { 0x2F, 6 }, - { 0x38, 7 }, - { 0x5CA, 11 }, - { 0x6, 4 }, - { 0x37, 6 }, - { 0x1E, 6 }, - { 0x3B, 7 }, - { 0x39, 7 }, - { 0xB8, 8 }, - { 0xB97, 12 }, - { 0x0, 4 }, - { 0x36, 6 } + { 30, 4 }, { 15, 4 }, { 17, 4 }, { 0, 4 }, { 7, 4 }, { 18, 4 }, + { 23, 4 }, { 21, 7 }, { 27, 7 }, { 2, 7 }, { 26, 7 }, { 25, 6 }, + { 1, 6 }, { 12, 4 }, { 11, 4 }, { 14, 4 }, { 16, 5 }, { 28, 8 }, + { 5, 10 }, { 22, 11 }, { 8, 13 }, { 6, 13 }, { 29, 12 }, { 4, 9 }, + { 3, 7 }, { 20, 6 }, { 13, 4 }, { 19, 5 }, { 31, 6 }, { 24, 6 }, + { 10, 4 }, { 9, 4 }, }, { /* AC bias group 1, table 5 */ - { 0x6, 4 }, - { 0x37, 6 }, - { 0x5D, 7 }, - { 0xC, 6 }, - { 0xB9, 8 }, - { 0x2E3, 10 }, - { 0x5C4, 11 }, - { 0x4, 4 }, - { 0x1715, 13 }, - { 0x0, 3 }, - { 0xF, 4 }, - { 0x8, 4 }, - { 0x7, 4 }, - { 0xC, 4 }, - { 0x9, 4 }, - { 0x1D, 5 }, - { 0x16, 5 }, - { 0x1C, 5 }, - { 0x1A, 5 }, - { 0xB, 5 }, - { 0x5E, 7 }, - { 0x170, 9 }, - { 0x1714, 13 }, - { 0xA, 4 }, - { 0xA, 5 }, - { 0x36, 6 }, - { 0x5F, 7 }, - { 0x1B, 7 }, - { 0x1A, 7 }, - { 0xB8B, 12 }, - { 0x2, 4 }, - { 0x7, 5 } + { 9, 3 }, { 30, 4 }, { 3, 6 }, { 28, 7 }, { 27, 7 }, { 31, 5 }, + { 7, 4 }, { 24, 5 }, { 19, 5 }, { 0, 4 }, { 12, 4 }, { 11, 4 }, + { 14, 4 }, { 23, 4 }, { 16, 5 }, { 21, 9 }, { 6, 11 }, { 22, 13 }, + { 8, 13 }, { 29, 12 }, { 5, 10 }, { 4, 8 }, { 2, 7 }, { 20, 7 }, + { 26, 7 }, { 13, 4 }, { 18, 5 }, { 25, 6 }, { 1, 6 }, { 17, 5 }, + { 15, 5 }, { 10, 4 }, }, { /* AC bias group 1, table 6 */ - { 0xC, 4 }, - { 0xB, 5 }, - { 0x79, 7 }, - { 0x22, 6 }, - { 0xF0, 8 }, - { 0x119, 9 }, - { 0x230, 10 }, - { 0x1D, 5 }, - { 0x8C4, 12 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0xA, 4 }, - { 0x9, 4 }, - { 0xB, 4 }, - { 0x7, 4 }, - { 0x1C, 5 }, - { 0x3D, 6 }, - { 0xD, 5 }, - { 0x8, 5 }, - { 0x15, 6 }, - { 0x8D, 8 }, - { 0x118B, 13 }, - { 0x118A, 13 }, - { 0xD, 4 }, - { 0x10, 5 }, - { 0x9, 5 }, - { 0x14, 6 }, - { 0x47, 7 }, - { 0xF1, 8 }, - { 0x463, 11 }, - { 0x1F, 5 }, - { 0xC, 5 } + { 10, 3 }, { 9, 3 }, { 18, 5 }, { 25, 5 }, { 26, 6 }, { 19, 6 }, + { 1, 5 }, { 31, 5 }, { 17, 5 }, { 14, 4 }, { 24, 5 }, { 3, 6 }, + { 6, 10 }, { 8, 12 }, { 22, 13 }, { 21, 13 }, { 29, 11 }, { 5, 9 }, + { 20, 8 }, { 27, 7 }, { 12, 4 }, { 11, 4 }, { 13, 4 }, { 0, 4 }, + { 23, 4 }, { 15, 5 }, { 7, 5 }, { 4, 8 }, { 28, 8 }, { 2, 7 }, + { 16, 6 }, { 30, 5 }, }, { /* AC bias group 1, table 7 */ - { 0x0, 3 }, - { 0x1A, 5 }, - { 0x33, 6 }, - { 0xC, 5 }, - { 0x46, 7 }, - { 0x1E3, 9 }, - { 0x3C5, 10 }, - { 0x17, 5 }, - { 0x1E21, 13 }, - { 0x2, 3 }, - { 0x1, 3 }, - { 0x9, 4 }, - { 0xA, 4 }, - { 0x7, 4 }, - { 0x1B, 5 }, - { 0x3D, 6 }, - { 0x1B, 6 }, - { 0x22, 6 }, - { 0x79, 7 }, - { 0xF0, 8 }, - { 0x1E20, 13 }, - { 0x1E23, 13 }, - { 0x1E22, 13 }, - { 0xE, 4 }, - { 0x16, 5 }, - { 0x18, 5 }, - { 0x32, 6 }, - { 0x1A, 6 }, - { 0x47, 7 }, - { 0x789, 11 }, - { 0x1F, 5 }, - { 0x10, 5 } + { 0, 3 }, { 10, 3 }, { 9, 3 }, { 3, 5 }, { 27, 6 }, { 16, 6 }, + { 13, 4 }, { 31, 5 }, { 17, 6 }, { 4, 7 }, { 28, 7 }, { 11, 4 }, + { 12, 4 }, { 24, 5 }, { 7, 5 }, { 25, 5 }, { 26, 6 }, { 2, 6 }, + { 1, 5 }, { 14, 5 }, { 23, 4 }, { 19, 8 }, { 20, 13 }, { 8, 13 }, + { 22, 13 }, { 21, 13 }, { 29, 11 }, { 6, 10 }, { 5, 9 }, { 18, 7 }, + { 15, 6 }, { 30, 5 }, }, { /* AC bias group 1, table 8 */ - { 0x1D, 5 }, - { 0x61, 7 }, - { 0x4E, 8 }, - { 0x9E, 9 }, - { 0x27C, 11 }, - { 0x9F5, 13 }, - { 0x9F4, 13 }, - { 0x3, 4 }, - { 0x60, 7 }, - { 0x0, 3 }, - { 0xF, 4 }, - { 0xB, 4 }, - { 0xA, 4 }, - { 0x9, 4 }, - { 0x5, 4 }, - { 0xD, 5 }, - { 0x31, 6 }, - { 0x8, 5 }, - { 0x38, 6 }, - { 0x12, 6 }, - { 0x26, 7 }, - { 0x13F, 10 }, - { 0x4FB, 12 }, - { 0xD, 4 }, - { 0x2, 4 }, - { 0xC, 5 }, - { 0x39, 6 }, - { 0x1C, 6 }, - { 0xF, 5 }, - { 0x1D, 6 }, - { 0x8, 4 }, - { 0x19, 5 } + { 9, 3 }, { 24, 4 }, { 7, 4 }, { 17, 5 }, { 19, 6 }, { 20, 7 }, + { 2, 8 }, { 3, 9 }, { 4, 11 }, { 6, 13 }, { 5, 13 }, { 22, 12 }, + { 21, 10 }, { 14, 4 }, { 25, 5 }, { 15, 5 }, { 27, 6 }, { 29, 6 }, + { 28, 5 }, { 30, 4 }, { 13, 4 }, { 12, 4 }, { 11, 4 }, { 8, 7 }, + { 1, 7 }, { 16, 6 }, { 31, 5 }, { 23, 4 }, { 18, 6 }, { 26, 6 }, + { 0, 5 }, { 10, 4 }, }, { /* AC bias group 1, table 9 */ - { 0x7, 4 }, - { 0x19, 6 }, - { 0xAB, 8 }, - { 0xAA, 8 }, - { 0x119, 10 }, - { 0x461, 12 }, - { 0x460, 12 }, - { 0x1B, 5 }, - { 0x47, 8 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0xC, 4 }, - { 0xB, 4 }, - { 0x9, 4 }, - { 0x5, 4 }, - { 0xD, 5 }, - { 0x35, 6 }, - { 0x3D, 6 }, - { 0x3C, 6 }, - { 0x18, 6 }, - { 0x22, 7 }, - { 0x8D, 9 }, - { 0x231, 11 }, - { 0xE, 4 }, - { 0x1F, 5 }, - { 0x9, 5 }, - { 0x2B, 6 }, - { 0x10, 6 }, - { 0x34, 6 }, - { 0x54, 7 }, - { 0x8, 4 }, - { 0x14, 5 } + { 10, 3 }, { 9, 3 }, { 27, 6 }, { 20, 7 }, { 6, 12 }, { 5, 12 }, + { 22, 11 }, { 4, 10 }, { 21, 9 }, { 8, 8 }, { 25, 5 }, { 14, 4 }, + { 19, 6 }, { 1, 6 }, { 15, 5 }, { 0, 4 }, { 30, 4 }, { 13, 4 }, + { 31, 5 }, { 29, 7 }, { 3, 8 }, { 2, 8 }, { 26, 6 }, { 12, 4 }, + { 11, 4 }, { 28, 6 }, { 16, 6 }, { 7, 5 }, { 23, 4 }, { 18, 6 }, + { 17, 6 }, { 24, 5 }, }, { /* AC bias group 1, table 10 */ - { 0xC, 4 }, - { 0x5, 5 }, - { 0x8, 6 }, - { 0x5B, 7 }, - { 0x4D, 9 }, - { 0x131, 11 }, - { 0x261, 12 }, - { 0x1A, 5 }, - { 0x12, 7 }, - { 0x0, 3 }, - { 0xF, 4 }, - { 0xA, 4 }, - { 0x9, 4 }, - { 0x6, 4 }, - { 0x1B, 5 }, - { 0x6, 5 }, - { 0x1C, 6 }, - { 0x2C, 6 }, - { 0x15, 6 }, - { 0x5A, 7 }, - { 0x27, 8 }, - { 0x99, 10 }, - { 0x260, 12 }, - { 0xE, 4 }, - { 0x4, 4 }, - { 0xF, 5 }, - { 0x7, 5 }, - { 0x1D, 6 }, - { 0xB, 5 }, - { 0x14, 6 }, - { 0x8, 4 }, - { 0x17, 5 } + { 9, 3 }, { 2, 6 }, { 8, 7 }, { 22, 12 }, { 6, 12 }, { 5, 11 }, + { 21, 10 }, { 4, 9 }, { 20, 8 }, { 1, 5 }, { 15, 5 }, { 26, 5 }, + { 24, 4 }, { 29, 6 }, { 18, 6 }, { 28, 5 }, { 13, 4 }, { 16, 6 }, + { 27, 6 }, { 25, 5 }, { 30, 4 }, { 12, 4 }, { 11, 4 }, { 17, 6 }, + { 19, 7 }, { 3, 7 }, { 31, 5 }, { 0, 4 }, { 7, 5 }, { 14, 5 }, + { 23, 4 }, { 10, 4 }, }, { /* AC bias group 1, table 11 */ - { 0xF, 4 }, - { 0x13, 5 }, - { 0x75, 7 }, - { 0x24, 6 }, - { 0x95, 8 }, - { 0x251, 10 }, - { 0x4A0, 11 }, - { 0x10, 5 }, - { 0xC8, 8 }, - { 0x2, 3 }, - { 0x1, 3 }, - { 0x1, 4 }, - { 0x0, 4 }, - { 0x1A, 5 }, - { 0x11, 5 }, - { 0x2C, 6 }, - { 0x65, 7 }, - { 0x74, 7 }, - { 0x4B, 7 }, - { 0xC9, 8 }, - { 0x129, 9 }, - { 0x943, 12 }, - { 0x942, 12 }, - { 0x3, 3 }, - { 0xA, 4 }, - { 0x1C, 5 }, - { 0x18, 5 }, - { 0x33, 6 }, - { 0x17, 5 }, - { 0x2D, 6 }, - { 0x1B, 5 }, - { 0x3B, 6 } + { 12, 4 }, { 11, 4 }, { 10, 3 }, { 9, 3 }, { 23, 3 }, { 7, 5 }, + { 14, 5 }, { 3, 6 }, { 6, 11 }, { 22, 12 }, { 21, 12 }, { 5, 10 }, + { 20, 9 }, { 4, 8 }, { 18, 7 }, { 1, 5 }, { 24, 4 }, { 15, 6 }, + { 29, 6 }, { 28, 5 }, { 26, 5 }, { 8, 8 }, { 19, 8 }, { 16, 7 }, + { 27, 6 }, { 13, 5 }, { 30, 5 }, { 25, 5 }, { 17, 7 }, { 2, 7 }, + { 31, 6 }, { 0, 4 }, }, { /* AC bias group 1, table 12 */ - { 0x3, 3 }, - { 0x1A, 5 }, - { 0x2D, 6 }, - { 0x38, 6 }, - { 0x28, 7 }, - { 0x395, 10 }, - { 0xE51, 12 }, - { 0x37, 6 }, - { 0xE4, 8 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0x1F, 5 }, - { 0x1E, 5 }, - { 0x17, 5 }, - { 0x3A, 6 }, - { 0x73, 7 }, - { 0x2A, 7 }, - { 0x2B, 7 }, - { 0x29, 7 }, - { 0x1CB, 9 }, - { 0x729, 11 }, - { 0x1CA1, 13 }, - { 0x1CA0, 13 }, - { 0x4, 3 }, - { 0xA, 4 }, - { 0x4, 4 }, - { 0x18, 5 }, - { 0x36, 6 }, - { 0xB, 5 }, - { 0x2C, 6 }, - { 0x19, 5 }, - { 0x3B, 6 } + { 10, 3 }, { 9, 3 }, { 25, 4 }, { 4, 7 }, { 18, 7 }, { 16, 7 }, + { 17, 7 }, { 28, 5 }, { 0, 3 }, { 23, 3 }, { 24, 4 }, { 29, 6 }, + { 2, 6 }, { 13, 5 }, { 26, 5 }, { 30, 5 }, { 1, 5 }, { 27, 6 }, + { 7, 6 }, { 3, 6 }, { 8, 8 }, { 22, 13 }, { 21, 13 }, { 6, 12 }, + { 20, 11 }, { 5, 10 }, { 19, 9 }, { 15, 7 }, { 14, 6 }, { 31, 6 }, + { 12, 5 }, { 11, 5 }, }, { /* AC bias group 1, table 13 */ - { 0x4, 3 }, - { 0x4, 4 }, - { 0x3F, 6 }, - { 0x17, 5 }, - { 0x75, 7 }, - { 0x1F5, 9 }, - { 0x7D1, 11 }, - { 0x17, 6 }, - { 0x1F6, 9 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0x1B, 5 }, - { 0x1A, 5 }, - { 0xA, 5 }, - { 0x32, 6 }, - { 0x74, 7 }, - { 0xF8, 8 }, - { 0xF9, 8 }, - { 0x1F7, 9 }, - { 0x3E9, 10 }, - { 0xFA0, 12 }, - { 0x1F43, 13 }, - { 0x1F42, 13 }, - { 0x3, 3 }, - { 0xA, 4 }, - { 0x1E, 5 }, - { 0x1C, 5 }, - { 0x3B, 6 }, - { 0x18, 5 }, - { 0x16, 6 }, - { 0x16, 5 }, - { 0x33, 6 } + { 10, 3 }, { 9, 3 }, { 1, 4 }, { 13, 5 }, { 29, 6 }, { 7, 6 }, + { 23, 3 }, { 0, 3 }, { 24, 4 }, { 30, 5 }, { 3, 5 }, { 28, 5 }, + { 14, 6 }, { 31, 6 }, { 12, 5 }, { 11, 5 }, { 26, 5 }, { 15, 7 }, + { 4, 7 }, { 27, 6 }, { 25, 5 }, { 16, 8 }, { 17, 8 }, { 20, 12 }, + { 22, 13 }, { 21, 13 }, { 6, 11 }, { 19, 10 }, { 5, 9 }, { 8, 9 }, + { 18, 9 }, { 2, 6 }, }, { /* AC bias group 1, table 14 */ - { 0x4, 3 }, - { 0x7, 4 }, - { 0x18, 5 }, - { 0x1E, 5 }, - { 0x36, 6 }, - { 0x31, 7 }, - { 0x177, 9 }, - { 0x77, 7 }, - { 0x176, 9 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0x1A, 5 }, - { 0x19, 5 }, - { 0x3A, 6 }, - { 0x19, 6 }, - { 0x5C, 7 }, - { 0xBA, 8 }, - { 0x61, 8 }, - { 0xC1, 9 }, - { 0x180, 10 }, - { 0x302, 11 }, - { 0x607, 12 }, - { 0x606, 12 }, - { 0x2, 3 }, - { 0xA, 4 }, - { 0x1F, 5 }, - { 0x1C, 5 }, - { 0x37, 6 }, - { 0x16, 5 }, - { 0x76, 7 }, - { 0xD, 5 }, - { 0x2F, 6 } + { 10, 3 }, { 9, 3 }, { 23, 3 }, { 19, 10 }, { 20, 11 }, { 22, 12 }, + { 21, 12 }, { 18, 9 }, { 17, 8 }, { 5, 7 }, { 14, 6 }, { 30, 5 }, + { 1, 4 }, { 0, 3 }, { 24, 4 }, { 28, 5 }, { 15, 7 }, { 16, 8 }, + { 8, 9 }, { 6, 9 }, { 31, 6 }, { 2, 5 }, { 12, 5 }, { 11, 5 }, + { 4, 6 }, { 27, 6 }, { 26, 5 }, { 13, 6 }, { 29, 7 }, { 7, 7 }, + { 3, 5 }, { 25, 5 }, }, { /* AC bias group 1, table 15 */ - { 0x0, 3 }, - { 0xA, 4 }, - { 0x1A, 5 }, - { 0xC, 4 }, - { 0x1D, 5 }, - { 0x39, 6 }, - { 0x78, 7 }, - { 0x5E, 7 }, - { 0x393, 11 }, - { 0x2, 3 }, - { 0x1, 3 }, - { 0x16, 5 }, - { 0xF, 5 }, - { 0x2E, 6 }, - { 0x5F, 7 }, - { 0x73, 8 }, - { 0xE5, 9 }, - { 0x1C8, 10 }, - { 0xE4A, 13 }, - { 0x1C97, 14 }, - { 0x1C96, 14 }, - { 0xE49, 13 }, - { 0xE48, 13 }, - { 0x4, 3 }, - { 0x6, 4 }, - { 0x1F, 5 }, - { 0x1B, 5 }, - { 0x1D, 6 }, - { 0x38, 6 }, - { 0x38, 7 }, - { 0x3D, 6 }, - { 0x79, 7 } + { 0, 3 }, { 10, 3 }, { 9, 3 }, { 24, 4 }, { 29, 7 }, { 17, 10 }, + { 22, 13 }, { 21, 13 }, { 18, 13 }, { 20, 14 }, { 19, 14 }, { 8, 11 }, + { 16, 9 }, { 15, 8 }, { 27, 6 }, { 12, 5 }, { 23, 3 }, { 1, 4 }, + { 11, 5 }, { 13, 6 }, { 7, 7 }, { 14, 7 }, { 3, 4 }, { 2, 5 }, + { 26, 5 }, { 28, 6 }, { 5, 6 }, { 4, 5 }, { 6, 7 }, { 31, 7 }, + { 30, 6 }, { 25, 5 }, }, { /* AC bias group 2, table 0 */ - { 0xB, 5 }, - { 0x2B, 7 }, - { 0x54, 8 }, - { 0x1B7, 9 }, - { 0x6D9, 11 }, - { 0xDB1, 12 }, - { 0xDB0, 12 }, - { 0x2, 4 }, - { 0xAB, 9 }, - { 0x9, 4 }, - { 0xA, 4 }, - { 0x7, 4 }, - { 0x8, 4 }, - { 0xF, 4 }, - { 0xC, 4 }, - { 0x3, 4 }, - { 0x1D, 5 }, - { 0x4, 4 }, - { 0xB, 4 }, - { 0x6, 4 }, - { 0x1A, 5 }, - { 0x3, 6 }, - { 0xAA, 9 }, - { 0x1, 4 }, - { 0x0, 5 }, - { 0x14, 6 }, - { 0x6C, 7 }, - { 0xDA, 8 }, - { 0x2, 6 }, - { 0x36D, 10 }, - { 0x1C, 5 }, - { 0x37, 6 } + { 24, 5 }, { 28, 6 }, { 21, 6 }, { 23, 4 }, { 7, 4 }, { 15, 4 }, + { 17, 4 }, { 25, 6 }, { 2, 8 }, { 22, 9 }, { 8, 9 }, { 1, 7 }, + { 0, 5 }, { 19, 4 }, { 11, 4 }, { 12, 4 }, { 9, 4 }, { 10, 4 }, + { 18, 4 }, { 14, 4 }, { 20, 5 }, { 26, 7 }, { 27, 8 }, { 6, 12 }, + { 5, 12 }, { 4, 11 }, { 29, 10 }, { 3, 9 }, { 31, 6 }, { 30, 5 }, + { 16, 5 }, { 13, 4 }, }, { /* AC bias group 2, table 1 */ - { 0x1D, 5 }, - { 0x4, 6 }, - { 0xB6, 8 }, - { 0x6A, 8 }, - { 0x5B9, 11 }, - { 0x16E1, 13 }, - { 0x16E0, 13 }, - { 0x7, 4 }, - { 0x16F, 9 }, - { 0xC, 4 }, - { 0xD, 4 }, - { 0x9, 4 }, - { 0x8, 4 }, - { 0xF, 4 }, - { 0xA, 4 }, - { 0x3, 4 }, - { 0x17, 5 }, - { 0x2, 4 }, - { 0x4, 4 }, - { 0x1C, 5 }, - { 0x2C, 6 }, - { 0x6B, 8 }, - { 0xB71, 12 }, - { 0x5, 4 }, - { 0x3, 5 }, - { 0x1B, 6 }, - { 0x5A, 7 }, - { 0x34, 7 }, - { 0x5, 6 }, - { 0x2DD, 10 }, - { 0x0, 4 }, - { 0xC, 5 } + { 30, 4 }, { 1, 6 }, { 28, 6 }, { 24, 5 }, { 17, 4 }, { 15, 4 }, + { 18, 4 }, { 23, 4 }, { 31, 5 }, { 27, 7 }, { 3, 8 }, { 21, 8 }, + { 25, 6 }, { 7, 4 }, { 12, 4 }, { 11, 4 }, { 14, 4 }, { 20, 6 }, + { 26, 7 }, { 2, 8 }, { 6, 13 }, { 5, 13 }, { 22, 12 }, { 4, 11 }, + { 29, 10 }, { 8, 9 }, { 16, 5 }, { 9, 4 }, { 10, 4 }, { 19, 5 }, + { 0, 5 }, { 13, 4 }, }, { /* AC bias group 2, table 2 */ - { 0x3, 4 }, - { 0x7F, 7 }, - { 0xA1, 8 }, - { 0xA0, 8 }, - { 0x20C, 10 }, - { 0x834, 12 }, - { 0x106B, 13 }, - { 0x7, 4 }, - { 0x82, 8 }, - { 0xE, 4 }, - { 0xD, 4 }, - { 0xB, 4 }, - { 0xC, 4 }, - { 0x0, 3 }, - { 0x9, 4 }, - { 0x2, 4 }, - { 0x11, 5 }, - { 0x1E, 5 }, - { 0x15, 5 }, - { 0x3E, 6 }, - { 0x40, 7 }, - { 0x41B, 11 }, - { 0x106A, 13 }, - { 0x6, 4 }, - { 0xA, 5 }, - { 0x29, 6 }, - { 0x7E, 7 }, - { 0x51, 7 }, - { 0x21, 6 }, - { 0x107, 9 }, - { 0x4, 4 }, - { 0xB, 5 } + { 13, 3 }, { 15, 4 }, { 0, 4 }, { 30, 4 }, { 24, 5 }, { 31, 5 }, + { 23, 4 }, { 7, 4 }, { 20, 7 }, { 8, 8 }, { 4, 10 }, { 5, 12 }, + { 22, 13 }, { 6, 13 }, { 21, 11 }, { 29, 9 }, { 28, 6 }, { 16, 5 }, + { 14, 4 }, { 3, 8 }, { 2, 8 }, { 27, 7 }, { 25, 6 }, { 18, 5 }, + { 11, 4 }, { 12, 4 }, { 10, 4 }, { 9, 4 }, { 17, 5 }, { 19, 6 }, + { 26, 7 }, { 1, 7 }, }, { /* AC bias group 2, table 3 */ - { 0x7, 4 }, - { 0x1B, 6 }, - { 0xF6, 8 }, - { 0xE9, 8 }, - { 0x3A1, 10 }, - { 0x740, 11 }, - { 0xE82, 12 }, - { 0x1F, 5 }, - { 0x1EF, 9 }, - { 0x1, 3 }, - { 0x2, 3 }, - { 0xB, 4 }, - { 0xC, 4 }, - { 0xD, 4 }, - { 0x8, 4 }, - { 0x1C, 5 }, - { 0x3, 5 }, - { 0x12, 5 }, - { 0x2, 5 }, - { 0x75, 7 }, - { 0x1D1, 9 }, - { 0x1D07, 13 }, - { 0x1D06, 13 }, - { 0xA, 4 }, - { 0x13, 5 }, - { 0x3B, 6 }, - { 0x1A, 6 }, - { 0x7A, 7 }, - { 0x3C, 6 }, - { 0x1EE, 9 }, - { 0x0, 4 }, - { 0xC, 5 } + { 30, 4 }, { 18, 5 }, { 16, 5 }, { 9, 3 }, { 10, 3 }, { 31, 5 }, + { 26, 6 }, { 1, 6 }, { 0, 4 }, { 14, 4 }, { 17, 5 }, { 24, 5 }, + { 23, 4 }, { 11, 4 }, { 12, 4 }, { 13, 4 }, { 15, 5 }, { 5, 11 }, + { 6, 12 }, { 22, 13 }, { 21, 13 }, { 4, 10 }, { 20, 9 }, { 3, 8 }, + { 19, 7 }, { 25, 6 }, { 28, 6 }, { 27, 7 }, { 2, 8 }, { 29, 9 }, + { 8, 9 }, { 7, 5 }, }, { /* AC bias group 2, table 4 */ - { 0xD, 4 }, - { 0x3D, 6 }, - { 0x42, 7 }, - { 0x37, 7 }, - { 0xD9, 9 }, - { 0x362, 11 }, - { 0x6C6, 12 }, - { 0x1F, 5 }, - { 0x86, 8 }, - { 0x1, 3 }, - { 0x2, 3 }, - { 0xC, 4 }, - { 0xB, 4 }, - { 0xA, 4 }, - { 0x1, 4 }, - { 0xF, 5 }, - { 0x25, 6 }, - { 0x3C, 6 }, - { 0x1A, 6 }, - { 0x87, 8 }, - { 0x1B0, 10 }, - { 0xD8F, 13 }, - { 0xD8E, 13 }, - { 0xE, 4 }, - { 0x13, 5 }, - { 0xC, 5 }, - { 0x24, 6 }, - { 0x20, 6 }, - { 0x11, 5 }, - { 0x6D, 8 }, - { 0x0, 4 }, - { 0xE, 5 } + { 30, 4 }, { 14, 4 }, { 9, 3 }, { 10, 3 }, { 25, 5 }, { 18, 6 }, + { 20, 10 }, { 5, 11 }, { 6, 12 }, { 22, 13 }, { 21, 13 }, { 4, 9 }, + { 29, 8 }, { 3, 7 }, { 31, 5 }, { 15, 5 }, { 27, 6 }, { 2, 7 }, + { 8, 8 }, { 19, 8 }, { 28, 5 }, { 26, 6 }, { 16, 6 }, { 24, 5 }, + { 13, 4 }, { 12, 4 }, { 11, 4 }, { 0, 4 }, { 23, 4 }, { 17, 6 }, + { 1, 6 }, { 7, 5 }, }, { /* AC bias group 2, table 5 */ - { 0x0, 3 }, - { 0x12, 5 }, - { 0x76, 7 }, - { 0x77, 7 }, - { 0x14D, 9 }, - { 0x533, 11 }, - { 0x14C9, 13 }, - { 0x13, 5 }, - { 0xA5, 8 }, - { 0x2, 3 }, - { 0x3, 3 }, - { 0xB, 4 }, - { 0xC, 4 }, - { 0x8, 4 }, - { 0x1A, 5 }, - { 0x2B, 6 }, - { 0x75, 7 }, - { 0x74, 7 }, - { 0xA7, 8 }, - { 0x298, 10 }, - { 0x14C8, 13 }, - { 0x14CB, 13 }, - { 0x14CA, 13 }, - { 0xF, 4 }, - { 0x1C, 5 }, - { 0x7, 5 }, - { 0x2A, 6 }, - { 0x28, 6 }, - { 0x1B, 5 }, - { 0xA4, 8 }, - { 0x2, 4 }, - { 0x6, 5 } + { 0, 3 }, { 30, 4 }, { 31, 5 }, { 25, 5 }, { 9, 3 }, { 10, 3 }, + { 13, 4 }, { 1, 5 }, { 7, 5 }, { 27, 6 }, { 29, 8 }, { 8, 8 }, + { 19, 10 }, { 20, 13 }, { 6, 13 }, { 22, 13 }, { 21, 13 }, { 5, 11 }, + { 4, 9 }, { 18, 8 }, { 26, 6 }, { 15, 6 }, { 11, 4 }, { 12, 4 }, + { 14, 5 }, { 28, 5 }, { 24, 5 }, { 17, 7 }, { 16, 7 }, { 2, 7 }, + { 3, 7 }, { 23, 4 }, }, { /* AC bias group 2, table 6 */ - { 0x2, 3 }, - { 0x1A, 5 }, - { 0x2B, 6 }, - { 0x3A, 6 }, - { 0xED, 8 }, - { 0x283, 10 }, - { 0xA0A, 12 }, - { 0x4, 5 }, - { 0xA1, 8 }, - { 0x4, 3 }, - { 0x3, 3 }, - { 0xB, 4 }, - { 0xC, 4 }, - { 0x1F, 5 }, - { 0x6, 5 }, - { 0x77, 7 }, - { 0xA3, 8 }, - { 0xA2, 8 }, - { 0x140, 9 }, - { 0x1417, 13 }, - { 0x1416, 13 }, - { 0xA09, 12 }, - { 0xA08, 12 }, - { 0x0, 3 }, - { 0x1E, 5 }, - { 0x7, 5 }, - { 0x2A, 6 }, - { 0x29, 6 }, - { 0x1C, 5 }, - { 0xEC, 8 }, - { 0x1B, 5 }, - { 0x5, 5 } + { 23, 3 }, { 7, 5 }, { 31, 5 }, { 14, 5 }, { 25, 5 }, { 0, 3 }, + { 10, 3 }, { 9, 3 }, { 18, 9 }, { 22, 12 }, { 21, 12 }, { 6, 12 }, + { 20, 13 }, { 19, 13 }, { 5, 10 }, { 8, 8 }, { 17, 8 }, { 16, 8 }, + { 27, 6 }, { 26, 6 }, { 2, 6 }, { 11, 4 }, { 12, 4 }, { 1, 5 }, + { 30, 5 }, { 28, 5 }, { 3, 6 }, { 29, 8 }, { 4, 8 }, { 15, 7 }, + { 24, 5 }, { 13, 5 }, }, { /* AC bias group 2, table 7 */ - { 0x2, 3 }, - { 0x2, 4 }, - { 0x18, 5 }, - { 0x1D, 5 }, - { 0x35, 6 }, - { 0xE4, 8 }, - { 0x1CF, 11 }, - { 0x1D, 7 }, - { 0x72, 9 }, - { 0x4, 3 }, - { 0x5, 3 }, - { 0x6, 4 }, - { 0x7, 4 }, - { 0x6, 5 }, - { 0x73, 7 }, - { 0x38, 8 }, - { 0x1CE, 11 }, - { 0x39B, 12 }, - { 0x398, 12 }, - { 0x733, 13 }, - { 0x732, 13 }, - { 0x735, 13 }, - { 0x734, 13 }, - { 0x0, 3 }, - { 0x1F, 5 }, - { 0x1B, 5 }, - { 0x34, 6 }, - { 0xF, 6 }, - { 0x1E, 5 }, - { 0xE5, 8 }, - { 0x19, 5 }, - { 0x38, 6 } + { 23, 3 }, { 1, 4 }, { 13, 5 }, { 15, 8 }, { 8, 9 }, { 18, 12 }, + { 20, 13 }, { 19, 13 }, { 22, 13 }, { 21, 13 }, { 17, 12 }, { 16, 11 }, + { 6, 11 }, { 7, 7 }, { 27, 6 }, { 0, 3 }, { 11, 4 }, { 12, 4 }, + { 9, 3 }, { 10, 3 }, { 2, 5 }, { 30, 5 }, { 26, 6 }, { 4, 6 }, + { 25, 5 }, { 31, 6 }, { 5, 8 }, { 29, 8 }, { 14, 7 }, { 3, 5 }, + { 28, 5 }, { 24, 5 }, }, { /* AC bias group 2, table 8 */ - { 0x16, 5 }, - { 0x50, 7 }, - { 0x172, 9 }, - { 0x2E7, 10 }, - { 0x1732, 13 }, - { 0x2E67, 14 }, - { 0x2E66, 14 }, - { 0x6, 4 }, - { 0x51, 7 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0xD, 4 }, - { 0xC, 4 }, - { 0x9, 4 }, - { 0x1C, 5 }, - { 0x9, 5 }, - { 0x1C, 6 }, - { 0x1D, 6 }, - { 0x5D, 7 }, - { 0xB8, 8 }, - { 0x5CD, 11 }, - { 0x1731, 13 }, - { 0x1730, 13 }, - { 0xF, 4 }, - { 0x5, 4 }, - { 0xF, 5 }, - { 0x8, 5 }, - { 0x29, 6 }, - { 0x1D, 5 }, - { 0x2F, 6 }, - { 0x8, 4 }, - { 0x15, 5 } + { 10, 3 }, { 9, 3 }, { 26, 5 }, { 15, 5 }, { 24, 4 }, { 7, 4 }, + { 16, 6 }, { 17, 6 }, { 25, 5 }, { 30, 4 }, { 13, 4 }, { 1, 7 }, + { 8, 7 }, { 27, 6 }, { 31, 5 }, { 0, 5 }, { 19, 8 }, { 2, 9 }, + { 22, 13 }, { 21, 13 }, { 4, 13 }, { 6, 14 }, { 5, 14 }, { 20, 11 }, + { 3, 10 }, { 18, 7 }, { 29, 6 }, { 12, 4 }, { 11, 4 }, { 14, 5 }, + { 28, 5 }, { 23, 4 }, }, { /* AC bias group 2, table 9 */ - { 0x9, 4 }, - { 0x21, 6 }, - { 0x40, 7 }, - { 0xAD, 8 }, - { 0x2B0, 10 }, - { 0x1589, 13 }, - { 0x1588, 13 }, - { 0x1C, 5 }, - { 0x5F, 7 }, - { 0x0, 3 }, - { 0xF, 4 }, - { 0xD, 4 }, - { 0xC, 4 }, - { 0x6, 4 }, - { 0x11, 5 }, - { 0x2A, 6 }, - { 0x57, 7 }, - { 0x5E, 7 }, - { 0x41, 7 }, - { 0x159, 9 }, - { 0x563, 11 }, - { 0x158B, 13 }, - { 0x158A, 13 }, - { 0x1, 3 }, - { 0x5, 4 }, - { 0x14, 5 }, - { 0x3B, 6 }, - { 0x2E, 6 }, - { 0x4, 4 }, - { 0x3A, 6 }, - { 0x7, 4 }, - { 0x16, 5 } + { 9, 3 }, { 23, 3 }, { 28, 4 }, { 24, 4 }, { 13, 4 }, { 30, 4 }, + { 2, 7 }, { 18, 7 }, { 1, 6 }, { 14, 5 }, { 0, 4 }, { 25, 5 }, + { 15, 6 }, { 4, 10 }, { 6, 13 }, { 5, 13 }, { 22, 13 }, { 21, 13 }, + { 20, 11 }, { 19, 9 }, { 3, 8 }, { 16, 7 }, { 31, 5 }, { 27, 6 }, + { 17, 7 }, { 8, 7 }, { 12, 4 }, { 11, 4 }, { 7, 5 }, { 29, 6 }, + { 26, 6 }, { 10, 4 }, }, { /* AC bias group 2, table 10 */ - { 0xE, 4 }, - { 0x7, 5 }, - { 0x46, 7 }, - { 0x45, 7 }, - { 0x64, 9 }, - { 0x32A, 12 }, - { 0x657, 13 }, - { 0x18, 5 }, - { 0xD, 6 }, - { 0x0, 3 }, - { 0xF, 4 }, - { 0xA, 4 }, - { 0xB, 4 }, - { 0x1A, 5 }, - { 0x36, 6 }, - { 0x47, 7 }, - { 0x44, 7 }, - { 0x18, 7 }, - { 0x33, 8 }, - { 0xCB, 10 }, - { 0x656, 13 }, - { 0x329, 12 }, - { 0x328, 12 }, - { 0x2, 3 }, - { 0x6, 4 }, - { 0x19, 5 }, - { 0xE, 5 }, - { 0x37, 6 }, - { 0x9, 4 }, - { 0xF, 5 }, - { 0x2, 4 }, - { 0x10, 5 } + { 9, 3 }, { 30, 4 }, { 17, 7 }, { 4, 9 }, { 22, 12 }, { 21, 12 }, + { 5, 12 }, { 20, 13 }, { 6, 13 }, { 19, 10 }, { 18, 8 }, { 8, 6 }, + { 1, 5 }, { 23, 3 }, { 24, 4 }, { 26, 5 }, { 29, 5 }, { 31, 5 }, + { 16, 7 }, { 3, 7 }, { 2, 7 }, { 15, 7 }, { 28, 4 }, { 11, 4 }, + { 12, 4 }, { 7, 5 }, { 25, 5 }, { 13, 5 }, { 14, 6 }, { 27, 6 }, + { 0, 4 }, { 10, 4 }, }, { /* AC bias group 2, table 11 */ - { 0x3, 3 }, - { 0x18, 5 }, - { 0x23, 6 }, - { 0x77, 7 }, - { 0x194, 9 }, - { 0x1956, 13 }, - { 0x32AF, 14 }, - { 0x3A, 6 }, - { 0x76, 7 }, - { 0x2, 3 }, - { 0x1, 3 }, - { 0x1F, 5 }, - { 0x1E, 5 }, - { 0x14, 5 }, - { 0x22, 6 }, - { 0x64, 7 }, - { 0x197, 9 }, - { 0x196, 9 }, - { 0x32B, 10 }, - { 0x654, 11 }, - { 0x32AE, 14 }, - { 0x1955, 13 }, - { 0x1954, 13 }, - { 0x0, 3 }, - { 0x9, 4 }, - { 0x1C, 5 }, - { 0x15, 5 }, - { 0x10, 5 }, - { 0xD, 4 }, - { 0x17, 5 }, - { 0x16, 5 }, - { 0x33, 6 } + { 23, 3 }, { 10, 3 }, { 9, 3 }, { 0, 3 }, { 27, 5 }, { 14, 6 }, + { 2, 6 }, { 24, 4 }, { 13, 5 }, { 26, 5 }, { 30, 5 }, { 29, 5 }, + { 1, 5 }, { 15, 7 }, { 4, 9 }, { 19, 11 }, { 22, 13 }, { 21, 13 }, + { 5, 13 }, { 20, 14 }, { 6, 14 }, { 18, 10 }, { 17, 9 }, { 16, 9 }, + { 31, 6 }, { 28, 4 }, { 25, 5 }, { 7, 6 }, { 8, 7 }, { 3, 7 }, + { 12, 5 }, { 11, 5 }, }, { /* AC bias group 2, table 12 */ - { 0x5, 3 }, - { 0x6, 4 }, - { 0x3E, 6 }, - { 0x10, 5 }, - { 0x48, 7 }, - { 0x93F, 12 }, - { 0x24FA, 14 }, - { 0x32, 6 }, - { 0x67, 7 }, - { 0x2, 3 }, - { 0x1, 3 }, - { 0x1B, 5 }, - { 0x1E, 5 }, - { 0x34, 6 }, - { 0x66, 7 }, - { 0x92, 8 }, - { 0x126, 9 }, - { 0x24E, 10 }, - { 0x49E, 11 }, - { 0x49F7, 15 }, - { 0x49F6, 15 }, - { 0x24F9, 14 }, - { 0x24F8, 14 }, - { 0x0, 3 }, - { 0x7, 4 }, - { 0x18, 5 }, - { 0x11, 5 }, - { 0x3F, 6 }, - { 0xE, 4 }, - { 0x13, 5 }, - { 0x35, 6 }, - { 0x25, 6 } + { 23, 3 }, { 10, 3 }, { 9, 3 }, { 1, 4 }, { 24, 4 }, { 3, 5 }, + { 26, 5 }, { 4, 7 }, { 15, 8 }, { 16, 9 }, { 17, 10 }, { 18, 11 }, + { 22, 14 }, { 21, 14 }, { 6, 14 }, { 20, 15 }, { 19, 15 }, { 5, 12 }, + { 31, 6 }, { 29, 5 }, { 0, 3 }, { 25, 5 }, { 7, 6 }, { 14, 7 }, + { 8, 7 }, { 13, 6 }, { 30, 6 }, { 11, 5 }, { 28, 4 }, { 12, 5 }, + { 2, 6 }, { 27, 6 }, }, { /* AC bias group 2, table 13 */ - { 0x5, 3 }, - { 0x8, 4 }, - { 0x12, 5 }, - { 0x1C, 5 }, - { 0x1C, 6 }, - { 0xEA, 9 }, - { 0x1D75, 14 }, - { 0x1E, 6 }, - { 0x66, 7 }, - { 0x1, 3 }, - { 0x2, 3 }, - { 0x1B, 5 }, - { 0x1A, 5 }, - { 0x1F, 6 }, - { 0x3B, 7 }, - { 0x74, 8 }, - { 0x1D6, 10 }, - { 0x3AF, 11 }, - { 0x1D74, 14 }, - { 0x1D77, 14 }, - { 0x1D76, 14 }, - { 0xEB9, 13 }, - { 0xEB8, 13 }, - { 0xF, 4 }, - { 0x6, 4 }, - { 0x13, 5 }, - { 0x3B, 6 }, - { 0x3A, 6 }, - { 0x0, 3 }, - { 0x18, 5 }, - { 0x32, 6 }, - { 0x67, 7 } + { 28, 3 }, { 9, 3 }, { 10, 3 }, { 24, 4 }, { 4, 6 }, { 15, 8 }, + { 5, 9 }, { 16, 10 }, { 22, 13 }, { 21, 13 }, { 18, 14 }, { 6, 14 }, + { 20, 14 }, { 19, 14 }, { 17, 11 }, { 14, 7 }, { 7, 6 }, { 13, 6 }, + { 1, 4 }, { 2, 5 }, { 25, 5 }, { 0, 3 }, { 29, 5 }, { 30, 6 }, + { 8, 7 }, { 31, 7 }, { 12, 5 }, { 11, 5 }, { 3, 5 }, { 27, 6 }, + { 26, 6 }, { 23, 4 }, }, { /* AC bias group 2, table 14 */ - { 0x4, 3 }, - { 0xA, 4 }, - { 0x1B, 5 }, - { 0xC, 4 }, - { 0xD, 5 }, - { 0xE6, 8 }, - { 0x684, 11 }, - { 0x72, 7 }, - { 0xE7, 8 }, - { 0x2, 3 }, - { 0x1, 3 }, - { 0x17, 5 }, - { 0x16, 5 }, - { 0x18, 6 }, - { 0xD1, 8 }, - { 0x1A0, 9 }, - { 0x686, 11 }, - { 0xD0F, 12 }, - { 0xD0A, 12 }, - { 0x1A17, 13 }, - { 0x1A16, 13 }, - { 0x1A1D, 13 }, - { 0x1A1C, 13 }, - { 0xF, 4 }, - { 0x1D, 5 }, - { 0xE, 5 }, - { 0x35, 6 }, - { 0x38, 6 }, - { 0x0, 3 }, - { 0xF, 5 }, - { 0x19, 6 }, - { 0x69, 7 } + { 28, 3 }, { 10, 3 }, { 9, 3 }, { 13, 6 }, { 30, 6 }, { 4, 5 }, + { 25, 5 }, { 29, 5 }, { 0, 3 }, { 1, 4 }, { 12, 5 }, { 11, 5 }, + { 3, 4 }, { 15, 9 }, { 6, 11 }, { 18, 12 }, { 20, 13 }, { 19, 13 }, + { 16, 11 }, { 22, 13 }, { 21, 13 }, { 17, 12 }, { 14, 8 }, { 31, 7 }, + { 26, 6 }, { 2, 5 }, { 27, 6 }, { 7, 7 }, { 5, 8 }, { 8, 8 }, + { 24, 5 }, { 23, 4 }, }, { /* AC bias group 2, table 15 */ - { 0x3, 3 }, - { 0xC, 4 }, - { 0x1B, 5 }, - { 0x0, 3 }, - { 0x3, 4 }, - { 0x2E, 6 }, - { 0x51, 9 }, - { 0xBC, 8 }, - { 0x53, 9 }, - { 0x4, 3 }, - { 0x2, 3 }, - { 0x16, 5 }, - { 0x15, 5 }, - { 0x15, 7 }, - { 0x50, 9 }, - { 0xA4, 10 }, - { 0x294, 12 }, - { 0x52B, 13 }, - { 0x52A, 13 }, - { 0x52D, 13 }, - { 0x52C, 13 }, - { 0x52F, 13 }, - { 0x52E, 13 }, - { 0xE, 4 }, - { 0x1A, 5 }, - { 0x4, 5 }, - { 0x28, 6 }, - { 0x29, 6 }, - { 0xF, 4 }, - { 0xB, 6 }, - { 0x5F, 7 }, - { 0xBD, 8 } + { 3, 3 }, { 25, 5 }, { 14, 9 }, { 6, 9 }, { 15, 10 }, { 16, 12 }, + { 18, 13 }, { 17, 13 }, { 20, 13 }, { 19, 13 }, { 22, 13 }, { 21, 13 }, + { 8, 9 }, { 13, 7 }, { 29, 6 }, { 4, 4 }, { 10, 3 }, { 0, 3 }, + { 9, 3 }, { 26, 6 }, { 27, 6 }, { 12, 5 }, { 11, 5 }, { 5, 6 }, + { 7, 8 }, { 31, 8 }, { 30, 7 }, { 1, 4 }, { 24, 5 }, { 2, 5 }, + { 23, 4 }, { 28, 4 }, }, { /* AC bias group 3, table 0 */ - { 0x3, 4 }, - { 0x9, 6 }, - { 0xD0, 8 }, - { 0x1A3, 9 }, - { 0x344, 10 }, - { 0xD14, 12 }, - { 0x1A2B, 13 }, - { 0x4, 4 }, - { 0x15, 7 }, - { 0x0, 3 }, - { 0xF, 4 }, - { 0xB, 4 }, - { 0xC, 4 }, - { 0xE, 4 }, - { 0x9, 4 }, - { 0x1B, 5 }, - { 0xA, 5 }, - { 0x14, 5 }, - { 0xD, 5 }, - { 0x2A, 6 }, - { 0x14, 7 }, - { 0x68B, 11 }, - { 0x1A2A, 13 }, - { 0x8, 4 }, - { 0xB, 5 }, - { 0x2B, 6 }, - { 0xB, 6 }, - { 0x69, 7 }, - { 0x35, 6 }, - { 0x8, 6 }, - { 0x7, 4 }, - { 0xC, 5 } + { 9, 3 }, { 29, 6 }, { 1, 6 }, { 20, 7 }, { 8, 7 }, { 26, 6 }, + { 0, 4 }, { 7, 4 }, { 16, 5 }, { 24, 5 }, { 31, 5 }, { 18, 5 }, + { 30, 4 }, { 23, 4 }, { 14, 4 }, { 17, 5 }, { 19, 6 }, { 25, 6 }, + { 11, 4 }, { 12, 4 }, { 2, 8 }, { 4, 10 }, { 5, 12 }, { 22, 13 }, + { 6, 13 }, { 21, 11 }, { 3, 9 }, { 27, 7 }, { 28, 6 }, { 15, 5 }, + { 13, 4 }, { 10, 4 }, }, { /* AC bias group 3, table 1 */ - { 0xA, 4 }, - { 0x3C, 6 }, - { 0x32, 7 }, - { 0x30, 7 }, - { 0xC5, 9 }, - { 0x621, 12 }, - { 0x620, 12 }, - { 0x1F, 5 }, - { 0x33, 7 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0xE, 4 }, - { 0xD, 4 }, - { 0xC, 4 }, - { 0x4, 4 }, - { 0xD, 5 }, - { 0x26, 6 }, - { 0x27, 6 }, - { 0x14, 6 }, - { 0x63, 8 }, - { 0x189, 10 }, - { 0x623, 12 }, - { 0x622, 12 }, - { 0xB, 4 }, - { 0x12, 5 }, - { 0x3D, 6 }, - { 0x22, 6 }, - { 0x15, 6 }, - { 0xB, 5 }, - { 0x23, 6 }, - { 0x7, 4 }, - { 0x10, 5 } + { 10, 3 }, { 9, 3 }, { 14, 4 }, { 18, 6 }, { 27, 6 }, { 28, 5 }, + { 3, 7 }, { 6, 12 }, { 5, 12 }, { 22, 12 }, { 21, 12 }, { 20, 10 }, + { 4, 9 }, { 19, 8 }, { 2, 7 }, { 8, 7 }, { 15, 5 }, { 30, 4 }, + { 31, 5 }, { 26, 6 }, { 29, 6 }, { 24, 5 }, { 16, 6 }, { 17, 6 }, + { 0, 4 }, { 23, 4 }, { 13, 4 }, { 12, 4 }, { 11, 4 }, { 1, 6 }, + { 25, 6 }, { 7, 5 }, }, { /* AC bias group 3, table 2 */ - { 0xF, 4 }, - { 0xC, 5 }, - { 0x43, 7 }, - { 0x10, 6 }, - { 0x44, 8 }, - { 0x114, 10 }, - { 0x455, 12 }, - { 0x18, 5 }, - { 0x23, 7 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0xE, 4 }, - { 0xD, 4 }, - { 0x9, 4 }, - { 0x19, 5 }, - { 0x9, 5 }, - { 0x17, 6 }, - { 0x16, 6 }, - { 0x42, 7 }, - { 0x8B, 9 }, - { 0x454, 12 }, - { 0x457, 12 }, - { 0x456, 12 }, - { 0xB, 4 }, - { 0x15, 5 }, - { 0xA, 5 }, - { 0x29, 6 }, - { 0x20, 6 }, - { 0xD, 5 }, - { 0x28, 6 }, - { 0x7, 4 }, - { 0x11, 5 } + { 10, 3 }, { 9, 3 }, { 3, 6 }, { 4, 8 }, { 5, 10 }, { 20, 12 }, + { 6, 12 }, { 22, 12 }, { 21, 12 }, { 19, 9 }, { 8, 7 }, { 15, 5 }, + { 25, 5 }, { 17, 6 }, { 16, 6 }, { 1, 5 }, { 28, 5 }, { 30, 4 }, + { 27, 6 }, { 18, 7 }, { 2, 7 }, { 31, 5 }, { 13, 4 }, { 29, 6 }, + { 26, 6 }, { 24, 5 }, { 23, 4 }, { 7, 5 }, { 14, 5 }, { 12, 4 }, + { 11, 4 }, { 0, 4 }, }, { /* AC bias group 3, table 3 */ - { 0x1, 3 }, - { 0x1A, 5 }, - { 0x29, 6 }, - { 0x2A, 6 }, - { 0xA0, 8 }, - { 0x285, 10 }, - { 0x1425, 13 }, - { 0x2, 5 }, - { 0x0, 7 }, - { 0x2, 3 }, - { 0x3, 3 }, - { 0xC, 4 }, - { 0xB, 4 }, - { 0x8, 4 }, - { 0x12, 5 }, - { 0x1, 6 }, - { 0x51, 7 }, - { 0x1, 7 }, - { 0x143, 9 }, - { 0x508, 11 }, - { 0x1424, 13 }, - { 0x1427, 13 }, - { 0x1426, 13 }, - { 0xF, 4 }, - { 0x1C, 5 }, - { 0x3, 5 }, - { 0x37, 6 }, - { 0x2B, 6 }, - { 0x13, 5 }, - { 0x36, 6 }, - { 0x1D, 5 }, - { 0x1, 5 } + { 8, 7 }, { 17, 7 }, { 15, 6 }, { 31, 5 }, { 7, 5 }, { 25, 5 }, + { 0, 3 }, { 9, 3 }, { 10, 3 }, { 13, 4 }, { 14, 5 }, { 28, 5 }, + { 4, 8 }, { 19, 11 }, { 20, 13 }, { 6, 13 }, { 22, 13 }, { 21, 13 }, + { 5, 10 }, { 18, 9 }, { 16, 7 }, { 2, 6 }, { 3, 6 }, { 27, 6 }, + { 12, 4 }, { 11, 4 }, { 1, 5 }, { 29, 6 }, { 26, 6 }, { 24, 5 }, + { 30, 5 }, { 23, 4 }, }, { /* AC bias group 3, table 4 */ - { 0x4, 3 }, - { 0x1F, 5 }, - { 0x3D, 6 }, - { 0x6, 5 }, - { 0x16, 7 }, - { 0x53, 9 }, - { 0x14A, 11 }, - { 0x34, 6 }, - { 0x2A, 8 }, - { 0x2, 3 }, - { 0x3, 3 }, - { 0xB, 4 }, - { 0xC, 4 }, - { 0x1C, 5 }, - { 0x37, 6 }, - { 0x17, 7 }, - { 0x2B, 8 }, - { 0x28, 8 }, - { 0xA4, 10 }, - { 0x52D, 13 }, - { 0x52C, 13 }, - { 0x52F, 13 }, - { 0x52E, 13 }, - { 0x0, 3 }, - { 0x1D, 5 }, - { 0x7, 5 }, - { 0x4, 5 }, - { 0x35, 6 }, - { 0x14, 5 }, - { 0x36, 6 }, - { 0x15, 5 }, - { 0x3C, 6 } + { 23, 3 }, { 26, 5 }, { 17, 8 }, { 18, 10 }, { 6, 11 }, { 20, 13 }, + { 19, 13 }, { 22, 13 }, { 21, 13 }, { 5, 9 }, { 8, 8 }, { 16, 8 }, + { 4, 7 }, { 15, 7 }, { 3, 5 }, { 25, 5 }, { 9, 3 }, { 10, 3 }, + { 0, 3 }, { 28, 5 }, { 30, 5 }, { 11, 4 }, { 12, 4 }, { 7, 6 }, + { 27, 6 }, { 29, 6 }, { 14, 6 }, { 13, 5 }, { 24, 5 }, { 31, 6 }, + { 2, 6 }, { 1, 5 }, }, { /* AC bias group 3, table 5 */ - { 0x4, 3 }, - { 0xA, 4 }, - { 0x7, 5 }, - { 0x1D, 5 }, - { 0x9, 6 }, - { 0x1F3, 9 }, - { 0x7C7, 11 }, - { 0x8, 6 }, - { 0x1F0, 9 }, - { 0x3, 3 }, - { 0x2, 3 }, - { 0xD, 4 }, - { 0xC, 4 }, - { 0x17, 5 }, - { 0x7D, 7 }, - { 0x1F2, 9 }, - { 0x7C6, 11 }, - { 0x7C5, 11 }, - { 0x1F12, 13 }, - { 0x3E27, 14 }, - { 0x3E26, 14 }, - { 0x1F11, 13 }, - { 0x1F10, 13 }, - { 0x0, 3 }, - { 0x1E, 5 }, - { 0x6, 5 }, - { 0x39, 6 }, - { 0x38, 6 }, - { 0x3F, 6 }, - { 0x2C, 6 }, - { 0x5, 5 }, - { 0x2D, 6 } + { 23, 3 }, { 7, 6 }, { 4, 6 }, { 30, 5 }, { 25, 5 }, { 2, 5 }, + { 10, 3 }, { 9, 3 }, { 0, 3 }, { 1, 4 }, { 29, 6 }, { 31, 6 }, + { 13, 5 }, { 12, 4 }, { 11, 4 }, { 27, 6 }, { 26, 6 }, { 3, 5 }, + { 24, 5 }, { 8, 9 }, { 22, 13 }, { 21, 13 }, { 18, 13 }, { 20, 14 }, + { 19, 14 }, { 17, 11 }, { 16, 11 }, { 6, 11 }, { 15, 9 }, { 5, 9 }, + { 14, 7 }, { 28, 6 }, }, { /* AC bias group 3, table 6 */ - { 0x2, 3 }, - { 0x7, 4 }, - { 0x18, 5 }, - { 0x3, 4 }, - { 0x5, 5 }, - { 0x35, 7 }, - { 0x4F, 9 }, - { 0x12, 7 }, - { 0x4E5, 13 }, - { 0x5, 3 }, - { 0x4, 3 }, - { 0xD, 4 }, - { 0xE, 4 }, - { 0x33, 6 }, - { 0x26, 8 }, - { 0x9D, 10 }, - { 0x4E4, 13 }, - { 0x4E7, 13 }, - { 0x4E6, 13 }, - { 0x4E1, 13 }, - { 0x4E0, 13 }, - { 0x4E3, 13 }, - { 0x4E2, 13 }, - { 0x0, 3 }, - { 0x1F, 5 }, - { 0xC, 5 }, - { 0x3D, 6 }, - { 0x3C, 6 }, - { 0x32, 6 }, - { 0x34, 7 }, - { 0x1B, 6 }, - { 0x8, 6 } + { 23, 3 }, { 31, 6 }, { 7, 7 }, { 14, 8 }, { 20, 13 }, { 19, 13 }, + { 22, 13 }, { 21, 13 }, { 16, 13 }, { 8, 13 }, { 18, 13 }, { 17, 13 }, + { 15, 10 }, { 6, 9 }, { 4, 5 }, { 3, 4 }, { 0, 3 }, { 25, 5 }, + { 29, 7 }, { 5, 7 }, { 30, 6 }, { 1, 4 }, { 10, 3 }, { 9, 3 }, + { 2, 5 }, { 28, 6 }, { 13, 6 }, { 11, 4 }, { 12, 4 }, { 27, 6 }, + { 26, 6 }, { 24, 5 }, }, { /* AC bias group 3, table 7 */ - { 0x0, 3 }, - { 0x4, 4 }, - { 0x1C, 5 }, - { 0xF, 4 }, - { 0x2, 4 }, - { 0x7, 5 }, - { 0x75, 7 }, - { 0xE8, 8 }, - { 0x1D2A, 13 }, - { 0x5, 3 }, - { 0x4, 3 }, - { 0xD, 4 }, - { 0xC, 4 }, - { 0x77, 7 }, - { 0xE96, 12 }, - { 0x3A57, 14 }, - { 0x3A56, 14 }, - { 0x3A5D, 14 }, - { 0x3A5C, 14 }, - { 0x3A5F, 14 }, - { 0x3A5E, 14 }, - { 0x1D29, 13 }, - { 0x1D28, 13 }, - { 0x3, 3 }, - { 0x6, 5 }, - { 0xA, 5 }, - { 0x2C, 7 }, - { 0x17, 6 }, - { 0x76, 7 }, - { 0x1D3, 9 }, - { 0x3A4, 10 }, - { 0x2D, 7 } + { 0, 3 }, { 4, 4 }, { 24, 5 }, { 5, 5 }, { 1, 4 }, { 25, 5 }, + { 26, 7 }, { 31, 7 }, { 27, 6 }, { 23, 3 }, { 10, 3 }, { 9, 3 }, + { 12, 4 }, { 11, 4 }, { 2, 5 }, { 7, 8 }, { 30, 10 }, { 22, 13 }, + { 21, 13 }, { 8, 13 }, { 16, 14 }, { 15, 14 }, { 14, 12 }, { 18, 14 }, + { 17, 14 }, { 20, 14 }, { 19, 14 }, { 29, 9 }, { 6, 7 }, { 28, 7 }, + { 13, 7 }, { 3, 4 }, }, { /* AC bias group 3, table 8 */ - { 0xA, 4 }, - { 0x24, 6 }, - { 0xBF, 8 }, - { 0x85, 8 }, - { 0x211, 10 }, - { 0x842, 12 }, - { 0x1087, 13 }, - { 0x18, 5 }, - { 0x20, 6 }, - { 0x1, 3 }, - { 0x2, 3 }, - { 0xE, 4 }, - { 0xD, 4 }, - { 0x7, 4 }, - { 0x13, 5 }, - { 0x25, 6 }, - { 0x5E, 7 }, - { 0x43, 7 }, - { 0xBE, 8 }, - { 0x109, 9 }, - { 0x1086, 13 }, - { 0x841, 12 }, - { 0x840, 12 }, - { 0xF, 4 }, - { 0x1, 4 }, - { 0x11, 5 }, - { 0x0, 5 }, - { 0x2E, 6 }, - { 0x19, 5 }, - { 0x1, 5 }, - { 0x6, 4 }, - { 0x16, 5 } + { 26, 5 }, { 29, 5 }, { 24, 4 }, { 9, 3 }, { 10, 3 }, { 30, 4 }, + { 13, 4 }, { 8, 6 }, { 22, 12 }, { 21, 12 }, { 5, 12 }, { 20, 13 }, + { 6, 13 }, { 4, 10 }, { 19, 9 }, { 3, 8 }, { 17, 7 }, { 25, 5 }, + { 1, 6 }, { 15, 6 }, { 14, 5 }, { 0, 4 }, { 31, 5 }, { 27, 6 }, + { 16, 7 }, { 18, 8 }, { 2, 8 }, { 7, 5 }, { 28, 5 }, { 12, 4 }, + { 11, 4 }, { 23, 4 }, }, { /* AC bias group 3, table 9 */ - { 0x2, 3 }, - { 0xF, 5 }, - { 0x6F, 7 }, - { 0x61, 7 }, - { 0x374, 10 }, - { 0x1BA8, 13 }, - { 0x3753, 14 }, - { 0x12, 5 }, - { 0x36, 6 }, - { 0x0, 3 }, - { 0x1, 3 }, - { 0xA, 4 }, - { 0xB, 4 }, - { 0x1A, 5 }, - { 0x31, 6 }, - { 0x60, 7 }, - { 0xDC, 8 }, - { 0x1BB, 9 }, - { 0x6EB, 11 }, - { 0x1BAB, 13 }, - { 0x3752, 14 }, - { 0x3755, 14 }, - { 0x3754, 14 }, - { 0xE, 4 }, - { 0x6, 4 }, - { 0x13, 5 }, - { 0xE, 5 }, - { 0x3E, 6 }, - { 0x8, 4 }, - { 0x1E, 5 }, - { 0x19, 5 }, - { 0x3F, 6 } + { 9, 3 }, { 10, 3 }, { 0, 3 }, { 24, 4 }, { 26, 5 }, { 1, 5 }, + { 28, 4 }, { 7, 5 }, { 25, 5 }, { 11, 4 }, { 12, 4 }, { 15, 7 }, + { 3, 7 }, { 14, 6 }, { 30, 5 }, { 13, 5 }, { 8, 6 }, { 16, 8 }, + { 4, 10 }, { 5, 13 }, { 20, 14 }, { 6, 14 }, { 22, 14 }, { 21, 14 }, + { 19, 13 }, { 18, 11 }, { 17, 9 }, { 2, 7 }, { 23, 4 }, { 29, 5 }, + { 27, 6 }, { 31, 6 }, }, { /* AC bias group 3, table 10 */ - { 0x3, 3 }, - { 0x1C, 5 }, - { 0x25, 6 }, - { 0x24, 6 }, - { 0x1DA, 9 }, - { 0x1DBD, 13 }, - { 0x3B7C, 14 }, - { 0x3C, 6 }, - { 0x3D, 6 }, - { 0x0, 3 }, - { 0x1, 3 }, - { 0xB, 4 }, - { 0xA, 4 }, - { 0xB, 5 }, - { 0x77, 7 }, - { 0xEC, 8 }, - { 0x3B6, 10 }, - { 0x76E, 11 }, - { 0x1DBF, 13 }, - { 0x76FB, 15 }, - { 0x76FA, 15 }, - { 0x3B79, 14 }, - { 0x3B78, 14 }, - { 0xD, 4 }, - { 0x1F, 5 }, - { 0x13, 5 }, - { 0xA, 5 }, - { 0x8, 5 }, - { 0xC, 4 }, - { 0x8, 4 }, - { 0x9, 5 }, - { 0x3A, 6 } + { 9, 3 }, { 10, 3 }, { 27, 5 }, { 30, 5 }, { 26, 5 }, { 13, 5 }, + { 0, 3 }, { 29, 4 }, { 3, 6 }, { 2, 6 }, { 25, 5 }, { 12, 4 }, + { 11, 4 }, { 28, 4 }, { 23, 4 }, { 1, 5 }, { 31, 6 }, { 15, 8 }, + { 4, 9 }, { 16, 10 }, { 17, 11 }, { 22, 14 }, { 21, 14 }, { 5, 13 }, + { 6, 14 }, { 20, 15 }, { 19, 15 }, { 18, 13 }, { 14, 7 }, { 7, 6 }, + { 8, 6 }, { 24, 5 }, }, { /* AC bias group 3, table 11 */ - { 0x5, 3 }, - { 0x3, 4 }, - { 0x4, 5 }, - { 0x10, 5 }, - { 0x8F, 8 }, - { 0x475, 11 }, - { 0x11D1, 13 }, - { 0x79, 7 }, - { 0x27, 6 }, - { 0x2, 3 }, - { 0x3, 3 }, - { 0x1, 4 }, - { 0x0, 4 }, - { 0x26, 6 }, - { 0x46, 7 }, - { 0x11C, 9 }, - { 0x477, 11 }, - { 0x8ED, 12 }, - { 0x11D0, 13 }, - { 0x11D3, 13 }, - { 0x11D2, 13 }, - { 0x11D9, 13 }, - { 0x11D8, 13 }, - { 0xD, 4 }, - { 0x1F, 5 }, - { 0x12, 5 }, - { 0x5, 5 }, - { 0x3D, 6 }, - { 0xC, 4 }, - { 0xE, 4 }, - { 0x22, 6 }, - { 0x78, 7 } + { 12, 4 }, { 11, 4 }, { 2, 5 }, { 26, 5 }, { 1, 4 }, { 9, 3 }, + { 10, 3 }, { 3, 5 }, { 30, 6 }, { 14, 7 }, { 15, 9 }, { 18, 13 }, + { 6, 13 }, { 20, 13 }, { 19, 13 }, { 5, 11 }, { 22, 13 }, { 21, 13 }, + { 17, 12 }, { 16, 11 }, { 4, 8 }, { 25, 5 }, { 13, 6 }, { 8, 6 }, + { 0, 3 }, { 28, 4 }, { 23, 4 }, { 29, 4 }, { 31, 7 }, { 7, 7 }, + { 27, 6 }, { 24, 5 }, }, { /* AC bias group 3, table 12 */ - { 0x5, 3 }, - { 0xC, 4 }, - { 0x1B, 5 }, - { 0x0, 4 }, - { 0x6, 6 }, - { 0x3E2, 10 }, - { 0x3E3D, 14 }, - { 0xF, 7 }, - { 0x34, 6 }, - { 0x3, 3 }, - { 0x2, 3 }, - { 0x1E, 5 }, - { 0x1D, 5 }, - { 0x7D, 7 }, - { 0x1F0, 9 }, - { 0x7C6, 11 }, - { 0x3E3C, 14 }, - { 0x3E3F, 14 }, - { 0x3E3E, 14 }, - { 0x3E39, 14 }, - { 0x3E38, 14 }, - { 0x3E3B, 14 }, - { 0x3E3A, 14 }, - { 0x8, 4 }, - { 0x1C, 5 }, - { 0x2, 5 }, - { 0x3F, 6 }, - { 0x35, 6 }, - { 0x9, 4 }, - { 0x1, 3 }, - { 0xE, 7 }, - { 0xF9, 8 } + { 3, 4 }, { 25, 5 }, { 4, 6 }, { 30, 7 }, { 7, 7 }, { 29, 3 }, + { 10, 3 }, { 9, 3 }, { 23, 4 }, { 28, 4 }, { 0, 3 }, { 1, 4 }, + { 8, 6 }, { 27, 6 }, { 2, 5 }, { 24, 5 }, { 12, 5 }, { 11, 5 }, + { 14, 9 }, { 5, 10 }, { 15, 11 }, { 20, 14 }, { 19, 14 }, { 22, 14 }, + { 21, 14 }, { 16, 14 }, { 6, 14 }, { 18, 14 }, { 17, 14 }, { 31, 8 }, + { 13, 7 }, { 26, 6 }, }, { /* AC bias group 3, table 13 */ - { 0x4, 3 }, - { 0xB, 4 }, - { 0x1, 4 }, - { 0xA, 4 }, - { 0x1E, 6 }, - { 0xE0, 9 }, - { 0xE1E, 13 }, - { 0x71, 8 }, - { 0x39, 7 }, - { 0x7, 3 }, - { 0x6, 3 }, - { 0xD, 5 }, - { 0xC, 5 }, - { 0x20, 7 }, - { 0x1C2, 10 }, - { 0x1C3F, 14 }, - { 0x1C3E, 14 }, - { 0xE19, 13 }, - { 0xE18, 13 }, - { 0xE1B, 13 }, - { 0xE1A, 13 }, - { 0xE1D, 13 }, - { 0xE1C, 13 }, - { 0x0, 4 }, - { 0x9, 5 }, - { 0x1D, 6 }, - { 0x1F, 6 }, - { 0x11, 6 }, - { 0x5, 4 }, - { 0x1, 3 }, - { 0x43, 8 }, - { 0x42, 8 } + { 23, 4 }, { 2, 4 }, { 29, 3 }, { 13, 7 }, { 31, 8 }, { 30, 8 }, + { 27, 6 }, { 24, 5 }, { 28, 4 }, { 12, 5 }, { 11, 5 }, { 5, 9 }, + { 14, 10 }, { 18, 13 }, { 17, 13 }, { 20, 13 }, { 19, 13 }, { 22, 13 }, + { 21, 13 }, { 6, 13 }, { 16, 14 }, { 15, 14 }, { 7, 8 }, { 8, 7 }, + { 25, 6 }, { 4, 6 }, { 26, 6 }, { 0, 3 }, { 3, 4 }, { 1, 4 }, + { 10, 3 }, { 9, 3 }, }, { /* AC bias group 3, table 14 */ - { 0x4, 3 }, - { 0xD, 4 }, - { 0x7, 4 }, - { 0x2, 3 }, - { 0x14, 5 }, - { 0x16C, 9 }, - { 0x16D1, 13 }, - { 0x2DF, 10 }, - { 0x16E, 9 }, - { 0x0, 2 }, - { 0x7, 3 }, - { 0x2C, 6 }, - { 0x2B, 6 }, - { 0x2DE, 10 }, - { 0x16D0, 13 }, - { 0x16D3, 13 }, - { 0x16D2, 13 }, - { 0x2DB5, 14 }, - { 0x2DB4, 14 }, - { 0x2DB7, 14 }, - { 0x2DB6, 14 }, - { 0x16D9, 13 }, - { 0x16D8, 13 }, - { 0xC, 5 }, - { 0x2A, 6 }, - { 0x5A, 7 }, - { 0x1B, 6 }, - { 0x1A, 6 }, - { 0x17, 5 }, - { 0xC, 4 }, - { 0x5B7, 11 }, - { 0x5B5, 11 } + { 9, 2 }, { 3, 3 }, { 23, 5 }, { 27, 6 }, { 26, 6 }, { 2, 4 }, + { 0, 3 }, { 4, 5 }, { 24, 6 }, { 12, 6 }, { 11, 6 }, { 25, 7 }, + { 5, 9 }, { 14, 13 }, { 6, 13 }, { 16, 13 }, { 15, 13 }, { 31, 11 }, + { 22, 13 }, { 21, 13 }, { 18, 14 }, { 17, 14 }, { 20, 14 }, { 19, 14 }, + { 30, 11 }, { 8, 9 }, { 13, 10 }, { 7, 10 }, { 28, 5 }, { 29, 4 }, + { 1, 4 }, { 10, 3 }, }, { /* AC bias group 3, table 15 */ - { 0x2, 2 }, - { 0xF, 4 }, - { 0x1C, 5 }, - { 0xC, 4 }, - { 0x3B, 6 }, - { 0x1AC, 9 }, - { 0x1AD8, 13 }, - { 0x35B3, 14 }, - { 0x35B2, 14 }, - { 0x1, 2 }, - { 0x0, 2 }, - { 0x69, 7 }, - { 0x68, 7 }, - { 0x35BD, 14 }, - { 0x35BC, 14 }, - { 0x35BF, 14 }, - { 0x35BE, 14 }, - { 0x35B9, 14 }, - { 0x35B8, 14 }, - { 0x35BB, 14 }, - { 0x35BA, 14 }, - { 0x35B5, 14 }, - { 0x35B4, 14 }, - { 0x1A9, 9 }, - { 0x1A8, 9 }, - { 0x35A, 10 }, - { 0xD7, 8 }, - { 0xD5, 8 }, - { 0x3A, 6 }, - { 0x1B, 5 }, - { 0x35B7, 14 }, - { 0x35B6, 14 } + { 10, 2 }, { 9, 2 }, { 0, 2 }, { 3, 4 }, { 12, 7 }, { 11, 7 }, + { 24, 9 }, { 23, 9 }, { 27, 8 }, { 5, 9 }, { 25, 10 }, { 6, 13 }, + { 8, 14 }, { 7, 14 }, { 22, 14 }, { 21, 14 }, { 31, 14 }, { 30, 14 }, + { 18, 14 }, { 17, 14 }, { 20, 14 }, { 19, 14 }, { 14, 14 }, { 13, 14 }, + { 16, 14 }, { 15, 14 }, { 26, 8 }, { 29, 5 }, { 2, 5 }, { 28, 6 }, + { 4, 6 }, { 1, 4 }, }, { /* AC bias group 4, table 0 */ - { 0x0, 3 }, - { 0x10, 5 }, - { 0x72, 7 }, - { 0x71, 7 }, - { 0x154, 9 }, - { 0xAAB, 12 }, - { 0xAA8, 12 }, - { 0x14, 5 }, - { 0x70, 7 }, - { 0x2, 3 }, - { 0x3, 3 }, - { 0xC, 4 }, - { 0xB, 4 }, - { 0x3, 4 }, - { 0x11, 5 }, - { 0x73, 7 }, - { 0x54, 7 }, - { 0xAB, 8 }, - { 0x2AB, 10 }, - { 0x1553, 13 }, - { 0x1552, 13 }, - { 0x1555, 13 }, - { 0x1554, 13 }, - { 0xD, 4 }, - { 0x1E, 5 }, - { 0x12, 5 }, - { 0x3E, 6 }, - { 0x2B, 6 }, - { 0x2, 4 }, - { 0x3F, 6 }, - { 0x1D, 5 }, - { 0x13, 5 } + { 0, 3 }, { 28, 4 }, { 13, 4 }, { 9, 3 }, { 10, 3 }, { 1, 5 }, + { 14, 5 }, { 25, 5 }, { 31, 5 }, { 7, 5 }, { 16, 7 }, { 4, 9 }, + { 6, 12 }, { 20, 13 }, { 19, 13 }, { 22, 13 }, { 21, 13 }, { 5, 12 }, + { 18, 10 }, { 17, 8 }, { 27, 6 }, { 12, 4 }, { 11, 4 }, { 23, 4 }, + { 8, 7 }, { 3, 7 }, { 2, 7 }, { 15, 7 }, { 30, 5 }, { 24, 5 }, + { 26, 6 }, { 29, 6 }, }, { /* AC bias group 4, table 1 */ - { 0x3, 3 }, - { 0x1F, 5 }, - { 0x29, 6 }, - { 0x3D, 6 }, - { 0xC, 7 }, - { 0x69, 10 }, - { 0x345, 13 }, - { 0x2, 5 }, - { 0x28, 6 }, - { 0x2, 3 }, - { 0x1, 3 }, - { 0xE, 4 }, - { 0xC, 4 }, - { 0x15, 5 }, - { 0x7, 6 }, - { 0x1B, 8 }, - { 0x6B, 10 }, - { 0x6A, 10 }, - { 0x344, 13 }, - { 0x347, 13 }, - { 0x346, 13 }, - { 0x1A1, 12 }, - { 0x1A0, 12 }, - { 0xB, 4 }, - { 0x1A, 5 }, - { 0x12, 5 }, - { 0x0, 5 }, - { 0x3C, 6 }, - { 0x8, 4 }, - { 0x1B, 5 }, - { 0x13, 5 }, - { 0x1, 5 } + { 26, 5 }, { 31, 5 }, { 7, 5 }, { 4, 7 }, { 22, 12 }, { 21, 12 }, + { 18, 13 }, { 6, 13 }, { 20, 13 }, { 19, 13 }, { 5, 10 }, { 17, 10 }, + { 16, 10 }, { 15, 8 }, { 14, 6 }, { 10, 3 }, { 9, 3 }, { 0, 3 }, + { 28, 4 }, { 25, 5 }, { 30, 5 }, { 8, 6 }, { 2, 6 }, { 13, 5 }, + { 23, 4 }, { 12, 4 }, { 24, 5 }, { 29, 5 }, { 11, 4 }, { 27, 6 }, + { 3, 6 }, { 1, 5 }, }, { /* AC bias group 4, table 2 */ - { 0x4, 3 }, - { 0x4, 4 }, - { 0x3F, 6 }, - { 0x14, 5 }, - { 0x56, 7 }, - { 0x15C, 9 }, - { 0x15D5, 13 }, - { 0x3C, 6 }, - { 0x2A, 6 }, - { 0x0, 3 }, - { 0x1, 3 }, - { 0xE, 4 }, - { 0xD, 4 }, - { 0xC, 5 }, - { 0xAF, 8 }, - { 0x2BB, 10 }, - { 0x15D4, 13 }, - { 0x15D7, 13 }, - { 0x15D6, 13 }, - { 0x15D1, 13 }, - { 0x15D0, 13 }, - { 0x15D3, 13 }, - { 0x15D2, 13 }, - { 0xB, 4 }, - { 0x19, 5 }, - { 0xD, 5 }, - { 0x3E, 6 }, - { 0x31, 6 }, - { 0x7, 4 }, - { 0x5, 4 }, - { 0x3D, 6 }, - { 0x30, 6 } + { 9, 3 }, { 10, 3 }, { 1, 4 }, { 29, 4 }, { 13, 5 }, { 25, 5 }, + { 28, 4 }, { 0, 3 }, { 3, 5 }, { 8, 6 }, { 4, 7 }, { 5, 9 }, + { 20, 13 }, { 19, 13 }, { 22, 13 }, { 21, 13 }, { 16, 13 }, { 6, 13 }, + { 18, 13 }, { 17, 13 }, { 15, 10 }, { 14, 8 }, { 23, 4 }, { 31, 6 }, + { 27, 6 }, { 24, 5 }, { 12, 4 }, { 11, 4 }, { 7, 6 }, { 30, 6 }, + { 26, 6 }, { 2, 6 }, }, { /* AC bias group 4, table 3 */ - { 0x5, 3 }, - { 0x8, 4 }, - { 0x1A, 5 }, - { 0x0, 4 }, - { 0x36, 6 }, - { 0x11, 8 }, - { 0x106, 12 }, - { 0xA, 7 }, - { 0x6E, 7 }, - { 0x2, 3 }, - { 0x3, 3 }, - { 0x3, 4 }, - { 0x2, 4 }, - { 0x6F, 7 }, - { 0x21, 9 }, - { 0x20F, 13 }, - { 0x20E, 13 }, - { 0x101, 12 }, - { 0x100, 12 }, - { 0x103, 12 }, - { 0x102, 12 }, - { 0x105, 12 }, - { 0x104, 12 }, - { 0xC, 4 }, - { 0x1E, 5 }, - { 0x3, 5 }, - { 0x3E, 6 }, - { 0x3F, 6 }, - { 0x9, 4 }, - { 0xE, 4 }, - { 0xB, 7 }, - { 0x9, 7 } + { 3, 4 }, { 18, 12 }, { 17, 12 }, { 20, 12 }, { 19, 12 }, { 22, 12 }, + { 21, 12 }, { 6, 12 }, { 16, 13 }, { 15, 13 }, { 14, 9 }, { 5, 8 }, + { 31, 7 }, { 7, 7 }, { 30, 7 }, { 25, 5 }, { 12, 4 }, { 11, 4 }, + { 9, 3 }, { 10, 3 }, { 1, 4 }, { 28, 4 }, { 0, 3 }, { 23, 4 }, + { 2, 5 }, { 4, 6 }, { 8, 7 }, { 13, 7 }, { 29, 4 }, { 24, 5 }, + { 26, 6 }, { 27, 6 }, }, { /* AC bias group 4, table 4 */ - { 0x2, 3 }, - { 0xE, 4 }, - { 0x1E, 5 }, - { 0xC, 4 }, - { 0x1F, 5 }, - { 0x6E, 7 }, - { 0xAD, 10 }, - { 0xAF, 10 }, - { 0x14, 7 }, - { 0x4, 3 }, - { 0x3, 3 }, - { 0x1A, 5 }, - { 0x17, 5 }, - { 0x2A, 8 }, - { 0x576, 13 }, - { 0xAEF, 14 }, - { 0xAEE, 14 }, - { 0x571, 13 }, - { 0x570, 13 }, - { 0x573, 13 }, - { 0x572, 13 }, - { 0x575, 13 }, - { 0x574, 13 }, - { 0x3, 4 }, - { 0x16, 5 }, - { 0x4, 5 }, - { 0x36, 6 }, - { 0xB, 6 }, - { 0xA, 4 }, - { 0x0, 3 }, - { 0x6F, 7 }, - { 0xAC, 10 } + { 29, 3 }, { 25, 5 }, { 8, 7 }, { 13, 8 }, { 31, 10 }, { 6, 10 }, + { 18, 13 }, { 17, 13 }, { 20, 13 }, { 19, 13 }, { 22, 13 }, { 21, 13 }, + { 14, 13 }, { 16, 14 }, { 15, 14 }, { 7, 10 }, { 27, 6 }, { 23, 4 }, + { 0, 3 }, { 10, 3 }, { 9, 3 }, { 28, 4 }, { 24, 5 }, { 12, 5 }, + { 3, 4 }, { 11, 5 }, { 26, 6 }, { 5, 7 }, { 30, 7 }, { 1, 4 }, + { 2, 5 }, { 4, 5 }, }, { /* AC bias group 4, table 5 */ - { 0x4, 3 }, - { 0x5, 4 }, - { 0x3, 3 }, - { 0x1, 3 }, - { 0x4, 4 }, - { 0x2F, 6 }, - { 0x526, 11 }, - { 0x1495, 13 }, - { 0xA6, 8 }, - { 0x7, 3 }, - { 0x6, 3 }, - { 0x2D, 6 }, - { 0x2C, 6 }, - { 0x1494, 13 }, - { 0x1497, 13 }, - { 0x1496, 13 }, - { 0x1491, 13 }, - { 0x1490, 13 }, - { 0x1493, 13 }, - { 0x1492, 13 }, - { 0x293D, 14 }, - { 0x293C, 14 }, - { 0x293F, 14 }, - { 0x0, 3 }, - { 0x28, 6 }, - { 0xA5, 8 }, - { 0x148, 9 }, - { 0xA7, 8 }, - { 0x2E, 6 }, - { 0x15, 5 }, - { 0xA4E, 12 }, - { 0x293E, 14 } + { 23, 3 }, { 3, 3 }, { 4, 4 }, { 1, 4 }, { 2, 3 }, { 0, 3 }, + { 24, 6 }, { 26, 9 }, { 17, 13 }, { 16, 13 }, { 19, 13 }, { 18, 13 }, + { 13, 13 }, { 7, 13 }, { 15, 13 }, { 14, 13 }, { 6, 11 }, { 30, 12 }, + { 21, 14 }, { 20, 14 }, { 31, 14 }, { 22, 14 }, { 25, 8 }, { 8, 8 }, + { 27, 8 }, { 29, 5 }, { 12, 6 }, { 11, 6 }, { 28, 6 }, { 5, 6 }, + { 10, 3 }, { 9, 3 }, }, { /* AC bias group 4, table 6 */ - { 0x4, 3 }, - { 0x5, 4 }, - { 0x3, 3 }, - { 0x1, 3 }, - { 0x4, 4 }, - { 0x2F, 6 }, - { 0x526, 11 }, - { 0x1495, 13 }, - { 0xA6, 8 }, - { 0x7, 3 }, - { 0x6, 3 }, - { 0x2D, 6 }, - { 0x2C, 6 }, - { 0x1494, 13 }, - { 0x1497, 13 }, - { 0x1496, 13 }, - { 0x1491, 13 }, - { 0x1490, 13 }, - { 0x1493, 13 }, - { 0x1492, 13 }, - { 0x293D, 14 }, - { 0x293C, 14 }, - { 0x293F, 14 }, - { 0x0, 3 }, - { 0x28, 6 }, - { 0xA5, 8 }, - { 0x148, 9 }, - { 0xA7, 8 }, - { 0x2E, 6 }, - { 0x15, 5 }, - { 0xA4E, 12 }, - { 0x293E, 14 } + { 23, 3 }, { 3, 3 }, { 4, 4 }, { 1, 4 }, { 2, 3 }, { 0, 3 }, + { 24, 6 }, { 26, 9 }, { 17, 13 }, { 16, 13 }, { 19, 13 }, { 18, 13 }, + { 13, 13 }, { 7, 13 }, { 15, 13 }, { 14, 13 }, { 6, 11 }, { 30, 12 }, + { 21, 14 }, { 20, 14 }, { 31, 14 }, { 22, 14 }, { 25, 8 }, { 8, 8 }, + { 27, 8 }, { 29, 5 }, { 12, 6 }, { 11, 6 }, { 28, 6 }, { 5, 6 }, + { 10, 3 }, { 9, 3 }, }, { /* AC bias group 4, table 7 */ - { 0x4, 3 }, - { 0x5, 4 }, - { 0x3, 3 }, - { 0x1, 3 }, - { 0x4, 4 }, - { 0x2F, 6 }, - { 0x526, 11 }, - { 0x1495, 13 }, - { 0xA6, 8 }, - { 0x7, 3 }, - { 0x6, 3 }, - { 0x2D, 6 }, - { 0x2C, 6 }, - { 0x1494, 13 }, - { 0x1497, 13 }, - { 0x1496, 13 }, - { 0x1491, 13 }, - { 0x1490, 13 }, - { 0x1493, 13 }, - { 0x1492, 13 }, - { 0x293D, 14 }, - { 0x293C, 14 }, - { 0x293F, 14 }, - { 0x0, 3 }, - { 0x28, 6 }, - { 0xA5, 8 }, - { 0x148, 9 }, - { 0xA7, 8 }, - { 0x2E, 6 }, - { 0x15, 5 }, - { 0xA4E, 12 }, - { 0x293E, 14 } + { 23, 3 }, { 3, 3 }, { 4, 4 }, { 1, 4 }, { 2, 3 }, { 0, 3 }, + { 24, 6 }, { 26, 9 }, { 17, 13 }, { 16, 13 }, { 19, 13 }, { 18, 13 }, + { 13, 13 }, { 7, 13 }, { 15, 13 }, { 14, 13 }, { 6, 11 }, { 30, 12 }, + { 21, 14 }, { 20, 14 }, { 31, 14 }, { 22, 14 }, { 25, 8 }, { 8, 8 }, + { 27, 8 }, { 29, 5 }, { 12, 6 }, { 11, 6 }, { 28, 6 }, { 5, 6 }, + { 10, 3 }, { 9, 3 }, }, { /* AC bias group 4, table 8 */ - { 0x3, 3 }, - { 0x11, 5 }, - { 0x20, 6 }, - { 0x74, 7 }, - { 0x10D, 9 }, - { 0x863, 12 }, - { 0x860, 12 }, - { 0xA, 5 }, - { 0x75, 7 }, - { 0x1, 3 }, - { 0x0, 3 }, - { 0xB, 4 }, - { 0xA, 4 }, - { 0x18, 5 }, - { 0x38, 6 }, - { 0x42, 7 }, - { 0x10F, 9 }, - { 0x10E, 9 }, - { 0x219, 10 }, - { 0x10C3, 13 }, - { 0x10C2, 13 }, - { 0x10C5, 13 }, - { 0x10C4, 13 }, - { 0xF, 4 }, - { 0x4, 4 }, - { 0x19, 5 }, - { 0xB, 5 }, - { 0x39, 6 }, - { 0x9, 4 }, - { 0x1B, 5 }, - { 0x1A, 5 }, - { 0x3B, 6 } + { 10, 3 }, { 9, 3 }, { 24, 4 }, { 7, 5 }, { 26, 5 }, { 0, 3 }, + { 2, 6 }, { 15, 7 }, { 6, 12 }, { 20, 13 }, { 19, 13 }, { 22, 13 }, + { 21, 13 }, { 5, 12 }, { 18, 10 }, { 4, 9 }, { 17, 9 }, { 16, 9 }, + { 1, 5 }, { 28, 4 }, { 12, 4 }, { 11, 4 }, { 13, 5 }, { 25, 5 }, + { 30, 5 }, { 29, 5 }, { 14, 6 }, { 27, 6 }, { 3, 7 }, { 8, 7 }, + { 31, 6 }, { 23, 4 }, }, { /* AC bias group 4, table 9 */ - { 0x5, 3 }, - { 0x1, 4 }, - { 0x3E, 6 }, - { 0x1, 5 }, - { 0xE2, 8 }, - { 0x1C6F, 13 }, - { 0x38D9, 14 }, - { 0x39, 6 }, - { 0x1F, 6 }, - { 0x2, 3 }, - { 0x1, 3 }, - { 0x9, 4 }, - { 0x8, 4 }, - { 0x0, 5 }, - { 0x70, 7 }, - { 0x1C7, 9 }, - { 0x38C, 10 }, - { 0x71A, 11 }, - { 0x38D8, 14 }, - { 0x38DB, 14 }, - { 0x38DA, 14 }, - { 0x38DD, 14 }, - { 0x38DC, 14 }, - { 0xD, 4 }, - { 0x1D, 5 }, - { 0xE, 5 }, - { 0x3F, 6 }, - { 0x3C, 6 }, - { 0xC, 4 }, - { 0x6, 4 }, - { 0x3D, 6 }, - { 0x1E, 6 } + { 13, 5 }, { 3, 5 }, { 1, 4 }, { 10, 3 }, { 9, 3 }, { 29, 4 }, + { 25, 5 }, { 31, 6 }, { 8, 6 }, { 12, 4 }, { 11, 4 }, { 0, 3 }, + { 28, 4 }, { 23, 4 }, { 14, 7 }, { 4, 8 }, { 16, 10 }, { 17, 11 }, + { 18, 14 }, { 6, 14 }, { 20, 14 }, { 19, 14 }, { 22, 14 }, { 21, 14 }, + { 5, 13 }, { 15, 9 }, { 7, 6 }, { 24, 5 }, { 27, 6 }, { 30, 6 }, + { 2, 6 }, { 26, 6 }, }, { /* AC bias group 4, table 10 */ - { 0x6, 3 }, - { 0xB, 4 }, - { 0x11, 5 }, - { 0x1E, 5 }, - { 0x74, 7 }, - { 0x3AA, 10 }, - { 0x1D5C, 13 }, - { 0x1, 6 }, - { 0x21, 6 }, - { 0x1, 3 }, - { 0x2, 3 }, - { 0x7, 4 }, - { 0x6, 4 }, - { 0x3E, 6 }, - { 0xEB, 8 }, - { 0x1D4, 9 }, - { 0xEAF, 12 }, - { 0x3ABB, 14 }, - { 0x3ABA, 14 }, - { 0x1D59, 13 }, - { 0x1D58, 13 }, - { 0x1D5B, 13 }, - { 0x1D5A, 13 }, - { 0xA, 4 }, - { 0x1C, 5 }, - { 0x1, 5 }, - { 0x3F, 6 }, - { 0x3B, 6 }, - { 0x1, 4 }, - { 0x9, 4 }, - { 0x20, 6 }, - { 0x0, 6 } + { 31, 6 }, { 7, 6 }, { 25, 5 }, { 28, 4 }, { 9, 3 }, { 10, 3 }, + { 12, 4 }, { 11, 4 }, { 30, 6 }, { 8, 6 }, { 2, 5 }, { 29, 4 }, + { 23, 4 }, { 1, 4 }, { 0, 3 }, { 24, 5 }, { 4, 7 }, { 15, 9 }, + { 5, 10 }, { 20, 13 }, { 19, 13 }, { 22, 13 }, { 21, 13 }, { 6, 13 }, + { 18, 14 }, { 17, 14 }, { 16, 12 }, { 14, 8 }, { 27, 6 }, { 3, 5 }, + { 13, 6 }, { 26, 6 }, }, { /* AC bias group 4, table 11 */ - { 0x4, 3 }, - { 0xA, 4 }, - { 0x17, 5 }, - { 0x4, 4 }, - { 0x16, 6 }, - { 0x16A, 9 }, - { 0x16B1, 13 }, - { 0x17, 7 }, - { 0x5B, 7 }, - { 0x6, 3 }, - { 0x7, 3 }, - { 0x1, 4 }, - { 0x0, 4 }, - { 0xA, 6 }, - { 0x2D7, 10 }, - { 0xB5A, 12 }, - { 0x16B0, 13 }, - { 0x16B3, 13 }, - { 0x16B2, 13 }, - { 0x2D6D, 14 }, - { 0x2D6C, 14 }, - { 0x2D6F, 14 }, - { 0x2D6E, 14 }, - { 0x6, 4 }, - { 0xA, 5 }, - { 0x4, 5 }, - { 0x2C, 6 }, - { 0x17, 6 }, - { 0x3, 4 }, - { 0x7, 4 }, - { 0x16, 7 }, - { 0xB4, 8 } + { 12, 4 }, { 11, 4 }, { 25, 5 }, { 13, 6 }, { 30, 7 }, { 7, 7 }, + { 28, 4 }, { 3, 4 }, { 24, 5 }, { 4, 6 }, { 27, 6 }, { 23, 4 }, + { 29, 4 }, { 0, 3 }, { 1, 4 }, { 26, 6 }, { 31, 8 }, { 5, 9 }, + { 16, 13 }, { 6, 13 }, { 18, 13 }, { 17, 13 }, { 15, 12 }, { 20, 14 }, + { 19, 14 }, { 22, 14 }, { 21, 14 }, { 14, 10 }, { 8, 7 }, { 2, 5 }, + { 9, 3 }, { 10, 3 }, }, { /* AC bias group 4, table 12 */ - { 0x5, 3 }, - { 0xD, 4 }, - { 0x5, 4 }, - { 0x9, 4 }, - { 0x33, 6 }, - { 0x193, 9 }, - { 0x192C, 13 }, - { 0x61, 8 }, - { 0x31, 7 }, - { 0x0, 2 }, - { 0x7, 3 }, - { 0x10, 5 }, - { 0x11, 5 }, - { 0xC8, 8 }, - { 0x192F, 13 }, - { 0x325B, 14 }, - { 0x325A, 14 }, - { 0x1929, 13 }, - { 0x1928, 13 }, - { 0x192B, 13 }, - { 0x192A, 13 }, - { 0x325D, 14 }, - { 0x325C, 14 }, - { 0x18, 5 }, - { 0x1A, 6 }, - { 0x1B, 6 }, - { 0x65, 7 }, - { 0x19, 6 }, - { 0x4, 4 }, - { 0x7, 4 }, - { 0x60, 8 }, - { 0x324, 10 } + { 9, 2 }, { 28, 4 }, { 2, 4 }, { 30, 8 }, { 7, 8 }, { 8, 7 }, + { 27, 6 }, { 24, 6 }, { 25, 6 }, { 29, 4 }, { 11, 5 }, { 12, 5 }, + { 3, 4 }, { 0, 3 }, { 23, 5 }, { 13, 8 }, { 31, 10 }, { 18, 13 }, + { 17, 13 }, { 20, 13 }, { 19, 13 }, { 6, 13 }, { 16, 14 }, { 15, 14 }, + { 22, 14 }, { 21, 14 }, { 14, 13 }, { 5, 9 }, { 26, 7 }, { 4, 6 }, + { 1, 4 }, { 10, 3 }, }, { /* AC bias group 4, table 13 */ - { 0x6, 3 }, - { 0x0, 3 }, - { 0x2, 4 }, - { 0xF, 4 }, - { 0x39, 6 }, - { 0x1D9, 9 }, - { 0x1D82, 13 }, - { 0x761, 11 }, - { 0x3BE, 10 }, - { 0x1, 2 }, - { 0x2, 2 }, - { 0xF, 6 }, - { 0xE, 6 }, - { 0x762, 11 }, - { 0x3B07, 14 }, - { 0x3B06, 14 }, - { 0x3B1D, 14 }, - { 0x3B1C, 14 }, - { 0x3B1F, 14 }, - { 0x3B1E, 14 }, - { 0x3B19, 14 }, - { 0x3B18, 14 }, - { 0x3B1B, 14 }, - { 0x38, 6 }, - { 0x1DE, 9 }, - { 0xED, 8 }, - { 0x3BF, 10 }, - { 0xEE, 8 }, - { 0x3A, 6 }, - { 0x6, 5 }, - { 0xEC0, 12 }, - { 0x3B1A, 14 } + { 1, 3 }, { 2, 4 }, { 29, 5 }, { 12, 6 }, { 11, 6 }, { 9, 2 }, + { 10, 2 }, { 0, 3 }, { 23, 6 }, { 4, 6 }, { 28, 6 }, { 30, 12 }, + { 6, 13 }, { 15, 14 }, { 14, 14 }, { 7, 11 }, { 13, 11 }, { 21, 14 }, + { 20, 14 }, { 31, 14 }, { 22, 14 }, { 17, 14 }, { 16, 14 }, { 19, 14 }, + { 18, 14 }, { 5, 9 }, { 25, 8 }, { 27, 8 }, { 24, 9 }, { 8, 10 }, + { 26, 10 }, { 3, 4 }, }, { /* AC bias group 4, table 14 */ - { 0x0, 2 }, - { 0x2, 3 }, - { 0xF, 5 }, - { 0x6, 4 }, - { 0x1C, 6 }, - { 0x1D0, 10 }, - { 0xE8C, 13 }, - { 0x1D1B, 14 }, - { 0x1D1A, 14 }, - { 0x3, 2 }, - { 0x2, 2 }, - { 0xEA, 9 }, - { 0xE9, 9 }, - { 0xE89, 13 }, - { 0xE88, 13 }, - { 0xE8B, 13 }, - { 0xE8A, 13 }, - { 0x1D65, 14 }, - { 0x1D64, 14 }, - { 0x1D67, 14 }, - { 0x1D66, 14 }, - { 0x1D61, 14 }, - { 0x1D60, 14 }, - { 0x3AD, 11 }, - { 0x1D63, 14 }, - { 0x1D62, 14 }, - { 0x1D1D, 14 }, - { 0x1D1C, 14 }, - { 0x3B, 7 }, - { 0x1D7, 10 }, - { 0x1D1F, 14 }, - { 0x1D1E, 14 } + { 0, 2 }, { 1, 3 }, { 3, 4 }, { 4, 6 }, { 5, 10 }, { 14, 13 }, + { 13, 13 }, { 16, 13 }, { 15, 13 }, { 6, 13 }, { 8, 14 }, { 7, 14 }, + { 27, 14 }, { 26, 14 }, { 31, 14 }, { 30, 14 }, { 12, 9 }, { 11, 9 }, + { 22, 14 }, { 21, 14 }, { 25, 14 }, { 24, 14 }, { 18, 14 }, { 17, 14 }, + { 20, 14 }, { 19, 14 }, { 23, 11 }, { 29, 10 }, { 28, 7 }, { 2, 5 }, + { 10, 2 }, { 9, 2 }, }, { /* AC bias group 4, table 15 */ - { 0x2, 2 }, - { 0xF, 4 }, - { 0x1C, 5 }, - { 0xC, 4 }, - { 0x3B, 6 }, - { 0x1AC, 9 }, - { 0x1AD8, 13 }, - { 0x35B3, 14 }, - { 0x35B2, 14 }, - { 0x1, 2 }, - { 0x0, 2 }, - { 0x69, 7 }, - { 0x68, 7 }, - { 0x35BD, 14 }, - { 0x35BC, 14 }, - { 0x35BF, 14 }, - { 0x35BE, 14 }, - { 0x35B9, 14 }, - { 0x35B8, 14 }, - { 0x35BB, 14 }, - { 0x35BA, 14 }, - { 0x35B5, 14 }, - { 0x35B4, 14 }, - { 0x1A9, 9 }, - { 0x1A8, 9 }, - { 0x35A, 10 }, - { 0xD7, 8 }, - { 0xD5, 8 }, - { 0x3A, 6 }, - { 0x1B, 5 }, - { 0x35B7, 14 }, - { 0x35B6, 14 } - } + { 10, 2 }, { 9, 2 }, { 0, 2 }, { 3, 4 }, { 12, 7 }, { 11, 7 }, + { 24, 9 }, { 23, 9 }, { 27, 8 }, { 5, 9 }, { 25, 10 }, { 6, 13 }, + { 8, 14 }, { 7, 14 }, { 22, 14 }, { 21, 14 }, { 31, 14 }, { 30, 14 }, + { 18, 14 }, { 17, 14 }, { 20, 14 }, { 19, 14 }, { 14, 14 }, { 13, 14 }, + { 16, 14 }, { 15, 14 }, { 26, 8 }, { 29, 5 }, { 2, 5 }, { 28, 6 }, + { 4, 6 }, { 1, 4 }, + }, }; #endif /* AVCODEC_VP3DATA_H */ diff --git a/libavcodec/vp4data.h b/libavcodec/vp4data.h index 13c7b7cd5e..156cfd011f 100644 --- a/libavcodec/vp4data.h +++ b/libavcodec/vp4data.h @@ -326,807 +326,647 @@ static const uint8_t vp4_mv_vlc[2][7][63][2] = { } }; -static const uint16_t vp4_bias[5 * 16][32][2] = { +static const uint8_t vp4_bias[5 * 16][32][2] = { { /* DC bias table 0 */ - { 0xC, 5 }, { 0x70, 7 }, { 0x1CA, 9 }, { 0x1CB, 9 }, - { 0x391, 10 }, { 0x1C9B, 13 }, { 0x3935, 14 }, { 0x71, 7 }, - { 0x3934, 14 }, { 0xB, 4 }, { 0xF, 4 }, { 0x19, 5 }, - { 0x2, 4 }, { 0x9, 4 }, { 0x3, 4 }, { 0x1D, 5 }, - { 0x18, 5 }, { 0x7, 4 }, { 0xD, 4 }, { 0x2, 3 }, - { 0x0, 3 }, { 0xA, 4 }, { 0x8, 4 }, { 0x1A, 6 }, - { 0x73, 7 }, { 0x6F, 8 }, { 0xE4C, 12 }, { 0x727, 11 }, - { 0x392, 10 }, { 0x390, 10 }, { 0x36, 7 }, { 0x6E, 8 } + { 20, 3 }, { 12, 4 }, { 14, 4 }, { 19, 3 }, { 0, 5 }, { 23, 6 }, + { 30, 7 }, { 31, 8 }, { 25, 8 }, { 17, 4 }, { 22, 4 }, { 13, 4 }, + { 21, 4 }, { 9, 4 }, { 16, 5 }, { 11, 5 }, { 18, 4 }, { 1, 7 }, + { 7, 7 }, { 29, 10 }, { 4, 10 }, { 28, 10 }, { 26, 12 }, { 8, 14 }, + { 6, 14 }, { 5, 13 }, { 27, 11 }, { 2, 9 }, { 3, 9 }, { 24, 7 }, + { 15, 5 }, { 10, 4 }, }, { /* DC bias table 1 */ - { 0x11, 5 }, { 0x7A, 7 }, { 0x83, 8 }, { 0x40, 7 }, - { 0x105, 9 }, { 0x413, 11 }, { 0x410, 11 }, { 0x7B, 7 }, - { 0x822, 12 }, { 0xE, 4 }, { 0x2, 3 }, { 0x2, 4 }, - { 0x6, 4 }, { 0xA, 4 }, { 0x7, 4 }, { 0x1F, 5 }, - { 0x17, 5 }, { 0x9, 4 }, { 0xD, 4 }, { 0x0, 3 }, - { 0xC, 4 }, { 0x3, 4 }, { 0x3C, 6 }, { 0x2C, 6 }, - { 0x21, 6 }, { 0x169, 9 }, { 0x412, 11 }, { 0x2D0, 10 }, - { 0x2D1, 10 }, { 0x823, 12 }, { 0x5B, 7 }, { 0xB5, 8 } + { 19, 3 }, { 11, 4 }, { 21, 4 }, { 10, 3 }, { 12, 4 }, { 14, 4 }, + { 3, 7 }, { 6, 11 }, { 8, 12 }, { 29, 12 }, { 26, 11 }, { 5, 11 }, + { 4, 9 }, { 2, 8 }, { 24, 6 }, { 0, 5 }, { 17, 4 }, { 13, 4 }, + { 23, 6 }, { 27, 10 }, { 28, 10 }, { 25, 9 }, { 31, 8 }, { 30, 7 }, + { 16, 5 }, { 20, 4 }, { 18, 4 }, { 9, 4 }, { 22, 6 }, { 1, 7 }, + { 7, 7 }, { 15, 5 }, }, { /* DC bias table 2 */ - { 0x17, 5 }, { 0x10, 6 }, { 0xB6, 8 }, { 0x22, 7 }, - { 0x16A, 9 }, { 0x2D0, 10 }, { 0xB48, 12 }, { 0x77, 7 }, - { 0x1692, 13 }, { 0x0, 3 }, { 0x3, 3 }, { 0x3, 4 }, - { 0x9, 4 }, { 0xC, 4 }, { 0x5, 4 }, { 0x2, 4 }, - { 0x1C, 5 }, { 0x8, 4 }, { 0xD, 4 }, { 0xF, 4 }, - { 0xA, 4 }, { 0x9, 5 }, { 0x23, 7 }, { 0x3A, 6 }, - { 0x2C, 6 }, { 0x16B, 9 }, { 0x5A5, 11 }, { 0x2D3, 10 }, - { 0x2D1, 10 }, { 0x1693, 13 }, { 0x76, 7 }, { 0xB7, 8 } + { 9, 3 }, { 15, 4 }, { 11, 4 }, { 1, 6 }, { 3, 7 }, { 22, 7 }, + { 21, 5 }, { 14, 4 }, { 10, 3 }, { 17, 4 }, { 12, 4 }, { 20, 4 }, + { 24, 6 }, { 5, 10 }, { 28, 10 }, { 6, 12 }, { 8, 13 }, { 29, 13 }, + { 26, 11 }, { 27, 10 }, { 4, 9 }, { 25, 9 }, { 2, 8 }, { 31, 8 }, + { 0, 5 }, { 13, 4 }, { 18, 4 }, { 16, 5 }, { 23, 6 }, { 30, 7 }, + { 7, 7 }, { 19, 4 }, }, { /* DC bias table 3 */ - { 0x1E, 5 }, { 0x13, 6 }, { 0xFB, 8 }, { 0x7C, 7 }, - { 0x46, 8 }, { 0x7D6, 11 }, { 0xFA9, 12 }, { 0x12, 6 }, - { 0x1F50, 13 }, { 0x1, 3 }, { 0x4, 3 }, { 0x5, 4 }, - { 0xA, 4 }, { 0xE, 4 }, { 0x7, 4 }, { 0x0, 4 }, - { 0x17, 5 }, { 0x6, 4 }, { 0xD, 4 }, { 0xC, 4 }, - { 0x1, 4 }, { 0x2C, 6 }, { 0x8F, 9 }, { 0x3F, 6 }, - { 0x2D, 6 }, { 0x1F4, 9 }, { 0x7D5, 11 }, { 0x8E, 9 }, - { 0x7D7, 11 }, { 0x1F51, 13 }, { 0x10, 6 }, { 0x22, 7 } + { 15, 4 }, { 20, 4 }, { 9, 3 }, { 30, 6 }, { 31, 7 }, { 4, 8 }, + { 27, 9 }, { 22, 9 }, { 7, 6 }, { 1, 6 }, { 11, 4 }, { 17, 4 }, + { 14, 4 }, { 10, 3 }, { 12, 4 }, { 21, 6 }, { 24, 6 }, { 16, 5 }, + { 19, 4 }, { 18, 4 }, { 13, 4 }, { 0, 5 }, { 3, 7 }, { 25, 9 }, + { 8, 13 }, { 29, 13 }, { 6, 12 }, { 26, 11 }, { 5, 11 }, { 28, 11 }, + { 2, 8 }, { 23, 6 }, }, { /* DC bias table 4 */ - { 0x1, 4 }, { 0x2B, 6 }, { 0x12, 7 }, { 0x55, 7 }, - { 0x27, 8 }, { 0x3B0, 10 }, { 0x762, 11 }, { 0x77, 7 }, - { 0x261, 12 }, { 0x2, 3 }, { 0x6, 3 }, { 0x7, 4 }, - { 0xB, 4 }, { 0xF, 4 }, { 0x8, 4 }, { 0x0, 4 }, - { 0x1C, 5 }, { 0x3, 4 }, { 0x9, 4 }, { 0x6, 4 }, - { 0x14, 5 }, { 0x54, 7 }, { 0x131, 11 }, { 0x5, 5 }, - { 0x3A, 6 }, { 0x1D9, 9 }, { 0x99, 10 }, { 0x4D, 9 }, - { 0x763, 11 }, { 0x260, 12 }, { 0x8, 6 }, { 0xED, 8 } + { 15, 4 }, { 0, 4 }, { 30, 6 }, { 2, 7 }, { 29, 12 }, { 8, 12 }, + { 22, 11 }, { 26, 10 }, { 27, 9 }, { 4, 8 }, { 23, 5 }, { 17, 4 }, + { 9, 3 }, { 19, 4 }, { 11, 4 }, { 14, 4 }, { 18, 4 }, { 20, 5 }, + { 21, 7 }, { 3, 7 }, { 1, 6 }, { 12, 4 }, { 10, 3 }, { 16, 5 }, + { 24, 6 }, { 5, 10 }, { 6, 11 }, { 28, 11 }, { 25, 9 }, { 31, 8 }, + { 7, 7 }, { 13, 4 }, }, { /* DC bias table 5 */ - { 0x4, 4 }, { 0x33, 6 }, { 0x60, 7 }, { 0x65, 7 }, - { 0xC2, 8 }, { 0x30D, 10 }, { 0x619, 11 }, { 0x64, 7 }, - { 0x1862, 13 }, { 0x4, 3 }, { 0x7, 3 }, { 0xA, 4 }, - { 0xB, 4 }, { 0xD, 4 }, { 0x6, 4 }, { 0x0, 4 }, - { 0xF, 5 }, { 0x3, 4 }, { 0x5, 4 }, { 0x2, 4 }, - { 0x2, 5 }, { 0x77, 8 }, { 0xC30, 12 }, { 0x3, 5 }, - { 0x31, 6 }, { 0x187, 9 }, { 0x1D9, 10 }, { 0xED, 9 }, - { 0x1D8, 10 }, { 0x1863, 13 }, { 0x1C, 6 }, { 0x3A, 7 } + { 15, 4 }, { 20, 5 }, { 23, 5 }, { 19, 4 }, { 17, 4 }, { 0, 4 }, + { 18, 4 }, { 14, 4 }, { 30, 6 }, { 31, 7 }, { 28, 10 }, { 26, 10 }, + { 27, 9 }, { 21, 8 }, { 16, 5 }, { 9, 3 }, { 11, 4 }, { 12, 4 }, + { 2, 7 }, { 4, 8 }, { 22, 12 }, { 8, 13 }, { 29, 13 }, { 6, 11 }, + { 5, 10 }, { 25, 9 }, { 24, 6 }, { 7, 7 }, { 3, 7 }, { 1, 6 }, + { 13, 4 }, { 10, 3 }, }, { /* DC bias table 6 */ - { 0x8, 4 }, { 0xA, 5 }, { 0x6A, 7 }, { 0x16, 6 }, - { 0x1E, 7 }, { 0x34E, 10 }, { 0x69F, 11 }, { 0x68, 7 }, - { 0xD28, 12 }, { 0x5, 3 }, { 0x7, 3 }, { 0x7, 4 }, - { 0xC, 4 }, { 0x0, 3 }, { 0x6, 4 }, { 0x1B, 5 }, - { 0x12, 5 }, { 0x2, 4 }, { 0x4, 4 }, { 0x13, 5 }, - { 0xE, 6 }, { 0x34B, 10 }, { 0x1A53, 13 }, { 0x6, 5 }, - { 0x17, 6 }, { 0x1A6, 9 }, { 0x69E, 11 }, { 0x1A4, 9 }, - { 0x695, 11 }, { 0x1A52, 13 }, { 0x6B, 7 }, { 0x1F, 7 } + { 13, 3 }, { 17, 4 }, { 23, 5 }, { 20, 6 }, { 4, 7 }, { 31, 7 }, + { 18, 4 }, { 1, 5 }, { 3, 6 }, { 24, 6 }, { 14, 4 }, { 11, 4 }, + { 0, 4 }, { 16, 5 }, { 19, 5 }, { 9, 3 }, { 12, 4 }, { 7, 7 }, + { 27, 9 }, { 8, 12 }, { 29, 13 }, { 22, 13 }, { 28, 11 }, { 21, 10 }, + { 25, 9 }, { 5, 10 }, { 26, 11 }, { 6, 11 }, { 2, 7 }, { 30, 7 }, + { 15, 5 }, { 10, 3 }, }, { /* DC bias table 7 */ - { 0xE, 4 }, { 0xF, 5 }, { 0x17, 6 }, { 0x25, 6 }, - { 0x9F, 8 }, { 0x138, 9 }, { 0x24B, 10 }, { 0x93, 8 }, - { 0x92A, 12 }, { 0x5, 3 }, { 0x0, 2 }, { 0x8, 4 }, - { 0xD, 4 }, { 0xF, 4 }, { 0x6, 4 }, { 0x4, 4 }, - { 0xE, 5 }, { 0x19, 5 }, { 0x18, 5 }, { 0xA, 5 }, - { 0x9E, 8 }, { 0x494, 11 }, { 0x1256, 13 }, { 0x26, 6 }, - { 0x16, 6 }, { 0x124, 9 }, { 0x4E5, 11 }, { 0x273, 10 }, - { 0x4E4, 11 }, { 0x1257, 13 }, { 0x48, 7 }, { 0x9D, 8 } + { 10, 2 }, { 15, 4 }, { 19, 5 }, { 24, 6 }, { 2, 6 }, { 14, 4 }, + { 16, 5 }, { 1, 5 }, { 11, 4 }, { 30, 7 }, { 25, 9 }, { 21, 11 }, + { 8, 12 }, { 22, 13 }, { 29, 13 }, { 6, 10 }, { 7, 8 }, { 3, 6 }, + { 23, 6 }, { 5, 9 }, { 28, 11 }, { 26, 11 }, { 27, 10 }, { 31, 8 }, + { 20, 8 }, { 4, 8 }, { 9, 3 }, { 18, 5 }, { 17, 5 }, { 12, 4 }, + { 0, 4 }, { 13, 4 }, }, { /* DC bias table 8 */ - { 0x4, 4 }, { 0x2C, 6 }, { 0x50, 7 }, { 0x1E, 7 }, - { 0x71, 9 }, { 0xE1, 10 }, { 0xE0, 10 }, { 0x1D, 7 }, - { 0x6, 6 }, { 0x7, 3 }, { 0x6, 3 }, { 0x7, 4 }, - { 0x5, 4 }, { 0x6, 4 }, { 0x15, 5 }, { 0x0, 5 }, - { 0x29, 6 }, { 0x2, 5 }, { 0x6, 5 }, { 0x1, 5 }, - { 0x23, 6 }, { 0x1F, 7 }, { 0x39, 8 }, { 0x9, 4 }, - { 0x2, 4 }, { 0x10, 5 }, { 0x7, 6 }, { 0x2D, 6 }, - { 0x2F, 6 }, { 0x2E, 6 }, { 0x22, 6 }, { 0x51, 7 } + { 15, 5 }, { 19, 5 }, { 17, 5 }, { 8, 6 }, { 26, 6 }, { 24, 4 }, + { 18, 5 }, { 6, 10 }, { 5, 10 }, { 4, 9 }, { 22, 8 }, { 7, 7 }, + { 3, 7 }, { 21, 7 }, { 0, 4 }, { 12, 4 }, { 13, 4 }, { 11, 4 }, + { 25, 5 }, { 30, 6 }, { 20, 6 }, { 23, 4 }, { 2, 7 }, { 31, 7 }, + { 16, 6 }, { 14, 5 }, { 1, 6 }, { 27, 6 }, { 29, 6 }, { 28, 6 }, + { 10, 3 }, { 9, 3 }, }, { /* DC bias table 9 */ - { 0x8, 4 }, { 0x2F, 6 }, { 0x51, 7 }, { 0x50, 7 }, - { 0x2ED, 10 }, { 0x5D9, 11 }, { 0x5D8, 11 }, { 0xBA, 8 }, - { 0x5C, 7 }, { 0x7, 3 }, { 0x6, 3 }, { 0x9, 4 }, - { 0x6, 4 }, { 0x7, 4 }, { 0x16, 5 }, { 0x5, 5 }, - { 0x2B, 6 }, { 0x6, 5 }, { 0xA, 5 }, { 0x1, 5 }, - { 0xF, 6 }, { 0x1D, 7 }, { 0x177, 9 }, { 0x4, 4 }, - { 0x1, 4 }, { 0x4, 5 }, { 0x1, 6 }, { 0x2A, 6 }, - { 0xB, 5 }, { 0x29, 6 }, { 0x0, 6 }, { 0x1C, 7 } + { 30, 6 }, { 26, 6 }, { 19, 5 }, { 24, 4 }, { 25, 5 }, { 15, 5 }, + { 17, 5 }, { 31, 7 }, { 21, 7 }, { 20, 6 }, { 23, 4 }, { 18, 5 }, + { 28, 5 }, { 12, 4 }, { 13, 4 }, { 0, 4 }, { 11, 4 }, { 3, 7 }, + { 2, 7 }, { 29, 6 }, { 27, 6 }, { 16, 6 }, { 14, 5 }, { 8, 7 }, + { 7, 8 }, { 6, 11 }, { 5, 11 }, { 4, 10 }, { 22, 9 }, { 1, 6 }, + { 10, 3 }, { 9, 3 }, }, { /* DC bias table 10 */ - { 0xA, 4 }, { 0x3C, 6 }, { 0x74, 7 }, { 0x4E, 7 }, - { 0x26D, 10 }, { 0x4D9, 11 }, { 0x4D8, 11 }, { 0x9A, 8 }, - { 0x4C, 7 }, { 0x0, 2 }, { 0x6, 3 }, { 0x8, 4 }, - { 0x7, 4 }, { 0x6, 4 }, { 0x16, 5 }, { 0x8, 5 }, - { 0x2E, 6 }, { 0xA, 5 }, { 0xB, 5 }, { 0x3D, 6 }, - { 0x24, 6 }, { 0xEB, 8 }, { 0x137, 9 }, { 0x1F, 5 }, - { 0x1C, 5 }, { 0x3B, 6 }, { 0x12, 6 }, { 0x25, 6 }, - { 0x2F, 6 }, { 0x13, 6 }, { 0x4F, 7 }, { 0xEA, 8 } + { 9, 2 }, { 15, 5 }, { 26, 6 }, { 29, 6 }, { 17, 5 }, { 18, 5 }, + { 13, 4 }, { 12, 4 }, { 11, 4 }, { 20, 6 }, { 27, 6 }, { 8, 7 }, + { 7, 8 }, { 6, 11 }, { 5, 11 }, { 4, 10 }, { 22, 9 }, { 3, 7 }, + { 30, 7 }, { 0, 4 }, { 14, 5 }, { 16, 6 }, { 28, 6 }, { 10, 3 }, + { 24, 5 }, { 2, 7 }, { 31, 8 }, { 21, 8 }, { 25, 6 }, { 1, 6 }, + { 19, 6 }, { 23, 5 }, }, { /* DC bias table 11 */ - { 0xA, 4 }, { 0xA, 5 }, { 0x3, 6 }, { 0x16, 6 }, - { 0x9, 8 }, { 0x21, 10 }, { 0x20, 10 }, { 0xB3, 8 }, - { 0x58, 7 }, { 0x7, 3 }, { 0x6, 3 }, { 0x7, 4 }, - { 0x6, 4 }, { 0x4, 4 }, { 0x13, 5 }, { 0x2, 5 }, - { 0x25, 6 }, { 0x0, 5 }, { 0x3, 5 }, { 0x2D, 6 }, - { 0x5D, 7 }, { 0xB2, 8 }, { 0x11, 9 }, { 0x8, 4 }, - { 0x2, 4 }, { 0x6, 5 }, { 0x17, 6 }, { 0x2F, 6 }, - { 0x7, 5 }, { 0x24, 6 }, { 0x5C, 7 }, { 0x5, 7 } + { 17, 5 }, { 6, 10 }, { 5, 10 }, { 22, 9 }, { 4, 8 }, { 31, 7 }, + { 2, 6 }, { 15, 5 }, { 18, 5 }, { 24, 4 }, { 25, 5 }, { 28, 5 }, + { 13, 4 }, { 1, 5 }, { 3, 6 }, { 26, 6 }, { 12, 4 }, { 11, 4 }, + { 23, 4 }, { 29, 6 }, { 16, 6 }, { 14, 5 }, { 0, 4 }, { 8, 7 }, + { 21, 8 }, { 7, 8 }, { 19, 6 }, { 30, 7 }, { 20, 7 }, { 27, 6 }, + { 10, 3 }, { 9, 3 }, }, { /* DC bias table 12 */ - { 0xB, 4 }, { 0x13, 5 }, { 0x1F, 6 }, { 0x31, 6 }, - { 0x21, 7 }, { 0x295, 10 }, { 0x528, 11 }, { 0xA4, 8 }, - { 0x3C, 7 }, { 0x0, 2 }, { 0x7, 3 }, { 0x6, 4 }, - { 0x5, 4 }, { 0x1B, 5 }, { 0x12, 5 }, { 0x32, 6 }, - { 0x1D, 6 }, { 0x2B, 6 }, { 0x30, 6 }, { 0x1C, 6 }, - { 0x3D, 7 }, { 0x14B, 9 }, { 0x529, 11 }, { 0x8, 4 }, - { 0x1A, 5 }, { 0x33, 6 }, { 0x11, 6 }, { 0x2A, 6 }, - { 0x9, 5 }, { 0x28, 6 }, { 0x53, 7 }, { 0x20, 7 } + { 9, 2 }, { 31, 7 }, { 4, 7 }, { 26, 6 }, { 28, 5 }, { 12, 4 }, + { 11, 4 }, { 19, 6 }, { 16, 6 }, { 8, 7 }, { 20, 7 }, { 2, 6 }, + { 23, 4 }, { 14, 5 }, { 1, 5 }, { 29, 6 }, { 7, 8 }, { 6, 11 }, + { 22, 11 }, { 5, 10 }, { 21, 9 }, { 30, 7 }, { 27, 6 }, { 17, 6 }, + { 0, 4 }, { 18, 6 }, { 3, 6 }, { 15, 6 }, { 25, 6 }, { 24, 5 }, + { 13, 5 }, { 10, 3 }, }, { /* DC bias table 13 */ - { 0xE, 4 }, { 0x15, 5 }, { 0x29, 6 }, { 0x3F, 6 }, - { 0x4D, 7 }, { 0x2F1, 10 }, { 0x5E0, 11 }, { 0x92, 8 }, - { 0x48, 7 }, { 0x0, 2 }, { 0x6, 3 }, { 0x6, 4 }, - { 0x5, 4 }, { 0x4, 4 }, { 0xF, 5 }, { 0x2E, 6 }, - { 0x1D, 6 }, { 0x28, 6 }, { 0x27, 6 }, { 0x5F, 7 }, - { 0xBD, 8 }, { 0x179, 9 }, { 0x5E1, 11 }, { 0x8, 4 }, - { 0x1E, 5 }, { 0x2D, 6 }, { 0x1C, 6 }, { 0x2C, 6 }, - { 0x3E, 6 }, { 0x25, 6 }, { 0x4C, 7 }, { 0x93, 8 } + { 9, 2 }, { 13, 4 }, { 12, 4 }, { 11, 4 }, { 26, 6 }, { 16, 6 }, + { 14, 5 }, { 23, 4 }, { 8, 7 }, { 7, 8 }, { 31, 8 }, { 29, 6 }, + { 30, 7 }, { 4, 7 }, { 18, 6 }, { 17, 6 }, { 2, 6 }, { 1, 5 }, + { 27, 6 }, { 25, 6 }, { 15, 6 }, { 6, 11 }, { 22, 11 }, { 5, 10 }, + { 21, 9 }, { 20, 8 }, { 19, 7 }, { 10, 3 }, { 0, 4 }, { 24, 5 }, + { 28, 6 }, { 3, 6 }, }, { /* DC bias table 14 */ - { 0xC, 4 }, { 0x17, 5 }, { 0x35, 6 }, { 0x13, 5 }, - { 0x21, 6 }, { 0xAD, 8 }, { 0x6F1, 11 }, { 0x1BD, 9 }, - { 0xD9, 8 }, { 0x0, 2 }, { 0x7, 3 }, { 0x7, 4 }, - { 0x6, 4 }, { 0x4, 4 }, { 0x11, 5 }, { 0x2A, 6 }, - { 0x6E, 7 }, { 0x25, 6 }, { 0x24, 6 }, { 0x57, 7 }, - { 0xD8, 8 }, { 0x379, 10 }, { 0x6F0, 11 }, { 0x5, 4 }, - { 0x16, 5 }, { 0x29, 6 }, { 0x6D, 7 }, { 0x28, 6 }, - { 0x34, 6 }, { 0x20, 6 }, { 0xDF, 8 }, { 0xAC, 8 } + { 9, 2 }, { 13, 4 }, { 23, 4 }, { 12, 4 }, { 11, 4 }, { 29, 6 }, + { 4, 6 }, { 14, 5 }, { 18, 6 }, { 17, 6 }, { 3, 5 }, { 27, 6 }, + { 25, 6 }, { 15, 6 }, { 31, 8 }, { 5, 8 }, { 19, 7 }, { 24, 5 }, + { 1, 5 }, { 0, 4 }, { 28, 6 }, { 2, 6 }, { 20, 8 }, { 8, 8 }, + { 26, 7 }, { 16, 7 }, { 22, 11 }, { 6, 11 }, { 21, 10 }, { 7, 9 }, + { 30, 8 }, { 10, 3 }, }, { /* DC bias table 15 */ - { 0x0, 3 }, { 0x1A, 5 }, { 0x6, 5 }, { 0x19, 5 }, - { 0x30, 6 }, { 0x5A, 7 }, { 0x18A, 9 }, { 0x2DD, 10 }, - { 0x18B, 9 }, { 0x1, 2 }, { 0x7, 3 }, { 0xA, 4 }, - { 0x9, 4 }, { 0x2, 4 }, { 0x10, 5 }, { 0x2E, 6 }, - { 0x6E, 7 }, { 0x2C, 6 }, { 0xE, 6 }, { 0x5E, 7 }, - { 0xC4, 8 }, { 0x5B9, 11 }, { 0x5B8, 11 }, { 0x11, 5 }, - { 0x36, 6 }, { 0x5F, 7 }, { 0x1E, 7 }, { 0x63, 7 }, - { 0x6F, 7 }, { 0x1F, 7 }, { 0xB6, 8 }, { 0x16F, 9 } + { 0, 3 }, { 13, 4 }, { 2, 5 }, { 18, 6 }, { 26, 7 }, { 29, 7 }, + { 9, 2 }, { 14, 5 }, { 23, 5 }, { 12, 4 }, { 11, 4 }, { 17, 6 }, + { 5, 7 }, { 30, 8 }, { 22, 11 }, { 21, 11 }, { 7, 10 }, { 31, 9 }, + { 15, 6 }, { 19, 7 }, { 25, 7 }, { 4, 6 }, { 20, 8 }, { 6, 9 }, + { 8, 9 }, { 27, 7 }, { 3, 5 }, { 1, 5 }, { 24, 6 }, { 16, 7 }, + { 28, 7 }, { 10, 3 }, }, { /* AC bias group 1, table 0 */ - { 0x6, 5 }, { 0x1E, 7 }, { 0x1CC, 9 }, { 0x1CE, 9 }, - { 0x734, 11 }, { 0x1CD5, 13 }, { 0x1CD4, 13 }, { 0x18, 5 }, - { 0xE6B, 12 }, { 0x0, 3 }, { 0xF, 4 }, { 0x6, 4 }, - { 0x7, 4 }, { 0xD, 4 }, { 0x8, 4 }, { 0x2, 4 }, - { 0x19, 5 }, { 0x5, 4 }, { 0xB, 4 }, { 0xA, 4 }, - { 0x1D, 5 }, { 0x27, 6 }, { 0x1CF, 9 }, { 0x4, 4 }, - { 0x38, 6 }, { 0xE, 6 }, { 0x4C, 7 }, { 0x1F, 7 }, - { 0x4D, 7 }, { 0x39B, 10 }, { 0x12, 5 }, { 0x72, 7 } + { 9, 3 }, { 15, 4 }, { 0, 5 }, { 25, 6 }, { 1, 7 }, { 27, 7 }, + { 23, 4 }, { 17, 4 }, { 11, 4 }, { 12, 4 }, { 14, 4 }, { 30, 5 }, + { 26, 7 }, { 28, 7 }, { 21, 6 }, { 19, 4 }, { 18, 4 }, { 7, 5 }, + { 16, 5 }, { 13, 4 }, { 24, 6 }, { 31, 7 }, { 2, 9 }, { 4, 11 }, + { 6, 13 }, { 5, 13 }, { 8, 12 }, { 29, 10 }, { 3, 9 }, { 22, 9 }, + { 20, 5 }, { 10, 4 }, }, { /* AC bias group 1, table 1 */ - { 0x9, 5 }, { 0x4B, 7 }, { 0x90, 8 }, { 0x91, 8 }, - { 0x745, 11 }, { 0x1D11, 13 }, { 0x1D10, 13 }, { 0x19, 5 }, - { 0xE89, 12 }, { 0x0, 3 }, { 0xF, 4 }, { 0x8, 4 }, - { 0x7, 4 }, { 0xD, 4 }, { 0xB, 4 }, { 0x2, 4 }, - { 0x1C, 5 }, { 0x3, 4 }, { 0xA, 4 }, { 0x5, 4 }, - { 0x18, 5 }, { 0x10, 6 }, { 0x1D0, 9 }, { 0x6, 4 }, - { 0x3B, 6 }, { 0x11, 6 }, { 0x4A, 7 }, { 0x49, 7 }, - { 0xE9, 8 }, { 0x3A3, 10 }, { 0x13, 5 }, { 0x75, 7 } + { 9, 3 }, { 15, 4 }, { 17, 4 }, { 21, 6 }, { 25, 6 }, { 0, 5 }, + { 19, 4 }, { 23, 4 }, { 12, 4 }, { 11, 4 }, { 2, 8 }, { 3, 8 }, + { 27, 7 }, { 26, 7 }, { 1, 7 }, { 30, 5 }, { 18, 4 }, { 14, 4 }, + { 20, 5 }, { 7, 5 }, { 13, 4 }, { 16, 5 }, { 22, 9 }, { 6, 13 }, + { 5, 13 }, { 8, 12 }, { 4, 11 }, { 29, 10 }, { 28, 8 }, { 31, 7 }, + { 24, 6 }, { 10, 4 }, }, { /* AC bias group 1, table 2 */ - { 0x19, 5 }, { 0x74, 7 }, { 0x1D, 8 }, { 0xEA, 8 }, - { 0x73, 10 }, { 0x1CA, 12 }, { 0x396, 13 }, { 0x1C, 5 }, - { 0xE4, 11 }, { 0x2, 3 }, { 0x1, 3 }, { 0x7, 4 }, - { 0x8, 4 }, { 0xD, 4 }, { 0x9, 4 }, { 0x1F, 5 }, - { 0x18, 5 }, { 0x0, 4 }, { 0x6, 4 }, { 0x1E, 5 }, - { 0x3B, 6 }, { 0xEB, 8 }, { 0x397, 13 }, { 0xA, 4 }, - { 0x2, 5 }, { 0x2C, 6 }, { 0x5B, 7 }, { 0x5A, 7 }, - { 0xF, 7 }, { 0x38, 9 }, { 0x17, 5 }, { 0x6, 6 } + { 17, 4 }, { 24, 5 }, { 31, 6 }, { 29, 9 }, { 8, 11 }, { 5, 12 }, + { 6, 13 }, { 22, 13 }, { 4, 10 }, { 2, 8 }, { 28, 7 }, { 10, 3 }, + { 9, 3 }, { 18, 4 }, { 11, 4 }, { 12, 4 }, { 14, 4 }, { 23, 4 }, + { 25, 6 }, { 27, 7 }, { 26, 7 }, { 30, 5 }, { 16, 5 }, { 0, 5 }, + { 13, 4 }, { 7, 5 }, { 1, 7 }, { 3, 8 }, { 21, 8 }, { 20, 6 }, + { 19, 5 }, { 15, 5 }, }, { /* AC bias group 1, table 3 */ - { 0x1E, 5 }, { 0x6F, 7 }, { 0xAE, 8 }, { 0xAF, 8 }, - { 0x187, 10 }, { 0x61B, 12 }, { 0xC35, 13 }, { 0x1A, 5 }, - { 0x30C, 11 }, { 0x2, 3 }, { 0x1, 3 }, { 0x7, 4 }, - { 0x8, 4 }, { 0xE, 4 }, { 0x9, 4 }, { 0x1F, 5 }, - { 0x14, 5 }, { 0x0, 4 }, { 0x1, 4 }, { 0x19, 5 }, - { 0x2A, 6 }, { 0x60, 8 }, { 0xC34, 13 }, { 0xB, 4 }, - { 0xD, 5 }, { 0x36, 6 }, { 0x6E, 7 }, { 0x56, 7 }, - { 0x31, 7 }, { 0xC2, 9 }, { 0x18, 5 }, { 0x19, 6 } + { 17, 4 }, { 18, 4 }, { 10, 3 }, { 9, 3 }, { 21, 8 }, { 29, 9 }, + { 8, 11 }, { 22, 13 }, { 6, 13 }, { 5, 12 }, { 4, 10 }, { 28, 7 }, + { 31, 6 }, { 24, 5 }, { 11, 4 }, { 12, 4 }, { 14, 4 }, { 16, 5 }, + { 20, 6 }, { 27, 7 }, { 2, 8 }, { 3, 8 }, { 23, 4 }, { 30, 5 }, + { 19, 5 }, { 7, 5 }, { 25, 6 }, { 26, 7 }, { 1, 7 }, { 13, 4 }, + { 0, 5 }, { 15, 5 }, }, { /* AC bias group 1, table 4 */ - { 0x1, 4 }, { 0x2C, 6 }, { 0x5, 7 }, { 0x15, 7 }, - { 0x8, 8 }, { 0x97, 12 }, { 0x12D, 13 }, { 0x17, 5 }, - { 0x4A, 11 }, { 0x3, 3 }, { 0x2, 3 }, { 0x9, 4 }, - { 0xA, 4 }, { 0xE, 4 }, { 0x8, 4 }, { 0x1F, 5 }, - { 0x7, 5 }, { 0x1E, 5 }, { 0x1B, 5 }, { 0x4, 5 }, - { 0x5A, 7 }, { 0x24, 10 }, { 0x12C, 13 }, { 0xC, 4 }, - { 0x6, 5 }, { 0x0, 5 }, { 0x3, 6 }, { 0x5B, 7 }, - { 0x14, 7 }, { 0x13, 9 }, { 0x1A, 5 }, { 0xB, 6 } + { 25, 5 }, { 4, 8 }, { 21, 10 }, { 8, 11 }, { 22, 13 }, { 6, 13 }, + { 5, 12 }, { 29, 9 }, { 2, 7 }, { 26, 6 }, { 0, 4 }, { 19, 5 }, + { 28, 7 }, { 3, 7 }, { 31, 6 }, { 24, 5 }, { 16, 5 }, { 10, 3 }, + { 9, 3 }, { 14, 4 }, { 11, 4 }, { 12, 4 }, { 1, 6 }, { 20, 7 }, + { 27, 7 }, { 7, 5 }, { 23, 4 }, { 30, 5 }, { 18, 5 }, { 13, 4 }, + { 17, 5 }, { 15, 5 }, }, { /* AC bias group 1, table 5 */ - { 0x4, 4 }, { 0x0, 5 }, { 0x17, 7 }, { 0x63, 7 }, - { 0x18B, 9 }, { 0x310, 10 }, { 0xC44, 12 }, { 0x19, 5 }, - { 0x623, 11 }, { 0x4, 3 }, { 0x3, 3 }, { 0xA, 4 }, - { 0xB, 4 }, { 0xD, 4 }, { 0x3, 4 }, { 0x1C, 5 }, - { 0x3, 5 }, { 0xA, 5 }, { 0x4, 5 }, { 0x3, 6 }, - { 0x18A, 9 }, { 0x188B, 13 }, { 0x188A, 13 }, { 0xF, 4 }, - { 0xB, 5 }, { 0x2, 5 }, { 0xA, 6 }, { 0x2, 6 }, - { 0x16, 7 }, { 0x189, 9 }, { 0x1D, 5 }, { 0x30, 6 } + { 1, 5 }, { 27, 6 }, { 19, 6 }, { 25, 5 }, { 16, 5 }, { 18, 5 }, + { 26, 6 }, { 28, 7 }, { 2, 7 }, { 14, 4 }, { 0, 4 }, { 17, 5 }, + { 24, 5 }, { 10, 3 }, { 9, 3 }, { 11, 4 }, { 12, 4 }, { 31, 6 }, + { 5, 10 }, { 6, 12 }, { 22, 13 }, { 21, 13 }, { 8, 11 }, { 29, 9 }, + { 20, 9 }, { 4, 9 }, { 3, 7 }, { 7, 5 }, { 13, 4 }, { 15, 5 }, + { 30, 5 }, { 23, 4 }, }, { /* AC bias group 1, table 6 */ - { 0xD, 4 }, { 0x3, 5 }, { 0x77, 7 }, { 0xD, 6 }, - { 0x82, 8 }, { 0x20D, 10 }, { 0x830, 12 }, { 0x19, 5 }, - { 0x419, 11 }, { 0x3, 3 }, { 0x2, 3 }, { 0xA, 4 }, - { 0x9, 4 }, { 0xB, 4 }, { 0x2, 4 }, { 0x11, 5 }, - { 0x39, 6 }, { 0x2, 5 }, { 0x21, 6 }, { 0x40, 7 }, - { 0x1063, 13 }, { 0x20C5, 14 }, { 0x20C4, 14 }, { 0xF, 4 }, - { 0x18, 5 }, { 0x7, 5 }, { 0x38, 6 }, { 0xC, 6 }, - { 0x76, 7 }, { 0x107, 9 }, { 0x0, 4 }, { 0x3A, 6 } + { 30, 4 }, { 17, 5 }, { 1, 5 }, { 14, 4 }, { 27, 6 }, { 3, 6 }, + { 25, 5 }, { 10, 3 }, { 9, 3 }, { 19, 7 }, { 4, 8 }, { 6, 12 }, + { 22, 14 }, { 21, 14 }, { 20, 13 }, { 8, 11 }, { 5, 10 }, { 29, 9 }, + { 18, 6 }, { 15, 5 }, { 12, 4 }, { 11, 4 }, { 13, 4 }, { 24, 5 }, + { 7, 5 }, { 0, 4 }, { 26, 6 }, { 16, 6 }, { 31, 6 }, { 28, 7 }, + { 2, 7 }, { 23, 4 }, }, { /* AC bias group 1, table 7 */ - { 0xF, 4 }, { 0x1C, 5 }, { 0x36, 6 }, { 0x8, 5 }, - { 0x61, 7 }, { 0x91, 8 }, { 0x243, 10 }, { 0x9, 5 }, - { 0x120, 9 }, { 0x5, 3 }, { 0x3, 3 }, { 0x8, 4 }, - { 0x5, 4 }, { 0x1, 4 }, { 0x13, 5 }, { 0x31, 6 }, - { 0x76, 7 }, { 0x60, 7 }, { 0x93, 8 }, { 0x909, 12 }, - { 0x908, 12 }, { 0x90B, 12 }, { 0x90A, 12 }, { 0x1, 3 }, - { 0x1A, 5 }, { 0x19, 5 }, { 0x3A, 6 }, { 0x25, 6 }, - { 0x77, 7 }, { 0x92, 8 }, { 0x0, 4 }, { 0x37, 6 } + { 30, 4 }, { 13, 4 }, { 23, 3 }, { 3, 5 }, { 7, 5 }, { 12, 4 }, + { 10, 3 }, { 11, 4 }, { 8, 9 }, { 20, 12 }, { 19, 12 }, { 22, 12 }, + { 21, 12 }, { 6, 10 }, { 5, 8 }, { 29, 8 }, { 18, 8 }, { 27, 6 }, + { 14, 5 }, { 9, 3 }, { 17, 7 }, { 4, 7 }, { 15, 6 }, { 25, 5 }, + { 24, 5 }, { 2, 6 }, { 31, 6 }, { 1, 5 }, { 26, 6 }, { 16, 7 }, + { 28, 7 }, { 0, 4 }, }, { /* AC bias group 1, table 8 */ - { 0x1F, 5 }, { 0x79, 7 }, { 0xF1, 8 }, { 0xF0, 8 }, - { 0x11B, 10 }, { 0x469, 12 }, { 0x468, 12 }, { 0x3B, 6 }, - { 0x22, 7 }, { 0x5, 3 }, { 0x4, 3 }, { 0x7, 4 }, - { 0x5, 4 }, { 0x6, 4 }, { 0x1C, 5 }, { 0x1, 5 }, - { 0x35, 6 }, { 0x3D, 6 }, { 0x3A, 6 }, { 0x10, 6 }, - { 0x47, 8 }, { 0x8C, 9 }, { 0x235, 11 }, { 0x1, 3 }, - { 0x1, 4 }, { 0x19, 5 }, { 0x0, 5 }, { 0x30, 6 }, - { 0x9, 5 }, { 0x31, 6 }, { 0x1B, 5 }, { 0x34, 6 } + { 26, 5 }, { 15, 5 }, { 24, 4 }, { 23, 3 }, { 19, 6 }, { 8, 7 }, + { 21, 9 }, { 6, 12 }, { 5, 12 }, { 22, 11 }, { 4, 10 }, { 20, 8 }, + { 28, 5 }, { 12, 4 }, { 13, 4 }, { 11, 4 }, { 10, 3 }, { 9, 3 }, + { 27, 6 }, { 29, 6 }, { 25, 5 }, { 31, 6 }, { 16, 6 }, { 30, 5 }, + { 14, 5 }, { 18, 6 }, { 7, 6 }, { 3, 8 }, { 2, 8 }, { 1, 7 }, + { 17, 6 }, { 0, 5 }, }, { /* AC bias group 1, table 9 */ - { 0x3, 4 }, { 0x1B, 6 }, { 0xF3, 8 }, { 0xFD, 8 }, - { 0x3C9, 10 }, { 0xF20, 12 }, { 0x1E42, 13 }, { 0x3D, 6 }, - { 0xFC, 8 }, { 0x6, 3 }, { 0x4, 3 }, { 0x2, 4 }, - { 0x0, 4 }, { 0x1, 4 }, { 0x17, 5 }, { 0x3E, 6 }, - { 0x1A, 6 }, { 0x39, 6 }, { 0x2B, 6 }, { 0x78, 7 }, - { 0x1E5, 9 }, { 0x791, 11 }, { 0x1E43, 13 }, { 0x2, 3 }, - { 0x7, 4 }, { 0x1D, 5 }, { 0xC, 5 }, { 0x38, 6 }, - { 0x14, 5 }, { 0x7F, 7 }, { 0x16, 5 }, { 0x2A, 6 } + { 12, 4 }, { 13, 4 }, { 11, 4 }, { 0, 4 }, { 23, 3 }, { 26, 5 }, + { 16, 6 }, { 1, 6 }, { 24, 4 }, { 10, 3 }, { 28, 5 }, { 31, 6 }, + { 18, 6 }, { 30, 5 }, { 14, 5 }, { 9, 3 }, { 27, 6 }, { 17, 6 }, + { 25, 5 }, { 19, 7 }, { 5, 12 }, { 6, 13 }, { 22, 13 }, { 21, 11 }, + { 4, 10 }, { 20, 9 }, { 2, 8 }, { 7, 6 }, { 15, 6 }, { 8, 8 }, + { 3, 8 }, { 29, 7 }, }, { /* AC bias group 1, table 10 */ - { 0x7, 4 }, { 0x39, 6 }, { 0x51, 7 }, { 0x78, 7 }, - { 0x3CB, 10 }, { 0xF29, 12 }, { 0x1E51, 13 }, { 0x3D, 6 }, - { 0xF3, 8 }, { 0x6, 3 }, { 0x4, 3 }, { 0x2, 4 }, - { 0x0, 4 }, { 0x1, 4 }, { 0x17, 5 }, { 0x3E, 6 }, - { 0x7F, 7 }, { 0x2B, 6 }, { 0x7E, 7 }, { 0x50, 7 }, - { 0x1E4, 9 }, { 0x795, 11 }, { 0x1E50, 13 }, { 0x2, 3 }, - { 0x6, 4 }, { 0x1D, 5 }, { 0x6, 5 }, { 0x38, 6 }, - { 0x7, 5 }, { 0x29, 6 }, { 0x16, 5 }, { 0x2A, 6 } + { 12, 4 }, { 13, 4 }, { 11, 4 }, { 26, 5 }, { 28, 5 }, { 23, 3 }, + { 24, 4 }, { 0, 4 }, { 10, 3 }, { 19, 7 }, { 2, 7 }, { 29, 6 }, + { 31, 6 }, { 17, 6 }, { 30, 5 }, { 14, 5 }, { 9, 3 }, { 27, 6 }, + { 1, 6 }, { 25, 5 }, { 3, 7 }, { 20, 9 }, { 22, 13 }, { 6, 13 }, + { 5, 12 }, { 21, 11 }, { 4, 10 }, { 8, 8 }, { 7, 6 }, { 15, 6 }, + { 18, 7 }, { 16, 7 }, }, { /* AC bias group 1, table 11 */ - { 0x8, 4 }, { 0x3B, 6 }, { 0x1D, 7 }, { 0x72, 7 }, - { 0x1CC, 9 }, { 0x734, 11 }, { 0x1CD5, 13 }, { 0x3A, 6 }, - { 0x1C, 7 }, { 0x6, 3 }, { 0x5, 3 }, { 0x2, 4 }, - { 0x1, 4 }, { 0x0, 4 }, { 0x12, 5 }, { 0x3E, 6 }, - { 0x7F, 7 }, { 0x1E, 6 }, { 0x7E, 7 }, { 0xE7, 8 }, - { 0x39B, 10 }, { 0xE6B, 12 }, { 0x1CD4, 13 }, { 0x2, 3 }, - { 0x6, 4 }, { 0x1E, 5 }, { 0xE, 5 }, { 0x38, 6 }, - { 0x6, 5 }, { 0xF, 6 }, { 0x13, 5 }, { 0x1F, 6 } + { 13, 4 }, { 12, 4 }, { 11, 4 }, { 28, 5 }, { 8, 7 }, { 2, 7 }, + { 29, 6 }, { 23, 3 }, { 24, 4 }, { 26, 5 }, { 17, 6 }, { 31, 6 }, + { 0, 4 }, { 14, 5 }, { 30, 5 }, { 10, 3 }, { 9, 3 }, { 27, 6 }, + { 3, 7 }, { 4, 9 }, { 5, 11 }, { 22, 13 }, { 6, 13 }, { 21, 12 }, + { 20, 10 }, { 19, 8 }, { 7, 6 }, { 1, 6 }, { 25, 5 }, { 15, 6 }, + { 18, 7 }, { 16, 7 }, }, { /* AC bias group 1, table 12 */ - { 0xD, 4 }, { 0x3F, 6 }, { 0x73, 7 }, { 0xC, 6 }, - { 0xE4, 8 }, { 0x72B, 11 }, { 0xE54, 12 }, { 0x3A, 6 }, - { 0x1A, 7 }, { 0x5, 3 }, { 0x4, 3 }, { 0x2, 4 }, - { 0x1, 4 }, { 0x0, 4 }, { 0x7, 5 }, { 0x38, 6 }, - { 0x76, 7 }, { 0x77, 7 }, { 0x1B, 7 }, { 0x1CB, 9 }, - { 0x394, 10 }, { 0x1CAB, 13 }, { 0x1CAA, 13 }, { 0x2, 3 }, - { 0x6, 4 }, { 0x1E, 5 }, { 0xE, 5 }, { 0x3E, 6 }, - { 0x19, 5 }, { 0x1F, 6 }, { 0x18, 5 }, { 0x1E, 6 } + { 13, 4 }, { 12, 4 }, { 11, 4 }, { 3, 6 }, { 8, 7 }, { 18, 7 }, + { 14, 5 }, { 23, 3 }, { 24, 4 }, { 26, 5 }, { 31, 6 }, { 29, 6 }, + { 10, 3 }, { 9, 3 }, { 30, 5 }, { 28, 5 }, { 0, 4 }, { 15, 6 }, + { 4, 8 }, { 20, 10 }, { 6, 12 }, { 22, 13 }, { 21, 13 }, { 5, 11 }, + { 19, 9 }, { 2, 7 }, { 7, 6 }, { 16, 7 }, { 17, 7 }, { 25, 5 }, + { 27, 6 }, { 1, 6 }, }, { /* AC bias group 1, table 13 */ - { 0xE, 4 }, { 0x7, 5 }, { 0xC, 6 }, { 0x1C, 6 }, - { 0xBD, 8 }, { 0x2F3, 10 }, { 0xBC9, 12 }, { 0x1F, 6 }, - { 0xBF, 8 }, { 0x6, 3 }, { 0x4, 3 }, { 0x2, 4 }, - { 0x1, 4 }, { 0x1E, 5 }, { 0x1, 5 }, { 0xD, 6 }, - { 0x3A, 7 }, { 0x3B, 7 }, { 0xBE, 8 }, { 0x178, 9 }, - { 0x5E5, 11 }, { 0x1791, 13 }, { 0x1790, 13 }, { 0x2, 3 }, - { 0x6, 4 }, { 0x1F, 5 }, { 0x16, 5 }, { 0x0, 5 }, - { 0x15, 5 }, { 0x2E, 6 }, { 0x14, 5 }, { 0x1E, 6 } + { 27, 5 }, { 14, 5 }, { 12, 4 }, { 11, 4 }, { 2, 6 }, { 15, 6 }, + { 1, 5 }, { 23, 3 }, { 24, 4 }, { 3, 6 }, { 16, 7 }, { 17, 7 }, + { 31, 6 }, { 7, 6 }, { 10, 3 }, { 30, 5 }, { 28, 5 }, { 26, 5 }, + { 29, 6 }, { 19, 9 }, { 22, 13 }, { 21, 13 }, { 6, 12 }, { 20, 11 }, + { 5, 10 }, { 4, 8 }, { 18, 8 }, { 8, 8 }, { 9, 3 }, { 0, 4 }, + { 13, 5 }, { 25, 5 }, }, { /* AC bias group 1, table 14 */ - { 0x0, 3 }, { 0x1B, 5 }, { 0x31, 6 }, { 0x3A, 6 }, - { 0x60, 7 }, { 0x6F, 9 }, { 0x1B9, 11 }, { 0xE, 6 }, - { 0x1A, 7 }, { 0x5, 3 }, { 0x3, 3 }, { 0x2, 4 }, - { 0x1F, 5 }, { 0x1A, 5 }, { 0x39, 6 }, { 0xC, 6 }, - { 0xC3, 8 }, { 0xC2, 8 }, { 0x36, 8 }, { 0xDD, 10 }, - { 0x370, 12 }, { 0x6E3, 13 }, { 0x6E2, 13 }, { 0x2, 3 }, - { 0x8, 4 }, { 0x1E, 5 }, { 0x19, 5 }, { 0x3B, 6 }, - { 0x12, 5 }, { 0xF, 6 }, { 0x13, 5 }, { 0x38, 6 } + { 0, 3 }, { 11, 4 }, { 15, 6 }, { 8, 7 }, { 18, 8 }, { 20, 12 }, + { 22, 13 }, { 21, 13 }, { 6, 11 }, { 19, 10 }, { 5, 9 }, { 7, 6 }, + { 29, 6 }, { 23, 3 }, { 10, 3 }, { 24, 4 }, { 28, 5 }, { 30, 5 }, + { 9, 3 }, { 4, 7 }, { 17, 8 }, { 16, 8 }, { 2, 6 }, { 26, 5 }, + { 13, 5 }, { 1, 5 }, { 31, 6 }, { 14, 6 }, { 3, 6 }, { 27, 6 }, + { 25, 5 }, { 12, 5 }, }, { /* AC bias group 1, table 15 */ - { 0x2, 3 }, { 0x0, 4 }, { 0x3, 5 }, { 0x1C, 5 }, - { 0x32, 6 }, { 0x1C, 7 }, { 0x199, 9 }, { 0x4, 6 }, - { 0xCD, 8 }, { 0x4, 3 }, { 0x3, 3 }, { 0x1B, 5 }, - { 0x1A, 5 }, { 0x3D, 6 }, { 0x67, 7 }, { 0x3B, 8 }, - { 0x198, 9 }, { 0x75, 9 }, { 0xE9, 10 }, { 0x3A1, 12 }, - { 0x3A0, 12 }, { 0x3A3, 12 }, { 0x3A2, 12 }, { 0x5, 3 }, - { 0x2, 4 }, { 0x1F, 5 }, { 0x1D, 5 }, { 0x3C, 6 }, - { 0x18, 5 }, { 0xF, 6 }, { 0x6, 5 }, { 0x5, 6 } + { 1, 4 }, { 7, 6 }, { 31, 6 }, { 2, 5 }, { 24, 4 }, { 30, 5 }, + { 5, 7 }, { 20, 12 }, { 19, 12 }, { 22, 12 }, { 21, 12 }, { 18, 10 }, + { 17, 9 }, { 15, 8 }, { 29, 6 }, { 0, 3 }, { 10, 3 }, { 9, 3 }, + { 23, 3 }, { 28, 5 }, { 4, 6 }, { 16, 9 }, { 6, 9 }, { 8, 8 }, + { 14, 7 }, { 12, 5 }, { 11, 5 }, { 3, 5 }, { 26, 5 }, { 27, 6 }, + { 13, 6 }, { 25, 5 }, }, { /* AC bias group 2, table 0 */ - { 0x4, 5 }, { 0xF5, 8 }, { 0x182, 9 }, { 0x60F, 11 }, - { 0x1839, 13 }, { 0x1838, 13 }, { 0x183B, 13 }, { 0x13, 5 }, - { 0xC0, 8 }, { 0x3, 3 }, { 0x2, 3 }, { 0xB, 4 }, - { 0xA, 4 }, { 0xE, 4 }, { 0x8, 4 }, { 0x1, 4 }, - { 0x12, 5 }, { 0x1F, 5 }, { 0x0, 4 }, { 0x6, 5 }, - { 0x7B, 7 }, { 0x306, 10 }, { 0x183A, 13 }, { 0xD, 4 }, - { 0x7, 5 }, { 0x31, 6 }, { 0xA, 6 }, { 0x61, 7 }, - { 0x3C, 6 }, { 0xF4, 8 }, { 0x19, 5 }, { 0xB, 6 } + { 18, 4 }, { 15, 4 }, { 0, 5 }, { 26, 6 }, { 31, 6 }, { 19, 5 }, + { 24, 5 }, { 10, 3 }, { 9, 3 }, { 14, 4 }, { 16, 5 }, { 7, 5 }, + { 12, 4 }, { 11, 4 }, { 8, 8 }, { 2, 9 }, { 21, 10 }, { 5, 13 }, + { 4, 13 }, { 22, 13 }, { 6, 13 }, { 3, 11 }, { 27, 7 }, { 25, 6 }, + { 30, 5 }, { 23, 4 }, { 13, 4 }, { 28, 6 }, { 29, 8 }, { 1, 8 }, + { 20, 7 }, { 17, 5 }, }, { /* AC bias group 2, table 1 */ - { 0xA, 5 }, { 0x1A, 7 }, { 0x1D8, 9 }, { 0x3B3, 10 }, - { 0xECA, 12 }, { 0x1D96, 13 }, { 0x3B2F, 14 }, { 0x14, 5 }, - { 0x36, 8 }, { 0x4, 3 }, { 0x3, 3 }, { 0xC, 4 }, - { 0xB, 4 }, { 0x0, 3 }, { 0x4, 4 }, { 0x1C, 5 }, - { 0x5, 5 }, { 0x15, 5 }, { 0x7, 5 }, { 0x17, 6 }, - { 0x37, 8 }, { 0x764, 11 }, { 0x3B2E, 14 }, { 0xF, 4 }, - { 0x1A, 5 }, { 0x3A, 6 }, { 0xC, 6 }, { 0x77, 7 }, - { 0x4, 5 }, { 0xED, 8 }, { 0x1B, 5 }, { 0x16, 6 } + { 13, 3 }, { 28, 5 }, { 16, 5 }, { 26, 6 }, { 1, 7 }, { 8, 8 }, + { 20, 8 }, { 18, 5 }, { 14, 4 }, { 0, 5 }, { 31, 6 }, { 19, 6 }, + { 10, 3 }, { 9, 3 }, { 7, 5 }, { 17, 5 }, { 12, 4 }, { 11, 4 }, + { 24, 5 }, { 30, 5 }, { 15, 5 }, { 25, 6 }, { 2, 9 }, { 21, 11 }, + { 4, 12 }, { 5, 13 }, { 22, 14 }, { 6, 14 }, { 3, 10 }, { 29, 8 }, + { 27, 7 }, { 23, 4 }, }, { /* AC bias group 2, table 2 */ - { 0x1A, 5 }, { 0x2D, 7 }, { 0x58, 8 }, { 0x1F4, 9 }, - { 0x7D4, 11 }, { 0x1F55, 13 }, { 0x1F54, 13 }, { 0x14, 5 }, - { 0x59, 8 }, { 0x4, 3 }, { 0x3, 3 }, { 0xB, 4 }, - { 0xC, 4 }, { 0xE, 4 }, { 0x4, 4 }, { 0x15, 5 }, - { 0x5, 5 }, { 0x7, 5 }, { 0x4, 5 }, { 0x7C, 7 }, - { 0x3EB, 10 }, { 0x1F57, 13 }, { 0x1F56, 13 }, { 0x0, 3 }, - { 0x1B, 5 }, { 0x3F, 6 }, { 0xD, 6 }, { 0xC, 6 }, - { 0xA, 5 }, { 0xFB, 8 }, { 0x1E, 5 }, { 0x17, 6 } + { 23, 3 }, { 18, 5 }, { 16, 5 }, { 27, 6 }, { 26, 6 }, { 17, 5 }, + { 14, 4 }, { 28, 5 }, { 2, 8 }, { 8, 8 }, { 1, 7 }, { 31, 6 }, + { 10, 3 }, { 9, 3 }, { 7, 5 }, { 15, 5 }, { 11, 4 }, { 12, 4 }, + { 0, 5 }, { 24, 5 }, { 13, 4 }, { 30, 5 }, { 19, 7 }, { 3, 9 }, + { 4, 11 }, { 6, 13 }, { 5, 13 }, { 22, 13 }, { 21, 13 }, { 20, 10 }, + { 29, 8 }, { 25, 6 }, }, { /* AC bias group 2, table 3 */ - { 0x0, 4 }, { 0x75, 7 }, { 0x4A, 8 }, { 0x97, 9 }, - { 0x25B, 11 }, { 0x969, 13 }, { 0x968, 13 }, { 0xB, 5 }, - { 0xE8, 8 }, { 0x5, 3 }, { 0x4, 3 }, { 0x7, 4 }, - { 0xC, 4 }, { 0xD, 4 }, { 0x1, 4 }, { 0xA, 5 }, - { 0x39, 6 }, { 0x3B, 6 }, { 0x18, 6 }, { 0xE9, 8 }, - { 0x12C, 10 }, { 0x96B, 13 }, { 0x96A, 13 }, { 0x1, 3 }, - { 0x1F, 5 }, { 0x8, 5 }, { 0x19, 6 }, { 0x13, 6 }, - { 0xD, 5 }, { 0x24, 7 }, { 0x1E, 5 }, { 0x38, 6 } + { 0, 4 }, { 14, 4 }, { 23, 3 }, { 25, 5 }, { 29, 7 }, { 2, 8 }, + { 20, 10 }, { 6, 13 }, { 5, 13 }, { 22, 13 }, { 21, 13 }, { 4, 11 }, + { 3, 9 }, { 27, 6 }, { 15, 5 }, { 7, 5 }, { 18, 6 }, { 26, 6 }, + { 28, 5 }, { 11, 4 }, { 10, 3 }, { 9, 3 }, { 12, 4 }, { 13, 4 }, + { 31, 6 }, { 16, 6 }, { 8, 8 }, { 19, 8 }, { 1, 7 }, { 17, 6 }, + { 30, 5 }, { 24, 5 }, }, { /* AC bias group 2, table 4 */ - { 0x4, 4 }, { 0x14, 6 }, { 0x6E, 8 }, { 0x57, 8 }, - { 0x159, 10 }, { 0x562, 12 }, { 0xAC7, 13 }, { 0xB, 5 }, - { 0x6F, 8 }, { 0x6, 3 }, { 0x5, 3 }, { 0x8, 4 }, - { 0x9, 4 }, { 0x7, 4 }, { 0x1E, 5 }, { 0x2, 5 }, - { 0x7, 6 }, { 0x6, 6 }, { 0x2A, 7 }, { 0xAD, 9 }, - { 0xAC6, 13 }, { 0x561, 12 }, { 0x560, 12 }, { 0x1, 3 }, - { 0x1F, 5 }, { 0xC, 5 }, { 0x39, 6 }, { 0x1A, 6 }, - { 0x0, 4 }, { 0x36, 7 }, { 0x1D, 5 }, { 0x38, 6 } + { 28, 4 }, { 15, 5 }, { 17, 6 }, { 16, 6 }, { 23, 3 }, { 0, 4 }, + { 1, 6 }, { 18, 7 }, { 22, 12 }, { 21, 12 }, { 5, 12 }, { 20, 13 }, + { 6, 13 }, { 4, 10 }, { 19, 9 }, { 3, 8 }, { 7, 5 }, { 25, 5 }, + { 27, 6 }, { 29, 7 }, { 2, 8 }, { 8, 8 }, { 13, 4 }, { 11, 4 }, + { 12, 4 }, { 10, 3 }, { 9, 3 }, { 31, 6 }, { 26, 6 }, { 30, 5 }, + { 14, 5 }, { 24, 5 }, }, { /* AC bias group 2, table 5 */ - { 0x7, 4 }, { 0x1B, 6 }, { 0xE, 7 }, { 0xD, 7 }, - { 0x3E1, 10 }, { 0x1F06, 13 }, { 0x3E0F, 14 }, { 0x2, 5 }, - { 0xF9, 8 }, { 0x5, 3 }, { 0x6, 3 }, { 0x8, 4 }, - { 0x9, 4 }, { 0x4, 4 }, { 0xC, 5 }, { 0x1A, 6 }, - { 0xF, 7 }, { 0xC, 7 }, { 0x1F1, 9 }, { 0x7C0, 11 }, - { 0x3E0E, 14 }, { 0x1F05, 13 }, { 0x1F04, 13 }, { 0x1, 3 }, - { 0x0, 4 }, { 0x1C, 5 }, { 0x3F, 6 }, { 0x3D, 6 }, - { 0x5, 4 }, { 0x7D, 7 }, { 0x1D, 5 }, { 0x3C, 6 } + { 24, 4 }, { 7, 5 }, { 17, 7 }, { 3, 7 }, { 2, 7 }, { 16, 7 }, + { 23, 3 }, { 13, 4 }, { 28, 4 }, { 14, 5 }, { 15, 6 }, { 1, 6 }, + { 0, 4 }, { 11, 4 }, { 12, 4 }, { 9, 3 }, { 10, 3 }, { 25, 5 }, + { 30, 5 }, { 31, 6 }, { 27, 6 }, { 19, 11 }, { 22, 13 }, { 21, 13 }, + { 5, 13 }, { 20, 14 }, { 6, 14 }, { 4, 10 }, { 18, 9 }, { 8, 8 }, + { 29, 7 }, { 26, 6 }, }, { /* AC bias group 2, table 6 */ - { 0xF, 4 }, { 0xA, 5 }, { 0x71, 7 }, { 0x6, 6 }, - { 0x1C2, 9 }, { 0x702, 11 }, { 0x1C0E, 13 }, { 0x2, 5 }, - { 0xE, 7 }, { 0x5, 3 }, { 0x4, 3 }, { 0x6, 4 }, - { 0x7, 4 }, { 0x1D, 5 }, { 0x17, 6 }, { 0xF, 7 }, - { 0x1C3, 9 }, { 0x1C1, 9 }, { 0x380, 10 }, { 0x381F, 14 }, - { 0x381E, 14 }, { 0x1C0D, 13 }, { 0x1C0C, 13 }, { 0x1, 3 }, - { 0x4, 4 }, { 0x18, 5 }, { 0x1, 5 }, { 0x0, 5 }, - { 0xD, 4 }, { 0x16, 6 }, { 0x19, 5 }, { 0x39, 6 } + { 27, 5 }, { 26, 5 }, { 7, 5 }, { 3, 6 }, { 8, 7 }, { 15, 7 }, + { 23, 3 }, { 24, 4 }, { 1, 5 }, { 29, 6 }, { 14, 6 }, { 11, 4 }, + { 12, 4 }, { 10, 3 }, { 9, 3 }, { 25, 5 }, { 30, 5 }, { 28, 4 }, + { 18, 10 }, { 5, 11 }, { 22, 13 }, { 21, 13 }, { 6, 13 }, { 20, 14 }, + { 19, 14 }, { 17, 9 }, { 4, 9 }, { 16, 9 }, { 2, 7 }, { 31, 6 }, + { 13, 5 }, { 0, 4 }, }, { /* AC bias group 2, table 7 */ - { 0x2, 3 }, { 0x1E, 5 }, { 0x3B, 6 }, { 0xD, 5 }, - { 0x61, 7 }, { 0x1FA, 9 }, { 0x1FB5, 13 }, { 0x31, 6 }, - { 0xFC, 8 }, { 0x4, 3 }, { 0x5, 3 }, { 0x1, 4 }, - { 0x7, 4 }, { 0x3A, 6 }, { 0x60, 7 }, { 0x3F7, 10 }, - { 0x7EC, 11 }, { 0x1FB7, 13 }, { 0x3F6C, 14 }, { 0x7EDB, 15 }, - { 0x7EDA, 15 }, { 0x3F69, 14 }, { 0x3F68, 14 }, { 0x1, 3 }, - { 0x0, 4 }, { 0x19, 5 }, { 0x3E, 6 }, { 0x39, 6 }, - { 0xD, 4 }, { 0x38, 6 }, { 0xC, 5 }, { 0x7F, 7 } + { 24, 4 }, { 11, 4 }, { 23, 3 }, { 0, 3 }, { 30, 5 }, { 3, 5 }, + { 12, 4 }, { 9, 3 }, { 10, 3 }, { 14, 7 }, { 4, 7 }, { 7, 6 }, + { 25, 5 }, { 28, 4 }, { 29, 6 }, { 27, 6 }, { 13, 6 }, { 2, 6 }, + { 1, 5 }, { 26, 6 }, { 8, 8 }, { 5, 9 }, { 16, 11 }, { 22, 14 }, + { 21, 14 }, { 6, 13 }, { 18, 14 }, { 20, 15 }, { 19, 15 }, { 17, 13 }, + { 15, 10 }, { 31, 7 }, }, { /* AC bias group 2, table 8 */ - { 0x1E, 5 }, { 0x70, 7 }, { 0x127, 9 }, { 0x126, 9 }, - { 0x492, 11 }, { 0x124D, 13 }, { 0x124C, 13 }, { 0x1, 5 }, - { 0x7F, 7 }, { 0x6, 3 }, { 0x5, 3 }, { 0x5, 4 }, - { 0x4, 4 }, { 0x1, 4 }, { 0x7, 5 }, { 0x25, 6 }, - { 0x71, 7 }, { 0x7E, 7 }, { 0x48, 7 }, { 0x125, 9 }, - { 0x248, 10 }, { 0x124F, 13 }, { 0x124E, 13 }, { 0x3, 3 }, - { 0x8, 4 }, { 0x1D, 5 }, { 0x6, 5 }, { 0x3E, 6 }, - { 0x2, 4 }, { 0x0, 5 }, { 0x13, 5 }, { 0x39, 6 } + { 29, 5 }, { 7, 5 }, { 13, 4 }, { 28, 4 }, { 26, 5 }, { 14, 5 }, + { 12, 4 }, { 11, 4 }, { 23, 3 }, { 24, 4 }, { 18, 7 }, { 20, 10 }, + { 4, 11 }, { 6, 13 }, { 5, 13 }, { 22, 13 }, { 21, 13 }, { 19, 9 }, + { 3, 9 }, { 2, 9 }, { 15, 6 }, { 30, 5 }, { 10, 3 }, { 9, 3 }, + { 1, 7 }, { 16, 7 }, { 31, 6 }, { 25, 5 }, { 0, 5 }, { 27, 6 }, + { 17, 7 }, { 8, 7 }, }, { /* AC bias group 2, table 9 */ - { 0x1, 4 }, { 0x1, 6 }, { 0xE7, 8 }, { 0x91, 8 }, - { 0x240, 10 }, { 0x120D, 13 }, { 0x120C, 13 }, { 0x3C, 6 }, - { 0x0, 6 }, { 0x6, 3 }, { 0x5, 3 }, { 0x5, 4 }, - { 0x4, 4 }, { 0x1F, 5 }, { 0x4, 5 }, { 0x25, 6 }, - { 0x72, 7 }, { 0x49, 7 }, { 0xE6, 8 }, { 0x121, 9 }, - { 0x482, 11 }, { 0x120F, 13 }, { 0x120E, 13 }, { 0x3, 3 }, - { 0x8, 4 }, { 0x1D, 5 }, { 0x5, 5 }, { 0x3D, 6 }, - { 0x3, 4 }, { 0x1, 5 }, { 0x13, 5 }, { 0x38, 6 } + { 8, 6 }, { 1, 6 }, { 29, 5 }, { 0, 4 }, { 14, 5 }, { 26, 5 }, + { 28, 4 }, { 12, 4 }, { 11, 4 }, { 23, 3 }, { 24, 4 }, { 4, 10 }, + { 20, 11 }, { 6, 13 }, { 5, 13 }, { 22, 13 }, { 21, 13 }, { 19, 9 }, + { 3, 8 }, { 17, 7 }, { 15, 6 }, { 30, 5 }, { 10, 3 }, { 9, 3 }, + { 31, 6 }, { 16, 7 }, { 18, 8 }, { 2, 8 }, { 25, 5 }, { 7, 6 }, + { 27, 6 }, { 13, 5 }, }, { /* AC bias group 2, table 10 */ - { 0x4, 4 }, { 0xF, 6 }, { 0xF4, 8 }, { 0x5B, 8 }, - { 0x2D3, 11 }, { 0xB4A, 13 }, { 0x1697, 14 }, { 0x3C, 6 }, - { 0xE, 6 }, { 0x6, 3 }, { 0x5, 3 }, { 0x2, 4 }, - { 0x1, 4 }, { 0x1D, 5 }, { 0x0, 5 }, { 0x7B, 7 }, - { 0x2C, 7 }, { 0xF5, 8 }, { 0xB5, 9 }, { 0x168, 10 }, - { 0x1696, 14 }, { 0xB49, 13 }, { 0xB48, 13 }, { 0x3, 3 }, - { 0x9, 4 }, { 0x1F, 5 }, { 0xA, 5 }, { 0x1, 5 }, - { 0x8, 4 }, { 0x6, 5 }, { 0x1C, 5 }, { 0x17, 6 } + { 14, 5 }, { 27, 5 }, { 12, 4 }, { 11, 4 }, { 29, 5 }, { 8, 6 }, + { 1, 6 }, { 0, 4 }, { 26, 5 }, { 16, 7 }, { 19, 10 }, { 22, 13 }, + { 21, 13 }, { 5, 13 }, { 20, 14 }, { 6, 14 }, { 4, 11 }, { 18, 9 }, + { 3, 8 }, { 31, 6 }, { 23, 3 }, { 28, 4 }, { 24, 4 }, { 10, 3 }, + { 9, 3 }, { 30, 5 }, { 13, 5 }, { 7, 6 }, { 2, 8 }, { 17, 8 }, + { 15, 7 }, { 25, 5 }, }, { /* AC bias group 2, table 11 */ - { 0x8, 4 }, { 0x39, 6 }, { 0x1A, 7 }, { 0x3, 7 }, - { 0xDB, 10 }, { 0x6D6, 13 }, { 0xDAF, 14 }, { 0x3C, 6 }, - { 0xC, 6 }, { 0x6, 3 }, { 0x5, 3 }, { 0x2, 4 }, - { 0x1, 4 }, { 0x1D, 5 }, { 0x3D, 6 }, { 0x0, 6 }, - { 0x2, 7 }, { 0x37, 8 }, { 0x6C, 9 }, { 0x1B4, 11 }, - { 0xDAE, 14 }, { 0x6D5, 13 }, { 0x6D4, 13 }, { 0x2, 3 }, - { 0x7, 4 }, { 0x1F, 5 }, { 0x7, 5 }, { 0x1, 5 }, - { 0x9, 4 }, { 0xD, 5 }, { 0xC, 5 }, { 0x38, 6 } + { 15, 6 }, { 16, 7 }, { 3, 7 }, { 27, 5 }, { 12, 4 }, { 11, 4 }, + { 8, 6 }, { 2, 7 }, { 18, 9 }, { 19, 11 }, { 22, 13 }, { 21, 13 }, + { 5, 13 }, { 20, 14 }, { 6, 14 }, { 4, 10 }, { 17, 8 }, { 26, 5 }, + { 23, 3 }, { 30, 5 }, { 29, 5 }, { 24, 4 }, { 0, 4 }, { 28, 4 }, + { 10, 3 }, { 9, 3 }, { 31, 6 }, { 1, 6 }, { 13, 5 }, { 7, 6 }, + { 14, 6 }, { 25, 5 }, }, { /* AC bias group 2, table 12 */ - { 0xF, 4 }, { 0x4, 5 }, { 0x2F, 7 }, { 0x2E, 7 }, - { 0x54, 9 }, { 0x555, 13 }, { 0x554, 13 }, { 0x16, 6 }, - { 0xE, 6 }, { 0x6, 3 }, { 0x5, 3 }, { 0x1, 4 }, - { 0x0, 4 }, { 0x9, 5 }, { 0xB, 6 }, { 0x14, 7 }, - { 0x57, 9 }, { 0x56, 9 }, { 0xAB, 10 }, { 0x557, 13 }, - { 0x556, 13 }, { 0x2A9, 12 }, { 0x2A8, 12 }, { 0x3, 3 }, - { 0x8, 4 }, { 0x13, 5 }, { 0xA, 5 }, { 0x8, 5 }, - { 0xE, 4 }, { 0x12, 5 }, { 0x6, 5 }, { 0xF, 6 } + { 12, 4 }, { 11, 4 }, { 1, 5 }, { 15, 7 }, { 4, 9 }, { 22, 12 }, + { 21, 12 }, { 6, 13 }, { 5, 13 }, { 20, 13 }, { 19, 13 }, { 18, 10 }, + { 17, 9 }, { 16, 9 }, { 14, 6 }, { 30, 5 }, { 8, 6 }, { 31, 6 }, + { 27, 5 }, { 13, 5 }, { 26, 5 }, { 7, 6 }, { 3, 7 }, { 2, 7 }, + { 23, 3 }, { 24, 4 }, { 29, 5 }, { 25, 5 }, { 10, 3 }, { 9, 3 }, + { 28, 4 }, { 0, 4 }, }, { /* AC bias group 2, table 13 */ - { 0x1, 3 }, { 0xE, 5 }, { 0x6, 6 }, { 0x4, 6 }, - { 0xDA, 9 }, { 0xDBE, 13 }, { 0x1B7E, 14 }, { 0x7, 6 }, - { 0x1A, 6 }, { 0x5, 3 }, { 0x4, 3 }, { 0x1C, 5 }, - { 0x1B, 5 }, { 0x3A, 6 }, { 0x37, 7 }, { 0x6C, 8 }, - { 0x1B6, 10 }, { 0x36E, 11 }, { 0xDBD, 13 }, { 0x36FF, 15 }, - { 0x36FE, 15 }, { 0x1B79, 14 }, { 0x1B78, 14 }, { 0x2, 3 }, - { 0xC, 4 }, { 0x0, 4 }, { 0xF, 5 }, { 0xC, 5 }, - { 0xF, 4 }, { 0x1A, 5 }, { 0x3B, 6 }, { 0x5, 6 } + { 25, 4 }, { 3, 6 }, { 31, 6 }, { 2, 6 }, { 7, 6 }, { 0, 3 }, + { 23, 3 }, { 27, 5 }, { 8, 6 }, { 15, 8 }, { 4, 9 }, { 16, 10 }, + { 17, 11 }, { 22, 14 }, { 21, 14 }, { 18, 13 }, { 5, 13 }, { 6, 14 }, + { 20, 15 }, { 19, 15 }, { 14, 7 }, { 1, 5 }, { 26, 5 }, { 10, 3 }, + { 9, 3 }, { 24, 4 }, { 29, 5 }, { 12, 5 }, { 11, 5 }, { 13, 6 }, + { 30, 6 }, { 28, 4 }, }, { /* AC bias group 2, table 14 */ - { 0x5, 3 }, { 0x1E, 5 }, { 0x3A, 6 }, { 0x3E, 6 }, - { 0xFC, 8 }, { 0xFD7, 12 }, { 0x3F55, 14 }, { 0x77, 7 }, - { 0x30, 6 }, { 0x3, 3 }, { 0x4, 3 }, { 0x1A, 5 }, - { 0x19, 5 }, { 0x7F, 7 }, { 0x1FB, 9 }, { 0x3F4, 10 }, - { 0xFD6, 12 }, { 0x1FA9, 13 }, { 0x3F54, 14 }, { 0x3F57, 14 }, - { 0x3F56, 14 }, { 0x3F51, 14 }, { 0x3F50, 14 }, { 0x1, 3 }, - { 0x4, 4 }, { 0x1C, 5 }, { 0xB, 5 }, { 0xA, 5 }, - { 0x0, 3 }, { 0x1B, 5 }, { 0x31, 6 }, { 0x76, 7 } + { 28, 3 }, { 23, 3 }, { 24, 4 }, { 27, 5 }, { 26, 5 }, { 9, 3 }, + { 10, 3 }, { 0, 3 }, { 8, 6 }, { 30, 6 }, { 12, 5 }, { 11, 5 }, + { 29, 5 }, { 25, 5 }, { 2, 6 }, { 31, 7 }, { 7, 7 }, { 1, 5 }, + { 3, 6 }, { 4, 8 }, { 15, 10 }, { 22, 14 }, { 21, 14 }, { 17, 13 }, + { 18, 14 }, { 6, 14 }, { 20, 14 }, { 19, 14 }, { 16, 12 }, { 5, 12 }, + { 14, 9 }, { 13, 7 }, }, { /* AC bias group 2, table 15 */ - { 0x5, 3 }, { 0xC, 4 }, { 0x1B, 5 }, { 0x8, 4 }, - { 0x38, 6 }, { 0x15, 8 }, { 0xA3, 11 }, { 0xE6, 8 }, - { 0x4, 6 }, { 0x1, 3 }, { 0x2, 3 }, { 0x12, 5 }, - { 0x3, 5 }, { 0xB, 7 }, { 0x29, 9 }, { 0xA0, 11 }, - { 0x142, 12 }, { 0x287, 13 }, { 0x286, 13 }, { 0x289, 13 }, - { 0x288, 13 }, { 0x28B, 13 }, { 0x28A, 13 }, { 0xF, 4 }, - { 0x1D, 5 }, { 0x13, 5 }, { 0x1, 5 }, { 0x0, 5 }, - { 0x3, 3 }, { 0x1A, 5 }, { 0x72, 7 }, { 0xE7, 8 } + { 27, 5 }, { 26, 5 }, { 8, 6 }, { 15, 11 }, { 16, 12 }, { 18, 13 }, + { 17, 13 }, { 20, 13 }, { 19, 13 }, { 22, 13 }, { 21, 13 }, { 6, 11 }, + { 14, 9 }, { 5, 8 }, { 13, 7 }, { 12, 5 }, { 9, 3 }, { 10, 3 }, + { 28, 3 }, { 3, 4 }, { 11, 5 }, { 25, 5 }, { 0, 3 }, { 1, 4 }, + { 29, 5 }, { 2, 5 }, { 4, 6 }, { 30, 7 }, { 7, 8 }, { 31, 8 }, + { 24, 5 }, { 23, 4 }, }, { /* AC bias group 3, table 0 */ - { 0x9, 5 }, { 0x15, 7 }, { 0x28, 8 }, { 0x52, 9 }, - { 0x29A, 12 }, { 0x537, 13 }, { 0x536, 13 }, { 0xA, 5 }, - { 0x54, 7 }, { 0x4, 3 }, { 0x3, 3 }, { 0xC, 4 }, - { 0xB, 4 }, { 0xD, 4 }, { 0x3, 4 }, { 0x14, 5 }, - { 0x3A, 6 }, { 0x4, 5 }, { 0x38, 6 }, { 0x55, 7 }, - { 0xA7, 10 }, { 0x299, 12 }, { 0x298, 12 }, { 0x0, 3 }, - { 0x1E, 5 }, { 0x8, 5 }, { 0x2B, 6 }, { 0xB, 6 }, - { 0xB, 5 }, { 0x3B, 6 }, { 0x1F, 5 }, { 0x39, 6 } + { 23, 3 }, { 17, 5 }, { 2, 8 }, { 3, 9 }, { 22, 12 }, { 21, 12 }, + { 4, 12 }, { 6, 13 }, { 5, 13 }, { 20, 10 }, { 1, 7 }, { 27, 6 }, + { 14, 4 }, { 25, 5 }, { 0, 5 }, { 7, 5 }, { 28, 5 }, { 10, 3 }, + { 9, 3 }, { 15, 5 }, { 8, 7 }, { 19, 7 }, { 26, 6 }, { 12, 4 }, + { 11, 4 }, { 13, 4 }, { 18, 6 }, { 31, 6 }, { 16, 6 }, { 29, 6 }, + { 24, 5 }, { 30, 5 }, }, { /* AC bias group 3, table 1 */ - { 0x1D, 5 }, { 0x2F, 7 }, { 0x2, 8 }, { 0x7, 9 }, - { 0x19, 11 }, { 0x35, 12 }, { 0x34, 12 }, { 0x9, 5 }, - { 0x2E, 7 }, { 0x6, 3 }, { 0x5, 3 }, { 0x9, 4 }, - { 0x8, 4 }, { 0x7, 4 }, { 0x1F, 5 }, { 0x8, 5 }, - { 0x18, 6 }, { 0x19, 6 }, { 0x1, 6 }, { 0x0, 7 }, - { 0x18, 11 }, { 0x37, 12 }, { 0x36, 12 }, { 0x1, 3 }, - { 0x1, 4 }, { 0xA, 5 }, { 0x39, 6 }, { 0x16, 6 }, - { 0xD, 5 }, { 0x1, 5 }, { 0x1E, 5 }, { 0x38, 6 } + { 19, 7 }, { 2, 8 }, { 20, 11 }, { 4, 11 }, { 6, 12 }, { 5, 12 }, + { 22, 12 }, { 21, 12 }, { 3, 9 }, { 18, 6 }, { 29, 5 }, { 24, 4 }, + { 23, 3 }, { 15, 5 }, { 7, 5 }, { 25, 5 }, { 27, 6 }, { 8, 7 }, + { 1, 7 }, { 16, 6 }, { 17, 6 }, { 28, 5 }, { 13, 4 }, { 12, 4 }, + { 11, 4 }, { 10, 3 }, { 9, 3 }, { 31, 6 }, { 26, 6 }, { 0, 5 }, + { 30, 5 }, { 14, 5 }, }, { /* AC bias group 3, table 2 */ - { 0x1, 4 }, { 0x71, 7 }, { 0xE0, 8 }, { 0x1C3, 9 }, - { 0x708, 11 }, { 0x1C26, 13 }, { 0x384F, 14 }, { 0x1, 5 }, - { 0x31, 7 }, { 0x6, 3 }, { 0x5, 3 }, { 0x9, 4 }, - { 0x8, 4 }, { 0x5, 4 }, { 0xF, 5 }, { 0x39, 6 }, - { 0x77, 7 }, { 0x76, 7 }, { 0x30, 7 }, { 0x385, 10 }, - { 0x384E, 14 }, { 0x1C25, 13 }, { 0x1C24, 13 }, { 0x1, 3 }, - { 0x4, 4 }, { 0xD, 5 }, { 0x0, 5 }, { 0x19, 6 }, - { 0x1F, 5 }, { 0xE, 5 }, { 0x1E, 5 }, { 0x3A, 6 } + { 26, 5 }, { 7, 5 }, { 0, 4 }, { 23, 3 }, { 24, 4 }, { 13, 4 }, + { 18, 7 }, { 8, 7 }, { 27, 6 }, { 25, 5 }, { 29, 5 }, { 14, 5 }, + { 12, 4 }, { 11, 4 }, { 10, 3 }, { 9, 3 }, { 2, 8 }, { 4, 11 }, + { 22, 13 }, { 21, 13 }, { 5, 13 }, { 20, 14 }, { 6, 14 }, { 19, 10 }, + { 3, 9 }, { 1, 7 }, { 15, 6 }, { 31, 6 }, { 17, 7 }, { 16, 7 }, + { 30, 5 }, { 28, 5 }, }, { /* AC bias group 3, table 3 */ - { 0x6, 4 }, { 0xC, 6 }, { 0xD6, 8 }, { 0x7B, 8 }, - { 0x1E8, 10 }, { 0x7A4, 12 }, { 0xF4B, 13 }, { 0x36, 6 }, - { 0x6A, 7 }, { 0x7, 3 }, { 0x5, 3 }, { 0x8, 4 }, - { 0x9, 4 }, { 0x1, 4 }, { 0x7, 5 }, { 0xD, 6 }, - { 0x3C, 7 }, { 0xD7, 8 }, { 0xF5, 9 }, { 0x7A7, 12 }, - { 0xF4A, 13 }, { 0xF4D, 13 }, { 0xF4C, 13 }, { 0x2, 3 }, - { 0x2, 4 }, { 0xE, 5 }, { 0x37, 6 }, { 0x34, 6 }, - { 0x0, 4 }, { 0x19, 5 }, { 0x18, 5 }, { 0x1F, 6 } + { 28, 4 }, { 13, 4 }, { 24, 4 }, { 1, 6 }, { 15, 6 }, { 14, 5 }, + { 23, 3 }, { 0, 4 }, { 25, 5 }, { 16, 7 }, { 4, 10 }, { 5, 12 }, + { 20, 13 }, { 6, 13 }, { 22, 13 }, { 21, 13 }, { 19, 12 }, { 18, 9 }, + { 3, 8 }, { 31, 6 }, { 11, 4 }, { 12, 4 }, { 10, 3 }, { 30, 5 }, + { 29, 5 }, { 27, 6 }, { 8, 7 }, { 2, 8 }, { 17, 8 }, { 7, 6 }, + { 26, 6 }, { 9, 3 }, }, { /* AC bias group 3, table 4 */ - { 0xA, 4 }, { 0x27, 6 }, { 0xBF, 8 }, { 0xBE, 8 }, - { 0x224, 10 }, { 0x225D, 14 }, { 0x225C, 14 }, { 0x26, 6 }, - { 0x5E, 7 }, { 0x7, 3 }, { 0x6, 3 }, { 0x6, 4 }, - { 0x7, 4 }, { 0x16, 5 }, { 0x2E, 6 }, { 0x45, 7 }, - { 0x88, 8 }, { 0x113, 9 }, { 0x44A, 11 }, { 0x225F, 14 }, - { 0x225E, 14 }, { 0x112D, 13 }, { 0x112C, 13 }, { 0x2, 3 }, - { 0x2, 4 }, { 0x12, 5 }, { 0x3, 5 }, { 0x2, 5 }, - { 0x3, 4 }, { 0x0, 4 }, { 0x10, 5 }, { 0x23, 6 } + { 29, 4 }, { 27, 5 }, { 26, 5 }, { 24, 4 }, { 28, 4 }, { 23, 3 }, + { 11, 4 }, { 12, 4 }, { 30, 5 }, { 16, 8 }, { 4, 10 }, { 18, 11 }, + { 22, 13 }, { 21, 13 }, { 6, 14 }, { 5, 14 }, { 20, 14 }, { 19, 14 }, + { 17, 9 }, { 15, 7 }, { 31, 6 }, { 25, 5 }, { 7, 6 }, { 1, 6 }, + { 0, 4 }, { 13, 5 }, { 14, 6 }, { 8, 7 }, { 3, 8 }, { 2, 8 }, + { 10, 3 }, { 9, 3 }, }, { /* AC bias group 3, table 5 */ - { 0xF, 4 }, { 0x6, 5 }, { 0x75, 7 }, { 0x74, 7 }, - { 0xA, 9 }, { 0xBF, 13 }, { 0xB9, 13 }, { 0x22, 6 }, - { 0x3, 7 }, { 0x5, 3 }, { 0x6, 3 }, { 0x1, 4 }, - { 0x2, 4 }, { 0x7, 5 }, { 0x0, 6 }, { 0x4, 8 }, - { 0x16, 10 }, { 0x5E, 12 }, { 0xB8, 13 }, { 0xBB, 13 }, - { 0xBA, 13 }, { 0x17D, 14 }, { 0x17C, 14 }, { 0x2, 3 }, - { 0x6, 4 }, { 0x1C, 5 }, { 0x10, 5 }, { 0x3B, 6 }, - { 0x9, 4 }, { 0x7, 4 }, { 0x1, 5 }, { 0x23, 6 } + { 14, 6 }, { 15, 8 }, { 4, 9 }, { 16, 10 }, { 18, 13 }, { 6, 13 }, + { 20, 13 }, { 19, 13 }, { 17, 12 }, { 22, 14 }, { 21, 14 }, { 5, 13 }, + { 8, 7 }, { 30, 5 }, { 11, 4 }, { 12, 4 }, { 1, 5 }, { 13, 5 }, + { 23, 3 }, { 24, 4 }, { 29, 4 }, { 26, 5 }, { 7, 6 }, { 31, 6 }, + { 28, 4 }, { 9, 3 }, { 10, 3 }, { 25, 5 }, { 3, 7 }, { 2, 7 }, + { 27, 6 }, { 0, 4 }, }, { /* AC bias group 3, table 6 */ - { 0x1, 3 }, { 0x1C, 5 }, { 0x36, 6 }, { 0x3B, 6 }, - { 0xEA, 8 }, { 0x75B, 11 }, { 0x1D65, 13 }, { 0x19, 6 }, - { 0x74, 7 }, { 0x4, 3 }, { 0x5, 3 }, { 0x0, 4 }, - { 0x1, 4 }, { 0x37, 6 }, { 0x1D7, 9 }, { 0x75A, 11 }, - { 0x1D64, 13 }, { 0x1D67, 13 }, { 0x1D66, 13 }, { 0x1D61, 13 }, - { 0x1D60, 13 }, { 0x1D63, 13 }, { 0x1D62, 13 }, { 0x2, 3 }, - { 0x1F, 5 }, { 0x1A, 5 }, { 0xD, 5 }, { 0x3D, 6 }, - { 0xC, 4 }, { 0x7, 4 }, { 0x3C, 6 }, { 0x18, 6 } + { 11, 4 }, { 12, 4 }, { 0, 3 }, { 23, 3 }, { 31, 6 }, { 7, 6 }, + { 26, 5 }, { 29, 4 }, { 9, 3 }, { 10, 3 }, { 28, 4 }, { 25, 5 }, + { 2, 6 }, { 13, 6 }, { 1, 5 }, { 8, 7 }, { 4, 8 }, { 20, 13 }, + { 19, 13 }, { 22, 13 }, { 21, 13 }, { 16, 13 }, { 6, 13 }, { 18, 13 }, + { 17, 13 }, { 15, 11 }, { 5, 11 }, { 14, 9 }, { 3, 6 }, { 30, 6 }, + { 27, 6 }, { 24, 5 }, }, { /* AC bias group 3, table 7 */ - { 0x2, 3 }, { 0x1, 4 }, { 0x14, 5 }, { 0x0, 4 }, - { 0x2F, 6 }, { 0xBB, 8 }, { 0x2E4, 10 }, { 0x7D, 7 }, - { 0xBA, 8 }, { 0x3, 3 }, { 0x4, 3 }, { 0x16, 5 }, - { 0x1A, 5 }, { 0xB8, 8 }, { 0x172E, 13 }, { 0x2E5F, 14 }, - { 0x2E5E, 14 }, { 0x1729, 13 }, { 0x1728, 13 }, { 0x172B, 13 }, - { 0x172A, 13 }, { 0x172D, 13 }, { 0x172C, 13 }, { 0x1, 3 }, - { 0x1E, 5 }, { 0x15, 5 }, { 0x1B, 5 }, { 0x3F, 6 }, - { 0xC, 4 }, { 0xE, 4 }, { 0x7C, 7 }, { 0x173, 9 } + { 3, 4 }, { 1, 4 }, { 23, 3 }, { 0, 3 }, { 9, 3 }, { 10, 3 }, + { 2, 5 }, { 25, 5 }, { 11, 5 }, { 13, 8 }, { 6, 10 }, { 18, 13 }, + { 17, 13 }, { 20, 13 }, { 19, 13 }, { 22, 13 }, { 21, 13 }, { 14, 13 }, + { 16, 14 }, { 15, 14 }, { 31, 9 }, { 8, 8 }, { 5, 8 }, { 4, 6 }, + { 28, 4 }, { 12, 5 }, { 26, 5 }, { 29, 4 }, { 24, 5 }, { 30, 7 }, + { 7, 7 }, { 27, 6 }, }, { /* AC bias group 3, table 8 */ - { 0x3, 4 }, { 0x7B, 7 }, { 0x58, 8 }, { 0x1EA, 9 }, - { 0x1EB1, 13 }, { 0x1EB0, 13 }, { 0x1EB3, 13 }, { 0x13, 6 }, - { 0x12, 6 }, { 0x5, 3 }, { 0x6, 3 }, { 0x2, 4 }, - { 0x1, 4 }, { 0x13, 5 }, { 0x3C, 6 }, { 0x2D, 7 }, - { 0xF4, 8 }, { 0x59, 8 }, { 0x3D7, 10 }, { 0xF5B, 12 }, - { 0x1EB2, 13 }, { 0x1EB5, 13 }, { 0x1EB4, 13 }, { 0x3, 3 }, - { 0xE, 4 }, { 0x1F, 5 }, { 0x12, 5 }, { 0x8, 5 }, - { 0x8, 4 }, { 0x0, 4 }, { 0xA, 5 }, { 0x17, 6 } + { 29, 4 }, { 12, 4 }, { 11, 4 }, { 0, 4 }, { 27, 5 }, { 8, 6 }, + { 7, 6 }, { 30, 5 }, { 2, 8 }, { 17, 8 }, { 15, 7 }, { 31, 6 }, + { 23, 3 }, { 28, 4 }, { 26, 5 }, { 13, 5 }, { 9, 3 }, { 10, 3 }, + { 24, 4 }, { 14, 6 }, { 16, 8 }, { 3, 9 }, { 5, 13 }, { 4, 13 }, + { 20, 13 }, { 6, 13 }, { 22, 13 }, { 21, 13 }, { 19, 12 }, { 18, 10 }, + { 1, 7 }, { 25, 5 }, }, { /* AC bias group 3, table 9 */ - { 0x8, 4 }, { 0x3C, 6 }, { 0xF5, 8 }, { 0xF4, 8 }, - { 0x1EF7, 13 }, { 0x3DE9, 14 }, { 0x3DE8, 14 }, { 0x1C, 6 }, - { 0xD, 6 }, { 0x5, 3 }, { 0x6, 3 }, { 0x1, 4 }, - { 0x0, 4 }, { 0x7, 5 }, { 0xC, 6 }, { 0xF6, 8 }, - { 0x1EE, 9 }, { 0x3DF, 10 }, { 0x7BC, 11 }, { 0x3DEB, 14 }, - { 0x3DEA, 14 }, { 0x3DED, 14 }, { 0x3DEC, 14 }, { 0x2, 3 }, - { 0x9, 4 }, { 0x1F, 5 }, { 0xF, 5 }, { 0x5, 5 }, - { 0xE, 4 }, { 0x6, 4 }, { 0x4, 5 }, { 0x1D, 6 } + { 12, 4 }, { 11, 4 }, { 30, 5 }, { 27, 5 }, { 14, 6 }, { 8, 6 }, + { 13, 5 }, { 23, 3 }, { 29, 4 }, { 7, 6 }, { 31, 6 }, { 26, 5 }, + { 0, 4 }, { 24, 4 }, { 9, 3 }, { 10, 3 }, { 28, 4 }, { 1, 6 }, + { 3, 8 }, { 2, 8 }, { 15, 8 }, { 16, 9 }, { 18, 11 }, { 6, 14 }, + { 5, 14 }, { 20, 14 }, { 19, 14 }, { 22, 14 }, { 21, 14 }, { 4, 13 }, + { 17, 10 }, { 25, 5 }, }, { /* AC bias group 3, table 10 */ - { 0x9, 4 }, { 0x39, 6 }, { 0x19, 7 }, { 0x18, 7 }, - { 0x706, 11 }, { 0x383D, 14 }, { 0x383C, 14 }, { 0xD, 6 }, - { 0xF, 6 }, { 0x5, 3 }, { 0x6, 3 }, { 0x0, 4 }, - { 0x1D, 5 }, { 0x3, 5 }, { 0x71, 7 }, { 0xE1, 8 }, - { 0x1C0, 9 }, { 0x382, 10 }, { 0x1C1D, 13 }, { 0x383F, 14 }, - { 0x383E, 14 }, { 0x3839, 14 }, { 0x3838, 14 }, { 0x2, 3 }, - { 0x8, 4 }, { 0x2, 4 }, { 0xD, 5 }, { 0xC, 5 }, - { 0xF, 4 }, { 0x7, 4 }, { 0x2, 5 }, { 0xE, 6 } + { 11, 4 }, { 30, 5 }, { 13, 5 }, { 25, 4 }, { 3, 7 }, { 2, 7 }, + { 7, 6 }, { 31, 6 }, { 8, 6 }, { 23, 3 }, { 27, 5 }, { 26, 5 }, + { 29, 4 }, { 24, 4 }, { 0, 4 }, { 9, 3 }, { 10, 3 }, { 16, 9 }, + { 17, 10 }, { 4, 11 }, { 22, 14 }, { 21, 14 }, { 18, 13 }, { 6, 14 }, + { 5, 14 }, { 20, 14 }, { 19, 14 }, { 15, 8 }, { 14, 7 }, { 1, 6 }, + { 12, 5 }, { 28, 4 }, }, { /* AC bias group 3, table 11 */ - { 0x0, 3 }, { 0x6, 5 }, { 0x35, 7 }, { 0x34, 7 }, - { 0x777, 11 }, { 0x1DD4, 13 }, { 0x3BAB, 14 }, { 0xE, 6 }, - { 0xF, 6 }, { 0x5, 3 }, { 0x4, 3 }, { 0x1C, 5 }, - { 0x19, 5 }, { 0x3A, 6 }, { 0xEF, 8 }, { 0x1DC, 9 }, - { 0x776, 11 }, { 0x774, 11 }, { 0x3BAA, 14 }, { 0x3BAD, 14 }, - { 0x3BAC, 14 }, { 0x3BAF, 14 }, { 0x3BAE, 14 }, { 0x2, 3 }, - { 0x7, 4 }, { 0x2, 4 }, { 0x18, 5 }, { 0xC, 5 }, - { 0xF, 4 }, { 0xD, 4 }, { 0x1B, 6 }, { 0x76, 7 } + { 0, 3 }, { 25, 4 }, { 1, 5 }, { 7, 6 }, { 8, 6 }, { 23, 3 }, + { 27, 5 }, { 3, 7 }, { 2, 7 }, { 30, 6 }, { 24, 4 }, { 10, 3 }, + { 9, 3 }, { 26, 5 }, { 12, 5 }, { 29, 4 }, { 11, 5 }, { 13, 6 }, + { 31, 7 }, { 15, 9 }, { 17, 11 }, { 5, 13 }, { 18, 14 }, { 6, 14 }, + { 20, 14 }, { 19, 14 }, { 22, 14 }, { 21, 14 }, { 16, 11 }, { 4, 11 }, + { 14, 8 }, { 28, 4 }, }, { /* AC bias group 3, table 12 */ - { 0x2, 3 }, { 0x11, 5 }, { 0x6, 6 }, { 0x4F, 7 }, - { 0x130, 9 }, { 0x1319, 13 }, { 0x1318, 13 }, { 0x4E, 7 }, - { 0x7, 6 }, { 0x6, 3 }, { 0x5, 3 }, { 0x10, 5 }, - { 0xD, 5 }, { 0x5, 6 }, { 0x99, 8 }, { 0x262, 10 }, - { 0x98E, 12 }, { 0x131B, 13 }, { 0x131A, 13 }, { 0x263D, 14 }, - { 0x263C, 14 }, { 0x263F, 14 }, { 0x263E, 14 }, { 0x1, 3 }, - { 0x7, 4 }, { 0x0, 4 }, { 0x12, 5 }, { 0xC, 5 }, - { 0xE, 4 }, { 0xF, 4 }, { 0x4, 6 }, { 0x4D, 7 } + { 25, 4 }, { 30, 6 }, { 13, 6 }, { 2, 6 }, { 8, 6 }, { 23, 3 }, + { 0, 3 }, { 27, 5 }, { 12, 5 }, { 24, 4 }, { 11, 5 }, { 1, 5 }, + { 26, 5 }, { 4, 9 }, { 15, 10 }, { 6, 13 }, { 5, 13 }, { 18, 13 }, + { 17, 13 }, { 16, 12 }, { 20, 14 }, { 19, 14 }, { 22, 14 }, { 21, 14 }, + { 14, 8 }, { 31, 7 }, { 7, 7 }, { 3, 7 }, { 10, 3 }, { 9, 3 }, + { 28, 4 }, { 29, 4 }, }, { /* AC bias group 3, table 13 */ - { 0x3, 3 }, { 0x0, 4 }, { 0x2, 5 }, { 0x37, 6 }, - { 0x1B7, 9 }, { 0xDB5, 12 }, { 0x36DD, 14 }, { 0x6C, 7 }, - { 0x16, 6 }, { 0x5, 3 }, { 0x4, 3 }, { 0x3, 5 }, - { 0xA, 5 }, { 0x2E, 7 }, { 0x36C, 10 }, { 0xDB4, 12 }, - { 0x36DC, 14 }, { 0x36DF, 14 }, { 0x36DE, 14 }, { 0x36D9, 14 }, - { 0x36D8, 14 }, { 0x36DB, 14 }, { 0x36DA, 14 }, { 0xE, 4 }, - { 0x4, 4 }, { 0x1A, 5 }, { 0x19, 5 }, { 0x18, 5 }, - { 0xF, 4 }, { 0x1, 3 }, { 0x2F, 7 }, { 0xDA, 8 } + { 1, 4 }, { 2, 5 }, { 11, 5 }, { 29, 3 }, { 24, 4 }, { 12, 5 }, + { 8, 6 }, { 13, 7 }, { 30, 7 }, { 0, 3 }, { 10, 3 }, { 9, 3 }, + { 27, 5 }, { 26, 5 }, { 25, 5 }, { 7, 7 }, { 31, 8 }, { 14, 10 }, + { 15, 12 }, { 5, 12 }, { 20, 14 }, { 19, 14 }, { 22, 14 }, { 21, 14 }, + { 16, 14 }, { 6, 14 }, { 18, 14 }, { 17, 14 }, { 4, 9 }, { 3, 6 }, + { 23, 4 }, { 28, 4 }, }, { /* AC bias group 3, table 14 */ - { 0x6, 3 }, { 0x6, 4 }, { 0xF, 5 }, { 0x0, 4 }, - { 0x75, 7 }, { 0x3B8, 10 }, { 0x1DCA, 13 }, { 0x74, 7 }, - { 0x76, 7 }, { 0x4, 3 }, { 0x5, 3 }, { 0x3, 5 }, - { 0x2, 5 }, { 0x1DE, 9 }, { 0xEE6, 12 }, { 0x3B97, 14 }, - { 0x3B96, 14 }, { 0x3B9D, 14 }, { 0x3B9C, 14 }, { 0x3B9F, 14 }, - { 0x3B9E, 14 }, { 0x1DC9, 13 }, { 0x1DC8, 13 }, { 0x5, 4 }, - { 0x1C, 5 }, { 0x9, 5 }, { 0xE, 5 }, { 0x8, 5 }, - { 0xF, 4 }, { 0x1, 3 }, { 0x1DF, 9 }, { 0x1DD, 9 } + { 3, 4 }, { 12, 5 }, { 11, 5 }, { 29, 3 }, { 27, 5 }, { 25, 5 }, + { 23, 4 }, { 1, 4 }, { 26, 5 }, { 2, 5 }, { 9, 3 }, { 10, 3 }, + { 0, 3 }, { 24, 5 }, { 7, 7 }, { 4, 7 }, { 8, 7 }, { 5, 10 }, + { 22, 13 }, { 21, 13 }, { 6, 13 }, { 16, 14 }, { 15, 14 }, { 14, 12 }, + { 18, 14 }, { 17, 14 }, { 20, 14 }, { 19, 14 }, { 31, 9 }, { 13, 9 }, + { 30, 9 }, { 28, 4 }, }, { /* AC bias group 3, table 15 */ - { 0x4, 3 }, { 0xB, 4 }, { 0x1D, 5 }, { 0xC, 4 }, - { 0x14, 5 }, { 0xE0, 8 }, { 0x3875, 14 }, { 0x386, 10 }, - { 0x1C2, 9 }, { 0x0, 2 }, { 0x1, 2 }, { 0x71, 7 }, - { 0x72, 7 }, { 0x1C3F, 13 }, { 0x3874, 14 }, { 0x3877, 14 }, - { 0x3876, 14 }, { 0x3871, 14 }, { 0x3870, 14 }, { 0x3873, 14 }, - { 0x3872, 14 }, { 0x3879, 14 }, { 0x3878, 14 }, { 0x3C, 6 }, - { 0x73, 7 }, { 0x2A, 6 }, { 0x3D, 6 }, { 0x2B, 6 }, - { 0x1F, 5 }, { 0xD, 4 }, { 0x1C3E, 13 }, { 0x1C3D, 13 } + { 9, 2 }, { 10, 2 }, { 0, 3 }, { 4, 5 }, { 25, 6 }, { 27, 6 }, + { 1, 4 }, { 3, 4 }, { 29, 4 }, { 5, 8 }, { 8, 9 }, { 7, 10 }, + { 18, 14 }, { 17, 14 }, { 20, 14 }, { 19, 14 }, { 14, 14 }, { 6, 14 }, + { 16, 14 }, { 15, 14 }, { 22, 14 }, { 21, 14 }, { 31, 13 }, { 30, 13 }, + { 13, 13 }, { 11, 7 }, { 12, 7 }, { 24, 7 }, { 2, 5 }, { 23, 6 }, + { 26, 6 }, { 28, 5 }, }, { /* AC bias group 4, table 0 */ - { 0x7, 4 }, { 0xF, 6 }, { 0xBB, 8 }, { 0xBA, 8 }, - { 0x5CF, 11 }, { 0x173A, 13 }, { 0x2E77, 14 }, { 0x29, 6 }, - { 0x172, 9 }, { 0x7, 3 }, { 0x6, 3 }, { 0x9, 4 }, - { 0x8, 4 }, { 0x1, 4 }, { 0x5, 5 }, { 0xD, 6 }, - { 0x1D, 7 }, { 0x1C, 7 }, { 0xB8, 8 }, { 0x2E6, 10 }, - { 0x2E76, 14 }, { 0x1739, 13 }, { 0x1738, 13 }, { 0x2, 3 }, - { 0x6, 4 }, { 0x16, 5 }, { 0x4, 5 }, { 0x28, 6 }, - { 0x15, 5 }, { 0xC, 6 }, { 0x0, 4 }, { 0x2F, 6 } + { 30, 4 }, { 13, 4 }, { 26, 5 }, { 14, 5 }, { 29, 6 }, { 15, 6 }, + { 17, 7 }, { 16, 7 }, { 1, 6 }, { 23, 3 }, { 24, 4 }, { 0, 4 }, + { 12, 4 }, { 11, 4 }, { 27, 6 }, { 7, 6 }, { 28, 5 }, { 25, 5 }, + { 18, 8 }, { 8, 9 }, { 19, 10 }, { 22, 13 }, { 21, 13 }, { 5, 13 }, + { 20, 14 }, { 6, 14 }, { 4, 11 }, { 3, 8 }, { 2, 8 }, { 31, 6 }, + { 10, 3 }, { 9, 3 }, }, { /* AC bias group 4, table 1 */ - { 0xB, 4 }, { 0x2, 5 }, { 0x54, 7 }, { 0x2F, 7 }, - { 0x2AC, 10 }, { 0x156B, 13 }, { 0x1568, 13 }, { 0x16, 6 }, - { 0x154, 9 }, { 0x7, 3 }, { 0x6, 3 }, { 0x4, 4 }, - { 0x3, 4 }, { 0x13, 5 }, { 0x28, 6 }, { 0x2E, 7 }, - { 0x157, 9 }, { 0x155, 9 }, { 0x55B, 11 }, { 0x2AD3, 14 }, - { 0x2AD2, 14 }, { 0x2AD5, 14 }, { 0x2AD4, 14 }, { 0x3, 3 }, - { 0x8, 4 }, { 0x0, 4 }, { 0xA, 5 }, { 0x3, 5 }, - { 0x2, 4 }, { 0x2B, 6 }, { 0x12, 5 }, { 0x29, 6 } + { 25, 4 }, { 1, 5 }, { 27, 5 }, { 28, 4 }, { 12, 4 }, { 11, 4 }, + { 26, 5 }, { 7, 6 }, { 15, 7 }, { 3, 7 }, { 23, 3 }, { 24, 4 }, + { 30, 5 }, { 13, 5 }, { 14, 6 }, { 31, 6 }, { 2, 7 }, { 8, 9 }, + { 17, 9 }, { 4, 10 }, { 6, 13 }, { 20, 14 }, { 19, 14 }, { 22, 14 }, + { 21, 14 }, { 5, 13 }, { 18, 11 }, { 16, 9 }, { 29, 6 }, { 0, 4 }, + { 10, 3 }, { 9, 3 }, }, { /* AC bias group 4, table 2 */ - { 0xF, 4 }, { 0x7, 5 }, { 0x1, 6 }, { 0x0, 6 }, - { 0x1C4, 9 }, { 0x703, 11 }, { 0xE02, 12 }, { 0x11, 6 }, - { 0xE1, 8 }, { 0x5, 3 }, { 0x6, 3 }, { 0x2, 4 }, - { 0x1, 4 }, { 0x9, 5 }, { 0x10, 6 }, { 0xE3, 8 }, - { 0x1C5, 9 }, { 0x1C1, 9 }, { 0x702, 11 }, { 0x1C07, 13 }, - { 0x1C06, 13 }, { 0xE01, 12 }, { 0xE00, 12 }, { 0x4, 3 }, - { 0x7, 4 }, { 0x1D, 5 }, { 0xD, 5 }, { 0x1, 5 }, - { 0x5, 4 }, { 0x6, 5 }, { 0xC, 5 }, { 0x39, 6 } + { 3, 6 }, { 2, 6 }, { 27, 5 }, { 12, 4 }, { 11, 4 }, { 29, 5 }, + { 1, 5 }, { 14, 6 }, { 7, 6 }, { 13, 5 }, { 28, 4 }, { 30, 5 }, + { 26, 5 }, { 24, 4 }, { 23, 3 }, { 9, 3 }, { 10, 3 }, { 22, 12 }, + { 21, 12 }, { 6, 12 }, { 20, 13 }, { 19, 13 }, { 18, 11 }, { 5, 11 }, + { 17, 9 }, { 8, 8 }, { 4, 9 }, { 16, 9 }, { 15, 8 }, { 31, 6 }, + { 25, 5 }, { 0, 4 }, }, { /* AC bias group 4, table 3 */ - { 0x1, 3 }, { 0x1C, 5 }, { 0x11, 6 }, { 0x13, 6 }, - { 0x42, 8 }, { 0x207, 11 }, { 0x815, 13 }, { 0x75, 7 }, - { 0x41, 8 }, { 0x5, 3 }, { 0x6, 3 }, { 0x0, 4 }, - { 0x1F, 5 }, { 0x3B, 6 }, { 0x74, 7 }, { 0x43, 8 }, - { 0x80, 9 }, { 0x206, 11 }, { 0x814, 13 }, { 0x817, 13 }, - { 0x816, 13 }, { 0x409, 12 }, { 0x408, 12 }, { 0x3, 3 }, - { 0x9, 4 }, { 0x1E, 5 }, { 0x11, 5 }, { 0x3, 5 }, - { 0x5, 4 }, { 0x10, 5 }, { 0x2, 5 }, { 0x12, 6 } + { 11, 4 }, { 30, 5 }, { 27, 5 }, { 0, 3 }, { 16, 9 }, { 22, 12 }, + { 21, 12 }, { 18, 13 }, { 6, 13 }, { 20, 13 }, { 19, 13 }, { 17, 11 }, + { 5, 11 }, { 8, 8 }, { 4, 8 }, { 15, 8 }, { 2, 6 }, { 31, 6 }, + { 3, 6 }, { 28, 4 }, { 23, 3 }, { 29, 5 }, { 26, 5 }, { 24, 4 }, + { 9, 3 }, { 10, 3 }, { 1, 5 }, { 14, 7 }, { 7, 7 }, { 13, 6 }, + { 25, 5 }, { 12, 5 }, }, { /* AC bias group 4, table 4 */ - { 0x1, 3 }, { 0x1F, 5 }, { 0x27, 6 }, { 0x1, 5 }, - { 0x4B, 8 }, { 0x123, 10 }, { 0x915, 13 }, { 0x0, 6 }, - { 0x49, 8 }, { 0x5, 3 }, { 0x6, 3 }, { 0x1D, 5 }, - { 0x1C, 5 }, { 0x13, 6 }, { 0x4A, 8 }, { 0x90, 9 }, - { 0x914, 13 }, { 0x917, 13 }, { 0x916, 13 }, { 0x911, 13 }, - { 0x910, 13 }, { 0x913, 13 }, { 0x912, 13 }, { 0x3, 3 }, - { 0x5, 4 }, { 0x1, 4 }, { 0x12, 5 }, { 0x8, 5 }, - { 0x8, 4 }, { 0x1E, 5 }, { 0x26, 6 }, { 0x1, 6 } + { 7, 6 }, { 31, 6 }, { 3, 5 }, { 25, 4 }, { 0, 3 }, { 27, 5 }, + { 15, 9 }, { 20, 13 }, { 19, 13 }, { 22, 13 }, { 21, 13 }, { 16, 13 }, + { 6, 13 }, { 18, 13 }, { 17, 13 }, { 5, 10 }, { 8, 8 }, { 14, 8 }, + { 4, 8 }, { 13, 6 }, { 24, 4 }, { 23, 3 }, { 28, 4 }, { 26, 5 }, + { 30, 6 }, { 2, 6 }, { 9, 3 }, { 10, 3 }, { 12, 5 }, { 11, 5 }, + { 29, 5 }, { 1, 5 }, }, { /* AC bias group 4, table 5 */ - { 0x3, 3 }, { 0x1, 4 }, { 0x3F, 6 }, { 0xB, 5 }, - { 0x4E, 7 }, { 0x132, 9 }, { 0x99A, 12 }, { 0x4F, 7 }, - { 0x98, 8 }, { 0x6, 3 }, { 0x5, 3 }, { 0x1D, 5 }, - { 0x1C, 5 }, { 0x7C, 7 }, { 0x267, 10 }, { 0x1331, 13 }, - { 0x1330, 13 }, { 0x1333, 13 }, { 0x1332, 13 }, { 0x266D, 14 }, - { 0x266C, 14 }, { 0x266F, 14 }, { 0x266E, 14 }, { 0x1, 3 }, - { 0x4, 4 }, { 0x1E, 5 }, { 0x12, 5 }, { 0xA, 5 }, - { 0x8, 4 }, { 0x0, 4 }, { 0x7D, 7 }, { 0x4D, 7 } + { 29, 4 }, { 1, 4 }, { 23, 3 }, { 24, 4 }, { 27, 5 }, { 3, 5 }, + { 0, 3 }, { 28, 4 }, { 26, 5 }, { 8, 8 }, { 5, 9 }, { 16, 13 }, + { 15, 13 }, { 18, 13 }, { 17, 13 }, { 6, 12 }, { 20, 14 }, { 19, 14 }, + { 22, 14 }, { 21, 14 }, { 14, 10 }, { 31, 7 }, { 4, 7 }, { 7, 7 }, + { 10, 3 }, { 9, 3 }, { 12, 5 }, { 11, 5 }, { 25, 5 }, { 13, 7 }, + { 30, 7 }, { 2, 6 }, }, { /* AC bias group 4, table 6 */ - { 0x2, 3 }, { 0x7, 4 }, { 0x15, 5 }, { 0x3, 4 }, - { 0x4, 5 }, { 0xA7, 8 }, { 0x536, 11 }, { 0x28, 6 }, - { 0x29A, 10 }, { 0x6, 3 }, { 0x4, 3 }, { 0x1C, 5 }, - { 0x17, 5 }, { 0xA4, 8 }, { 0x29BE, 14 }, { 0x537F, 15 }, - { 0x537E, 15 }, { 0x29B9, 14 }, { 0x29B8, 14 }, { 0x29BB, 14 }, - { 0x29BA, 14 }, { 0x29BD, 14 }, { 0x29BC, 14 }, { 0xF, 4 }, - { 0x0, 4 }, { 0x5, 5 }, { 0x16, 5 }, { 0x1D, 5 }, - { 0x6, 4 }, { 0x1, 4 }, { 0xA5, 8 }, { 0x14C, 9 } + { 24, 4 }, { 29, 4 }, { 4, 5 }, { 25, 5 }, { 3, 4 }, { 0, 3 }, + { 28, 4 }, { 1, 4 }, { 10, 3 }, { 7, 6 }, { 13, 8 }, { 30, 8 }, + { 31, 9 }, { 8, 10 }, { 6, 11 }, { 18, 14 }, { 17, 14 }, { 20, 14 }, + { 19, 14 }, { 22, 14 }, { 21, 14 }, { 14, 14 }, { 16, 15 }, { 15, 15 }, + { 5, 8 }, { 2, 5 }, { 26, 5 }, { 12, 5 }, { 9, 3 }, { 11, 5 }, + { 27, 5 }, { 23, 4 }, }, { /* AC bias group 4, table 7 */ - { 0x4, 3 }, { 0x7, 4 }, { 0x1A, 5 }, { 0xC, 4 }, - { 0x6, 4 }, { 0x29, 6 }, { 0x1BD, 9 }, { 0x1BE3, 13 }, - { 0x1BE0, 13 }, { 0x0, 2 }, { 0x7, 3 }, { 0x6E, 7 }, - { 0x1BC, 9 }, { 0x37C3, 14 }, { 0x37C2, 14 }, { 0x37CD, 14 }, - { 0x37CC, 14 }, { 0x37CF, 14 }, { 0x37CE, 14 }, { 0x37C9, 14 }, - { 0x37C8, 14 }, { 0x37CB, 14 }, { 0x37CA, 14 }, { 0x15, 5 }, - { 0x1BF, 9 }, { 0x37D, 10 }, { 0x36, 6 }, { 0x2, 3 }, - { 0xB, 4 }, { 0x28, 6 }, { 0x37C5, 14 }, { 0x37C4, 14 } + { 9, 2 }, { 27, 3 }, { 4, 4 }, { 1, 4 }, { 0, 3 }, { 29, 6 }, + { 5, 6 }, { 23, 5 }, { 28, 4 }, { 3, 4 }, { 2, 5 }, { 26, 6 }, + { 11, 7 }, { 12, 9 }, { 6, 9 }, { 8, 13 }, { 14, 14 }, { 13, 14 }, + { 31, 14 }, { 30, 14 }, { 7, 13 }, { 20, 14 }, { 19, 14 }, { 22, 14 }, + { 21, 14 }, { 16, 14 }, { 15, 14 }, { 18, 14 }, { 17, 14 }, { 25, 10 }, + { 24, 9 }, { 10, 3 }, }, { /* AC bias group 4, table 8 */ - { 0x1, 3 }, { 0x9, 5 }, { 0x3, 6 }, { 0x2, 6 }, - { 0x11F, 10 }, { 0x8E9, 13 }, { 0x8E8, 13 }, { 0x2D, 7 }, - { 0x22, 7 }, { 0x6, 3 }, { 0x7, 3 }, { 0x10, 5 }, - { 0x11, 5 }, { 0x17, 6 }, { 0x2C, 7 }, { 0x46, 8 }, - { 0x11E, 10 }, { 0x11C, 10 }, { 0x477, 12 }, { 0x8EB, 13 }, - { 0x8EA, 13 }, { 0x8ED, 13 }, { 0x8EC, 13 }, { 0x3, 3 }, - { 0xB, 4 }, { 0x1, 4 }, { 0x14, 5 }, { 0xA, 5 }, - { 0x9, 4 }, { 0x15, 5 }, { 0x0, 5 }, { 0x10, 6 } + { 30, 5 }, { 3, 6 }, { 2, 6 }, { 25, 4 }, { 0, 3 }, { 31, 6 }, + { 8, 7 }, { 15, 8 }, { 17, 10 }, { 6, 13 }, { 5, 13 }, { 20, 13 }, + { 19, 13 }, { 22, 13 }, { 21, 13 }, { 18, 12 }, { 16, 10 }, { 4, 10 }, + { 1, 5 }, { 27, 5 }, { 14, 7 }, { 7, 7 }, { 13, 6 }, { 23, 3 }, + { 11, 5 }, { 12, 5 }, { 28, 4 }, { 26, 5 }, { 29, 5 }, { 24, 4 }, + { 9, 3 }, { 10, 3 }, }, { /* AC bias group 4, table 9 */ - { 0x1, 3 }, { 0x1D, 5 }, { 0x22, 6 }, { 0x13, 6 }, - { 0x11E, 9 }, { 0x8FC, 12 }, { 0x23F5, 14 }, { 0x23, 7 }, - { 0x22, 7 }, { 0x5, 3 }, { 0x6, 3 }, { 0x10, 5 }, - { 0xB, 5 }, { 0x10, 6 }, { 0x8E, 8 }, { 0x23E, 10 }, - { 0x8FF, 12 }, { 0x11FD, 13 }, { 0x23F4, 14 }, { 0x23F7, 14 }, - { 0x23F6, 14 }, { 0x23F9, 14 }, { 0x23F8, 14 }, { 0x3, 3 }, - { 0x9, 4 }, { 0x0, 4 }, { 0x1C, 5 }, { 0xA, 5 }, - { 0xF, 4 }, { 0x1, 4 }, { 0x12, 6 }, { 0x46, 7 } + { 25, 4 }, { 29, 4 }, { 0, 3 }, { 13, 6 }, { 8, 7 }, { 7, 7 }, + { 30, 6 }, { 3, 6 }, { 27, 5 }, { 12, 5 }, { 23, 3 }, { 11, 5 }, + { 2, 6 }, { 31, 7 }, { 14, 8 }, { 4, 9 }, { 15, 10 }, { 5, 12 }, + { 18, 14 }, { 6, 14 }, { 20, 14 }, { 19, 14 }, { 22, 14 }, { 21, 14 }, + { 17, 13 }, { 16, 12 }, { 24, 4 }, { 9, 3 }, { 10, 3 }, { 26, 5 }, + { 1, 5 }, { 28, 4 }, }, { /* AC bias group 4, table 10 */ - { 0x3, 3 }, { 0x1F, 5 }, { 0x3C, 6 }, { 0x3D, 6 }, - { 0x86, 8 }, { 0x877, 12 }, { 0x10E8, 13 }, { 0x41, 7 }, - { 0x40, 7 }, { 0x5, 3 }, { 0x6, 3 }, { 0x7, 5 }, - { 0x6, 5 }, { 0x4, 6 }, { 0x10F, 9 }, { 0x21C, 10 }, - { 0x875, 12 }, { 0x21D3, 14 }, { 0x21D2, 14 }, { 0x21D9, 14 }, - { 0x21D8, 14 }, { 0x21DB, 14 }, { 0x21DA, 14 }, { 0x2, 3 }, - { 0x9, 4 }, { 0x0, 4 }, { 0x11, 5 }, { 0x3, 5 }, - { 0xE, 4 }, { 0x2, 4 }, { 0x5, 6 }, { 0x42, 7 } + { 25, 4 }, { 13, 6 }, { 30, 6 }, { 27, 5 }, { 29, 4 }, { 12, 5 }, + { 11, 5 }, { 23, 3 }, { 0, 3 }, { 8, 7 }, { 7, 7 }, { 31, 7 }, + { 4, 8 }, { 15, 10 }, { 6, 13 }, { 18, 14 }, { 17, 14 }, { 16, 12 }, + { 20, 14 }, { 19, 14 }, { 22, 14 }, { 21, 14 }, { 5, 12 }, { 14, 9 }, + { 26, 5 }, { 24, 4 }, { 9, 3 }, { 10, 3 }, { 28, 4 }, { 2, 6 }, + { 3, 6 }, { 1, 5 }, }, { /* AC bias group 4, table 11 */ - { 0x4, 3 }, { 0x1, 4 }, { 0x3D, 6 }, { 0x9, 5 }, - { 0xF3, 8 }, { 0x793, 11 }, { 0x1E45, 13 }, { 0x0, 7 }, - { 0x2, 7 }, { 0x5, 3 }, { 0x6, 3 }, { 0x8, 5 }, - { 0x1, 5 }, { 0x3, 7 }, { 0x1E5, 9 }, { 0x792, 11 }, - { 0x1E44, 13 }, { 0x1E47, 13 }, { 0x1E46, 13 }, { 0x1E41, 13 }, - { 0x1E40, 13 }, { 0x1E43, 13 }, { 0x1E42, 13 }, { 0x1, 3 }, - { 0x6, 4 }, { 0x1F, 5 }, { 0xF, 5 }, { 0xE, 5 }, - { 0xE, 4 }, { 0x5, 4 }, { 0x78, 7 }, { 0x1, 7 } + { 7, 7 }, { 31, 7 }, { 8, 7 }, { 13, 7 }, { 12, 5 }, { 1, 4 }, + { 23, 3 }, { 11, 5 }, { 3, 5 }, { 29, 4 }, { 24, 4 }, { 27, 5 }, + { 26, 5 }, { 0, 3 }, { 9, 3 }, { 10, 3 }, { 28, 4 }, { 30, 7 }, + { 20, 13 }, { 19, 13 }, { 22, 13 }, { 21, 13 }, { 16, 13 }, { 6, 13 }, + { 18, 13 }, { 17, 13 }, { 15, 11 }, { 5, 11 }, { 14, 9 }, { 4, 8 }, + { 2, 6 }, { 25, 5 }, }, { /* AC bias group 4, table 12 */ - { 0x4, 3 }, { 0x5, 4 }, { 0xE, 5 }, { 0x17, 5 }, - { 0x3E, 7 }, { 0xF0, 9 }, { 0xF1E, 13 }, { 0x7A, 8 }, - { 0x7F, 8 }, { 0x6, 3 }, { 0x7, 3 }, { 0x5, 5 }, - { 0x4, 5 }, { 0x7B, 8 }, { 0x1E2, 10 }, { 0x1E3F, 14 }, - { 0x1E3E, 14 }, { 0xF19, 13 }, { 0xF18, 13 }, { 0xF1B, 13 }, - { 0xF1A, 13 }, { 0xF1D, 13 }, { 0xF1C, 13 }, { 0x0, 3 }, - { 0x3, 4 }, { 0x16, 5 }, { 0x9, 5 }, { 0x8, 5 }, - { 0xA, 4 }, { 0x6, 4 }, { 0x7E, 8 }, { 0x79, 8 } + { 23, 3 }, { 12, 5 }, { 11, 5 }, { 24, 4 }, { 27, 5 }, { 26, 5 }, + { 1, 4 }, { 29, 4 }, { 2, 5 }, { 5, 9 }, { 14, 10 }, { 18, 13 }, + { 17, 13 }, { 20, 13 }, { 19, 13 }, { 22, 13 }, { 21, 13 }, { 6, 13 }, + { 16, 14 }, { 15, 14 }, { 31, 8 }, { 7, 8 }, { 13, 8 }, { 4, 7 }, + { 30, 8 }, { 8, 8 }, { 0, 3 }, { 28, 4 }, { 25, 5 }, { 3, 5 }, + { 9, 3 }, { 10, 3 }, }, { /* AC bias group 4, table 13 */ - { 0x5, 3 }, { 0xC, 4 }, { 0x1A, 5 }, { 0x4, 4 }, - { 0x1A, 6 }, { 0xDE, 9 }, { 0xDF4, 13 }, { 0xDD, 9 }, - { 0x6D, 8 }, { 0x0, 2 }, { 0x7, 3 }, { 0x25, 6 }, - { 0x24, 6 }, { 0xDC, 9 }, { 0xDF7, 13 }, { 0x1BEB, 14 }, - { 0x1BEA, 14 }, { 0xDF1, 13 }, { 0xDF0, 13 }, { 0xDF3, 13 }, - { 0xDF2, 13 }, { 0x1BED, 14 }, { 0x1BEC, 14 }, { 0x8, 4 }, - { 0x13, 5 }, { 0xC, 5 }, { 0x37, 6 }, { 0x36, 6 }, - { 0x5, 4 }, { 0x7, 4 }, { 0x6C, 8 }, { 0x1BF, 10 } + { 9, 2 }, { 3, 4 }, { 28, 4 }, { 25, 5 }, { 4, 6 }, { 30, 8 }, + { 8, 8 }, { 13, 9 }, { 7, 9 }, { 5, 9 }, { 18, 13 }, { 17, 13 }, + { 20, 13 }, { 19, 13 }, { 6, 13 }, { 16, 14 }, { 15, 14 }, { 22, 14 }, + { 21, 14 }, { 14, 13 }, { 31, 10 }, { 29, 4 }, { 23, 4 }, { 12, 6 }, + { 11, 6 }, { 24, 5 }, { 0, 3 }, { 1, 4 }, { 2, 5 }, { 27, 6 }, + { 26, 6 }, { 10, 3 }, }, { /* AC bias group 4, table 14 */ - { 0x5, 3 }, { 0xD, 4 }, { 0x1F, 5 }, { 0xC, 4 }, - { 0x3B, 6 }, { 0x40, 7 }, { 0x41A, 11 }, { 0x104, 9 }, - { 0x107, 9 }, { 0x1, 2 }, { 0x0, 2 }, { 0x24, 6 }, - { 0x21, 6 }, { 0x20B, 10 }, { 0x106E, 13 }, { 0x20DF, 14 }, - { 0x20DE, 14 }, { 0x1055, 13 }, { 0x1054, 13 }, { 0x1057, 13 }, - { 0x1056, 13 }, { 0x106D, 13 }, { 0x106C, 13 }, { 0x11, 5 }, - { 0x3A, 6 }, { 0x25, 6 }, { 0x38, 6 }, { 0x39, 6 }, - { 0x13, 5 }, { 0x1E, 5 }, { 0x20C, 10 }, { 0x414, 11 } + { 10, 2 }, { 9, 2 }, { 5, 7 }, { 7, 9 }, { 31, 11 }, { 18, 13 }, + { 17, 13 }, { 20, 13 }, { 19, 13 }, { 13, 10 }, { 30, 10 }, { 6, 11 }, + { 22, 13 }, { 21, 13 }, { 14, 13 }, { 16, 14 }, { 15, 14 }, { 8, 9 }, + { 12, 6 }, { 23, 5 }, { 11, 6 }, { 25, 6 }, { 28, 5 }, { 0, 3 }, + { 3, 4 }, { 1, 4 }, { 26, 6 }, { 27, 6 }, { 24, 6 }, { 4, 6 }, + { 29, 5 }, { 2, 5 }, }, { /* AC bias group 4, table 15 */ - { 0x0, 2 }, { 0x7, 4 }, { 0xD, 5 }, { 0x5, 4 }, - { 0x9, 5 }, { 0x22, 7 }, { 0xCD1, 13 }, { 0xCD0, 13 }, - { 0xCD3, 13 }, { 0x3, 2 }, { 0x2, 2 }, { 0x8D, 9 }, - { 0xCC, 9 }, { 0x66B, 12 }, { 0xCD2, 13 }, { 0x19B5, 14 }, - { 0x19B4, 14 }, { 0x19B7, 14 }, { 0x19B6, 14 }, { 0x19B1, 14 }, - { 0x19B0, 14 }, { 0x19B3, 14 }, { 0x19B2, 14 }, { 0x47, 8 }, - { 0x8C, 9 }, { 0x337, 11 }, { 0x67, 8 }, { 0x18, 6 }, - { 0x10, 6 }, { 0x32, 7 }, { 0xCD5, 13 }, { 0xCD4, 13 } - } + { 0, 2 }, { 28, 6 }, { 5, 7 }, { 24, 9 }, { 11, 9 }, { 23, 8 }, + { 4, 5 }, { 3, 4 }, { 27, 6 }, { 29, 7 }, { 12, 9 }, { 7, 13 }, + { 6, 13 }, { 14, 13 }, { 8, 13 }, { 31, 13 }, { 30, 13 }, { 13, 12 }, + { 20, 14 }, { 19, 14 }, { 22, 14 }, { 21, 14 }, { 16, 14 }, { 15, 14 }, + { 18, 14 }, { 17, 14 }, { 25, 11 }, { 26, 8 }, { 2, 5 }, { 1, 4 }, + { 10, 2 }, { 9, 2 }, + }, }; #endif /* AVCODEC_VP4DATA_H */ From patchwork Fri Nov 20 07:32:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23872 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 2CBFF449167 for ; Fri, 20 Nov 2020 09:48:20 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6FC0068BD0D; Fri, 20 Nov 2020 09:34:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D2D8F68B5E3 for ; Fri, 20 Nov 2020 09:34:28 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id 7so11547768ejm.0 for ; Thu, 19 Nov 2020 23:34:28 -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=+zRZFIDMkewC+lFjAg3BWPmxtEKZeeb5pfrz1660cwM=; b=jahOLrLGXMwec2vQTTp+7yep9iNYYH5SfCUruQEgcWsEJB51DXyKJazG2wR6esSmX7 F4GgfNbexWAknVd7uhVgaOA8aL83Kwh5k/HBc9CtNO3X1aFPhc7omoCv5SehSEr6etBi DUZMov/miKDDLz8xJc6MK63YWxTuZyIEx9OK+5T0FZqzi5ARrtloWfiZh0vqyiJdBR7w h3XmaU8oq3c5Rv2LE04lnMZsEKUllvNZHRDLwGv8qkBhls5LkwSOpbIfwf6ytS2TsnYd wBSjG/YeFriEsBdAKU09YVjoAjHWCaTuupRRq+2zHrcILlbUn19zi6Pp0+JqW8uva8Kx Q+0g== 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=+zRZFIDMkewC+lFjAg3BWPmxtEKZeeb5pfrz1660cwM=; b=dw2zPMc4RO8I3wWTSn3Gnwn8HuX7QtSD5JZS1/gvJLsbq99sQsYiazNcMraOxxsTEt WXNDuqFYhS320FSCy21QoN/oqGy7Xk2S21+2ox6W+8n2fkWe9dYylGnam+iuP01Upim+ beHsvFNmNvZDJI205hLw/amS6HZkNtg2MLAY017Lw4VFxRYi/B9S+IXVsN+bp+4mbA2O q+BjI7b5SnGKZFd2FfrR4KF4Uv3VDBQ6NtzJcqXUcWha4QtM3miYxW19Qusow3MXjDGx SStYDknEzrIJeiTpRVuzmgDgOJns7i9lcrc7NgCjZtyJEfofuozswAmBedom8uBIVrvS dBWw== X-Gm-Message-State: AOAM533CHoEC71/3inYxdUMwfJtH3SVbkHk1cDS2+Rxve25XNtJd8fCu syPqoNpKfgFRtqHn3khfi0nvxTs5rTVK3w== X-Google-Smtp-Source: ABdhPJyDpvUMLYAX86K/vtANEsIvF8xH8zNp0iZBVYDvPMEqewoSlALBUHKCO1rwwTp3RHsLVbmmEg== X-Received: by 2002:a17:906:2857:: with SMTP id s23mr21994117ejc.218.1605857667892; Thu, 19 Nov 2020 23:34:27 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:27 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:49 +0100 Message-Id: <20201120073327.820745-25-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 124/162] avcodec/vp3: Use symbols table for VP3 motion vectors 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" Expressions like array[get_vlc2()] can be optimized by using a symbols table if the array is always the same for a given VLC. This requirement is fulfilled for the VLC used for VP3 motion vectors. The reason it hasn't been done before is probably that the array in this case contained entries in the range -31..31; but this is no problem with ff_init_vlc_from_lengths(): Just apply an offset of 31 to the symbols before storing them in the table used to initialize VP3 motion vectors and apply an offset of -31 when initializing the actual VLC. Signed-off-by: Andreas Rheinhardt --- libavcodec/vp3.c | 21 +++++++++++++------- libavcodec/vp3data.h | 46 +++++++++++--------------------------------- 2 files changed, 25 insertions(+), 42 deletions(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 7d1d2411ab..2f43de757e 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -48,6 +48,7 @@ #include "vp3dsp.h" #include "xiph.h" +#define VP3_MV_VLC_BITS 6 #define VP4_MV_VLC_BITS 6 #define SUPERBLOCK_VLC_BITS 6 @@ -946,8 +947,10 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) case MODE_INTER_PLUS_MV: /* all 6 fragments use the same motion vector */ if (coding_mode == 0) { - motion_x[0] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)]; - motion_y[0] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)]; + motion_x[0] = get_vlc2(gb, s->motion_vector_vlc.table, + VP3_MV_VLC_BITS, 2); + motion_y[0] = get_vlc2(gb, s->motion_vector_vlc.table, + VP3_MV_VLC_BITS, 2); } else if (coding_mode == 1) { motion_x[0] = fixed_motion_vector_table[get_bits(gb, 6)]; motion_y[0] = fixed_motion_vector_table[get_bits(gb, 6)]; @@ -976,8 +979,10 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) current_fragment = BLOCK_Y * s->fragment_width[0] + BLOCK_X; if (s->all_fragments[current_fragment].coding_method != MODE_COPY) { if (coding_mode == 0) { - motion_x[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)]; - motion_y[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)]; + motion_x[k] = get_vlc2(gb, s->motion_vector_vlc.table, + VP3_MV_VLC_BITS, 2); + motion_y[k] = get_vlc2(gb, s->motion_vector_vlc.table, + VP3_MV_VLC_BITS, 2); } else if (coding_mode == 1) { motion_x[k] = fixed_motion_vector_table[get_bits(gb, 6)]; motion_y[k] = fixed_motion_vector_table[get_bits(gb, 6)]; @@ -2479,9 +2484,11 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) if (ret < 0) return ret; - if ((ret = init_vlc(&s->motion_vector_vlc, 6, 63, - &motion_vector_vlc_table[0][1], 2, 1, - &motion_vector_vlc_table[0][0], 2, 1, 0)) < 0) + ret = ff_init_vlc_from_lengths(&s->motion_vector_vlc, VP3_MV_VLC_BITS, 63, + &motion_vector_vlc_table[0][1], 2, + &motion_vector_vlc_table[0][0], 2, 1, + -31, 0, avctx); + if (ret < 0) return ret; #if CONFIG_VP4_DECODER diff --git a/libavcodec/vp3data.h b/libavcodec/vp3data.h index ae2b44f533..1fbeac731b 100644 --- a/libavcodec/vp3data.h +++ b/libavcodec/vp3data.h @@ -112,41 +112,17 @@ static const uint8_t mode_code_vlc_len[8] = { }; static const uint8_t motion_vector_vlc_table[63][2] = { - { 0, 3 }, - { 1, 3 }, - { 2, 3 }, - - { 6, 4 }, { 7, 4 }, - - { 8, 4 }, { 9, 4 }, - - { 40, 6 }, { 41, 6 }, { 42, 6 }, { 43, 6 }, - { 44, 6 }, { 45, 6 }, { 46, 6 }, { 47, 6 }, - - { 96, 7 }, { 97, 7 }, { 98, 7 }, { 99, 7 }, - { 100, 7 }, { 101, 7 }, { 102, 7 }, { 103, 7 }, - { 104, 7 }, { 105, 7 }, { 106, 7 }, { 107, 7 }, - { 108, 7 }, { 109, 7 }, { 110, 7 }, { 111, 7 }, - - { 0xE0, 8 }, { 0xE1, 8 }, { 0xE2, 8 }, { 0xE3, 8 }, - { 0xE4, 8 }, { 0xE5, 8 }, { 0xE6, 8 }, { 0xE7, 8 }, - { 0xE8, 8 }, { 0xE9, 8 }, { 0xEA, 8 }, { 0xEB, 8 }, - { 0xEC, 8 }, { 0xED, 8 }, { 0xEE, 8 }, { 0xEF, 8 }, - - { 0xF0, 8 }, { 0xF1, 8 }, { 0xF2, 8 }, { 0xF3, 8 }, - { 0xF4, 8 }, { 0xF5, 8 }, { 0xF6, 8 }, { 0xF7, 8 }, - { 0xF8, 8 }, { 0xF9, 8 }, { 0xFA, 8 }, { 0xFB, 8 }, - { 0xFC, 8 }, { 0xFD, 8 }, { 0xFE, 8 }, { 0xFF, 8 } -}; - -static const int8_t motion_vector_table[63] = { - 0, 1, -1, - 2, -2, - 3, -3, - 4, -4, 5, -5, 6, -6, 7, -7, - 8, -8, 9, -9, 10, -10, 11, -11, 12, -12, 13, -13, 14, -14, 15, -15, - 16, -16, 17, -17, 18, -18, 19, -19, 20, -20, 21, -21, 22, -22, 23, -23, - 24, -24, 25, -25, 26, -26, 27, -27, 28, -28, 29, -29, 30, -30, 31, -31 + { 31, 3 }, { 32, 3 }, { 30, 3 }, { 33, 4 }, { 29, 4 }, { 34, 4 }, + { 28, 4 }, { 35, 6 }, { 27, 6 }, { 36, 6 }, { 26, 6 }, { 37, 6 }, + { 25, 6 }, { 38, 6 }, { 24, 6 }, { 39, 7 }, { 23, 7 }, { 40, 7 }, + { 22, 7 }, { 41, 7 }, { 21, 7 }, { 42, 7 }, { 20, 7 }, { 43, 7 }, + { 19, 7 }, { 44, 7 }, { 18, 7 }, { 45, 7 }, { 17, 7 }, { 46, 7 }, + { 16, 7 }, { 47, 8 }, { 15, 8 }, { 48, 8 }, { 14, 8 }, { 49, 8 }, + { 13, 8 }, { 50, 8 }, { 12, 8 }, { 51, 8 }, { 11, 8 }, { 52, 8 }, + { 10, 8 }, { 53, 8 }, { 9, 8 }, { 54, 8 }, { 8, 8 }, { 55, 8 }, + { 7, 8 }, { 56, 8 }, { 6, 8 }, { 57, 8 }, { 5, 8 }, { 58, 8 }, + { 4, 8 }, { 59, 8 }, { 3, 8 }, { 60, 8 }, { 2, 8 }, { 61, 8 }, + { 1, 8 }, { 62, 8 }, { 0, 8 }, }; static const int8_t fixed_motion_vector_table[64] = { From patchwork Fri Nov 20 07:32: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: 23873 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 4EC0C449167 for ; Fri, 20 Nov 2020 09:48:32 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5167868BCF4; Fri, 20 Nov 2020 09:34:37 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E5E368BCE3 for ; Fri, 20 Nov 2020 09:34:29 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id s25so11524499ejy.6 for ; Thu, 19 Nov 2020 23:34:29 -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=25TZkiiY+3DGIOYHd0nBg+oUVVZwGTxQ1ma/vPaNZ6E=; b=JV3mxL6AdobmltMCsfWCIU7JUpdU/IB8eIjg5UPwFQnanMBGc/uQpezKNMddnqnGWT 3wZUAaeyAecoOlupzspXuNfLG4WSq22KPlSf6nEeqaLy1mnntwPSOVKMTa5xTGzEUMnV 5ftcHNwOlwK95Oe0cLP5RlaE8XeFY8ThKAoOVithlzyZ/p2dE05Ns8hjtU+PDhHI4THP gJKNhECZLfaM/1A+NRh7mM4HJRubKYfFWLEmIBOj1FLAKfMlTpsoI9qR+ygXXFSt/1K0 h7CLgWnKi0D24YTZ5JgouM4x50LV6ScSTEpEdKmQTL7MM/Wx6eWnCLA9o3g+qxQdYOPu Utgw== 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=25TZkiiY+3DGIOYHd0nBg+oUVVZwGTxQ1ma/vPaNZ6E=; b=ow0YQ8h2/VcfcSFO4PFlvBDDiQwEPh/gA0v5TmIahFPtVqTqvnNnNIwl7r4qzzA+MP KnCCzmyCTCHo68nhPlSv37qTpJeFFi0iFnGe7deOskGfJqCUXhoAmNMkPH5bQi0PgFoC mJxsfsLCTjT1Op9klPV8Qm82pKCwwzz1DQ31hhkayzmL5ngvIPueZX1dPJhpN3/x3N6A 8Qwi2jKF2QBS7sGaS/kn4NJpkk07u8uuwaf9nF5fPRR+jpL4vTjDugY9ytuk6jIUC30w LBV7e55L4P9J/XSbaqafpMsWdMsTvzS9qdKel8YRze/0Ae3BjwLWtBMlz4m6JElsDCC9 JjHQ== X-Gm-Message-State: AOAM532QxpXb6LuMTsdTplMS0mhpCKEyaTWM+pNlI8CorBLJI2LoDPEz j0bO6vzjPjWDTlO+EsF+2zlNwNUGmDL2nA== X-Google-Smtp-Source: ABdhPJxfeWARsnaxI/UtKG/bOrVk/OpKbSpRVVNHoo7qqAWghs7Rt879uN4wYhqUhcFanpG7IVOqUA== X-Received: by 2002:a17:906:8559:: with SMTP id h25mr8965507ejy.173.1605857668862; Thu, 19 Nov 2020 23:34:28 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:28 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:50 +0100 Message-Id: <20201120073327.820745-26-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 125/162] avcodec/vp3: Remove code duplication when initializing Theora 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" theora_init_huffman_tables() does essentially the same as ff_init_vlcs_from_lengths(). Signed-off-by: Andreas Rheinhardt --- libavcodec/vp3.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 2f43de757e..cf64a8c61e 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2319,20 +2319,6 @@ static av_cold int init_frames(Vp3DecodeContext *s) return 0; } -static av_cold int theora_init_huffman_tables(VLC *vlc, const HuffTable *huff) -{ - uint32_t code = 0, codes[32]; - - for (unsigned i = 0; i < huff->nb_entries; i++) { - codes[i] = code >> (31 - huff->entries[i].len); - code += 0x80000000U >> huff->entries[i].len; - } - return ff_init_vlc_sparse(vlc, 11, huff->nb_entries, - &huff->entries[0].len, sizeof(huff->entries[0]), 1, - codes, 4, 4, - &huff->entries[0].sym, sizeof(huff->entries[0]), 1, 0); -} - static av_cold int vp3_decode_init(AVCodecContext *avctx) { Vp3DecodeContext *s = avctx->priv_data; @@ -2460,7 +2446,12 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) } } else { for (i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { - ret = theora_init_huffman_tables(&s->coeff_vlc[i], &s->huffman_table[i]); + const HuffTable *tab = &s->huffman_table[i]; + + ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i], 11, tab->nb_entries, + &tab->entries[0].len, sizeof(*tab->entries), + &tab->entries[0].sym, sizeof(*tab->entries), 1, + 0, 0, avctx); if (ret < 0) return ret; } From patchwork Fri Nov 20 07:32:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23875 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 089B2449167 for ; Fri, 20 Nov 2020 09:49:01 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 82F7D68BCEE; Fri, 20 Nov 2020 09:34:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8B8A068BCE6 for ; Fri, 20 Nov 2020 09:34:30 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id f20so11519125ejz.4 for ; Thu, 19 Nov 2020 23:34:30 -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=nmc2UDwcOY+nOEmyMt8RAi5JykEHakFu6blHazAidt8=; b=IaXdt25xhzy6SO7F2qxxEwHC+FiCODfqqO9Iabjpm7OC6kB7d74h/AFCJAtEUZtcui i5G22SEtGF9cIJ8CLLWvHqcaLrmRG9WmewxvKUf/FpR8nrM4cpix1R3iMYJhEa+i2SVs sOjGepynzO3H2ZtU0di4BpznaOM9bTulkleJ6HCYlM4d0O7jL1dsF4fFT0lDcePHn15J dE6fJ0KpMsI+NLGi87qWl9jBa3CH8un8UdYrF+BJnSr4/jZpSABn/Bvzp3tJ3CZcjRSo GshI3NsArzH4ZzMlViaYHPZKLTYw5D4RhXcwVKDS/mSlAOXFQIX2DDTAY+Oh7jUMxhXm F/yg== 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=nmc2UDwcOY+nOEmyMt8RAi5JykEHakFu6blHazAidt8=; b=Ya+tXwR1etBjTGwubP87tQhGtkWGeC9lTiWeFPdJiMVcHBK2la9vPhXaW/iz1nPnCo LEEc0Z0luEJMGEh+/cOo0APQEFotRunhVDJveQ46HYwNC6P6S6TsJNKInXgysILMhAm8 TUclpc1AbCFIqBUwwydedD6SM2eSW8YO3vMxrnHdKIbpRLOVtHeM3ciW/tRU02IgBd1n gI9IRMo/mYqUKf6b840GekA5lqc8jUZkato3rbT/QVazgHA2i1QnRm79WsM3ERlJqlH2 N+3A7gRO+vtVSU3cB5InnPb2P0PPgi7NUuyEKetQrS1kZ1UNymEIyj8jsP6cZcl0s7n/ DgnA== X-Gm-Message-State: AOAM5328dbrx20CHZSF7POg7ZcMOEF7azLogrrUL2UejRdARIl3BS8JH QHjGFiU+QRawkoXow+mqF5hGZ0f/2p5wBw== X-Google-Smtp-Source: ABdhPJyytNIP5G/aHgS07uwomu4qhy/zeDVOFP8SfoFmgbHKVz4JlyljfFEqFgD1GCbLVUmoys7zNw== X-Received: by 2002:a17:906:4bcb:: with SMTP id x11mr30939863ejv.538.1605857669776; Thu, 19 Nov 2020 23:34:29 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:29 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:51 +0100 Message-Id: <20201120073327.820745-27-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 126/162] avcodec/intrax8: Replace always-false check by assert 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 | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index f385423dc1..390c10272e 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -46,7 +46,7 @@ static VLC j_ac_vlc[2][2][8]; // [quant < 13], [intra / inter], [select] static VLC j_dc_vlc[2][8]; // [quant], [select] static VLC j_orient_vlc[2][4]; // [quant], [select] -static av_cold int x8_vlc_init(void) +static av_cold void x8_vlc_init(void) { int i; int offset = 0; @@ -115,13 +115,7 @@ static av_cold int x8_vlc_init(void) init_or_vlc(j_orient_vlc[1][i], x8_orient_lowquant_table[i][0]); #undef init_or_vlc - if (offset != sizeof(table) / sizeof(VLC_TYPE) / 2) { - av_log(NULL, AV_LOG_ERROR, "table size %"SIZE_SPECIFIER" does not match needed %i\n", - sizeof(table) / sizeof(VLC_TYPE) / 2, offset); - return AVERROR_INVALIDDATA; - } - - return 0; + av_assert2(offset == FF_ARRAY_ELEMS(table)); } static void x8_reset_vlc_tables(IntraX8Context *w) @@ -731,10 +725,6 @@ av_cold int ff_intrax8_common_init(AVCodecContext *avctx, int block_last_index[12], int mb_width, int mb_height) { - int ret = x8_vlc_init(); - if (ret < 0) - return ret; - w->avctx = avctx; w->idsp = *idsp; w->mb_width = mb_width; @@ -762,6 +752,8 @@ av_cold int ff_intrax8_common_init(AVCodecContext *avctx, ff_intrax8dsp_init(&w->dsp); ff_blockdsp_init(&w->bdsp, avctx); + x8_vlc_init(); + return 0; } From patchwork Fri Nov 20 07:32:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23877 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 75EAE449298 for ; Fri, 20 Nov 2020 09:49:13 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 78A8C68BD1A; Fri, 20 Nov 2020 09:34:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BCEEA68BB03 for ; Fri, 20 Nov 2020 09:34:31 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id lv15so5670583ejb.12 for ; Thu, 19 Nov 2020 23:34: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=8Y2GlnOv+j+kxRP0Z82B+hQPJUKX9gg+8I1g9GXthDc=; b=ccZdSzgay8toU9qWvbMHJVb7ZG/pbGyum3hESDj3eSucWjlAol/tzygsQh2OX+r0Qc cgF9n68irz7DLTmtPiz5sAqTA4R15WgA019LE9VxqtjCtGIDzxWSEmaTowem+Ug73PtM 8AkEuFEO/oRWv/c9kVhnUNCiPgZ86Ymp+nb/vi/8rzIRBMO64t/zFq6miVbSqvsYtsy4 e+oX9fVszG1zGj3cCS8vQsaQsOkyzU0ZJCzblB14ibMt6UMF3mwqYTKigHIrlw3PYNwX hZIlulaPTrkA88kQT82HINzcsBv5c1pMoPsEDm0o5+E2NYUT5S9ZKr4VG26PtBwlomjW yjUg== 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=8Y2GlnOv+j+kxRP0Z82B+hQPJUKX9gg+8I1g9GXthDc=; b=sTLKsBXelqLYv72q/mT9UCZFK5llZAHzoDfDfy3FJfWh1lREonRV8hVF3CJmOvQAWU MPz4jeBBvRPEBr9cN4kd02G887xkHYiVPT6rt1ZZkQ7nlHsv6FAcaFL0bmHRp4+1jbDp sS3OnmcgXnSOStAwjkz9VAuDTLzuFOoSPZVhLgQesB6aJA/jTaaJjP06OBpfPDMb6C3O v7H314K+WD5syIh2P8hmoHisbWjMDATKuSrkM7+fbQbgR1AHLBLgS/dcHZbc4qpsxkeV SBo2yDLZ8FdjI7Q6pZL2zIGTrSEX1YAx/PK/RRZuoM6mwsbtPM4aFR3O4rsVo/VJA300 Mv5w== X-Gm-Message-State: AOAM532rbaS0lsgp13qRQAknRJBmXYDuoKb3orGo3WP1ELYnyl7rs3b6 GfazE3HGLnpdV21cJzndsIjbCUo1QtdeCQ== X-Google-Smtp-Source: ABdhPJyDy1gDrQpix40kmTMW9qK/KfGMApPbg9aY7pdxPooekgnzPL3C/O1JA+ozSxaL7r7nfN8PcQ== X-Received: by 2002:a17:906:7016:: with SMTP id n22mr33394014ejj.402.1605857670742; Thu, 19 Nov 2020 23:34:30 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:30 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:52 +0100 Message-Id: <20201120073327.820745-28-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 127/162] 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 | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index 390c10272e..2a93e5efd7 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -50,18 +50,6 @@ static av_cold void 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 void 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); \ + INIT_VLC_STATIC_OVERLONG); \ + offset += dst.table_size; \ } while(0) for (i = 0; i < 8; i++) { @@ -87,10 +75,10 @@ static av_cold void 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); \ + INIT_VLC_STATIC_OVERLONG); \ + offset += dst.table_size; \ } while(0) for (i = 0; i < 8; i++) { @@ -103,10 +91,10 @@ static av_cold void 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); \ + INIT_VLC_STATIC_OVERLONG); \ + offset += dst.table_size; \ } while(0) for (i = 0; i < 2; i++) From patchwork Fri Nov 20 07:32:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23878 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 D69E7449298 for ; Fri, 20 Nov 2020 09:49:24 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3907068BD3D; Fri, 20 Nov 2020 09:34:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 957EE68BCDD for ; Fri, 20 Nov 2020 09:34:32 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id f23so11549015ejk.2 for ; Thu, 19 Nov 2020 23:34:32 -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=KY8rfgmj6ueVsA2ZIALtb5f3Iq8PAspeA5NdidS6KlM=; b=SMyGqNIw87wL0WCv8ZcnHzLFq1GdtZqumV61pCnJriU0mAMg5eq6nCNIZXGkMKEgvX KpViVlVTqpF+YC+3xQ4etE1xSc2wqfh0AIrgpA2KoVPEWUQRjRyuqKVa2LNMqG5LIceN wooeFcbKbb+rO9h+BTEfSpXN3+7i59aNaZC2uDAdcwVmEYFjh9/UNxIFYBw7BSPXCEew QrPOPMUkir/T8xXzoK8dQPJXbgS39of4HvyKDrfJ8oFig0PkintZRXaexFYqopoi8y45 BjVvwgQSbSYlwO0NGc8ocp9yPaGEMwwLZvqZforFmjwLU9bYga3O3Kxy1htKEe8K5ABS 0JmQ== 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=KY8rfgmj6ueVsA2ZIALtb5f3Iq8PAspeA5NdidS6KlM=; b=ISsXqXQPN1cxV1QEBeTas+NBAEpVgvSl11UK/rUwoIoDgzJkjAyV3TfNhssuYMitRr 3szYzb0uz/gnBNU/pV0iyyP0XrrcuEAo6zk/w0E1VgklEJ5QURY7b74j1JvKq77jBW5b r+5me+siggWqP3/IlBAUs2G4dVuQz2+j8yX+YPARTA3FTTyZhCkZCJOghqszW15cP+wG 7FKG+ViWWMCESVLPLX/ytYBc7q4PnpA/sEs6g0h9xlsI8m8bzj3JOCWV7yW6IUTmXl/q 7D3l/MnTw8RdTNjGeeDZxXOXrgqHT2jTepLbSRqTzEWMKB6ayVH7vgxBS+QgVsd6Avtx qN+Q== X-Gm-Message-State: AOAM532tMjkhtmKVG2Fw1dEh5EPArqkj1Y0LWITfJqkuukrKljpYNl4H H5ygyKNAOEb9fdmYCqHlO7xmGgkWnFvayg== X-Google-Smtp-Source: ABdhPJzecYj0MU7nHLES2+ifN0AGXVP1TH1g4BbnaHWExGhuWRriQRlT0CNu1d5DQg7OOmBEc7AY7A== X-Received: by 2002:a17:906:5017:: with SMTP id s23mr33426733ejj.359.1605857671744; Thu, 19 Nov 2020 23:34:31 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:31 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:53 +0100 Message-Id: <20201120073327.820745-29-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 128/162] avcodec/intrax8: 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/intrax8.c | 46 ++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index 2a93e5efd7..9a2984c15b 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -31,6 +31,8 @@ #include "intrax8dsp.h" #include "mpegutils.h" +#define VLC_BUFFER_SIZE 28150 + #define MAX_TABLE_DEPTH(table_bits, max_bits) \ ((max_bits + table_bits - 1) / table_bits) @@ -46,21 +48,27 @@ static VLC j_ac_vlc[2][2][8]; // [quant < 13], [intra / inter], [select] static VLC j_dc_vlc[2][8]; // [quant], [select] static VLC j_orient_vlc[2][4]; // [quant], [select] +static av_cold void x8_init_vlc(VLC *vlc, int nb_bits, int nb_codes, + int *offset, const uint16_t table[][2]) +{ + static VLC_TYPE vlc_buf[VLC_BUFFER_SIZE][2]; + + vlc->table = &vlc_buf[*offset]; + vlc->table_allocated = VLC_BUFFER_SIZE - *offset; + init_vlc(vlc, nb_bits, nb_codes, &table[0][1], 4, 2, + &table[0][0], 4, 2, INIT_VLC_STATIC_OVERLONG); + *offset += vlc->table_size; +} + static av_cold void x8_vlc_init(void) { int i; int offset = 0; - static VLC_TYPE table[28150][2]; - // set ac tables #define init_ac_vlc(dst, src) \ do { \ - dst.table = &table[offset]; \ - 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_STATIC_OVERLONG); \ - offset += dst.table_size; \ + x8_init_vlc(&dst, AC_VLC_BITS, 77, &offset, &src); \ } while(0) for (i = 0; i < 8; i++) { @@ -74,11 +82,7 @@ static av_cold void x8_vlc_init(void) // set dc tables #define init_dc_vlc(dst, src) \ do { \ - dst.table = &table[offset]; \ - 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_STATIC_OVERLONG); \ - offset += dst.table_size; \ + x8_init_vlc(&dst, DC_VLC_BITS, 34, &offset, &src); \ } while(0) for (i = 0; i < 8; i++) { @@ -88,22 +92,14 @@ static av_cold void x8_vlc_init(void) #undef init_dc_vlc // set orient tables -#define init_or_vlc(dst, src) \ - do { \ - dst.table = &table[offset]; \ - 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_STATIC_OVERLONG); \ - offset += dst.table_size; \ - } while(0) - for (i = 0; i < 2; i++) - init_or_vlc(j_orient_vlc[0][i], x8_orient_highquant_table[i][0]); + x8_init_vlc(&j_orient_vlc[0][i], OR_VLC_BITS, 12, + &offset, x8_orient_highquant_table[i]); for (i = 0; i < 4; i++) - init_or_vlc(j_orient_vlc[1][i], x8_orient_lowquant_table[i][0]); -#undef init_or_vlc + x8_init_vlc(&j_orient_vlc[1][i], OR_VLC_BITS, 12, + &offset, x8_orient_lowquant_table[i]); - av_assert2(offset == FF_ARRAY_ELEMS(table)); + av_assert2(offset == VLC_BUFFER_SIZE); } static void x8_reset_vlc_tables(IntraX8Context *w) From patchwork Fri Nov 20 07:32:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23881 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 6D229449298 for ; Fri, 20 Nov 2020 09:49:58 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D77B268BD48; Fri, 20 Nov 2020 09:34:46 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EC8BA68BCBD for ; Fri, 20 Nov 2020 09:34:36 +0200 (EET) Received: by mail-ej1-f52.google.com with SMTP id f23so11549212ejk.2 for ; Thu, 19 Nov 2020 23:34:36 -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=uqNhlQ0yanNAqueFAUQ/V57DwDTnj7GkNTqrOJyAXIY=; b=neGQOh84HEAINdJh9l9hrZS2ijletY6zgzHHgLnJx6fx63Bet6oY/D07nPbEOYhSDC w96Jema69lWzwJ8kOzlcvG9oXEcT8I/SQr2yoGyas45yYbABXQrHn+4SRKBM1vjdLKCi 6tQ3VHf5REDJkU5G2/F4p1Mkl4ABw+DkmZIxlRRjl0SPzrateGEyBrNzzVjhA4kL0nYi w/AbCpFvCq/LxvpqzDuZ7C6txveHsFmbhtTZ/mlN9HJLiR1aA+6PbfZi5j8Zjmg3sdio SQ9cqmf1d7Gi2MGo0aFO8ebLTWXc6pHAieO+m9J6vtkQhwtoaXBG2W2OrN1VoXHeMSZV 4lmg== 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=uqNhlQ0yanNAqueFAUQ/V57DwDTnj7GkNTqrOJyAXIY=; b=s4D9FRno8JakAehBsDlhTunsL31las849IGpd2Kov2FWKX46GUoLRTbLyJG4i+nXPi w3++FgWBwrqTGmWIzl6STC/2u77idTfqOqWdDoZLxeZoAwOEGDIzgwhP0+CYfB4sccQD iQQpLhsej/uo6voTsUv2rJxZ40a3cW0alS7M4sGTT38zynmX4jqq4uDQJYKIvaDivGqI 84Ul8yg6oj83dDVbUKBTLYqf1R4Wvea7RqA23g9JhGR6y6jlbo8D7whLkfuaNo3f+b2a YyKJZAabHZep7e7tAYF0IvPIEgVB3lPinPCN1DvSbJnKT08Op8xVykcuwZBjwQ+s8sFO FLYg== X-Gm-Message-State: AOAM530ByqYPWqei8MCFJmhVHnVhTh4YdArCkjuN/nDlVfFGvuaGgrbU rmm/X+ur34cmxZm7I77Qtn3rPQLR3GQ7gw== X-Google-Smtp-Source: ABdhPJybJYeQ9JDHdQb58NG7P1RnsVZC1PxZ1CCYkM7IZtWkPvplp3AFIFWEuItnhIk3zExjHhA2wg== X-Received: by 2002:a17:906:d0cd:: with SMTP id bq13mr30599424ejb.372.1605857673308; Thu, 19 Nov 2020 23:34:33 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:32 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:54 +0100 Message-Id: <20201120073327.820745-30-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 129/162] avcodec/intrax8: Reduce the size of tables used to initialize 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" By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one can replace an array of codes of type uint16_t with an array of symbols of type uint8_t, saving space. Also remove some more code duplication while at it. Signed-off-by: Andreas Rheinhardt --- libavcodec/intrax8.c | 37 +- libavcodec/intrax8huf.h | 1674 ++++++++++++++++++--------------------- 2 files changed, 768 insertions(+), 943 deletions(-) diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index 9a2984c15b..b62bff3b48 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -49,14 +49,14 @@ static VLC j_dc_vlc[2][8]; // [quant], [select] static VLC j_orient_vlc[2][4]; // [quant], [select] static av_cold void x8_init_vlc(VLC *vlc, int nb_bits, int nb_codes, - int *offset, const uint16_t table[][2]) + int *offset, const uint8_t table[][2]) { static VLC_TYPE vlc_buf[VLC_BUFFER_SIZE][2]; vlc->table = &vlc_buf[*offset]; vlc->table_allocated = VLC_BUFFER_SIZE - *offset; - init_vlc(vlc, nb_bits, nb_codes, &table[0][1], 4, 2, - &table[0][0], 4, 2, INIT_VLC_STATIC_OVERLONG); + ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, &table[0][1], 2, + &table[0][0], 2, 1, 0, INIT_VLC_STATIC_OVERLONG, NULL); *offset += vlc->table_size; } @@ -66,30 +66,17 @@ static av_cold void x8_vlc_init(void) int offset = 0; // set ac tables -#define init_ac_vlc(dst, src) \ - do { \ - x8_init_vlc(&dst, AC_VLC_BITS, 77, &offset, &src); \ - } while(0) - - for (i = 0; i < 8; i++) { - init_ac_vlc(j_ac_vlc[0][0][i], x8_ac0_highquant_table[i][0]); - init_ac_vlc(j_ac_vlc[0][1][i], x8_ac1_highquant_table[i][0]); - init_ac_vlc(j_ac_vlc[1][0][i], x8_ac0_lowquant_table[i][0]); - init_ac_vlc(j_ac_vlc[1][1][i], x8_ac1_lowquant_table[i][0]); - } -#undef init_ac_vlc + for (int i = 0; i < 2; i++) + for (int j = 0; j < 2; j++) + for (int k = 0; k < 8; k++) + x8_init_vlc(&j_ac_vlc[i][j][k], AC_VLC_BITS, 77, + &offset, x8_ac_quant_table[i][j][k]); // set dc tables -#define init_dc_vlc(dst, src) \ - do { \ - x8_init_vlc(&dst, DC_VLC_BITS, 34, &offset, &src); \ - } while(0) - - for (i = 0; i < 8; i++) { - init_dc_vlc(j_dc_vlc[0][i], x8_dc_highquant_table[i][0]); - init_dc_vlc(j_dc_vlc[1][i], x8_dc_lowquant_table[i][0]); - } -#undef init_dc_vlc + for (int i = 0; i < 2; i++) + for (int j = 0; j < 8; j++) + x8_init_vlc(&j_dc_vlc[i][j], DC_VLC_BITS, 34, &offset, + x8_dc_quant_table[i][j]); // set orient tables for (i = 0; i < 2; i++) diff --git a/libavcodec/intrax8huf.h b/libavcodec/intrax8huf.h index 558d0e540d..f91b6728cc 100644 --- a/libavcodec/intrax8huf.h +++ b/libavcodec/intrax8huf.h @@ -21,939 +21,777 @@ #include -static const uint16_t x8_orient_lowquant_table[4][12][2] = { - { // 0 - { 0x0000, 1 }, { 0x0004, 3 }, { 0x0005, 3 }, { 0x000C, 4 }, - { 0x000D, 4 }, { 0x0038, 6 }, { 0x001D, 5 }, { 0x0039, 6 }, - { 0x003C, 6 }, { 0x003D, 6 }, { 0x003E, 6 }, { 0x003F, 6 }, +static const uint8_t x8_orient_lowquant_table[4][12][2] = { + { /* Orient lowquant table 0 */ + { 0, 1 }, { 1, 3 }, { 2, 3 }, { 3, 4 }, { 4, 4 }, { 5, 6 }, + { 7, 6 }, { 6, 5 }, { 8, 6 }, { 9, 6 }, { 10, 6 }, { 11, 6 }, }, - { // 1 - { 0x0000, 5 }, { 0x0001, 5 }, { 0x0002, 5 }, { 0x0001, 2 }, - { 0x0002, 2 }, { 0x0002, 4 }, { 0x0003, 5 }, { 0x0006, 3 }, - { 0x0003, 4 }, { 0x000E, 4 }, { 0x001E, 5 }, { 0x001F, 5 }, + { /* Orient lowquant table 1 */ + { 0, 5 }, { 1, 5 }, { 2, 5 }, { 6, 5 }, { 5, 4 }, { 8, 4 }, + { 3, 2 }, { 4, 2 }, { 7, 3 }, { 9, 4 }, { 10, 5 }, { 11, 5 }, }, - { // 2 - { 0x0000, 2 }, { 0x0001, 2 }, { 0x0004, 3 }, { 0x0005, 3 }, - { 0x0006, 3 }, { 0x0038, 6 }, { 0x0039, 6 }, { 0x001D, 5 }, - { 0x003C, 6 }, { 0x003D, 6 }, { 0x003E, 6 }, { 0x003F, 6 }, + { /* Orient lowquant table 2 */ + { 0, 2 }, { 1, 2 }, { 2, 3 }, { 3, 3 }, { 4, 3 }, { 5, 6 }, + { 6, 6 }, { 7, 5 }, { 8, 6 }, { 9, 6 }, { 10, 6 }, { 11, 6 }, }, - { // 3 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0003, 4 }, { 0x0001, 2 }, - { 0x0002, 2 }, { 0x0018, 5 }, { 0x0019, 5 }, { 0x000D, 4 }, - { 0x001C, 5 }, { 0x001D, 5 }, { 0x001E, 5 }, { 0x001F, 5 }, + { /* Orient lowquant table 3 */ + { 0, 3 }, { 1, 4 }, { 2, 4 }, { 3, 2 }, { 4, 2 }, { 5, 5 }, + { 6, 5 }, { 7, 4 }, { 8, 5 }, { 9, 5 }, { 10, 5 }, { 11, 5 }, }, }; -static const uint16_t x8_orient_highquant_table[2][12][2] = { - { // 0 - { 0x0000, 2 }, { 0x0001, 2 }, { 0x0004, 3 }, { 0x0005, 3 }, - { 0x0006, 3 }, { 0x0038, 6 }, { 0x001D, 5 }, { 0x0039, 6 }, - { 0x003C, 6 }, { 0x003D, 6 }, { 0x003E, 6 }, { 0x003F, 6 }, +static const uint8_t x8_orient_highquant_table[2][12][2] = { + { /* Orient highquant table 0 */ + { 0, 2 }, { 1, 2 }, { 2, 3 }, { 3, 3 }, { 4, 3 }, { 5, 6 }, + { 7, 6 }, { 6, 5 }, { 8, 6 }, { 9, 6 }, { 10, 6 }, { 11, 6 }, }, - { // 1 - { 0x0000, 1 }, { 0x0002, 2 }, { 0x0006, 3 }, { 0x001C, 5 }, - { 0x001D, 5 }, { 0x0078, 7 }, { 0x003D, 6 }, { 0x0079, 7 }, - { 0x007C, 7 }, { 0x007D, 7 }, { 0x007E, 7 }, { 0x007F, 7 }, + { /* Orient highquant table 1 */ + { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 5 }, { 4, 5 }, { 5, 7 }, + { 7, 7 }, { 6, 6 }, { 8, 7 }, { 9, 7 }, { 10, 7 }, { 11, 7 }, }, }; #define MAX_OR_VLC_BITS 7 -static const uint16_t x8_dc_lowquant_table[8][34][2] = { - { // 0 - { 0x0000, 5 }, { 0x0001, 4 }, { 0x0001, 5 }, { 0x0004, 5 }, - { 0x0005, 5 }, { 0x0006, 5 }, { 0x000E, 6 }, { 0x000F, 6 }, - { 0x0040, 8 }, { 0x0041, 8 }, { 0x0840, 13 }, { 0x0841, 13 }, - { 0x0842, 13 }, { 0x0843, 13 }, { 0x0844, 13 }, { 0x0845, 13 }, - { 0x0846, 13 }, { 0x0002, 2 }, { 0x0003, 2 }, { 0x0003, 3 }, - { 0x0005, 4 }, { 0x0009, 5 }, { 0x0011, 6 }, { 0x0043, 8 }, - { 0x0085, 9 }, { 0x0847, 13 }, { 0x0848, 13 }, { 0x0849, 13 }, - { 0x084A, 13 }, { 0x084B, 13 }, { 0x084C, 13 }, { 0x084D, 13 }, - { 0x084E, 13 }, { 0x084F, 13 }, - }, - { // 1 - { 0x0000, 4 }, { 0x0001, 3 }, { 0x0002, 3 }, { 0x0001, 4 }, - { 0x0006, 4 }, { 0x0004, 3 }, { 0x0007, 4 }, { 0x0005, 3 }, - { 0x000C, 4 }, { 0x000D, 4 }, { 0x001C, 5 }, { 0x003A, 6 }, - { 0x01D8, 9 }, { 0x01D9, 9 }, { 0x1DA0, 13 }, { 0x1DA1, 13 }, - { 0x1DA2, 13 }, { 0x003C, 6 }, { 0x003D, 6 }, { 0x003E, 6 }, - { 0x0077, 7 }, { 0x01DB, 9 }, { 0x007E, 7 }, { 0x00FE, 8 }, - { 0x01FE, 9 }, { 0x1DA3, 13 }, { 0x1DA4, 13 }, { 0x1DA5, 13 }, - { 0x0ED3, 12 }, { 0x0ED4, 12 }, { 0x01FF, 9 }, { 0x0ED5, 12 }, - { 0x0ED6, 12 }, { 0x0ED7, 12 }, - }, - { // 2 - { 0x0000, 4 }, { 0x0001, 3 }, { 0x0002, 3 }, { 0x0001, 4 }, - { 0x0006, 4 }, { 0x0007, 4 }, { 0x0008, 4 }, { 0x0009, 4 }, - { 0x0028, 6 }, { 0x0029, 6 }, { 0x0054, 7 }, { 0x0055, 7 }, - { 0x0AC0, 12 }, { 0x0AC1, 12 }, { 0x0AC2, 12 }, { 0x0AC3, 12 }, - { 0x0AC4, 12 }, { 0x000B, 4 }, { 0x0006, 3 }, { 0x000E, 4 }, - { 0x001E, 5 }, { 0x003E, 6 }, { 0x003F, 6 }, { 0x0057, 7 }, - { 0x00AD, 8 }, { 0x0AC5, 12 }, { 0x0AC6, 12 }, { 0x0AC7, 12 }, - { 0x0AC8, 12 }, { 0x0AC9, 12 }, { 0x0ACA, 12 }, { 0x0ACB, 12 }, - { 0x0566, 11 }, { 0x0567, 11 }, - }, - { // 3 - { 0x0000, 4 }, { 0x0001, 2 }, { 0x0001, 3 }, { 0x0004, 3 }, - { 0x0005, 3 }, { 0x0006, 3 }, { 0x0001, 4 }, { 0x000E, 4 }, - { 0x003C, 6 }, { 0x003D, 6 }, { 0x007C, 7 }, { 0x00FA, 8 }, - { 0x3EC0, 14 }, { 0x3EC1, 14 }, { 0x3EC2, 14 }, { 0x3EC3, 14 }, - { 0x1F62, 13 }, { 0x01F7, 9 }, { 0x007E, 7 }, { 0x00FE, 8 }, - { 0x00FF, 8 }, { 0x1F63, 13 }, { 0x1F64, 13 }, { 0x1F65, 13 }, - { 0x1F66, 13 }, { 0x1F67, 13 }, { 0x1F68, 13 }, { 0x1F69, 13 }, - { 0x1F6A, 13 }, { 0x1F6B, 13 }, { 0x1F6C, 13 }, { 0x1F6D, 13 }, - { 0x1F6E, 13 }, { 0x1F6F, 13 }, - }, - { // 4 - { 0x0000, 7 }, { 0x0001, 7 }, { 0x0002, 7 }, { 0x0003, 7 }, - { 0x0004, 7 }, { 0x0005, 7 }, { 0x0006, 7 }, { 0x0007, 7 }, - { 0x0008, 7 }, { 0x0009, 7 }, { 0x000A, 7 }, { 0x000B, 7 }, - { 0x000C, 7 }, { 0x000D, 7 }, { 0x000E, 7 }, { 0x000F, 7 }, - { 0x0010, 7 }, { 0x0001, 1 }, { 0x0001, 2 }, { 0x0011, 7 }, - { 0x0012, 7 }, { 0x0013, 7 }, { 0x0014, 7 }, { 0x0015, 7 }, - { 0x0016, 7 }, { 0x0017, 7 }, { 0x0018, 7 }, { 0x0019, 7 }, - { 0x001A, 7 }, { 0x001B, 7 }, { 0x001C, 7 }, { 0x001D, 7 }, - { 0x001E, 7 }, { 0x001F, 7 }, - }, - { // 5 - { 0x0000, 5 }, { 0x0001, 4 }, { 0x0001, 5 }, { 0x0008, 6 }, - { 0x0009, 6 }, { 0x000A, 6 }, { 0x0016, 7 }, { 0x000C, 6 }, - { 0x0017, 7 }, { 0x000D, 6 }, { 0x0038, 8 }, { 0x001D, 7 }, - { 0x0039, 8 }, { 0x0780, 13 }, { 0x0781, 13 }, { 0x0782, 13 }, - { 0x0783, 13 }, { 0x0002, 3 }, { 0x0001, 1 }, { 0x0003, 3 }, - { 0x001F, 7 }, { 0x003D, 8 }, { 0x0079, 9 }, { 0x0784, 13 }, - { 0x0785, 13 }, { 0x0786, 13 }, { 0x0787, 13 }, { 0x0788, 13 }, - { 0x0789, 13 }, { 0x078A, 13 }, { 0x078B, 13 }, { 0x078C, 13 }, - { 0x078D, 13 }, { 0x03C7, 12 }, - }, - { // 6 - { 0x0000, 4 }, { 0x0001, 2 }, { 0x0001, 3 }, { 0x0004, 3 }, - { 0x0001, 4 }, { 0x000A, 4 }, { 0x0016, 5 }, { 0x002E, 6 }, - { 0x005E, 7 }, { 0x005F, 7 }, { 0x00C0, 8 }, { 0x3040, 14 }, - { 0x3041, 14 }, { 0x0305, 10 }, { 0x0183, 9 }, { 0x3042, 14 }, - { 0x3043, 14 }, { 0x000D, 4 }, { 0x0007, 3 }, { 0x0019, 5 }, - { 0x0031, 6 }, { 0x00C2, 8 }, { 0x00C3, 8 }, { 0x3044, 14 }, - { 0x3045, 14 }, { 0x3046, 14 }, { 0x3047, 14 }, { 0x3048, 14 }, - { 0x3049, 14 }, { 0x304A, 14 }, { 0x304B, 14 }, { 0x304C, 14 }, - { 0x304D, 14 }, { 0x1827, 13 }, - }, - { // 7 - { 0x0000, 6 }, { 0x0001, 6 }, { 0x0002, 6 }, { 0x0006, 7 }, - { 0x0007, 7 }, { 0x0004, 6 }, { 0x0005, 6 }, { 0x0006, 6 }, - { 0x000E, 7 }, { 0x001E, 8 }, { 0x001F, 8 }, { 0x0040, 9 }, - { 0x0082, 10 }, { 0x0830, 14 }, { 0x0831, 14 }, { 0x0832, 14 }, - { 0x0833, 14 }, { 0x0001, 1 }, { 0x0001, 2 }, { 0x0003, 4 }, - { 0x0005, 5 }, { 0x0009, 6 }, { 0x0011, 7 }, { 0x0021, 8 }, - { 0x0834, 14 }, { 0x0835, 14 }, { 0x0836, 14 }, { 0x0837, 14 }, - { 0x0838, 14 }, { 0x0839, 14 }, { 0x083A, 14 }, { 0x083B, 14 }, - { 0x041E, 13 }, { 0x041F, 13 }, - }, -}; - -static const uint16_t x8_dc_highquant_table[8][34][2] = { - { // 0 - { 0x0000, 5 }, { 0x0001, 4 }, { 0x0002, 4 }, { 0x0001, 5 }, - { 0x0006, 5 }, { 0x0004, 4 }, { 0x0007, 5 }, { 0x000A, 5 }, - { 0x002C, 7 }, { 0x002D, 7 }, { 0x05C0, 12 }, { 0x05C1, 12 }, - { 0x05C2, 12 }, { 0x05C3, 12 }, { 0x05C4, 12 }, { 0x05C5, 12 }, - { 0x05C6, 12 }, { 0x0003, 3 }, { 0x0002, 2 }, { 0x0006, 3 }, - { 0x000E, 4 }, { 0x001E, 5 }, { 0x001F, 5 }, { 0x002F, 7 }, - { 0x005D, 8 }, { 0x05C7, 12 }, { 0x05C8, 12 }, { 0x05C9, 12 }, - { 0x05CA, 12 }, { 0x05CB, 12 }, { 0x05CC, 12 }, { 0x05CD, 12 }, - { 0x05CE, 12 }, { 0x05CF, 12 }, - }, - { // 1 - { 0x0000, 3 }, { 0x0001, 3 }, { 0x0002, 3 }, { 0x0006, 4 }, - { 0x0007, 4 }, { 0x0004, 3 }, { 0x000A, 4 }, { 0x000B, 4 }, - { 0x0030, 6 }, { 0x0062, 7 }, { 0x0063, 7 }, { 0x0640, 11 }, - { 0x0641, 11 }, { 0x0642, 11 }, { 0x0643, 11 }, { 0x0644, 11 }, - { 0x0645, 11 }, { 0x0033, 6 }, { 0x000D, 4 }, { 0x001C, 5 }, - { 0x001D, 5 }, { 0x003C, 6 }, { 0x001F, 5 }, { 0x0065, 7 }, - { 0x007A, 7 }, { 0x0646, 11 }, { 0x007B, 7 }, { 0x0647, 11 }, - { 0x0648, 11 }, { 0x0649, 11 }, { 0x064A, 11 }, { 0x064B, 11 }, - { 0x0326, 10 }, { 0x0327, 10 }, - }, - { // 2 - { 0x0000, 7 }, { 0x0001, 7 }, { 0x0001, 6 }, { 0x0004, 7 }, - { 0x0003, 6 }, { 0x0005, 7 }, { 0x0010, 8 }, { 0x0011, 8 }, - { 0x0240, 13 }, { 0x0241, 13 }, { 0x0242, 13 }, { 0x0243, 13 }, - { 0x0244, 13 }, { 0x0245, 13 }, { 0x0246, 13 }, { 0x0247, 13 }, - { 0x0124, 12 }, { 0x0001, 1 }, { 0x0001, 2 }, { 0x0001, 3 }, - { 0x0003, 5 }, { 0x0005, 6 }, { 0x0013, 8 }, { 0x0125, 12 }, - { 0x0126, 12 }, { 0x0127, 12 }, { 0x0128, 12 }, { 0x0129, 12 }, - { 0x012A, 12 }, { 0x012B, 12 }, { 0x012C, 12 }, { 0x012D, 12 }, - { 0x012E, 12 }, { 0x012F, 12 }, - }, - { // 3 - { 0x0000, 4 }, { 0x0001, 3 }, { 0x0002, 3 }, { 0x0001, 4 }, - { 0x0006, 4 }, { 0x0004, 3 }, { 0x0005, 3 }, { 0x0006, 3 }, - { 0x000E, 5 }, { 0x000F, 5 }, { 0x0070, 7 }, { 0x0710, 11 }, - { 0x0711, 11 }, { 0x0712, 11 }, { 0x0713, 11 }, { 0x0714, 11 }, - { 0x0715, 11 }, { 0x001D, 5 }, { 0x0072, 7 }, { 0x003C, 6 }, - { 0x003D, 6 }, { 0x0073, 7 }, { 0x007C, 7 }, { 0x007D, 7 }, - { 0x007E, 7 }, { 0x0716, 11 }, { 0x0717, 11 }, { 0x0718, 11 }, - { 0x007F, 7 }, { 0x0719, 11 }, { 0x071A, 11 }, { 0x071B, 11 }, - { 0x038E, 10 }, { 0x038F, 10 }, - }, - { // 4 - { 0x0000, 8 }, { 0x0001, 7 }, { 0x0002, 7 }, { 0x0003, 7 }, - { 0x0002, 9 }, { 0x0008, 8 }, { 0x0003, 9 }, { 0x0240, 14 }, - { 0x0241, 14 }, { 0x0242, 14 }, { 0x0243, 14 }, { 0x0244, 14 }, - { 0x0245, 14 }, { 0x0246, 14 }, { 0x0247, 14 }, { 0x0124, 13 }, - { 0x0125, 13 }, { 0x0001, 2 }, { 0x0001, 1 }, { 0x0001, 3 }, - { 0x0001, 4 }, { 0x0003, 6 }, { 0x0005, 7 }, { 0x0013, 9 }, - { 0x0126, 13 }, { 0x0127, 13 }, { 0x0128, 13 }, { 0x0129, 13 }, - { 0x012A, 13 }, { 0x012B, 13 }, { 0x012C, 13 }, { 0x012D, 13 }, - { 0x012E, 13 }, { 0x012F, 13 }, - }, - { // 5 - { 0x0000, 7 }, { 0x0001, 7 }, { 0x0001, 6 }, { 0x0002, 6 }, - { 0x0003, 6 }, { 0x0004, 6 }, { 0x0005, 6 }, { 0x0006, 6 }, - { 0x0007, 6 }, { 0x0008, 6 }, { 0x0009, 6 }, { 0x000A, 6 }, - { 0x000B, 6 }, { 0x000C, 6 }, { 0x000D, 6 }, { 0x000E, 6 }, - { 0x000F, 6 }, { 0x0010, 6 }, { 0x0011, 6 }, { 0x0012, 6 }, - { 0x0013, 6 }, { 0x0014, 6 }, { 0x0015, 6 }, { 0x0016, 6 }, - { 0x0017, 6 }, { 0x0018, 6 }, { 0x0019, 6 }, { 0x0001, 1 }, - { 0x001A, 6 }, { 0x001B, 6 }, { 0x001C, 6 }, { 0x001D, 6 }, - { 0x001E, 6 }, { 0x001F, 6 }, - }, - { // 6 - { 0x0000, 5 }, { 0x0001, 4 }, { 0x0001, 5 }, { 0x0004, 5 }, - { 0x000A, 6 }, { 0x0006, 5 }, { 0x000B, 6 }, { 0x000E, 6 }, - { 0x003C, 8 }, { 0x003D, 8 }, { 0x07C0, 13 }, { 0x07C1, 13 }, - { 0x07C2, 13 }, { 0x07C3, 13 }, { 0x07C4, 13 }, { 0x07C5, 13 }, - { 0x07C6, 13 }, { 0x0001, 2 }, { 0x0002, 2 }, { 0x0006, 3 }, - { 0x000E, 4 }, { 0x001E, 5 }, { 0x001F, 5 }, { 0x003F, 8 }, - { 0x007D, 9 }, { 0x07C7, 13 }, { 0x07C8, 13 }, { 0x07C9, 13 }, - { 0x07CA, 13 }, { 0x07CB, 13 }, { 0x07CC, 13 }, { 0x07CD, 13 }, - { 0x07CE, 13 }, { 0x07CF, 13 }, - }, - { // 7 - { 0x0000, 7 }, { 0x0001, 7 }, { 0x0002, 7 }, { 0x0003, 7 }, - { 0x0004, 7 }, { 0x0005, 7 }, { 0x0006, 7 }, { 0x0007, 7 }, - { 0x0008, 7 }, { 0x0009, 7 }, { 0x000A, 7 }, { 0x000B, 7 }, - { 0x000C, 7 }, { 0x000D, 7 }, { 0x000E, 7 }, { 0x000F, 7 }, - { 0x0010, 7 }, { 0x0001, 1 }, { 0x0001, 2 }, { 0x0011, 7 }, - { 0x0012, 7 }, { 0x0013, 7 }, { 0x0014, 7 }, { 0x0015, 7 }, - { 0x0016, 7 }, { 0x0017, 7 }, { 0x0018, 7 }, { 0x0019, 7 }, - { 0x001A, 7 }, { 0x001B, 7 }, { 0x001C, 7 }, { 0x001D, 7 }, - { 0x001E, 7 }, { 0x001F, 7 }, +static const uint8_t x8_dc_quant_table[2][8][34][2] = { + { + { /* DC highquant table 0 */ + { 0, 5 }, { 3, 5 }, { 1, 4 }, { 2, 4 }, { 4, 5 }, + { 6, 5 }, { 5, 4 }, { 7, 5 }, { 8, 7 }, { 9, 7 }, + { 10, 12 }, { 11, 12 }, { 12, 12 }, { 13, 12 }, { 14, 12 }, + { 15, 12 }, { 16, 12 }, { 25, 12 }, { 26, 12 }, { 27, 12 }, + { 28, 12 }, { 29, 12 }, { 30, 12 }, { 31, 12 }, { 32, 12 }, + { 33, 12 }, { 24, 8 }, { 23, 7 }, { 17, 3 }, { 18, 2 }, + { 19, 3 }, { 20, 4 }, { 21, 5 }, { 22, 5 }, + }, + { /* DC highquant table 1 */ + { 0, 3 }, { 1, 3 }, { 2, 3 }, { 3, 4 }, { 4, 4 }, + { 5, 3 }, { 6, 4 }, { 7, 4 }, { 8, 6 }, { 9, 7 }, + { 10, 7 }, { 11, 11 }, { 12, 11 }, { 13, 11 }, { 14, 11 }, + { 15, 11 }, { 16, 11 }, { 25, 11 }, { 27, 11 }, { 28, 11 }, + { 29, 11 }, { 30, 11 }, { 31, 11 }, { 32, 10 }, { 33, 10 }, + { 23, 7 }, { 17, 6 }, { 18, 4 }, { 19, 5 }, { 20, 5 }, + { 21, 6 }, { 24, 7 }, { 26, 7 }, { 22, 5 }, + }, + { /* DC highquant table 2 */ + { 0, 7 }, { 1, 7 }, { 2, 6 }, { 3, 7 }, { 5, 7 }, + { 4, 6 }, { 6, 8 }, { 7, 8 }, { 8, 13 }, { 9, 13 }, + { 10, 13 }, { 11, 13 }, { 12, 13 }, { 13, 13 }, { 14, 13 }, + { 15, 13 }, { 16, 12 }, { 23, 12 }, { 24, 12 }, { 25, 12 }, + { 26, 12 }, { 27, 12 }, { 28, 12 }, { 29, 12 }, { 30, 12 }, + { 31, 12 }, { 32, 12 }, { 33, 12 }, { 22, 8 }, { 21, 6 }, + { 20, 5 }, { 19, 3 }, { 18, 2 }, { 17, 1 }, + }, + { /* DC highquant table 3 */ + { 0, 4 }, { 3, 4 }, { 1, 3 }, { 2, 3 }, { 4, 4 }, + { 8, 5 }, { 9, 5 }, { 5, 3 }, { 6, 3 }, { 7, 3 }, + { 10, 7 }, { 11, 11 }, { 12, 11 }, { 13, 11 }, { 14, 11 }, + { 15, 11 }, { 16, 11 }, { 25, 11 }, { 26, 11 }, { 27, 11 }, + { 29, 11 }, { 30, 11 }, { 31, 11 }, { 32, 10 }, { 33, 10 }, + { 18, 7 }, { 21, 7 }, { 17, 5 }, { 19, 6 }, { 20, 6 }, + { 22, 7 }, { 23, 7 }, { 24, 7 }, { 28, 7 }, + }, + { /* DC highquant table 4 */ + { 0, 8 }, { 4, 9 }, { 6, 9 }, { 1, 7 }, { 2, 7 }, + { 3, 7 }, { 5, 8 }, { 7, 14 }, { 8, 14 }, { 9, 14 }, + { 10, 14 }, { 11, 14 }, { 12, 14 }, { 13, 14 }, { 14, 14 }, + { 15, 13 }, { 16, 13 }, { 24, 13 }, { 25, 13 }, { 26, 13 }, + { 27, 13 }, { 28, 13 }, { 29, 13 }, { 30, 13 }, { 31, 13 }, + { 32, 13 }, { 33, 13 }, { 23, 9 }, { 22, 7 }, { 21, 6 }, + { 20, 4 }, { 19, 3 }, { 17, 2 }, { 18, 1 }, + }, + { /* DC highquant table 5 */ + { 0, 7 }, { 1, 7 }, { 2, 6 }, { 3, 6 }, { 4, 6 }, + { 5, 6 }, { 6, 6 }, { 7, 6 }, { 8, 6 }, { 9, 6 }, + { 10, 6 }, { 11, 6 }, { 12, 6 }, { 13, 6 }, { 14, 6 }, + { 15, 6 }, { 16, 6 }, { 17, 6 }, { 18, 6 }, { 19, 6 }, + { 20, 6 }, { 21, 6 }, { 22, 6 }, { 23, 6 }, { 24, 6 }, + { 25, 6 }, { 26, 6 }, { 28, 6 }, { 29, 6 }, { 30, 6 }, + { 31, 6 }, { 32, 6 }, { 33, 6 }, { 27, 1 }, + }, + { /* DC highquant table 6 */ + { 0, 5 }, { 2, 5 }, { 1, 4 }, { 3, 5 }, { 4, 6 }, + { 6, 6 }, { 5, 5 }, { 7, 6 }, { 8, 8 }, { 9, 8 }, + { 10, 13 }, { 11, 13 }, { 12, 13 }, { 13, 13 }, { 14, 13 }, + { 15, 13 }, { 16, 13 }, { 25, 13 }, { 26, 13 }, { 27, 13 }, + { 28, 13 }, { 29, 13 }, { 30, 13 }, { 31, 13 }, { 32, 13 }, + { 33, 13 }, { 24, 9 }, { 23, 8 }, { 17, 2 }, { 18, 2 }, + { 19, 3 }, { 20, 4 }, { 21, 5 }, { 22, 5 }, + }, + { /* DC highquant table 7 */ + { 0, 7 }, { 1, 7 }, { 2, 7 }, { 3, 7 }, { 4, 7 }, + { 5, 7 }, { 6, 7 }, { 7, 7 }, { 8, 7 }, { 9, 7 }, + { 10, 7 }, { 11, 7 }, { 12, 7 }, { 13, 7 }, { 14, 7 }, + { 15, 7 }, { 16, 7 }, { 19, 7 }, { 20, 7 }, { 21, 7 }, + { 22, 7 }, { 23, 7 }, { 24, 7 }, { 25, 7 }, { 26, 7 }, + { 27, 7 }, { 28, 7 }, { 29, 7 }, { 30, 7 }, { 31, 7 }, + { 32, 7 }, { 33, 7 }, { 18, 2 }, { 17, 1 }, + }, + }, + { + { /* DC lowquant table 0 */ + { 0, 5 }, { 2, 5 }, { 1, 4 }, { 3, 5 }, { 4, 5 }, + { 5, 5 }, { 6, 6 }, { 7, 6 }, { 8, 8 }, { 9, 8 }, + { 10, 13 }, { 11, 13 }, { 12, 13 }, { 13, 13 }, { 14, 13 }, + { 15, 13 }, { 16, 13 }, { 25, 13 }, { 26, 13 }, { 27, 13 }, + { 28, 13 }, { 29, 13 }, { 30, 13 }, { 31, 13 }, { 32, 13 }, + { 33, 13 }, { 24, 9 }, { 23, 8 }, { 22, 6 }, { 21, 5 }, + { 20, 4 }, { 19, 3 }, { 17, 2 }, { 18, 2 }, + }, + { /* DC lowquant table 1 */ + { 0, 4 }, { 3, 4 }, { 1, 3 }, { 2, 3 }, { 4, 4 }, + { 6, 4 }, { 5, 3 }, { 7, 3 }, { 8, 4 }, { 9, 4 }, + { 10, 5 }, { 11, 6 }, { 12, 9 }, { 13, 9 }, { 14, 13 }, + { 15, 13 }, { 16, 13 }, { 25, 13 }, { 26, 13 }, { 27, 13 }, + { 28, 12 }, { 29, 12 }, { 31, 12 }, { 32, 12 }, { 33, 12 }, + { 21, 9 }, { 20, 7 }, { 17, 6 }, { 18, 6 }, { 19, 6 }, + { 22, 7 }, { 23, 8 }, { 24, 9 }, { 30, 9 }, + }, + { /* DC lowquant table 2 */ + { 0, 4 }, { 3, 4 }, { 1, 3 }, { 2, 3 }, { 4, 4 }, + { 5, 4 }, { 6, 4 }, { 7, 4 }, { 8, 6 }, { 9, 6 }, + { 10, 7 }, { 11, 7 }, { 12, 12 }, { 13, 12 }, { 14, 12 }, + { 15, 12 }, { 16, 12 }, { 25, 12 }, { 26, 12 }, { 27, 12 }, + { 28, 12 }, { 29, 12 }, { 30, 12 }, { 31, 12 }, { 32, 11 }, + { 33, 11 }, { 24, 8 }, { 23, 7 }, { 17, 4 }, { 18, 3 }, + { 19, 4 }, { 20, 5 }, { 21, 6 }, { 22, 6 }, + }, + { /* DC lowquant table 3 */ + { 0, 4 }, { 6, 4 }, { 2, 3 }, { 1, 2 }, { 3, 3 }, + { 4, 3 }, { 5, 3 }, { 7, 4 }, { 8, 6 }, { 9, 6 }, + { 10, 7 }, { 11, 8 }, { 12, 14 }, { 13, 14 }, { 14, 14 }, + { 15, 14 }, { 16, 13 }, { 21, 13 }, { 22, 13 }, { 23, 13 }, + { 24, 13 }, { 25, 13 }, { 26, 13 }, { 27, 13 }, { 28, 13 }, + { 29, 13 }, { 30, 13 }, { 31, 13 }, { 32, 13 }, { 33, 13 }, + { 17, 9 }, { 18, 7 }, { 19, 8 }, { 20, 8 }, + }, + { /* DC lowquant table 4 */ + { 0, 7 }, { 1, 7 }, { 2, 7 }, { 3, 7 }, { 4, 7 }, + { 5, 7 }, { 6, 7 }, { 7, 7 }, { 8, 7 }, { 9, 7 }, + { 10, 7 }, { 11, 7 }, { 12, 7 }, { 13, 7 }, { 14, 7 }, + { 15, 7 }, { 16, 7 }, { 19, 7 }, { 20, 7 }, { 21, 7 }, + { 22, 7 }, { 23, 7 }, { 24, 7 }, { 25, 7 }, { 26, 7 }, + { 27, 7 }, { 28, 7 }, { 29, 7 }, { 30, 7 }, { 31, 7 }, + { 32, 7 }, { 33, 7 }, { 18, 2 }, { 17, 1 }, + }, + { /* DC lowquant table 5 */ + { 0, 5 }, { 2, 5 }, { 1, 4 }, { 3, 6 }, { 4, 6 }, + { 5, 6 }, { 6, 7 }, { 8, 7 }, { 7, 6 }, { 9, 6 }, + { 10, 8 }, { 12, 8 }, { 11, 7 }, { 13, 13 }, { 14, 13 }, + { 15, 13 }, { 16, 13 }, { 23, 13 }, { 24, 13 }, { 25, 13 }, + { 26, 13 }, { 27, 13 }, { 28, 13 }, { 29, 13 }, { 30, 13 }, + { 31, 13 }, { 32, 13 }, { 33, 12 }, { 22, 9 }, { 21, 8 }, + { 20, 7 }, { 17, 3 }, { 19, 3 }, { 18, 1 }, + }, + { /* DC lowquant table 6 */ + { 0, 4 }, { 4, 4 }, { 2, 3 }, { 1, 2 }, { 3, 3 }, + { 5, 4 }, { 6, 5 }, { 7, 6 }, { 8, 7 }, { 9, 7 }, + { 10, 8 }, { 11, 14 }, { 12, 14 }, { 15, 14 }, { 16, 14 }, + { 23, 14 }, { 24, 14 }, { 25, 14 }, { 26, 14 }, { 27, 14 }, + { 28, 14 }, { 29, 14 }, { 30, 14 }, { 31, 14 }, { 32, 14 }, + { 33, 13 }, { 13, 10 }, { 14, 9 }, { 21, 8 }, { 22, 8 }, + { 20, 6 }, { 19, 5 }, { 17, 4 }, { 18, 3 }, + }, + { /* DC lowquant table 7 */ + { 0, 6 }, { 1, 6 }, { 2, 6 }, { 3, 7 }, { 4, 7 }, + { 5, 6 }, { 6, 6 }, { 7, 6 }, { 8, 7 }, { 9, 8 }, + { 10, 8 }, { 11, 9 }, { 12, 10 }, { 13, 14 }, { 14, 14 }, + { 15, 14 }, { 16, 14 }, { 24, 14 }, { 25, 14 }, { 26, 14 }, + { 27, 14 }, { 28, 14 }, { 29, 14 }, { 30, 14 }, { 31, 14 }, + { 32, 13 }, { 33, 13 }, { 23, 8 }, { 22, 7 }, { 21, 6 }, + { 20, 5 }, { 19, 4 }, { 18, 2 }, { 17, 1 }, + }, }, }; #define MAX_DC_VLC_BITS 14 -static const uint16_t x8_ac0_lowquant_table[8][77][2] = { - { // 0 - { 0x0000, 2 }, { 0x0002, 3 }, { 0x0006, 4 }, { 0x000E, 5 }, - { 0x001E, 6 }, { 0x003E, 7 }, { 0x003F, 7 }, { 0x0040, 7 }, - { 0x0104, 9 }, { 0x0083, 8 }, { 0x0084, 8 }, { 0x0085, 8 }, - { 0x020A, 10 }, { 0x020B, 10 }, { 0x0218, 10 }, { 0x0219, 10 }, - { 0x0009, 4 }, { 0x0044, 7 }, { 0x010D, 9 }, { 0x021C, 10 }, - { 0x0023, 6 }, { 0x0045, 7 }, { 0x0050, 7 }, { 0x000B, 4 }, - { 0x000C, 4 }, { 0x0015, 5 }, { 0x001A, 5 }, { 0x001B, 5 }, - { 0x0029, 6 }, { 0x0038, 6 }, { 0x0039, 6 }, { 0x003A, 6 }, - { 0x0051, 7 }, { 0x0076, 7 }, { 0x0077, 7 }, { 0x0078, 7 }, - { 0x0079, 7 }, { 0x007A, 7 }, { 0x007B, 7 }, { 0x00F8, 8 }, - { 0x010F, 9 }, { 0x021D, 10 }, { 0x3E40, 14 }, { 0x3E41, 14 }, - { 0x3E42, 14 }, { 0x3E43, 14 }, { 0x03E5, 10 }, { 0x3E44, 14 }, - { 0x01F3, 9 }, { 0x3E45, 14 }, { 0x3E46, 14 }, { 0x3E47, 14 }, - { 0x00FA, 8 }, { 0x3E48, 14 }, { 0x3E49, 14 }, { 0x3E4A, 14 }, - { 0x3E4B, 14 }, { 0x03EC, 10 }, { 0x3E4C, 14 }, { 0x007E, 7 }, - { 0x00FE, 8 }, { 0x00FF, 8 }, { 0x01F7, 9 }, { 0x3E4D, 14 }, - { 0x3E4E, 14 }, { 0x3E4F, 14 }, { 0x3ED0, 14 }, { 0x3ED1, 14 }, - { 0x3ED2, 14 }, { 0x3ED3, 14 }, { 0x3ED4, 14 }, { 0x3ED5, 14 }, - { 0x1F6B, 13 }, { 0x1F6C, 13 }, { 0x1F6D, 13 }, { 0x1F6E, 13 }, - { 0x1F6F, 13 }, - }, - { // 1 - { 0x0000, 3 }, { 0x0004, 5 }, { 0x0014, 7 }, { 0x000B, 6 }, - { 0x000C, 6 }, { 0x002A, 8 }, { 0x002B, 8 }, { 0x0034, 8 }, - { 0x0D40, 14 }, { 0x0D41, 14 }, { 0x001B, 7 }, { 0x0D42, 14 }, - { 0x0D43, 14 }, { 0x0D44, 14 }, { 0x0D45, 14 }, { 0x0D46, 14 }, - { 0x000E, 6 }, { 0x003C, 8 }, { 0x0D47, 14 }, { 0x003D, 8 }, - { 0x0D48, 14 }, { 0x0D49, 14 }, { 0x0D4A, 14 }, { 0x0001, 2 }, - { 0x0004, 3 }, { 0x0014, 5 }, { 0x000B, 4 }, { 0x000C, 4 }, - { 0x000D, 4 }, { 0x002A, 6 }, { 0x001F, 7 }, { 0x0056, 7 }, - { 0x0057, 7 }, { 0x0070, 7 }, { 0x00E2, 8 }, { 0x0072, 7 }, - { 0x003A, 6 }, { 0x003B, 6 }, { 0x003C, 6 }, { 0x003D, 6 }, - { 0x00E3, 8 }, { 0x0D4B, 14 }, { 0x00E6, 8 }, { 0x00E7, 8 }, - { 0x00F8, 8 }, { 0x0D4C, 14 }, { 0x0D4D, 14 }, { 0x0D4E, 14 }, - { 0x00F9, 8 }, { 0x0D4F, 14 }, { 0x0D50, 14 }, { 0x0D51, 14 }, - { 0x06A9, 13 }, { 0x06AA, 13 }, { 0x06AB, 13 }, { 0x06AC, 13 }, - { 0x06AD, 13 }, { 0x06AE, 13 }, { 0x06AF, 13 }, { 0x003F, 6 }, - { 0x06B0, 13 }, { 0x06B1, 13 }, { 0x06B2, 13 }, { 0x06B3, 13 }, - { 0x06B4, 13 }, { 0x007D, 7 }, { 0x06B5, 13 }, { 0x06B6, 13 }, - { 0x06B7, 13 }, { 0x06B8, 13 }, { 0x06B9, 13 }, { 0x06BA, 13 }, - { 0x06BB, 13 }, { 0x06BC, 13 }, { 0x06BD, 13 }, { 0x06BE, 13 }, - { 0x06BF, 13 }, - }, - { // 2 - { 0x0000, 2 }, { 0x0002, 3 }, { 0x0003, 3 }, { 0x0008, 4 }, - { 0x0012, 5 }, { 0x0013, 5 }, { 0x0028, 6 }, { 0x0029, 6 }, - { 0x0054, 7 }, { 0x0055, 7 }, { 0x0056, 7 }, { 0x00AE, 8 }, - { 0x00AF, 8 }, { 0x00B0, 8 }, { 0x0162, 9 }, { 0x02C6, 10 }, - { 0x000C, 4 }, { 0x002D, 6 }, { 0x00B2, 8 }, { 0x0166, 9 }, - { 0x002E, 6 }, { 0x0167, 9 }, { 0x00BC, 8 }, { 0x001A, 5 }, - { 0x0036, 6 }, { 0x0037, 6 }, { 0x0038, 6 }, { 0x005F, 7 }, - { 0x0072, 7 }, { 0x0073, 7 }, { 0x0074, 7 }, { 0x0075, 7 }, - { 0x0076, 7 }, { 0x0077, 7 }, { 0x0078, 7 }, { 0x0079, 7 }, - { 0x007A, 7 }, { 0x007B, 7 }, { 0x00BD, 8 }, { 0xB1C0, 16 }, - { 0xB1C1, 16 }, { 0x58E1, 15 }, { 0x0B1D, 12 }, { 0x58E2, 15 }, - { 0x58E3, 15 }, { 0x58E4, 15 }, { 0x00F8, 8 }, { 0x03E4, 10 }, - { 0x01F3, 9 }, { 0x0B1E, 12 }, { 0x58E5, 15 }, { 0x58E6, 15 }, - { 0x00FA, 8 }, { 0x58E7, 15 }, { 0x58F8, 15 }, { 0x58F9, 15 }, - { 0x58FA, 15 }, { 0x01F6, 9 }, { 0x58FB, 15 }, { 0x007E, 7 }, - { 0x00FE, 8 }, { 0x00FF, 8 }, { 0x07CA, 11 }, { 0x0F96, 12 }, - { 0x58FC, 15 }, { 0x58FD, 15 }, { 0x58FE, 15 }, { 0x58FF, 15 }, - { 0x7CB8, 15 }, { 0x7CB9, 15 }, { 0x7CBA, 15 }, { 0x7CBB, 15 }, - { 0x7CBC, 15 }, { 0x01F7, 9 }, { 0x7CBD, 15 }, { 0x7CBE, 15 }, - { 0x7CBF, 15 }, - }, - { // 3 - { 0x0000, 2 }, { 0x0002, 3 }, { 0x0006, 4 }, { 0x000E, 5 }, - { 0x000F, 5 }, { 0x0020, 6 }, { 0x0021, 6 }, { 0x0044, 7 }, - { 0x0045, 7 }, { 0x008C, 8 }, { 0x008D, 8 }, { 0x011C, 9 }, - { 0x011D, 9 }, { 0x011E, 9 }, { 0x023E, 10 }, { 0x023F, 10 }, - { 0x0005, 3 }, { 0x0012, 5 }, { 0x004C, 7 }, { 0x004D, 7 }, - { 0x000C, 4 }, { 0x004E, 7 }, { 0x001A, 5 }, { 0x0036, 6 }, - { 0x004F, 7 }, { 0x006E, 7 }, { 0x006F, 7 }, { 0x00E0, 8 }, - { 0x00E1, 8 }, { 0x00E2, 8 }, { 0x00E3, 8 }, { 0x00E4, 8 }, - { 0x00E5, 8 }, { 0x01CC, 9 }, { 0x00E7, 8 }, { 0x00E8, 8 }, - { 0x00E9, 8 }, { 0x01CD, 9 }, { 0x0750, 11 }, { 0x03A9, 10 }, - { 0x0751, 11 }, { 0x7540, 15 }, { 0x03AB, 10 }, { 0x7541, 15 }, - { 0x7542, 15 }, { 0x7543, 15 }, { 0x01D6, 9 }, { 0x0755, 11 }, - { 0x0076, 7 }, { 0x0EA9, 12 }, { 0x7544, 15 }, { 0x7545, 15 }, - { 0x001E, 5 }, { 0x0077, 7 }, { 0x00F8, 8 }, { 0x03AE, 10 }, - { 0x075E, 11 }, { 0x007D, 7 }, { 0x03E4, 10 }, { 0x00FC, 8 }, - { 0x00FD, 8 }, { 0x03E5, 10 }, { 0x03E6, 10 }, { 0x0EBE, 12 }, - { 0x7546, 15 }, { 0x07CE, 11 }, { 0x7547, 15 }, { 0x75F8, 15 }, - { 0x75F9, 15 }, { 0x75FA, 15 }, { 0x75FB, 15 }, { 0x75FC, 15 }, - { 0x75FD, 15 }, { 0x007F, 7 }, { 0x3AFF, 14 }, { 0x0F9E, 12 }, - { 0x0F9F, 12 }, - }, - { // 4 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0003, 4 }, { 0x0008, 5 }, - { 0x0012, 6 }, { 0x0013, 6 }, { 0x0014, 6 }, { 0x002A, 7 }, - { 0x0016, 6 }, { 0x002B, 7 }, { 0x005C, 8 }, { 0x005D, 8 }, - { 0x005E, 8 }, { 0x00BE, 9 }, { 0x00BF, 9 }, { 0x0060, 8 }, - { 0x0007, 4 }, { 0x000D, 5 }, { 0x0019, 6 }, { 0x0020, 6 }, - { 0x0009, 4 }, { 0x0021, 6 }, { 0x0011, 5 }, { 0x0014, 5 }, - { 0x002A, 6 }, { 0x002B, 6 }, { 0x002C, 6 }, { 0x002D, 6 }, - { 0x002E, 6 }, { 0x002F, 6 }, { 0x0030, 6 }, { 0x0031, 7 }, - { 0x0062, 7 }, { 0x0063, 7 }, { 0x0064, 7 }, { 0x0065, 7 }, - { 0x0066, 7 }, { 0x0061, 8 }, { 0x0670, 11 }, { 0x0068, 7 }, - { 0x0069, 7 }, { 0x00CF, 8 }, { 0x019D, 9 }, { 0x01A8, 9 }, - { 0x01A9, 9 }, { 0x0339, 10 }, { 0x01AA, 9 }, { 0x0356, 10 }, - { 0x0036, 6 }, { 0x00D6, 8 }, { 0x6710, 15 }, { 0x6711, 15 }, - { 0x000E, 4 }, { 0x006E, 7 }, { 0x01AE, 9 }, { 0x6712, 15 }, - { 0x6713, 15 }, { 0x003C, 6 }, { 0x0357, 10 }, { 0x006F, 7 }, - { 0x00F4, 8 }, { 0x00F5, 8 }, { 0x035E, 10 }, { 0x01EC, 9 }, - { 0x6714, 15 }, { 0x01ED, 9 }, { 0x035F, 10 }, { 0x03DC, 10 }, - { 0x03DD, 10 }, { 0x6715, 15 }, { 0x338B, 14 }, { 0x338C, 14 }, - { 0x338D, 14 }, { 0x001F, 5 }, { 0x01EF, 9 }, { 0x338E, 14 }, - { 0x338F, 14 }, - }, - { // 5 - { 0x0000, 2 }, { 0x0004, 4 }, { 0x000A, 5 }, { 0x000B, 5 }, - { 0x0018, 6 }, { 0x0019, 6 }, { 0x0034, 7 }, { 0x006A, 8 }, - { 0x006B, 8 }, { 0x006C, 8 }, { 0x00DA, 9 }, { 0x036C, 11 }, - { 0x006E, 8 }, { 0x01B7, 10 }, { 0x036D, 11 }, { 0x3780, 15 }, - { 0x0004, 3 }, { 0x000E, 5 }, { 0x001E, 6 }, { 0x003E, 7 }, - { 0x000A, 4 }, { 0x002C, 6 }, { 0x0017, 5 }, { 0x002D, 6 }, - { 0x003F, 7 }, { 0x00C0, 8 }, { 0x0061, 7 }, { 0x00C1, 8 }, - { 0x0062, 7 }, { 0x00C6, 8 }, { 0x0064, 7 }, { 0x00C7, 8 }, - { 0x00CA, 8 }, { 0x00DF, 9 }, { 0x0196, 9 }, { 0x0197, 9 }, - { 0x0198, 9 }, { 0x0199, 9 }, { 0x0379, 11 }, { 0x019A, 9 }, - { 0x01BD, 10 }, { 0x066C, 11 }, { 0x3781, 15 }, { 0x0337, 10 }, - { 0x066D, 11 }, { 0x0670, 11 }, { 0x0339, 10 }, { 0x0671, 11 }, - { 0x0034, 6 }, { 0x00CF, 8 }, { 0x3782, 15 }, { 0x3783, 15 }, - { 0x000E, 4 }, { 0x001B, 5 }, { 0x006A, 7 }, { 0x006B, 7 }, - { 0x019D, 9 }, { 0x003C, 6 }, { 0x00F4, 8 }, { 0x00F5, 8 }, - { 0x03D8, 10 }, { 0x07B2, 11 }, { 0x3784, 15 }, { 0x03DA, 10 }, - { 0x3785, 15 }, { 0x03DB, 10 }, { 0x03DC, 10 }, { 0x3786, 15 }, - { 0x3787, 15 }, { 0x1BC4, 14 }, { 0x1BC5, 14 }, { 0x1BC6, 14 }, - { 0x1BC7, 14 }, { 0x001F, 5 }, { 0x03DD, 10 }, { 0x07B3, 11 }, - { 0x01EF, 9 }, - }, - { // 6 - { 0x0000, 2 }, { 0x0004, 4 }, { 0x000A, 5 }, { 0x0016, 6 }, - { 0x0017, 6 }, { 0x0060, 8 }, { 0x00C2, 9 }, { 0x0186, 10 }, - { 0x0187, 10 }, { 0x00C4, 9 }, { 0x3140, 15 }, { 0x3141, 15 }, - { 0x018B, 10 }, { 0x3142, 15 }, { 0x018C, 10 }, { 0x3143, 15 }, - { 0x0007, 4 }, { 0x000D, 5 }, { 0x0064, 8 }, { 0x0065, 8 }, - { 0x0010, 5 }, { 0x00C7, 9 }, { 0x0066, 8 }, { 0x0005, 3 }, - { 0x0006, 3 }, { 0x0009, 4 }, { 0x0011, 5 }, { 0x0038, 6 }, - { 0x0039, 6 }, { 0x0074, 7 }, { 0x0075, 7 }, { 0x0076, 7 }, - { 0x0067, 8 }, { 0x00EE, 8 }, { 0x01DE, 9 }, { 0x00F0, 8 }, - { 0x018D, 10 }, { 0x3144, 15 }, { 0x01DF, 9 }, { 0x003D, 6 }, - { 0x003E, 6 }, { 0x01E2, 9 }, { 0x03C6, 10 }, { 0x00F2, 8 }, - { 0x00F3, 8 }, { 0x03C7, 10 }, { 0x3145, 15 }, { 0x3146, 15 }, - { 0x01F8, 9 }, { 0x3147, 15 }, { 0x3148, 15 }, { 0x3149, 15 }, - { 0x00FD, 8 }, { 0x314A, 15 }, { 0x314B, 15 }, { 0x314C, 15 }, - { 0x314D, 15 }, { 0x01F9, 9 }, { 0x314E, 15 }, { 0x01FC, 9 }, - { 0x314F, 15 }, { 0x3150, 15 }, { 0x3151, 15 }, { 0x3152, 15 }, - { 0x3153, 15 }, { 0x03FA, 10 }, { 0x03FB, 10 }, { 0x3154, 15 }, - { 0x3155, 15 }, { 0x3156, 15 }, { 0x3157, 15 }, { 0x3158, 15 }, - { 0x3159, 15 }, { 0x00FF, 8 }, { 0x18AD, 14 }, { 0x18AE, 14 }, - { 0x18AF, 14 }, - }, - { // 7 - { 0x0000, 4 }, { 0x0080, 11 }, { 0x0081, 11 }, { 0x0082, 11 }, - { 0x0083, 11 }, { 0x0084, 11 }, { 0x0085, 11 }, { 0x0086, 11 }, - { 0x0087, 11 }, { 0x0088, 11 }, { 0x0089, 11 }, { 0x008A, 11 }, - { 0x008B, 11 }, { 0x008C, 11 }, { 0x008D, 11 }, { 0x008E, 11 }, - { 0x008F, 11 }, { 0x0048, 10 }, { 0x0049, 10 }, { 0x004A, 10 }, - { 0x004B, 10 }, { 0x004C, 10 }, { 0x004D, 10 }, { 0x0001, 1 }, - { 0x0001, 2 }, { 0x004E, 10 }, { 0x0002, 4 }, { 0x0003, 4 }, - { 0x004F, 10 }, { 0x0050, 10 }, { 0x0051, 10 }, { 0x0052, 10 }, - { 0x0053, 10 }, { 0x0054, 10 }, { 0x0055, 10 }, { 0x0056, 10 }, - { 0x0057, 10 }, { 0x0058, 10 }, { 0x0059, 10 }, { 0x005A, 10 }, - { 0x005B, 10 }, { 0x005C, 10 }, { 0x005D, 10 }, { 0x005E, 10 }, - { 0x005F, 10 }, { 0x0060, 10 }, { 0x0061, 10 }, { 0x0062, 10 }, - { 0x0063, 10 }, { 0x0064, 10 }, { 0x0065, 10 }, { 0x0066, 10 }, - { 0x0067, 10 }, { 0x0068, 10 }, { 0x0069, 10 }, { 0x006A, 10 }, - { 0x006B, 10 }, { 0x006C, 10 }, { 0x006D, 10 }, { 0x006E, 10 }, - { 0x006F, 10 }, { 0x0070, 10 }, { 0x0071, 10 }, { 0x0072, 10 }, - { 0x0073, 10 }, { 0x0074, 10 }, { 0x0075, 10 }, { 0x0076, 10 }, - { 0x0077, 10 }, { 0x0078, 10 }, { 0x0079, 10 }, { 0x007A, 10 }, - { 0x007B, 10 }, { 0x007C, 10 }, { 0x007D, 10 }, { 0x007E, 10 }, - { 0x007F, 10 }, - }, -}; - -static const uint16_t x8_ac0_highquant_table[8][77][2] = { - { // 0 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x000C, 6 }, { 0x000D, 6 }, - { 0x001C, 7 }, { 0x000F, 6 }, { 0x1D00, 15 }, { 0x003B, 8 }, - { 0x1D01, 15 }, { 0x0075, 9 }, { 0x1D02, 15 }, { 0x0080, 9 }, - { 0x1D03, 15 }, { 0x1D04, 15 }, { 0x1D05, 15 }, { 0x0E83, 14 }, - { 0x0009, 5 }, { 0x0011, 6 }, { 0x0081, 9 }, { 0x0082, 9 }, - { 0x0021, 7 }, { 0x0028, 7 }, { 0x0083, 9 }, { 0x0002, 2 }, - { 0x0003, 3 }, { 0x000C, 4 }, { 0x000D, 4 }, { 0x000B, 5 }, - { 0x0015, 6 }, { 0x0052, 8 }, { 0x0070, 7 }, { 0x0039, 6 }, - { 0x0071, 7 }, { 0x0053, 8 }, { 0x0E84, 14 }, { 0x0074, 7 }, - { 0x0075, 7 }, { 0x0076, 7 }, { 0x01DC, 9 }, { 0x001E, 5 }, - { 0x003E, 6 }, { 0x01DD, 9 }, { 0x00EF, 8 }, { 0x01F8, 9 }, - { 0x01F9, 9 }, { 0x0E85, 14 }, { 0x0E86, 14 }, { 0x0E87, 14 }, - { 0x00FD, 8 }, { 0x0E88, 14 }, { 0x0E89, 14 }, { 0x0E8A, 14 }, - { 0x0E8B, 14 }, { 0x0E8C, 14 }, { 0x0E8D, 14 }, { 0x0E8E, 14 }, - { 0x0E8F, 14 }, { 0x0E90, 14 }, { 0x0E91, 14 }, { 0x01FC, 9 }, - { 0x0E92, 14 }, { 0x0E93, 14 }, { 0x0E94, 14 }, { 0x0E95, 14 }, - { 0x0E96, 14 }, { 0x0E97, 14 }, { 0x01FD, 9 }, { 0x0E98, 14 }, - { 0x01FE, 9 }, { 0x0E99, 14 }, { 0x0E9A, 14 }, { 0x0E9B, 14 }, - { 0x0E9C, 14 }, { 0x01FF, 9 }, { 0x0E9D, 14 }, { 0x0E9E, 14 }, - { 0x0E9F, 14 }, - }, - { // 1 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0003, 4 }, { 0x0008, 5 }, - { 0x0012, 6 }, { 0x0013, 6 }, { 0x0014, 6 }, { 0x0015, 6 }, - { 0x002C, 7 }, { 0x005A, 8 }, { 0x005B, 8 }, { 0x005C, 8 }, - { 0x005D, 8 }, { 0x1780, 14 }, { 0x0179, 10 }, { 0x017A, 10 }, - { 0x0006, 4 }, { 0x000E, 5 }, { 0x001E, 6 }, { 0x003E, 7 }, - { 0x0010, 5 }, { 0x0022, 6 }, { 0x0012, 5 }, { 0x000A, 4 }, - { 0x0013, 5 }, { 0x0016, 5 }, { 0x0023, 6 }, { 0x002E, 6 }, - { 0x002F, 6 }, { 0x0030, 6 }, { 0x0031, 6 }, { 0x003F, 7 }, - { 0x005F, 8 }, { 0x00C8, 8 }, { 0x0065, 7 }, { 0x0066, 7 }, - { 0x0067, 7 }, { 0x0068, 7 }, { 0x00C9, 8 }, { 0x0069, 7 }, - { 0x006A, 7 }, { 0x00D6, 8 }, { 0x00D7, 8 }, { 0x00D8, 8 }, - { 0x1781, 14 }, { 0x017B, 10 }, { 0x01B2, 9 }, { 0x1782, 14 }, - { 0x001C, 5 }, { 0x01B3, 9 }, { 0x1783, 14 }, { 0x1784, 14 }, - { 0x001D, 5 }, { 0x00DA, 8 }, { 0x1785, 14 }, { 0x1786, 14 }, - { 0x1787, 14 }, { 0x0037, 6 }, { 0x00DB, 8 }, { 0x0078, 7 }, - { 0x00F2, 8 }, { 0x01E6, 9 }, { 0x00F4, 8 }, { 0x1788, 14 }, - { 0x1789, 14 }, { 0x00F5, 8 }, { 0x01E7, 9 }, { 0x178A, 14 }, - { 0x178B, 14 }, { 0x178C, 14 }, { 0x178D, 14 }, { 0x01EC, 9 }, - { 0x178E, 14 }, { 0x001F, 5 }, { 0x00F7, 8 }, { 0x01ED, 9 }, - { 0x178F, 14 }, - }, - { // 2 - { 0x0000, 4 }, { 0x0002, 5 }, { 0x0180, 12 }, { 0x0181, 12 }, - { 0x0182, 12 }, { 0x0183, 12 }, { 0x0184, 12 }, { 0x0185, 12 }, - { 0x0186, 12 }, { 0x0187, 12 }, { 0x0188, 12 }, { 0x0189, 12 }, - { 0x00C5, 11 }, { 0x00C6, 11 }, { 0x00C7, 11 }, { 0x00C8, 11 }, - { 0x00C9, 11 }, { 0x00CA, 11 }, { 0x00CB, 11 }, { 0x00CC, 11 }, - { 0x00CD, 11 }, { 0x00CE, 11 }, { 0x00CF, 11 }, { 0x0001, 1 }, - { 0x0001, 2 }, { 0x0004, 5 }, { 0x0005, 5 }, { 0x0006, 5 }, - { 0x00D0, 11 }, { 0x00D1, 11 }, { 0x00D2, 11 }, { 0x00D3, 11 }, - { 0x00D4, 11 }, { 0x00D5, 11 }, { 0x00D6, 11 }, { 0x00D7, 11 }, - { 0x00D8, 11 }, { 0x00D9, 11 }, { 0x00DA, 11 }, { 0x0007, 5 }, - { 0x00DB, 11 }, { 0x00DC, 11 }, { 0x00DD, 11 }, { 0x00DE, 11 }, - { 0x00DF, 11 }, { 0x00E0, 11 }, { 0x00E1, 11 }, { 0x00E2, 11 }, - { 0x00E3, 11 }, { 0x00E4, 11 }, { 0x00E5, 11 }, { 0x00E6, 11 }, - { 0x00E7, 11 }, { 0x00E8, 11 }, { 0x00E9, 11 }, { 0x00EA, 11 }, - { 0x00EB, 11 }, { 0x00EC, 11 }, { 0x00ED, 11 }, { 0x00EE, 11 }, - { 0x00EF, 11 }, { 0x00F0, 11 }, { 0x00F1, 11 }, { 0x00F2, 11 }, - { 0x00F3, 11 }, { 0x00F4, 11 }, { 0x00F5, 11 }, { 0x00F6, 11 }, - { 0x00F7, 11 }, { 0x00F8, 11 }, { 0x00F9, 11 }, { 0x00FA, 11 }, - { 0x00FB, 11 }, { 0x00FC, 11 }, { 0x00FD, 11 }, { 0x00FE, 11 }, - { 0x00FF, 11 }, - }, - { // 3 - { 0x0000, 8 }, { 0x0001, 8 }, { 0x0002, 8 }, { 0x0003, 8 }, - { 0x0004, 8 }, { 0x0005, 8 }, { 0x0006, 8 }, { 0x0007, 8 }, - { 0x0008, 8 }, { 0x0009, 8 }, { 0x000A, 8 }, { 0x000B, 8 }, - { 0x000C, 8 }, { 0x000D, 8 }, { 0x000E, 8 }, { 0x000F, 8 }, - { 0x0010, 8 }, { 0x0011, 8 }, { 0x0012, 8 }, { 0x0013, 8 }, - { 0x0014, 8 }, { 0x0015, 8 }, { 0x0016, 8 }, { 0x0001, 1 }, - { 0x0017, 8 }, { 0x000C, 7 }, { 0x000D, 7 }, { 0x000E, 7 }, - { 0x000F, 7 }, { 0x0010, 7 }, { 0x0011, 7 }, { 0x0012, 7 }, - { 0x0013, 7 }, { 0x0014, 7 }, { 0x0015, 7 }, { 0x0016, 7 }, - { 0x0017, 7 }, { 0x0018, 7 }, { 0x0019, 7 }, { 0x001A, 7 }, - { 0x001B, 7 }, { 0x001C, 7 }, { 0x001D, 7 }, { 0x001E, 7 }, - { 0x001F, 7 }, { 0x0020, 7 }, { 0x0021, 7 }, { 0x0022, 7 }, - { 0x0023, 7 }, { 0x0024, 7 }, { 0x0025, 7 }, { 0x0026, 7 }, - { 0x0027, 7 }, { 0x0028, 7 }, { 0x0029, 7 }, { 0x002A, 7 }, - { 0x002B, 7 }, { 0x002C, 7 }, { 0x002D, 7 }, { 0x002E, 7 }, - { 0x002F, 7 }, { 0x0030, 7 }, { 0x0031, 7 }, { 0x0032, 7 }, - { 0x0033, 7 }, { 0x0034, 7 }, { 0x0035, 7 }, { 0x0036, 7 }, - { 0x0037, 7 }, { 0x0038, 7 }, { 0x0039, 7 }, { 0x003A, 7 }, - { 0x003B, 7 }, { 0x003C, 7 }, { 0x003D, 7 }, { 0x003E, 7 }, - { 0x003F, 7 }, - }, - { // 4 - { 0x0000, 9 }, { 0x0001, 9 }, { 0x0002, 9 }, { 0x0003, 9 }, - { 0x0004, 9 }, { 0x0005, 9 }, { 0x0006, 9 }, { 0x0007, 9 }, - { 0x0008, 9 }, { 0x0009, 9 }, { 0x000A, 9 }, { 0x000B, 9 }, - { 0x000C, 9 }, { 0x000D, 9 }, { 0x000E, 9 }, { 0x000F, 9 }, - { 0x0010, 9 }, { 0x0011, 9 }, { 0x0012, 9 }, { 0x0013, 9 }, - { 0x0014, 9 }, { 0x0015, 9 }, { 0x000B, 8 }, { 0x0001, 2 }, - { 0x0001, 1 }, { 0x000C, 8 }, { 0x000D, 8 }, { 0x000E, 8 }, - { 0x000F, 8 }, { 0x0010, 8 }, { 0x0011, 8 }, { 0x0012, 8 }, - { 0x0013, 8 }, { 0x0014, 8 }, { 0x0015, 8 }, { 0x0016, 8 }, - { 0x0017, 8 }, { 0x0018, 8 }, { 0x0019, 8 }, { 0x001A, 8 }, - { 0x001B, 8 }, { 0x001C, 8 }, { 0x001D, 8 }, { 0x001E, 8 }, - { 0x001F, 8 }, { 0x0020, 8 }, { 0x0021, 8 }, { 0x0022, 8 }, - { 0x0023, 8 }, { 0x0024, 8 }, { 0x0025, 8 }, { 0x0026, 8 }, - { 0x0027, 8 }, { 0x0028, 8 }, { 0x0029, 8 }, { 0x002A, 8 }, - { 0x002B, 8 }, { 0x002C, 8 }, { 0x002D, 8 }, { 0x002E, 8 }, - { 0x002F, 8 }, { 0x0030, 8 }, { 0x0031, 8 }, { 0x0032, 8 }, - { 0x0033, 8 }, { 0x0034, 8 }, { 0x0035, 8 }, { 0x0036, 8 }, - { 0x0037, 8 }, { 0x0038, 8 }, { 0x0039, 8 }, { 0x003A, 8 }, - { 0x003B, 8 }, { 0x003C, 8 }, { 0x003D, 8 }, { 0x003E, 8 }, - { 0x003F, 8 }, - }, - { // 5 - { 0x0000, 10 }, { 0x0001, 10 }, { 0x0002, 10 }, { 0x0003, 10 }, - { 0x0004, 10 }, { 0x0005, 10 }, { 0x0006, 10 }, { 0x0007, 10 }, - { 0x0008, 10 }, { 0x0009, 10 }, { 0x000A, 10 }, { 0x000B, 10 }, - { 0x000C, 10 }, { 0x000D, 10 }, { 0x000E, 10 }, { 0x000F, 10 }, - { 0x0010, 10 }, { 0x0011, 10 }, { 0x0012, 10 }, { 0x0013, 10 }, - { 0x000A, 9 }, { 0x000B, 9 }, { 0x000C, 9 }, { 0x0001, 1 }, - { 0x0001, 3 }, { 0x000D, 9 }, { 0x000E, 9 }, { 0x0001, 2 }, - { 0x000F, 9 }, { 0x0010, 9 }, { 0x0011, 9 }, { 0x0012, 9 }, - { 0x0013, 9 }, { 0x0014, 9 }, { 0x0015, 9 }, { 0x0016, 9 }, - { 0x0017, 9 }, { 0x0018, 9 }, { 0x0019, 9 }, { 0x001A, 9 }, - { 0x001B, 9 }, { 0x001C, 9 }, { 0x001D, 9 }, { 0x001E, 9 }, - { 0x001F, 9 }, { 0x0020, 9 }, { 0x0021, 9 }, { 0x0022, 9 }, - { 0x0023, 9 }, { 0x0024, 9 }, { 0x0025, 9 }, { 0x0026, 9 }, - { 0x0027, 9 }, { 0x0028, 9 }, { 0x0029, 9 }, { 0x002A, 9 }, - { 0x002B, 9 }, { 0x002C, 9 }, { 0x002D, 9 }, { 0x002E, 9 }, - { 0x002F, 9 }, { 0x0030, 9 }, { 0x0031, 9 }, { 0x0032, 9 }, - { 0x0033, 9 }, { 0x0034, 9 }, { 0x0035, 9 }, { 0x0036, 9 }, - { 0x0037, 9 }, { 0x0038, 9 }, { 0x0039, 9 }, { 0x003A, 9 }, - { 0x003B, 9 }, { 0x003C, 9 }, { 0x003D, 9 }, { 0x003E, 9 }, - { 0x003F, 9 }, - }, - { // 6 - { 0x0000, 2 }, { 0x0004, 4 }, { 0x000A, 5 }, { 0x000B, 5 }, - { 0x0018, 6 }, { 0x0019, 6 }, { 0x0034, 7 }, { 0x006A, 8 }, - { 0x006B, 8 }, { 0x006C, 8 }, { 0x00DA, 9 }, { 0x00DB, 9 }, - { 0x01B8, 10 }, { 0x00DD, 9 }, { 0x01B9, 10 }, { 0x3780, 15 }, - { 0x0004, 3 }, { 0x000E, 5 }, { 0x001E, 6 }, { 0x001F, 6 }, - { 0x000A, 4 }, { 0x0058, 7 }, { 0x0017, 5 }, { 0x0018, 5 }, - { 0x0059, 7 }, { 0x005A, 7 }, { 0x005B, 7 }, { 0x00C8, 8 }, - { 0x0065, 7 }, { 0x0066, 7 }, { 0x00C9, 8 }, { 0x00CE, 8 }, - { 0x00CF, 8 }, { 0x00D0, 8 }, { 0x00D1, 8 }, { 0x00D2, 8 }, - { 0x00D3, 8 }, { 0x00DF, 9 }, { 0x00D4, 8 }, { 0x00D5, 8 }, - { 0x00D6, 8 }, { 0x01AE, 9 }, { 0x3781, 15 }, { 0x01BD, 10 }, - { 0x035E, 10 }, { 0x035F, 10 }, { 0x3782, 15 }, { 0x0360, 10 }, - { 0x0037, 6 }, { 0x01B1, 9 }, { 0x3783, 15 }, { 0x3784, 15 }, - { 0x000E, 4 }, { 0x003C, 6 }, { 0x0361, 10 }, { 0x3785, 15 }, - { 0x1BC3, 14 }, { 0x003D, 6 }, { 0x00D9, 8 }, { 0x1BC4, 14 }, - { 0x0368, 10 }, { 0x1BC5, 14 }, { 0x1BC6, 14 }, { 0x1BC7, 14 }, - { 0x1BC8, 14 }, { 0x00DB, 8 }, { 0x0369, 10 }, { 0x036A, 10 }, - { 0x1BC9, 14 }, { 0x1BCA, 14 }, { 0x1BCB, 14 }, { 0x1BCC, 14 }, - { 0x1BCD, 14 }, { 0x001F, 5 }, { 0x036B, 10 }, { 0x1BCE, 14 }, - { 0x1BCF, 14 }, - }, - { // 7 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0006, 5 }, { 0x0007, 5 }, - { 0x0010, 6 }, { 0x0044, 8 }, { 0x0023, 7 }, { 0x0012, 6 }, - { 0x0026, 7 }, { 0x08A0, 13 }, { 0x004E, 8 }, { 0x004F, 8 }, - { 0x08A1, 13 }, { 0x08A2, 13 }, { 0x08A3, 13 }, { 0x0050, 8 }, - { 0x0006, 4 }, { 0x000B, 5 }, { 0x0029, 7 }, { 0x0015, 6 }, - { 0x001C, 6 }, { 0x003A, 7 }, { 0x001E, 6 }, { 0x0004, 3 }, - { 0x0014, 5 }, { 0x0015, 5 }, { 0x000B, 4 }, { 0x001F, 6 }, - { 0x0030, 6 }, { 0x0031, 6 }, { 0x0019, 5 }, { 0x0051, 8 }, - { 0x0034, 6 }, { 0x0035, 6 }, { 0x0036, 6 }, { 0x0037, 6 }, - { 0x0076, 8 }, { 0x0077, 8 }, { 0x0070, 7 }, { 0x001D, 5 }, - { 0x0071, 7 }, { 0x0072, 7 }, { 0x08A4, 13 }, { 0x0073, 7 }, - { 0x00F0, 8 }, { 0x08A5, 13 }, { 0x08A6, 13 }, { 0x08A7, 13 }, - { 0x0079, 7 }, { 0x007A, 7 }, { 0x08A8, 13 }, { 0x08A9, 13 }, - { 0x00F1, 8 }, { 0x08AA, 13 }, { 0x08AB, 13 }, { 0x08AC, 13 }, - { 0x08AD, 13 }, { 0x00F6, 8 }, { 0x08AE, 13 }, { 0x007C, 7 }, - { 0x00F7, 8 }, { 0x08AF, 13 }, { 0x08B0, 13 }, { 0x08B1, 13 }, - { 0x08B2, 13 }, { 0x00FA, 8 }, { 0x08B3, 13 }, { 0x08B4, 13 }, - { 0x08B5, 13 }, { 0x08B6, 13 }, { 0x08B7, 13 }, { 0x00FB, 8 }, - { 0x045C, 12 }, { 0x003F, 6 }, { 0x045D, 12 }, { 0x045E, 12 }, - { 0x045F, 12 }, - }, -}; - -static const uint16_t x8_ac1_lowquant_table[8][77][2] = { - { // 0 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0003, 4 }, { 0x0008, 5 }, - { 0x0012, 6 }, { 0x0026, 7 }, { 0x0014, 6 }, { 0x004E, 8 }, - { 0x004F, 8 }, { 0x00A8, 9 }, { 0x0152, 10 }, { 0x00AA, 9 }, - { 0x00AB, 9 }, { 0x00AC, 9 }, { 0x2A60, 15 }, { 0x02A7, 11 }, - { 0x0006, 4 }, { 0x000B, 5 }, { 0x001C, 6 }, { 0x003A, 7 }, - { 0x000F, 5 }, { 0x003B, 7 }, { 0x0010, 5 }, { 0x0005, 3 }, - { 0x0009, 4 }, { 0x0011, 5 }, { 0x0018, 5 }, { 0x0019, 5 }, - { 0x001A, 5 }, { 0x0036, 6 }, { 0x0037, 6 }, { 0x0070, 7 }, - { 0x0057, 8 }, { 0x00E2, 8 }, { 0x00E3, 8 }, { 0x00E4, 8 }, - { 0x00E5, 8 }, { 0x00AD, 9 }, { 0x0398, 10 }, { 0x003A, 6 }, - { 0x0076, 7 }, { 0x00E7, 8 }, { 0x00EE, 8 }, { 0x00EF, 8 }, - { 0x0732, 11 }, { 0x039A, 10 }, { 0x0733, 11 }, { 0x2A61, 15 }, - { 0x0078, 7 }, { 0x1531, 14 }, { 0x1532, 14 }, { 0x1533, 14 }, - { 0x003D, 6 }, { 0x039B, 10 }, { 0x1534, 14 }, { 0x1535, 14 }, - { 0x1536, 14 }, { 0x0079, 7 }, { 0x1537, 14 }, { 0x00F8, 8 }, - { 0x01F2, 9 }, { 0x07CC, 11 }, { 0x03E7, 10 }, { 0x07CD, 11 }, - { 0x3E80, 14 }, { 0x00FB, 8 }, { 0x03E9, 10 }, { 0x3E81, 14 }, - { 0x3E82, 14 }, { 0x3E83, 14 }, { 0x3E84, 14 }, { 0x3E85, 14 }, - { 0x3E86, 14 }, { 0x003F, 6 }, { 0x01F5, 9 }, { 0x07D1, 11 }, - { 0x3E87, 14 }, - }, - { // 1 - { 0x0000, 2 }, { 0x0002, 3 }, { 0x0006, 4 }, { 0x000E, 5 }, - { 0x001E, 6 }, { 0x001F, 6 }, { 0x0040, 7 }, { 0x0082, 8 }, - { 0x0083, 8 }, { 0x0084, 8 }, { 0x010A, 9 }, { 0x010B, 9 }, - { 0x0430, 11 }, { 0x0431, 11 }, { 0x0432, 11 }, { 0x0433, 11 }, - { 0x0005, 3 }, { 0x0011, 5 }, { 0x0024, 6 }, { 0x004A, 7 }, - { 0x000C, 4 }, { 0x0026, 6 }, { 0x000D, 4 }, { 0x0087, 8 }, - { 0x010D, 9 }, { 0x0258, 10 }, { 0x012D, 9 }, { 0x0259, 10 }, - { 0x025C, 10 }, { 0x0974, 12 }, { 0x025E, 10 }, { 0x025F, 10 }, - { 0x0270, 10 }, { 0x0271, 10 }, { 0x04BB, 11 }, { 0x0975, 12 }, - { 0x0272, 10 }, { 0x09CC, 12 }, { 0x09CD, 12 }, { 0x4E70, 15 }, - { 0x4E71, 15 }, { 0x4E72, 15 }, { 0x4E73, 15 }, { 0x273A, 14 }, - { 0x273B, 14 }, { 0x273C, 14 }, { 0x04E8, 11 }, { 0x04E9, 11 }, - { 0x009E, 8 }, { 0x0275, 10 }, { 0x09D8, 12 }, { 0x273D, 14 }, - { 0x000E, 4 }, { 0x003C, 6 }, { 0x007A, 7 }, { 0x009F, 8 }, - { 0x0277, 10 }, { 0x003E, 6 }, { 0x00F6, 8 }, { 0x04ED, 11 }, - { 0x03DC, 10 }, { 0x273E, 14 }, { 0x07BA, 11 }, { 0x09D9, 12 }, - { 0x273F, 14 }, { 0x3DD8, 14 }, { 0x3DD9, 14 }, { 0x3DDA, 14 }, - { 0x3DDB, 14 }, { 0x3DDC, 14 }, { 0x3DDD, 14 }, { 0x3DDE, 14 }, - { 0x3DDF, 14 }, { 0x003F, 6 }, { 0x07BC, 11 }, { 0x07BD, 11 }, - { 0x03DF, 10 }, - }, - { // 2 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0006, 5 }, { 0x000E, 6 }, - { 0x001E, 7 }, { 0x003E, 8 }, { 0x003F, 8 }, { 0x0040, 8 }, - { 0x0104, 10 }, { 0x0083, 9 }, { 0x0105, 10 }, { 0x0108, 10 }, - { 0x4240, 16 }, { 0x010A, 10 }, { 0x010B, 10 }, { 0x4241, 16 }, - { 0x0003, 3 }, { 0x0009, 5 }, { 0x0011, 6 }, { 0x0043, 8 }, - { 0x0004, 3 }, { 0x000A, 5 }, { 0x000A, 4 }, { 0x002C, 7 }, - { 0x00B4, 9 }, { 0x00B5, 9 }, { 0x00B6, 9 }, { 0x00B7, 9 }, - { 0x00B8, 9 }, { 0x0172, 10 }, { 0x0173, 10 }, { 0x0174, 10 }, - { 0x0175, 10 }, { 0x0176, 10 }, { 0x0177, 10 }, { 0x00BC, 9 }, - { 0x017A, 10 }, { 0x0213, 11 }, { 0x4242, 16 }, { 0x017B, 10 }, - { 0x02F8, 11 }, { 0x017D, 10 }, { 0x02F9, 11 }, { 0x017E, 10 }, - { 0x4243, 16 }, { 0x02FE, 11 }, { 0x2122, 15 }, { 0x2123, 15 }, - { 0x0058, 7 }, { 0x0164, 9 }, { 0x2124, 15 }, { 0x2125, 15 }, - { 0x0006, 3 }, { 0x000E, 4 }, { 0x002D, 6 }, { 0x002E, 6 }, - { 0x00B3, 8 }, { 0x001E, 5 }, { 0x005E, 7 }, { 0x2126, 15 }, - { 0x2127, 15 }, { 0x2128, 15 }, { 0x2129, 15 }, { 0x02FF, 11 }, - { 0x212A, 15 }, { 0x0594, 11 }, { 0x0595, 11 }, { 0x0596, 11 }, - { 0x212B, 15 }, { 0x212C, 15 }, { 0x212D, 15 }, { 0x212E, 15 }, - { 0x212F, 15 }, { 0x001F, 5 }, { 0x0597, 11 }, { 0x00BE, 8 }, - { 0x00BF, 8 }, - }, - { // 3 - { 0x0000, 2 }, { 0x0002, 3 }, { 0x0006, 4 }, { 0x0007, 4 }, - { 0x0010, 5 }, { 0x0011, 5 }, { 0x0024, 6 }, { 0x0025, 6 }, - { 0x0026, 6 }, { 0x0027, 6 }, { 0x0050, 7 }, { 0x0051, 7 }, - { 0x00A4, 8 }, { 0x00A5, 8 }, { 0x00A6, 8 }, { 0x014E, 9 }, - { 0x000B, 4 }, { 0x002A, 6 }, { 0x0056, 7 }, { 0x014F, 9 }, - { 0x0030, 6 }, { 0x00AE, 8 }, { 0x0062, 7 }, { 0x0032, 6 }, - { 0x0033, 6 }, { 0x0034, 6 }, { 0x0035, 6 }, { 0x0036, 6 }, - { 0x0063, 7 }, { 0x006E, 7 }, { 0x006F, 7 }, { 0x0070, 7 }, - { 0x0071, 7 }, { 0x0072, 7 }, { 0x0073, 7 }, { 0x0074, 7 }, - { 0x00AF, 8 }, { 0x00EA, 8 }, { 0x01D6, 9 }, { 0x075C, 11 }, - { 0x03AF, 10 }, { 0x75D0, 15 }, { 0x75D1, 15 }, { 0x75D2, 15 }, - { 0x75D3, 15 }, { 0x75D4, 15 }, { 0x0076, 7 }, { 0x00EE, 8 }, - { 0x00EF, 8 }, { 0x0EBB, 12 }, { 0x01E0, 9 }, { 0x75D5, 15 }, - { 0x0079, 7 }, { 0x01E1, 9 }, { 0x75D6, 15 }, { 0x75D7, 15 }, - { 0x7880, 15 }, { 0x00F4, 8 }, { 0x0789, 11 }, { 0x003E, 6 }, - { 0x007B, 7 }, { 0x00F5, 8 }, { 0x00FC, 8 }, { 0x007F, 7 }, - { 0x01E3, 9 }, { 0x078A, 11 }, { 0x078B, 11 }, { 0x7881, 15 }, - { 0x7882, 15 }, { 0x7883, 15 }, { 0x3C42, 14 }, { 0x3C43, 14 }, - { 0x3C44, 14 }, { 0x00FD, 8 }, { 0x3C45, 14 }, { 0x3C46, 14 }, - { 0x3C47, 14 }, - }, - { // 4 - { 0x0000, 2 }, { 0x0004, 4 }, { 0x000A, 5 }, { 0x0016, 6 }, - { 0x0017, 6 }, { 0x0030, 7 }, { 0x0031, 7 }, { 0x0064, 8 }, - { 0x0065, 8 }, { 0x0066, 8 }, { 0x00CE, 9 }, { 0x00CF, 9 }, - { 0x01A0, 10 }, { 0x01A1, 10 }, { 0x1A20, 14 }, { 0x0689, 12 }, - { 0x0004, 3 }, { 0x000E, 5 }, { 0x001B, 6 }, { 0x0035, 7 }, - { 0x000A, 4 }, { 0x001E, 6 }, { 0x0016, 5 }, { 0x0017, 5 }, - { 0x001F, 6 }, { 0x0030, 6 }, { 0x0031, 6 }, { 0x0064, 7 }, - { 0x0065, 7 }, { 0x0069, 8 }, { 0x0066, 7 }, { 0x00CE, 8 }, - { 0x00CF, 8 }, { 0x00D0, 8 }, { 0x00D1, 8 }, { 0x00D2, 8 }, - { 0x01A6, 9 }, { 0x01A3, 10 }, { 0x034E, 10 }, { 0x006A, 7 }, - { 0x00D6, 8 }, { 0x01AE, 9 }, { 0x01AF, 9 }, { 0x034F, 10 }, - { 0x0345, 11 }, { 0x01B0, 9 }, { 0x01B1, 9 }, { 0x0364, 10 }, - { 0x006D, 7 }, { 0x00DC, 8 }, { 0x0D94, 12 }, { 0x0D95, 12 }, - { 0x000E, 4 }, { 0x003C, 6 }, { 0x00DD, 8 }, { 0x00DE, 8 }, - { 0x01B3, 9 }, { 0x003D, 6 }, { 0x00DF, 8 }, { 0x01F0, 9 }, - { 0x03E2, 10 }, { 0x03E3, 10 }, { 0x06CB, 11 }, { 0x03E4, 10 }, - { 0x07CA, 11 }, { 0x01F3, 9 }, { 0x01F4, 9 }, { 0x07CB, 11 }, - { 0x07D4, 11 }, { 0x1A21, 14 }, { 0x1A22, 14 }, { 0x07D5, 11 }, - { 0x1A23, 14 }, { 0x003F, 6 }, { 0x01F6, 9 }, { 0x01F7, 9 }, - { 0x03EB, 10 }, - }, - { // 5 - { 0x0000, 2 }, { 0x0002, 3 }, { 0x0006, 4 }, { 0x000E, 5 }, - { 0x000F, 5 }, { 0x0020, 6 }, { 0x0021, 6 }, { 0x0044, 7 }, - { 0x0045, 7 }, { 0x0046, 7 }, { 0x008E, 8 }, { 0x008F, 8 }, - { 0x0090, 8 }, { 0x0122, 9 }, { 0x0246, 10 }, { 0x0124, 9 }, - { 0x0005, 3 }, { 0x0013, 5 }, { 0x004A, 7 }, { 0x0093, 8 }, - { 0x0018, 5 }, { 0x004B, 7 }, { 0x0032, 6 }, { 0x001A, 5 }, - { 0x0033, 6 }, { 0x006C, 7 }, { 0x006D, 7 }, { 0x006E, 7 }, - { 0x00DE, 8 }, { 0x00DF, 8 }, { 0x0070, 7 }, { 0x00E2, 8 }, - { 0x00E3, 8 }, { 0x00E4, 8 }, { 0x00E5, 8 }, { 0x00E6, 8 }, - { 0x00E7, 8 }, { 0x0125, 9 }, { 0x01D0, 9 }, { 0x048E, 11 }, - { 0x091E, 12 }, { 0x091F, 12 }, { 0x7440, 15 }, { 0x1D11, 13 }, - { 0x7441, 15 }, { 0x7442, 15 }, { 0x00E9, 8 }, { 0x01D4, 9 }, - { 0x00EB, 8 }, { 0x03A3, 10 }, { 0x01D5, 9 }, { 0x1D12, 13 }, - { 0x001E, 5 }, { 0x0076, 7 }, { 0x01DC, 9 }, { 0x01DD, 9 }, - { 0x7443, 15 }, { 0x007C, 7 }, { 0x0745, 11 }, { 0x00EF, 8 }, - { 0x00FA, 8 }, { 0x00FB, 8 }, { 0x01F8, 9 }, { 0x00FD, 8 }, - { 0x07E4, 11 }, { 0x0FCA, 12 }, { 0x1D13, 13 }, { 0x7E58, 15 }, - { 0x7E59, 15 }, { 0x7E5A, 15 }, { 0x7E5B, 15 }, { 0x7E5C, 15 }, - { 0x7E5D, 15 }, { 0x007F, 7 }, { 0x3F2F, 14 }, { 0x07E6, 11 }, - { 0x07E7, 11 }, - }, - { // 6 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0003, 4 }, { 0x0008, 5 }, - { 0x0009, 5 }, { 0x0014, 6 }, { 0x0015, 6 }, { 0x002C, 7 }, - { 0x005A, 8 }, { 0x005B, 8 }, { 0x005C, 8 }, { 0x00BA, 9 }, - { 0x00BB, 9 }, { 0x00BC, 9 }, { 0x02F4, 11 }, { 0x05EA, 12 }, - { 0x0003, 3 }, { 0x0010, 5 }, { 0x0022, 6 }, { 0x0046, 7 }, - { 0x0009, 4 }, { 0x0028, 6 }, { 0x0015, 5 }, { 0x000B, 4 }, - { 0x0018, 5 }, { 0x0029, 6 }, { 0x0032, 6 }, { 0x0047, 7 }, - { 0x0066, 7 }, { 0x0067, 7 }, { 0x0068, 7 }, { 0x0069, 7 }, - { 0x006A, 7 }, { 0x005F, 8 }, { 0x00D6, 8 }, { 0x00D7, 8 }, - { 0x01B0, 9 }, { 0x00D9, 8 }, { 0x017B, 10 }, { 0x006D, 7 }, - { 0x00DC, 8 }, { 0x01B1, 9 }, { 0x06E8, 11 }, { 0x01BB, 9 }, - { 0x0375, 10 }, { 0x05EB, 12 }, { 0x01BC, 9 }, { 0x6E90, 15 }, - { 0x0038, 6 }, { 0x0072, 7 }, { 0x6E91, 15 }, { 0x6E92, 15 }, - { 0x001D, 5 }, { 0x0073, 7 }, { 0x01BD, 9 }, { 0x06F8, 11 }, - { 0x6E93, 15 }, { 0x003C, 6 }, { 0x01BF, 9 }, { 0x00F4, 8 }, - { 0x01EA, 9 }, { 0x037D, 10 }, { 0x03D6, 10 }, { 0x06F9, 11 }, - { 0x6E94, 15 }, { 0x00F6, 8 }, { 0x01EE, 9 }, { 0x6E95, 15 }, - { 0x6E96, 15 }, { 0x6E97, 15 }, { 0x374C, 14 }, { 0x374D, 14 }, - { 0x374E, 14 }, { 0x001F, 5 }, { 0x03D7, 10 }, { 0x01EF, 9 }, - { 0x374F, 14 }, - }, - { // 7 - { 0x0000, 2 }, { 0x0004, 4 }, { 0x000A, 5 }, { 0x0016, 6 }, - { 0x002E, 7 }, { 0x002F, 7 }, { 0x0060, 8 }, { 0x0061, 8 }, - { 0x00C4, 9 }, { 0x00C5, 9 }, { 0x00C6, 9 }, { 0x018E, 10 }, - { 0x31E0, 15 }, { 0x31E1, 15 }, { 0x31E2, 15 }, { 0x31E3, 15 }, - { 0x0004, 3 }, { 0x000D, 5 }, { 0x0019, 6 }, { 0x0038, 7 }, - { 0x000A, 4 }, { 0x001D, 6 }, { 0x000B, 4 }, { 0x0072, 8 }, - { 0x0073, 8 }, { 0x00F0, 9 }, { 0x01E2, 10 }, { 0x00F2, 9 }, - { 0x01E3, 10 }, { 0x00F3, 9 }, { 0x01E8, 10 }, { 0x01E9, 10 }, - { 0x31E4, 15 }, { 0x01EA, 10 }, { 0x031F, 11 }, { 0x03D6, 11 }, - { 0x31E5, 15 }, { 0x01EC, 10 }, { 0x31E6, 15 }, { 0x00F7, 9 }, - { 0x03D7, 11 }, { 0x31E7, 15 }, { 0x31E8, 15 }, { 0x03DA, 11 }, - { 0x03DB, 11 }, { 0x31E9, 15 }, { 0x03E0, 11 }, { 0x31EA, 15 }, - { 0x003F, 7 }, { 0x01F1, 10 }, { 0x31EB, 15 }, { 0x31EC, 15 }, - { 0x0006, 3 }, { 0x001C, 5 }, { 0x0074, 7 }, { 0x0075, 7 }, - { 0x00F9, 9 }, { 0x001E, 5 }, { 0x0076, 7 }, { 0x00FA, 9 }, - { 0x03E1, 11 }, { 0x31ED, 15 }, { 0x18F7, 14 }, { 0x1F60, 14 }, - { 0x1F61, 14 }, { 0x01DC, 9 }, { 0x01DD, 9 }, { 0x1F62, 14 }, - { 0x1F63, 14 }, { 0x1F64, 14 }, { 0x1F65, 14 }, { 0x1F66, 14 }, - { 0x1F67, 14 }, { 0x001F, 5 }, { 0x03ED, 11 }, { 0x00EF, 8 }, - { 0x01F7, 10 }, - }, -}; - -static const uint16_t x8_ac1_highquant_table[8][77][2] = { - { // 0 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0006, 5 }, { 0x0007, 5 }, - { 0x0008, 5 }, { 0x0009, 5 }, { 0x0014, 6 }, { 0x002A, 7 }, - { 0x0016, 6 }, { 0x002B, 7 }, { 0x005C, 8 }, { 0x002F, 7 }, - { 0x0030, 7 }, { 0x005D, 8 }, { 0x0062, 8 }, { 0x00C6, 9 }, - { 0x0007, 4 }, { 0x0019, 6 }, { 0x001A, 6 }, { 0x0036, 7 }, - { 0x0010, 5 }, { 0x006E, 8 }, { 0x0022, 6 }, { 0x0009, 4 }, - { 0x000A, 4 }, { 0x0016, 5 }, { 0x0023, 6 }, { 0x002E, 6 }, - { 0x002F, 6 }, { 0x0030, 6 }, { 0x0062, 7 }, { 0x0063, 7 }, - { 0x0064, 7 }, { 0x0065, 7 }, { 0x0066, 7 }, { 0x0067, 7 }, - { 0x0068, 7 }, { 0x0069, 7 }, { 0x006A, 7 }, { 0x006B, 7 }, - { 0x006C, 7 }, { 0x00C7, 9 }, { 0x00DE, 9 }, { 0x00DF, 9 }, - { 0x06D0, 11 }, { 0x01B5, 9 }, { 0x0037, 6 }, { 0x00DB, 8 }, - { 0x001C, 5 }, { 0x0074, 7 }, { 0x01D4, 9 }, { 0x01D5, 9 }, - { 0x0076, 7 }, { 0x0369, 10 }, { 0x3688, 14 }, { 0x3689, 14 }, - { 0x368A, 14 }, { 0x0077, 7 }, { 0x03AC, 10 }, { 0x0078, 7 }, - { 0x00F2, 8 }, { 0x01D7, 9 }, { 0x00F3, 8 }, { 0x007A, 7 }, - { 0x368B, 14 }, { 0x007B, 7 }, { 0x007C, 7 }, { 0x03AD, 10 }, - { 0x03E8, 10 }, { 0x368C, 14 }, { 0x368D, 14 }, { 0x03E9, 10 }, - { 0x368E, 14 }, { 0x003F, 6 }, { 0x01F5, 9 }, { 0x00FB, 8 }, - { 0x368F, 14 }, - }, - { // 1 - { 0x0000, 2 }, { 0x0004, 4 }, { 0x000A, 5 }, { 0x000B, 5 }, - { 0x0018, 6 }, { 0x0032, 7 }, { 0x0033, 7 }, { 0x0034, 7 }, - { 0x006A, 8 }, { 0x00D6, 9 }, { 0x00D7, 9 }, { 0x00D8, 9 }, - { 0x00D9, 9 }, { 0x3680, 15 }, { 0x01B5, 10 }, { 0x0369, 11 }, - { 0x0004, 3 }, { 0x000E, 5 }, { 0x001E, 6 }, { 0x0037, 7 }, - { 0x000A, 4 }, { 0x0016, 5 }, { 0x000C, 4 }, { 0x001F, 6 }, - { 0x005C, 7 }, { 0x005D, 7 }, { 0x00BC, 8 }, { 0x00BD, 8 }, - { 0x005F, 7 }, { 0x00D0, 8 }, { 0x00DB, 9 }, { 0x00D1, 8 }, - { 0x01A4, 9 }, { 0x01A5, 9 }, { 0x01A6, 9 }, { 0x01A7, 9 }, - { 0x0350, 10 }, { 0x06A2, 11 }, { 0x06A3, 11 }, { 0x01A9, 9 }, - { 0x01AA, 9 }, { 0x06AC, 11 }, { 0x3681, 15 }, { 0x0357, 10 }, - { 0x3682, 15 }, { 0x3683, 15 }, { 0x3684, 15 }, { 0x3685, 15 }, - { 0x0036, 6 }, { 0x00D6, 8 }, { 0x3686, 15 }, { 0x3687, 15 }, - { 0x000E, 4 }, { 0x006E, 7 }, { 0x00D7, 8 }, { 0x06AD, 11 }, - { 0x3688, 15 }, { 0x001E, 5 }, { 0x00DE, 8 }, { 0x06F8, 11 }, - { 0x037D, 10 }, { 0x3689, 15 }, { 0x368A, 15 }, { 0x368B, 15 }, - { 0x368C, 15 }, { 0x01BF, 9 }, { 0x368D, 15 }, { 0x1B47, 14 }, - { 0x37C8, 14 }, { 0x37C9, 14 }, { 0x37CA, 14 }, { 0x37CB, 14 }, - { 0x37CC, 14 }, { 0x001F, 5 }, { 0x37CD, 14 }, { 0x37CE, 14 }, - { 0x37CF, 14 }, - }, - { // 2 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0003, 4 }, { 0x0008, 5 }, - { 0x0012, 6 }, { 0x0026, 7 }, { 0x0014, 6 }, { 0x0027, 7 }, - { 0x00A8, 9 }, { 0x00A9, 9 }, { 0x0055, 8 }, { 0x2B00, 15 }, - { 0x00AD, 9 }, { 0x2B01, 15 }, { 0x2B02, 15 }, { 0x2B03, 15 }, - { 0x0003, 3 }, { 0x000B, 5 }, { 0x0040, 7 }, { 0x0041, 7 }, - { 0x0009, 4 }, { 0x0021, 6 }, { 0x0011, 5 }, { 0x000A, 4 }, - { 0x000B, 4 }, { 0x0018, 5 }, { 0x0032, 6 }, { 0x0033, 6 }, - { 0x0034, 6 }, { 0x0035, 6 }, { 0x006C, 7 }, { 0x0057, 8 }, - { 0x006D, 7 }, { 0x00DC, 8 }, { 0x0159, 10 }, { 0x00DD, 8 }, - { 0x01BC, 9 }, { 0x037A, 10 }, { 0x037B, 10 }, { 0x0038, 6 }, - { 0x0072, 7 }, { 0x01BE, 9 }, { 0x01BF, 9 }, { 0x00E6, 8 }, - { 0x039C, 10 }, { 0x01CF, 9 }, { 0x2B04, 15 }, { 0x2B05, 15 }, - { 0x0074, 7 }, { 0x01D4, 9 }, { 0x2B06, 15 }, { 0x2B07, 15 }, - { 0x001E, 5 }, { 0x00EB, 8 }, { 0x1584, 14 }, { 0x1585, 14 }, - { 0x1586, 14 }, { 0x003B, 6 }, { 0x01D5, 9 }, { 0x01F0, 9 }, - { 0x039D, 10 }, { 0x03E2, 10 }, { 0x1587, 14 }, { 0x1588, 14 }, - { 0x1589, 14 }, { 0x00F9, 8 }, { 0x158A, 14 }, { 0x158B, 14 }, - { 0x03E3, 10 }, { 0x158C, 14 }, { 0x158D, 14 }, { 0x01F4, 9 }, - { 0x158E, 14 }, { 0x003F, 6 }, { 0x00FB, 8 }, { 0x01F5, 9 }, - { 0x158F, 14 }, - }, - { // 3 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0006, 5 }, { 0x0007, 5 }, - { 0x0010, 6 }, { 0x0011, 6 }, { 0x0024, 7 }, { 0x0025, 7 }, - { 0x0013, 6 }, { 0x0014, 6 }, { 0x002A, 7 }, { 0x002B, 7 }, - { 0x00B0, 9 }, { 0x00B1, 9 }, { 0x002D, 7 }, { 0x0059, 8 }, - { 0x000C, 5 }, { 0x0017, 6 }, { 0x00D0, 9 }, { 0x0035, 7 }, - { 0x001B, 6 }, { 0x0038, 7 }, { 0x0039, 7 }, { 0x0004, 3 }, - { 0x0005, 3 }, { 0x000F, 5 }, { 0x0018, 5 }, { 0x001D, 6 }, - { 0x0032, 6 }, { 0x0033, 6 }, { 0x0068, 7 }, { 0x0069, 7 }, - { 0x0069, 8 }, { 0x00D4, 8 }, { 0x00D5, 8 }, { 0x00D6, 8 }, - { 0x006C, 7 }, { 0x0037, 6 }, { 0x006D, 7 }, { 0x0070, 7 }, - { 0x0039, 6 }, { 0x00D7, 8 }, { 0x00D1, 9 }, { 0x3880, 14 }, - { 0x3881, 14 }, { 0x3882, 14 }, { 0x0074, 7 }, { 0x01C5, 9 }, - { 0x0075, 7 }, { 0x00E3, 8 }, { 0x3883, 14 }, { 0x3884, 14 }, - { 0x00EC, 8 }, { 0x3885, 14 }, { 0x1C43, 13 }, { 0x1C44, 13 }, - { 0x1C45, 13 }, { 0x00ED, 8 }, { 0x1C46, 13 }, { 0x003C, 6 }, - { 0x0077, 7 }, { 0x01E8, 9 }, { 0x003E, 6 }, { 0x007B, 7 }, - { 0x1C47, 13 }, { 0x007E, 7 }, { 0x007F, 7 }, { 0x1C48, 13 }, - { 0x1C49, 13 }, { 0x1C4A, 13 }, { 0x1C4B, 13 }, { 0x1C4C, 13 }, - { 0x1C4D, 13 }, { 0x00F5, 8 }, { 0x1C4E, 13 }, { 0x01E9, 9 }, - { 0x1C4F, 13 }, - }, - { // 4 - { 0x0000, 2 }, { 0x0004, 4 }, { 0x000A, 5 }, { 0x000B, 5 }, - { 0x0018, 6 }, { 0x0019, 6 }, { 0x0034, 7 }, { 0x0035, 7 }, - { 0x0036, 7 }, { 0x006E, 8 }, { 0x00DE, 9 }, { 0x00DF, 9 }, - { 0x01C0, 10 }, { 0x01C1, 10 }, { 0x01C2, 10 }, { 0x3860, 15 }, - { 0x0004, 3 }, { 0x000F, 5 }, { 0x001D, 6 }, { 0x0039, 7 }, - { 0x000A, 4 }, { 0x002C, 6 }, { 0x002D, 6 }, { 0x000C, 4 }, - { 0x0017, 5 }, { 0x0034, 6 }, { 0x0035, 6 }, { 0x0036, 6 }, - { 0x006E, 7 }, { 0x006F, 7 }, { 0x0070, 7 }, { 0x0071, 7 }, - { 0x0071, 8 }, { 0x00E4, 8 }, { 0x00E5, 8 }, { 0x00E6, 8 }, - { 0x00E7, 8 }, { 0x00E8, 8 }, { 0x03A4, 10 }, { 0x0075, 7 }, - { 0x00EC, 8 }, { 0x01D3, 9 }, { 0x01DA, 9 }, { 0x03A5, 10 }, - { 0x03B6, 10 }, { 0x070D, 12 }, { 0x03B7, 10 }, { 0x070E, 12 }, - { 0x003C, 6 }, { 0x00EE, 8 }, { 0x3861, 15 }, { 0x3862, 15 }, - { 0x003D, 6 }, { 0x01DE, 9 }, { 0x3863, 15 }, { 0x3864, 15 }, - { 0x3865, 15 }, { 0x007C, 7 }, { 0x070F, 12 }, { 0x03BE, 10 }, - { 0x03BF, 10 }, { 0x3866, 15 }, { 0x0FA0, 12 }, { 0x07D1, 11 }, - { 0x3867, 15 }, { 0x00FB, 8 }, { 0x01F5, 9 }, { 0x7D08, 15 }, - { 0x0FA4, 12 }, { 0x7D09, 15 }, { 0x7D0A, 15 }, { 0x7D0B, 15 }, - { 0x3E86, 14 }, { 0x003F, 6 }, { 0x0FA5, 12 }, { 0x07D3, 11 }, - { 0x3E87, 14 }, - }, - { // 5 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0003, 4 }, { 0x0008, 5 }, - { 0x0009, 5 }, { 0x0014, 6 }, { 0x002A, 7 }, { 0x0056, 8 }, - { 0x02B8, 11 }, { 0x00AF, 9 }, { 0x02B9, 11 }, { 0x015D, 10 }, - { 0x02C0, 11 }, { 0x2C10, 15 }, { 0x2C11, 15 }, { 0x2C12, 15 }, - { 0x0006, 4 }, { 0x000E, 5 }, { 0x0017, 6 }, { 0x002D, 7 }, - { 0x000F, 5 }, { 0x0040, 7 }, { 0x0021, 6 }, { 0x0005, 3 }, - { 0x0009, 4 }, { 0x0011, 5 }, { 0x0018, 5 }, { 0x0019, 5 }, - { 0x001A, 5 }, { 0x0036, 6 }, { 0x0037, 6 }, { 0x0041, 7 }, - { 0x0059, 8 }, { 0x00E0, 8 }, { 0x00E1, 8 }, { 0x0071, 7 }, - { 0x00E4, 8 }, { 0x00B1, 9 }, { 0x02C2, 11 }, { 0x001D, 5 }, - { 0x0073, 7 }, { 0x00E5, 8 }, { 0x00F0, 8 }, { 0x0079, 7 }, - { 0x03C4, 10 }, { 0x01E3, 9 }, { 0x01E8, 9 }, { 0x2C13, 15 }, - { 0x007B, 7 }, { 0x2C14, 15 }, { 0x2C15, 15 }, { 0x2C16, 15 }, - { 0x007C, 7 }, { 0x02C3, 11 }, { 0x2C17, 15 }, { 0x160C, 14 }, - { 0x160D, 14 }, { 0x007D, 7 }, { 0x160E, 14 }, { 0x01E9, 9 }, - { 0x03C5, 10 }, { 0x03D4, 10 }, { 0x01EB, 9 }, { 0x160F, 14 }, - { 0x3D50, 14 }, { 0x00FC, 8 }, { 0x07AB, 11 }, { 0x3D51, 14 }, - { 0x3D52, 14 }, { 0x3D53, 14 }, { 0x3D54, 14 }, { 0x01FA, 9 }, - { 0x3D55, 14 }, { 0x007F, 7 }, { 0x01FB, 9 }, { 0x3D56, 14 }, - { 0x3D57, 14 }, - }, - { // 6 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0003, 4 }, { 0x0008, 5 }, - { 0x0009, 5 }, { 0x000A, 5 }, { 0x000B, 5 }, { 0x0018, 6 }, - { 0x0032, 7 }, { 0x000D, 5 }, { 0x0033, 7 }, { 0x0E00, 13 }, - { 0x0039, 7 }, { 0x0E01, 13 }, { 0x003A, 7 }, { 0x0E02, 13 }, - { 0x0008, 4 }, { 0x001E, 6 }, { 0x003B, 7 }, { 0x003E, 7 }, - { 0x0012, 5 }, { 0x003F, 7 }, { 0x0013, 5 }, { 0x0028, 6 }, - { 0x0029, 6 }, { 0x0054, 7 }, { 0x002B, 6 }, { 0x0055, 7 }, - { 0x0058, 7 }, { 0x0E03, 13 }, { 0x0059, 7 }, { 0x005A, 7 }, - { 0x0E04, 13 }, { 0x0E05, 13 }, { 0x0703, 12 }, { 0x005B, 7 }, - { 0x005C, 7 }, { 0x0704, 12 }, { 0x0705, 12 }, { 0x005D, 7 }, - { 0x0706, 12 }, { 0x0707, 12 }, { 0x0708, 12 }, { 0x0709, 12 }, - { 0x070A, 12 }, { 0x070B, 12 }, { 0x0018, 5 }, { 0x002F, 6 }, - { 0x000D, 4 }, { 0x0019, 5 }, { 0x070C, 12 }, { 0x0070, 7 }, - { 0x001D, 5 }, { 0x070D, 12 }, { 0x070E, 12 }, { 0x070F, 12 }, - { 0x0710, 12 }, { 0x0039, 6 }, { 0x0711, 12 }, { 0x003C, 6 }, - { 0x0712, 12 }, { 0x0713, 12 }, { 0x0714, 12 }, { 0x0715, 12 }, - { 0x0716, 12 }, { 0x003D, 6 }, { 0x0717, 12 }, { 0x0718, 12 }, - { 0x0719, 12 }, { 0x071A, 12 }, { 0x071B, 12 }, { 0x071C, 12 }, - { 0x071D, 12 }, { 0x001F, 5 }, { 0x071E, 12 }, { 0x0071, 7 }, - { 0x071F, 12 }, - }, - { // 7 - { 0x0000, 3 }, { 0x0002, 4 }, { 0x0006, 5 }, { 0x000E, 6 }, - { 0x000F, 6 }, { 0x0040, 8 }, { 0x0041, 8 }, { 0x0042, 8 }, - { 0x0218, 11 }, { 0x2190, 15 }, { 0x2191, 15 }, { 0x2192, 15 }, - { 0x2193, 15 }, { 0x2194, 15 }, { 0x2195, 15 }, { 0x2196, 15 }, - { 0x0005, 4 }, { 0x0011, 6 }, { 0x0024, 7 }, { 0x0087, 9 }, - { 0x000C, 5 }, { 0x004A, 8 }, { 0x004B, 8 }, { 0x0002, 2 }, - { 0x0006, 3 }, { 0x000D, 5 }, { 0x000E, 5 }, { 0x000F, 5 }, - { 0x0013, 6 }, { 0x0038, 6 }, { 0x00E4, 8 }, { 0x00E5, 8 }, - { 0x01CC, 9 }, { 0x00E7, 8 }, { 0x0074, 7 }, { 0x00EA, 8 }, - { 0x01CD, 9 }, { 0x021A, 11 }, { 0x2197, 15 }, { 0x001E, 5 }, - { 0x0076, 7 }, { 0x00EB, 8 }, { 0x01DC, 9 }, { 0x00EF, 8 }, - { 0x01DD, 9 }, { 0x01F0, 9 }, { 0x2198, 15 }, { 0x2199, 15 }, - { 0x00F9, 8 }, { 0x03E2, 10 }, { 0x219A, 15 }, { 0x219B, 15 }, - { 0x00FA, 8 }, { 0x219C, 15 }, { 0x219D, 15 }, { 0x219E, 15 }, - { 0x219F, 15 }, { 0x01F6, 9 }, { 0x21B0, 15 }, { 0x00FC, 8 }, - { 0x01F7, 9 }, { 0x21B1, 15 }, { 0x21B2, 15 }, { 0x21B3, 15 }, - { 0x21B4, 15 }, { 0x01FA, 9 }, { 0x21B5, 15 }, { 0x21B6, 15 }, - { 0x21B7, 15 }, { 0x21B8, 15 }, { 0x21B9, 15 }, { 0x03E3, 10 }, - { 0x10DD, 14 }, { 0x007F, 7 }, { 0x01FB, 9 }, { 0x10DE, 14 }, - { 0x10DF, 14 }, +static const uint8_t x8_ac_quant_table[2][2][8][77][2] = { + { + { + { /* AC highquant table group 0, table 0 */ + { 0, 3 }, { 1, 4 }, { 2, 6 }, { 3, 6 }, { 4, 7 }, + { 6, 15 }, { 8, 15 }, { 10, 15 }, { 12, 15 }, { 13, 15 }, + { 14, 15 }, { 15, 14 }, { 34, 14 }, { 45, 14 }, { 46, 14 }, + { 47, 14 }, { 49, 14 }, { 50, 14 }, { 51, 14 }, { 52, 14 }, + { 53, 14 }, { 54, 14 }, { 55, 14 }, { 56, 14 }, { 57, 14 }, + { 58, 14 }, { 60, 14 }, { 61, 14 }, { 62, 14 }, { 63, 14 }, + { 64, 14 }, { 65, 14 }, { 67, 14 }, { 69, 14 }, { 70, 14 }, + { 71, 14 }, { 72, 14 }, { 74, 14 }, { 75, 14 }, { 76, 14 }, + { 9, 9 }, { 7, 8 }, { 5, 6 }, { 11, 9 }, { 18, 9 }, + { 19, 9 }, { 22, 9 }, { 20, 7 }, { 17, 6 }, { 16, 5 }, + { 21, 7 }, { 29, 8 }, { 33, 8 }, { 28, 6 }, { 27, 5 }, + { 24, 3 }, { 23, 2 }, { 25, 4 }, { 26, 4 }, { 30, 7 }, + { 32, 7 }, { 31, 6 }, { 35, 7 }, { 36, 7 }, { 37, 7 }, + { 38, 9 }, { 41, 9 }, { 42, 8 }, { 39, 5 }, { 40, 6 }, + { 43, 9 }, { 44, 9 }, { 48, 8 }, { 59, 9 }, { 66, 9 }, + { 68, 9 }, { 73, 9 }, + }, + { /* AC highquant table group 0, table 1 */ + { 0, 3 }, { 1, 4 }, { 2, 4 }, { 3, 5 }, { 4, 6 }, + { 5, 6 }, { 6, 6 }, { 7, 6 }, { 8, 7 }, { 9, 8 }, + { 10, 8 }, { 11, 8 }, { 12, 8 }, { 13, 14 }, { 44, 14 }, + { 47, 14 }, { 50, 14 }, { 51, 14 }, { 54, 14 }, { 55, 14 }, + { 56, 14 }, { 63, 14 }, { 64, 14 }, { 67, 14 }, { 68, 14 }, + { 69, 14 }, { 70, 14 }, { 72, 14 }, { 76, 14 }, { 14, 10 }, + { 15, 10 }, { 45, 10 }, { 32, 8 }, { 16, 4 }, { 17, 5 }, + { 18, 6 }, { 19, 7 }, { 31, 7 }, { 20, 5 }, { 21, 6 }, + { 26, 6 }, { 22, 5 }, { 24, 5 }, { 23, 4 }, { 25, 5 }, + { 27, 6 }, { 28, 6 }, { 29, 6 }, { 30, 6 }, { 33, 8 }, + { 38, 8 }, { 34, 7 }, { 35, 7 }, { 36, 7 }, { 37, 7 }, + { 39, 7 }, { 40, 7 }, { 41, 8 }, { 42, 8 }, { 43, 8 }, + { 46, 9 }, { 49, 9 }, { 53, 8 }, { 58, 8 }, { 57, 6 }, + { 48, 5 }, { 52, 5 }, { 59, 7 }, { 60, 8 }, { 61, 9 }, + { 66, 9 }, { 62, 8 }, { 65, 8 }, { 71, 9 }, { 75, 9 }, + { 74, 8 }, { 73, 5 }, + }, + { /* AC highquant table group 0, table 2 */ + { 0, 4 }, { 1, 5 }, { 2, 12 }, { 3, 12 }, { 4, 12 }, + { 5, 12 }, { 6, 12 }, { 7, 12 }, { 8, 12 }, { 9, 12 }, + { 10, 12 }, { 11, 12 }, { 12, 11 }, { 13, 11 }, { 14, 11 }, + { 15, 11 }, { 16, 11 }, { 17, 11 }, { 18, 11 }, { 19, 11 }, + { 20, 11 }, { 21, 11 }, { 22, 11 }, { 28, 11 }, { 29, 11 }, + { 30, 11 }, { 31, 11 }, { 32, 11 }, { 33, 11 }, { 34, 11 }, + { 35, 11 }, { 36, 11 }, { 37, 11 }, { 38, 11 }, { 40, 11 }, + { 41, 11 }, { 42, 11 }, { 43, 11 }, { 44, 11 }, { 45, 11 }, + { 46, 11 }, { 47, 11 }, { 48, 11 }, { 49, 11 }, { 50, 11 }, + { 51, 11 }, { 52, 11 }, { 53, 11 }, { 54, 11 }, { 55, 11 }, + { 56, 11 }, { 57, 11 }, { 58, 11 }, { 59, 11 }, { 60, 11 }, + { 61, 11 }, { 62, 11 }, { 63, 11 }, { 64, 11 }, { 65, 11 }, + { 66, 11 }, { 67, 11 }, { 68, 11 }, { 69, 11 }, { 70, 11 }, + { 71, 11 }, { 72, 11 }, { 73, 11 }, { 74, 11 }, { 75, 11 }, + { 76, 11 }, { 25, 5 }, { 26, 5 }, { 27, 5 }, { 39, 5 }, + { 24, 2 }, { 23, 1 }, + }, + { /* AC highquant table group 0, table 3 */ + { 0, 8 }, { 1, 8 }, { 2, 8 }, { 3, 8 }, { 4, 8 }, + { 5, 8 }, { 6, 8 }, { 7, 8 }, { 8, 8 }, { 9, 8 }, + { 10, 8 }, { 11, 8 }, { 12, 8 }, { 13, 8 }, { 14, 8 }, + { 15, 8 }, { 16, 8 }, { 17, 8 }, { 18, 8 }, { 19, 8 }, + { 20, 8 }, { 21, 8 }, { 22, 8 }, { 24, 8 }, { 25, 7 }, + { 26, 7 }, { 27, 7 }, { 28, 7 }, { 29, 7 }, { 30, 7 }, + { 31, 7 }, { 32, 7 }, { 33, 7 }, { 34, 7 }, { 35, 7 }, + { 36, 7 }, { 37, 7 }, { 38, 7 }, { 39, 7 }, { 40, 7 }, + { 41, 7 }, { 42, 7 }, { 43, 7 }, { 44, 7 }, { 45, 7 }, + { 46, 7 }, { 47, 7 }, { 48, 7 }, { 49, 7 }, { 50, 7 }, + { 51, 7 }, { 52, 7 }, { 53, 7 }, { 54, 7 }, { 55, 7 }, + { 56, 7 }, { 57, 7 }, { 58, 7 }, { 59, 7 }, { 60, 7 }, + { 61, 7 }, { 62, 7 }, { 63, 7 }, { 64, 7 }, { 65, 7 }, + { 66, 7 }, { 67, 7 }, { 68, 7 }, { 69, 7 }, { 70, 7 }, + { 71, 7 }, { 72, 7 }, { 73, 7 }, { 74, 7 }, { 75, 7 }, + { 76, 7 }, { 23, 1 }, + }, + { /* AC highquant table group 0, table 4 */ + { 0, 9 }, { 1, 9 }, { 2, 9 }, { 3, 9 }, { 4, 9 }, + { 5, 9 }, { 6, 9 }, { 7, 9 }, { 8, 9 }, { 9, 9 }, + { 10, 9 }, { 11, 9 }, { 12, 9 }, { 13, 9 }, { 14, 9 }, + { 15, 9 }, { 16, 9 }, { 17, 9 }, { 18, 9 }, { 19, 9 }, + { 20, 9 }, { 21, 9 }, { 22, 8 }, { 25, 8 }, { 26, 8 }, + { 27, 8 }, { 28, 8 }, { 29, 8 }, { 30, 8 }, { 31, 8 }, + { 32, 8 }, { 33, 8 }, { 34, 8 }, { 35, 8 }, { 36, 8 }, + { 37, 8 }, { 38, 8 }, { 39, 8 }, { 40, 8 }, { 41, 8 }, + { 42, 8 }, { 43, 8 }, { 44, 8 }, { 45, 8 }, { 46, 8 }, + { 47, 8 }, { 48, 8 }, { 49, 8 }, { 50, 8 }, { 51, 8 }, + { 52, 8 }, { 53, 8 }, { 54, 8 }, { 55, 8 }, { 56, 8 }, + { 57, 8 }, { 58, 8 }, { 59, 8 }, { 60, 8 }, { 61, 8 }, + { 62, 8 }, { 63, 8 }, { 64, 8 }, { 65, 8 }, { 66, 8 }, + { 67, 8 }, { 68, 8 }, { 69, 8 }, { 70, 8 }, { 71, 8 }, + { 72, 8 }, { 73, 8 }, { 74, 8 }, { 75, 8 }, { 76, 8 }, + { 23, 2 }, { 24, 1 }, + }, + { /* AC highquant table group 0, table 5 */ + { 0, 10 }, { 1, 10 }, { 2, 10 }, { 3, 10 }, { 4, 10 }, + { 5, 10 }, { 6, 10 }, { 7, 10 }, { 8, 10 }, { 9, 10 }, + { 10, 10 }, { 11, 10 }, { 12, 10 }, { 13, 10 }, { 14, 10 }, + { 15, 10 }, { 16, 10 }, { 17, 10 }, { 18, 10 }, { 19, 10 }, + { 20, 9 }, { 21, 9 }, { 22, 9 }, { 25, 9 }, { 26, 9 }, + { 28, 9 }, { 29, 9 }, { 30, 9 }, { 31, 9 }, { 32, 9 }, + { 33, 9 }, { 34, 9 }, { 35, 9 }, { 36, 9 }, { 37, 9 }, + { 38, 9 }, { 39, 9 }, { 40, 9 }, { 41, 9 }, { 42, 9 }, + { 43, 9 }, { 44, 9 }, { 45, 9 }, { 46, 9 }, { 47, 9 }, + { 48, 9 }, { 49, 9 }, { 50, 9 }, { 51, 9 }, { 52, 9 }, + { 53, 9 }, { 54, 9 }, { 55, 9 }, { 56, 9 }, { 57, 9 }, + { 58, 9 }, { 59, 9 }, { 60, 9 }, { 61, 9 }, { 62, 9 }, + { 63, 9 }, { 64, 9 }, { 65, 9 }, { 66, 9 }, { 67, 9 }, + { 68, 9 }, { 69, 9 }, { 70, 9 }, { 71, 9 }, { 72, 9 }, + { 73, 9 }, { 74, 9 }, { 75, 9 }, { 76, 9 }, { 24, 3 }, + { 27, 2 }, { 23, 1 }, + }, + { /* AC highquant table group 0, table 6 */ + { 0, 2 }, { 1, 4 }, { 2, 5 }, { 3, 5 }, { 4, 6 }, + { 5, 6 }, { 6, 7 }, { 7, 8 }, { 8, 8 }, { 9, 8 }, + { 10, 9 }, { 11, 9 }, { 12, 10 }, { 14, 10 }, { 13, 9 }, + { 15, 15 }, { 42, 15 }, { 46, 15 }, { 50, 15 }, { 51, 15 }, + { 55, 15 }, { 56, 14 }, { 59, 14 }, { 61, 14 }, { 62, 14 }, + { 63, 14 }, { 64, 14 }, { 68, 14 }, { 69, 14 }, { 70, 14 }, + { 71, 14 }, { 72, 14 }, { 75, 14 }, { 76, 14 }, { 43, 10 }, + { 37, 9 }, { 17, 5 }, { 18, 6 }, { 19, 6 }, { 16, 3 }, + { 20, 4 }, { 21, 7 }, { 24, 7 }, { 25, 7 }, { 26, 7 }, + { 22, 5 }, { 23, 5 }, { 27, 8 }, { 30, 8 }, { 28, 7 }, + { 29, 7 }, { 31, 8 }, { 32, 8 }, { 33, 8 }, { 34, 8 }, + { 35, 8 }, { 36, 8 }, { 38, 8 }, { 39, 8 }, { 40, 8 }, + { 41, 9 }, { 44, 10 }, { 45, 10 }, { 47, 10 }, { 54, 10 }, + { 49, 9 }, { 58, 8 }, { 60, 10 }, { 66, 10 }, { 67, 10 }, + { 74, 10 }, { 65, 8 }, { 48, 6 }, { 52, 4 }, { 53, 6 }, + { 57, 6 }, { 73, 5 }, + }, + { /* AC highquant table group 0, table 7 */ + { 0, 3 }, { 1, 4 }, { 2, 5 }, { 3, 5 }, { 4, 6 }, + { 5, 8 }, { 9, 13 }, { 12, 13 }, { 13, 13 }, { 14, 13 }, + { 42, 13 }, { 45, 13 }, { 46, 13 }, { 47, 13 }, { 50, 13 }, + { 51, 13 }, { 53, 13 }, { 54, 13 }, { 55, 13 }, { 56, 13 }, + { 58, 13 }, { 61, 13 }, { 62, 13 }, { 63, 13 }, { 64, 13 }, + { 66, 13 }, { 67, 13 }, { 68, 13 }, { 69, 13 }, { 70, 13 }, + { 72, 12 }, { 74, 12 }, { 75, 12 }, { 76, 12 }, { 6, 7 }, + { 7, 6 }, { 8, 7 }, { 10, 8 }, { 11, 8 }, { 15, 8 }, + { 31, 8 }, { 18, 7 }, { 19, 6 }, { 17, 5 }, { 16, 4 }, + { 20, 6 }, { 21, 7 }, { 36, 8 }, { 37, 8 }, { 22, 6 }, + { 27, 6 }, { 23, 3 }, { 24, 5 }, { 25, 5 }, { 26, 4 }, + { 28, 6 }, { 29, 6 }, { 30, 5 }, { 32, 6 }, { 33, 6 }, + { 34, 6 }, { 35, 6 }, { 38, 7 }, { 40, 7 }, { 41, 7 }, + { 43, 7 }, { 39, 5 }, { 44, 8 }, { 52, 8 }, { 48, 7 }, + { 49, 7 }, { 57, 8 }, { 60, 8 }, { 59, 7 }, { 65, 8 }, + { 71, 8 }, { 73, 6 }, + }, + }, + { + { /* AC highquant table group 1, table 0 */ + { 0, 3 }, { 1, 4 }, { 2, 5 }, { 3, 5 }, { 4, 5 }, + { 5, 5 }, { 6, 6 }, { 7, 7 }, { 9, 7 }, { 8, 6 }, + { 10, 8 }, { 13, 8 }, { 11, 7 }, { 12, 7 }, { 14, 8 }, + { 15, 9 }, { 41, 9 }, { 17, 6 }, { 18, 6 }, { 19, 7 }, + { 21, 8 }, { 42, 9 }, { 43, 9 }, { 16, 4 }, { 20, 5 }, + { 22, 6 }, { 26, 6 }, { 23, 4 }, { 24, 4 }, { 25, 5 }, + { 27, 6 }, { 28, 6 }, { 29, 6 }, { 30, 7 }, { 31, 7 }, + { 32, 7 }, { 33, 7 }, { 34, 7 }, { 35, 7 }, { 36, 7 }, + { 37, 7 }, { 38, 7 }, { 39, 7 }, { 40, 7 }, { 44, 11 }, + { 54, 14 }, { 55, 14 }, { 56, 14 }, { 64, 14 }, { 69, 14 }, + { 70, 14 }, { 72, 14 }, { 76, 14 }, { 53, 10 }, { 45, 9 }, + { 47, 8 }, { 46, 6 }, { 48, 5 }, { 49, 7 }, { 50, 9 }, + { 51, 9 }, { 58, 10 }, { 67, 10 }, { 61, 9 }, { 52, 7 }, + { 57, 7 }, { 59, 7 }, { 60, 8 }, { 62, 8 }, { 63, 7 }, + { 65, 7 }, { 66, 7 }, { 68, 10 }, { 71, 10 }, { 74, 9 }, + { 75, 8 }, { 73, 6 }, + }, + { /* AC highquant table group 1, table 1 */ + { 0, 2 }, { 1, 4 }, { 2, 5 }, { 3, 5 }, { 4, 6 }, + { 5, 7 }, { 6, 7 }, { 7, 7 }, { 8, 8 }, { 9, 9 }, + { 10, 9 }, { 11, 9 }, { 12, 9 }, { 13, 15 }, { 42, 15 }, + { 44, 15 }, { 45, 15 }, { 46, 15 }, { 47, 15 }, { 50, 15 }, + { 51, 15 }, { 56, 15 }, { 61, 15 }, { 62, 15 }, { 63, 15 }, + { 64, 15 }, { 66, 15 }, { 67, 14 }, { 15, 11 }, { 14, 10 }, + { 30, 9 }, { 19, 7 }, { 17, 5 }, { 18, 6 }, { 23, 6 }, + { 16, 3 }, { 20, 4 }, { 21, 5 }, { 24, 7 }, { 25, 7 }, + { 26, 8 }, { 27, 8 }, { 28, 7 }, { 22, 4 }, { 29, 8 }, + { 31, 8 }, { 32, 9 }, { 33, 9 }, { 34, 9 }, { 35, 9 }, + { 36, 10 }, { 37, 11 }, { 38, 11 }, { 39, 9 }, { 40, 9 }, + { 41, 11 }, { 55, 11 }, { 43, 10 }, { 49, 8 }, { 54, 8 }, + { 48, 6 }, { 53, 7 }, { 58, 8 }, { 59, 11 }, { 68, 14 }, + { 69, 14 }, { 70, 14 }, { 71, 14 }, { 72, 14 }, { 74, 14 }, + { 75, 14 }, { 76, 14 }, { 60, 10 }, { 65, 9 }, { 52, 4 }, + { 57, 5 }, { 73, 5 }, + }, + { /* AC highquant table group 1, table 2 */ + { 0, 3 }, { 1, 4 }, { 2, 4 }, { 3, 5 }, { 4, 6 }, + { 5, 7 }, { 7, 7 }, { 6, 6 }, { 8, 9 }, { 9, 9 }, + { 10, 8 }, { 11, 15 }, { 13, 15 }, { 14, 15 }, { 15, 15 }, + { 46, 15 }, { 47, 15 }, { 50, 15 }, { 51, 15 }, { 54, 14 }, + { 55, 14 }, { 56, 14 }, { 62, 14 }, { 63, 14 }, { 64, 14 }, + { 66, 14 }, { 67, 14 }, { 69, 14 }, { 70, 14 }, { 72, 14 }, + { 76, 14 }, { 34, 10 }, { 12, 9 }, { 31, 8 }, { 17, 5 }, + { 16, 3 }, { 18, 7 }, { 19, 7 }, { 21, 6 }, { 22, 5 }, + { 20, 4 }, { 23, 4 }, { 24, 4 }, { 25, 5 }, { 26, 6 }, + { 27, 6 }, { 28, 6 }, { 29, 6 }, { 30, 7 }, { 32, 7 }, + { 33, 8 }, { 35, 8 }, { 36, 9 }, { 37, 10 }, { 38, 10 }, + { 41, 9 }, { 42, 9 }, { 39, 6 }, { 40, 7 }, { 43, 8 }, + { 44, 10 }, { 60, 10 }, { 45, 9 }, { 48, 7 }, { 49, 9 }, + { 58, 9 }, { 53, 8 }, { 57, 6 }, { 52, 5 }, { 59, 9 }, + { 61, 10 }, { 68, 10 }, { 65, 8 }, { 71, 9 }, { 75, 9 }, + { 74, 8 }, { 73, 6 }, + }, + { /* AC highquant table group 1, table 3 */ + { 0, 3 }, { 1, 4 }, { 2, 5 }, { 3, 5 }, { 4, 6 }, + { 5, 6 }, { 6, 7 }, { 7, 7 }, { 8, 6 }, { 9, 6 }, + { 10, 7 }, { 11, 7 }, { 12, 9 }, { 13, 9 }, { 15, 8 }, + { 14, 7 }, { 17, 6 }, { 16, 5 }, { 18, 9 }, { 42, 9 }, + { 32, 8 }, { 19, 7 }, { 20, 6 }, { 21, 7 }, { 22, 7 }, + { 27, 6 }, { 25, 5 }, { 23, 3 }, { 24, 3 }, { 26, 5 }, + { 28, 6 }, { 29, 6 }, { 30, 7 }, { 31, 7 }, { 33, 8 }, + { 34, 8 }, { 35, 8 }, { 41, 8 }, { 36, 7 }, { 38, 7 }, + { 37, 6 }, { 39, 7 }, { 43, 14 }, { 44, 14 }, { 45, 14 }, + { 50, 14 }, { 51, 14 }, { 53, 14 }, { 54, 13 }, { 55, 13 }, + { 56, 13 }, { 58, 13 }, { 64, 13 }, { 67, 13 }, { 68, 13 }, + { 69, 13 }, { 70, 13 }, { 71, 13 }, { 72, 13 }, { 74, 13 }, + { 76, 13 }, { 47, 9 }, { 49, 8 }, { 40, 6 }, { 46, 7 }, + { 48, 7 }, { 52, 8 }, { 57, 8 }, { 60, 7 }, { 59, 6 }, + { 61, 9 }, { 75, 9 }, { 73, 8 }, { 63, 7 }, { 62, 6 }, + { 65, 7 }, { 66, 7 }, + }, + { /* AC highquant table group 1, table 4 */ + { 0, 2 }, { 1, 4 }, { 2, 5 }, { 3, 5 }, { 4, 6 }, + { 5, 6 }, { 6, 7 }, { 7, 7 }, { 8, 7 }, { 9, 8 }, + { 10, 9 }, { 11, 9 }, { 12, 10 }, { 13, 10 }, { 14, 10 }, + { 15, 15 }, { 50, 15 }, { 51, 15 }, { 54, 15 }, { 55, 15 }, + { 56, 15 }, { 61, 15 }, { 64, 15 }, { 45, 12 }, { 47, 12 }, + { 58, 12 }, { 32, 8 }, { 19, 7 }, { 18, 6 }, { 17, 5 }, + { 16, 3 }, { 20, 4 }, { 21, 6 }, { 22, 6 }, { 24, 5 }, + { 23, 4 }, { 25, 6 }, { 26, 6 }, { 27, 6 }, { 28, 7 }, + { 29, 7 }, { 30, 7 }, { 31, 7 }, { 33, 8 }, { 34, 8 }, + { 35, 8 }, { 36, 8 }, { 37, 8 }, { 38, 10 }, { 43, 10 }, + { 41, 9 }, { 39, 7 }, { 40, 8 }, { 42, 9 }, { 44, 10 }, + { 46, 10 }, { 49, 8 }, { 53, 9 }, { 59, 10 }, { 60, 10 }, + { 48, 6 }, { 52, 6 }, { 57, 7 }, { 62, 12 }, { 67, 15 }, + { 69, 15 }, { 70, 15 }, { 71, 15 }, { 72, 14 }, { 76, 14 }, + { 63, 11 }, { 68, 12 }, { 74, 12 }, { 75, 11 }, { 66, 9 }, + { 65, 8 }, { 73, 6 }, + }, + { /* AC highquant table group 1, table 5 */ + { 0, 3 }, { 1, 4 }, { 2, 4 }, { 3, 5 }, { 4, 5 }, + { 5, 6 }, { 6, 7 }, { 7, 8 }, { 8, 11 }, { 10, 11 }, + { 11, 10 }, { 9, 9 }, { 12, 11 }, { 13, 15 }, { 14, 15 }, + { 15, 15 }, { 47, 15 }, { 49, 15 }, { 50, 15 }, { 51, 15 }, + { 54, 15 }, { 55, 14 }, { 56, 14 }, { 58, 14 }, { 63, 14 }, + { 38, 11 }, { 53, 11 }, { 37, 9 }, { 32, 8 }, { 19, 7 }, + { 18, 6 }, { 16, 4 }, { 17, 5 }, { 20, 5 }, { 21, 7 }, + { 31, 7 }, { 22, 6 }, { 25, 5 }, { 24, 4 }, { 23, 3 }, + { 26, 5 }, { 27, 5 }, { 28, 5 }, { 29, 6 }, { 30, 6 }, + { 33, 8 }, { 34, 8 }, { 35, 7 }, { 36, 8 }, { 41, 8 }, + { 40, 7 }, { 39, 5 }, { 42, 8 }, { 44, 10 }, { 60, 10 }, + { 45, 9 }, { 43, 7 }, { 46, 9 }, { 59, 9 }, { 61, 10 }, + { 64, 14 }, { 67, 14 }, { 68, 14 }, { 69, 14 }, { 70, 14 }, + { 72, 14 }, { 75, 14 }, { 76, 14 }, { 66, 11 }, { 62, 9 }, + { 48, 7 }, { 52, 7 }, { 57, 7 }, { 65, 8 }, { 71, 9 }, + { 74, 9 }, { 73, 7 }, + }, + { /* AC highquant table group 1, table 6 */ + { 0, 3 }, { 1, 4 }, { 2, 4 }, { 3, 5 }, { 4, 5 }, + { 5, 5 }, { 6, 5 }, { 7, 6 }, { 8, 7 }, { 10, 7 }, + { 9, 5 }, { 11, 13 }, { 13, 13 }, { 15, 13 }, { 29, 13 }, + { 32, 13 }, { 33, 13 }, { 34, 12 }, { 37, 12 }, { 38, 12 }, + { 40, 12 }, { 41, 12 }, { 42, 12 }, { 43, 12 }, { 44, 12 }, + { 45, 12 }, { 50, 12 }, { 53, 12 }, { 54, 12 }, { 55, 12 }, + { 56, 12 }, { 58, 12 }, { 60, 12 }, { 61, 12 }, { 62, 12 }, + { 63, 12 }, { 64, 12 }, { 66, 12 }, { 67, 12 }, { 68, 12 }, + { 69, 12 }, { 70, 12 }, { 71, 12 }, { 72, 12 }, { 74, 12 }, + { 76, 12 }, { 12, 7 }, { 14, 7 }, { 18, 7 }, { 17, 6 }, + { 19, 7 }, { 21, 7 }, { 16, 4 }, { 20, 5 }, { 22, 5 }, + { 23, 6 }, { 24, 6 }, { 25, 7 }, { 27, 7 }, { 26, 6 }, + { 28, 7 }, { 30, 7 }, { 31, 7 }, { 35, 7 }, { 36, 7 }, + { 39, 7 }, { 47, 6 }, { 46, 5 }, { 49, 5 }, { 48, 4 }, + { 51, 7 }, { 75, 7 }, { 57, 6 }, { 52, 5 }, { 59, 6 }, + { 65, 6 }, { 73, 5 }, + }, + { /* AC highquant table group 1, table 7 */ + { 0, 3 }, { 1, 4 }, { 2, 5 }, { 3, 6 }, { 4, 6 }, + { 5, 8 }, { 6, 8 }, { 7, 8 }, { 8, 11 }, { 9, 15 }, + { 10, 15 }, { 11, 15 }, { 12, 15 }, { 13, 15 }, { 14, 15 }, + { 15, 15 }, { 38, 15 }, { 46, 15 }, { 47, 15 }, { 50, 15 }, + { 51, 15 }, { 53, 15 }, { 54, 15 }, { 55, 15 }, { 56, 15 }, + { 37, 11 }, { 58, 15 }, { 61, 15 }, { 62, 15 }, { 63, 15 }, + { 64, 15 }, { 66, 15 }, { 67, 15 }, { 68, 15 }, { 69, 15 }, + { 70, 15 }, { 72, 14 }, { 75, 14 }, { 76, 14 }, { 19, 9 }, + { 17, 6 }, { 18, 7 }, { 21, 8 }, { 22, 8 }, { 28, 6 }, + { 16, 4 }, { 20, 5 }, { 25, 5 }, { 26, 5 }, { 27, 5 }, + { 23, 2 }, { 24, 3 }, { 29, 6 }, { 30, 8 }, { 31, 8 }, + { 32, 9 }, { 36, 9 }, { 33, 8 }, { 34, 7 }, { 35, 8 }, + { 41, 8 }, { 40, 7 }, { 42, 9 }, { 44, 9 }, { 43, 8 }, + { 39, 5 }, { 45, 9 }, { 49, 10 }, { 71, 10 }, { 48, 8 }, + { 52, 8 }, { 57, 9 }, { 60, 9 }, { 59, 8 }, { 65, 9 }, + { 74, 9 }, { 73, 7 }, + }, + }, + }, + { + { + { /* AC lowquant table group 0, table 0 */ + { 0, 2 }, { 1, 3 }, { 2, 4 }, { 3, 5 }, { 4, 6 }, + { 5, 7 }, { 6, 7 }, { 7, 7 }, { 8, 9 }, { 12, 10 }, + { 13, 10 }, { 9, 8 }, { 10, 8 }, { 11, 8 }, { 14, 10 }, + { 15, 10 }, { 18, 9 }, { 19, 10 }, { 41, 10 }, { 40, 9 }, + { 17, 7 }, { 21, 7 }, { 20, 6 }, { 16, 4 }, { 22, 7 }, + { 32, 7 }, { 28, 6 }, { 25, 5 }, { 23, 4 }, { 24, 4 }, + { 26, 5 }, { 27, 5 }, { 29, 6 }, { 30, 6 }, { 31, 6 }, + { 33, 7 }, { 34, 7 }, { 35, 7 }, { 36, 7 }, { 37, 7 }, + { 38, 7 }, { 39, 8 }, { 42, 14 }, { 43, 14 }, { 44, 14 }, + { 45, 14 }, { 47, 14 }, { 49, 14 }, { 50, 14 }, { 51, 14 }, + { 53, 14 }, { 54, 14 }, { 55, 14 }, { 56, 14 }, { 58, 14 }, + { 63, 14 }, { 64, 14 }, { 65, 14 }, { 46, 10 }, { 48, 9 }, + { 52, 8 }, { 57, 10 }, { 66, 14 }, { 67, 14 }, { 68, 14 }, + { 69, 14 }, { 70, 14 }, { 71, 14 }, { 72, 13 }, { 73, 13 }, + { 74, 13 }, { 75, 13 }, { 76, 13 }, { 62, 9 }, { 59, 7 }, + { 60, 8 }, { 61, 8 }, + }, + { /* AC lowquant table group 0, table 1 */ + { 0, 3 }, { 1, 5 }, { 2, 7 }, { 5, 8 }, { 6, 8 }, + { 3, 6 }, { 4, 6 }, { 7, 8 }, { 8, 14 }, { 9, 14 }, + { 11, 14 }, { 12, 14 }, { 13, 14 }, { 14, 14 }, { 15, 14 }, + { 18, 14 }, { 20, 14 }, { 21, 14 }, { 22, 14 }, { 41, 14 }, + { 45, 14 }, { 46, 14 }, { 47, 14 }, { 49, 14 }, { 50, 14 }, + { 51, 14 }, { 52, 13 }, { 53, 13 }, { 54, 13 }, { 55, 13 }, + { 56, 13 }, { 57, 13 }, { 58, 13 }, { 60, 13 }, { 61, 13 }, + { 62, 13 }, { 63, 13 }, { 64, 13 }, { 66, 13 }, { 67, 13 }, + { 68, 13 }, { 69, 13 }, { 70, 13 }, { 71, 13 }, { 72, 13 }, + { 73, 13 }, { 74, 13 }, { 75, 13 }, { 76, 13 }, { 10, 7 }, + { 16, 6 }, { 17, 8 }, { 19, 8 }, { 30, 7 }, { 23, 2 }, + { 24, 3 }, { 25, 5 }, { 29, 6 }, { 31, 7 }, { 32, 7 }, + { 26, 4 }, { 27, 4 }, { 28, 4 }, { 33, 7 }, { 34, 8 }, + { 40, 8 }, { 35, 7 }, { 42, 8 }, { 43, 8 }, { 36, 6 }, + { 37, 6 }, { 38, 6 }, { 39, 6 }, { 44, 8 }, { 48, 8 }, + { 65, 7 }, { 59, 6 }, + }, + { /* AC lowquant table group 0, table 2 */ + { 0, 2 }, { 1, 3 }, { 2, 3 }, { 3, 4 }, { 4, 5 }, + { 5, 5 }, { 6, 6 }, { 7, 6 }, { 8, 7 }, { 9, 7 }, + { 10, 7 }, { 11, 8 }, { 12, 8 }, { 13, 8 }, { 14, 9 }, + { 15, 10 }, { 39, 16 }, { 40, 16 }, { 41, 15 }, { 43, 15 }, + { 44, 15 }, { 45, 15 }, { 50, 15 }, { 51, 15 }, { 53, 15 }, + { 42, 12 }, { 49, 12 }, { 54, 15 }, { 55, 15 }, { 56, 15 }, + { 58, 15 }, { 64, 15 }, { 65, 15 }, { 66, 15 }, { 67, 15 }, + { 18, 8 }, { 19, 9 }, { 21, 9 }, { 17, 6 }, { 20, 6 }, + { 22, 8 }, { 38, 8 }, { 27, 7 }, { 16, 4 }, { 23, 5 }, + { 24, 6 }, { 25, 6 }, { 26, 6 }, { 28, 7 }, { 29, 7 }, + { 30, 7 }, { 31, 7 }, { 32, 7 }, { 33, 7 }, { 34, 7 }, + { 35, 7 }, { 36, 7 }, { 37, 7 }, { 46, 8 }, { 47, 10 }, + { 62, 11 }, { 63, 12 }, { 68, 15 }, { 69, 15 }, { 70, 15 }, + { 71, 15 }, { 72, 15 }, { 74, 15 }, { 75, 15 }, { 76, 15 }, + { 48, 9 }, { 52, 8 }, { 57, 9 }, { 73, 9 }, { 59, 7 }, + { 60, 8 }, { 61, 8 }, + }, + { /* AC lowquant table group 0, table 3 */ + { 0, 2 }, { 1, 3 }, { 2, 4 }, { 3, 5 }, { 4, 5 }, + { 5, 6 }, { 6, 6 }, { 7, 7 }, { 8, 7 }, { 9, 8 }, + { 10, 8 }, { 11, 9 }, { 12, 9 }, { 13, 9 }, { 14, 10 }, + { 15, 10 }, { 17, 5 }, { 18, 7 }, { 19, 7 }, { 21, 7 }, + { 24, 7 }, { 16, 3 }, { 20, 4 }, { 22, 5 }, { 23, 6 }, + { 25, 7 }, { 26, 7 }, { 27, 8 }, { 28, 8 }, { 29, 8 }, + { 30, 8 }, { 31, 8 }, { 32, 8 }, { 33, 9 }, { 37, 9 }, + { 34, 8 }, { 35, 8 }, { 36, 8 }, { 38, 11 }, { 40, 11 }, + { 39, 10 }, { 41, 15 }, { 43, 15 }, { 44, 15 }, { 45, 15 }, + { 50, 15 }, { 51, 15 }, { 64, 15 }, { 66, 15 }, { 49, 12 }, + { 47, 11 }, { 42, 10 }, { 46, 9 }, { 55, 10 }, { 56, 11 }, + { 63, 12 }, { 67, 15 }, { 68, 15 }, { 69, 15 }, { 70, 15 }, + { 71, 15 }, { 72, 15 }, { 74, 14 }, { 48, 7 }, { 53, 7 }, + { 52, 5 }, { 54, 8 }, { 58, 10 }, { 61, 10 }, { 62, 10 }, + { 65, 11 }, { 75, 12 }, { 76, 12 }, { 57, 7 }, { 59, 8 }, + { 60, 8 }, { 73, 7 }, + }, + { /* AC lowquant table group 0, table 4 */ + { 0, 3 }, { 1, 4 }, { 2, 4 }, { 3, 5 }, { 4, 6 }, + { 5, 6 }, { 6, 6 }, { 7, 7 }, { 9, 7 }, { 8, 6 }, + { 10, 8 }, { 11, 8 }, { 12, 8 }, { 13, 9 }, { 14, 9 }, + { 15, 8 }, { 37, 8 }, { 31, 7 }, { 18, 6 }, { 17, 5 }, + { 16, 4 }, { 19, 6 }, { 21, 6 }, { 22, 5 }, { 20, 4 }, + { 23, 5 }, { 24, 6 }, { 25, 6 }, { 26, 6 }, { 27, 6 }, + { 28, 6 }, { 29, 6 }, { 30, 6 }, { 32, 7 }, { 33, 7 }, + { 34, 7 }, { 35, 7 }, { 36, 7 }, { 38, 11 }, { 50, 15 }, + { 51, 15 }, { 55, 15 }, { 56, 15 }, { 64, 15 }, { 69, 15 }, + { 70, 14 }, { 71, 14 }, { 72, 14 }, { 75, 14 }, { 76, 14 }, + { 45, 10 }, { 42, 9 }, { 41, 8 }, { 39, 7 }, { 40, 7 }, + { 43, 9 }, { 44, 9 }, { 46, 9 }, { 47, 10 }, { 58, 10 }, + { 49, 8 }, { 54, 9 }, { 62, 10 }, { 66, 10 }, { 48, 6 }, + { 53, 7 }, { 59, 7 }, { 52, 4 }, { 57, 6 }, { 60, 8 }, + { 61, 8 }, { 63, 9 }, { 65, 9 }, { 67, 10 }, { 68, 10 }, + { 74, 9 }, { 73, 5 }, + }, + { /* AC lowquant table group 0, table 5 */ + { 0, 2 }, { 1, 4 }, { 2, 5 }, { 3, 5 }, { 4, 6 }, + { 5, 6 }, { 6, 7 }, { 7, 8 }, { 8, 8 }, { 9, 8 }, + { 10, 9 }, { 11, 11 }, { 14, 11 }, { 13, 10 }, { 12, 8 }, + { 15, 15 }, { 42, 15 }, { 50, 15 }, { 51, 15 }, { 62, 15 }, + { 64, 15 }, { 67, 15 }, { 68, 15 }, { 69, 14 }, { 70, 14 }, + { 71, 14 }, { 72, 14 }, { 38, 11 }, { 40, 10 }, { 33, 9 }, + { 17, 5 }, { 18, 6 }, { 19, 7 }, { 24, 7 }, { 16, 3 }, + { 20, 4 }, { 21, 6 }, { 23, 6 }, { 22, 5 }, { 25, 8 }, + { 27, 8 }, { 26, 7 }, { 28, 7 }, { 29, 8 }, { 31, 8 }, + { 30, 7 }, { 32, 8 }, { 34, 9 }, { 35, 9 }, { 36, 9 }, + { 37, 9 }, { 39, 9 }, { 41, 11 }, { 44, 11 }, { 43, 10 }, + { 45, 11 }, { 47, 11 }, { 46, 10 }, { 56, 9 }, { 49, 8 }, + { 48, 6 }, { 54, 7 }, { 55, 7 }, { 53, 5 }, { 52, 4 }, + { 57, 6 }, { 58, 8 }, { 59, 8 }, { 60, 10 }, { 61, 11 }, + { 75, 11 }, { 63, 10 }, { 65, 10 }, { 66, 10 }, { 74, 10 }, + { 76, 9 }, { 73, 5 }, + }, + { /* AC lowquant table group 0, table 6 */ + { 0, 2 }, { 1, 4 }, { 2, 5 }, { 3, 6 }, { 4, 6 }, + { 5, 8 }, { 6, 9 }, { 7, 10 }, { 8, 10 }, { 9, 9 }, + { 10, 15 }, { 11, 15 }, { 13, 15 }, { 15, 15 }, { 37, 15 }, + { 46, 15 }, { 47, 15 }, { 49, 15 }, { 50, 15 }, { 51, 15 }, + { 53, 15 }, { 54, 15 }, { 55, 15 }, { 56, 15 }, { 58, 15 }, + { 60, 15 }, { 61, 15 }, { 62, 15 }, { 63, 15 }, { 64, 15 }, + { 67, 15 }, { 68, 15 }, { 69, 15 }, { 70, 15 }, { 71, 15 }, + { 72, 15 }, { 74, 14 }, { 75, 14 }, { 76, 14 }, { 12, 10 }, + { 14, 10 }, { 36, 10 }, { 21, 9 }, { 18, 8 }, { 19, 8 }, + { 22, 8 }, { 32, 8 }, { 17, 5 }, { 16, 4 }, { 20, 5 }, + { 26, 5 }, { 25, 4 }, { 23, 3 }, { 24, 3 }, { 27, 6 }, + { 28, 6 }, { 29, 7 }, { 30, 7 }, { 31, 7 }, { 33, 8 }, + { 34, 9 }, { 38, 9 }, { 35, 8 }, { 41, 9 }, { 42, 10 }, + { 45, 10 }, { 43, 8 }, { 44, 8 }, { 39, 6 }, { 40, 6 }, + { 48, 9 }, { 57, 9 }, { 52, 8 }, { 59, 9 }, { 65, 10 }, + { 66, 10 }, { 73, 8 }, + }, + { /* AC lowquant table group 0, table 7 */ + { 0, 4 }, { 1, 11 }, { 2, 11 }, { 3, 11 }, { 4, 11 }, + { 5, 11 }, { 6, 11 }, { 7, 11 }, { 8, 11 }, { 9, 11 }, + { 10, 11 }, { 11, 11 }, { 12, 11 }, { 13, 11 }, { 14, 11 }, + { 15, 11 }, { 16, 11 }, { 17, 10 }, { 18, 10 }, { 19, 10 }, + { 20, 10 }, { 21, 10 }, { 22, 10 }, { 25, 10 }, { 28, 10 }, + { 29, 10 }, { 30, 10 }, { 31, 10 }, { 32, 10 }, { 33, 10 }, + { 34, 10 }, { 35, 10 }, { 36, 10 }, { 37, 10 }, { 38, 10 }, + { 39, 10 }, { 40, 10 }, { 41, 10 }, { 42, 10 }, { 43, 10 }, + { 44, 10 }, { 45, 10 }, { 46, 10 }, { 47, 10 }, { 48, 10 }, + { 49, 10 }, { 50, 10 }, { 51, 10 }, { 52, 10 }, { 53, 10 }, + { 54, 10 }, { 55, 10 }, { 56, 10 }, { 57, 10 }, { 58, 10 }, + { 59, 10 }, { 60, 10 }, { 61, 10 }, { 62, 10 }, { 63, 10 }, + { 64, 10 }, { 65, 10 }, { 66, 10 }, { 67, 10 }, { 68, 10 }, + { 69, 10 }, { 70, 10 }, { 71, 10 }, { 72, 10 }, { 73, 10 }, + { 74, 10 }, { 75, 10 }, { 76, 10 }, { 26, 4 }, { 27, 4 }, + { 24, 2 }, { 23, 1 }, + }, + }, + { + { /* AC lowquant table group 1, table 0 */ + { 0, 3 }, { 1, 4 }, { 2, 4 }, { 3, 5 }, { 4, 6 }, + { 5, 7 }, { 7, 8 }, { 8, 8 }, { 6, 6 }, { 9, 9 }, + { 10, 10 }, { 14, 15 }, { 47, 15 }, { 49, 14 }, { 50, 14 }, + { 51, 14 }, { 54, 14 }, { 55, 14 }, { 56, 14 }, { 58, 14 }, + { 15, 11 }, { 11, 9 }, { 12, 9 }, { 13, 9 }, { 37, 9 }, + { 32, 8 }, { 17, 5 }, { 16, 4 }, { 18, 6 }, { 19, 7 }, + { 21, 7 }, { 20, 5 }, { 22, 5 }, { 25, 5 }, { 24, 4 }, + { 23, 3 }, { 26, 5 }, { 27, 5 }, { 28, 5 }, { 29, 6 }, + { 30, 6 }, { 31, 7 }, { 33, 8 }, { 34, 8 }, { 35, 8 }, + { 36, 8 }, { 38, 10 }, { 44, 11 }, { 46, 11 }, { 45, 10 }, + { 53, 10 }, { 41, 8 }, { 39, 6 }, { 40, 7 }, { 42, 8 }, + { 43, 8 }, { 48, 7 }, { 57, 7 }, { 52, 6 }, { 59, 8 }, + { 60, 9 }, { 61, 11 }, { 63, 11 }, { 62, 10 }, { 64, 14 }, + { 67, 14 }, { 68, 14 }, { 69, 14 }, { 70, 14 }, { 71, 14 }, + { 72, 14 }, { 76, 14 }, { 75, 11 }, { 66, 10 }, { 74, 9 }, + { 65, 8 }, { 73, 6 }, + }, + { /* AC lowquant table group 1, table 1 */ + { 0, 2 }, { 1, 3 }, { 2, 4 }, { 3, 5 }, { 4, 6 }, + { 5, 6 }, { 6, 7 }, { 7, 8 }, { 8, 8 }, { 9, 8 }, + { 10, 9 }, { 11, 9 }, { 12, 11 }, { 13, 11 }, { 14, 11 }, + { 15, 11 }, { 24, 9 }, { 23, 8 }, { 17, 5 }, { 18, 6 }, + { 19, 7 }, { 25, 10 }, { 27, 10 }, { 26, 9 }, { 28, 10 }, + { 29, 12 }, { 35, 12 }, { 34, 11 }, { 30, 10 }, { 31, 10 }, + { 21, 6 }, { 32, 10 }, { 33, 10 }, { 36, 10 }, { 37, 12 }, + { 38, 12 }, { 39, 15 }, { 40, 15 }, { 41, 15 }, { 42, 15 }, + { 43, 14 }, { 44, 14 }, { 45, 14 }, { 51, 14 }, { 61, 14 }, + { 64, 14 }, { 46, 11 }, { 47, 11 }, { 49, 10 }, { 50, 12 }, + { 63, 12 }, { 59, 11 }, { 56, 10 }, { 48, 8 }, { 55, 8 }, + { 16, 3 }, { 20, 4 }, { 22, 4 }, { 52, 4 }, { 53, 6 }, + { 54, 7 }, { 58, 8 }, { 60, 10 }, { 62, 11 }, { 65, 14 }, + { 66, 14 }, { 67, 14 }, { 68, 14 }, { 69, 14 }, { 70, 14 }, + { 71, 14 }, { 72, 14 }, { 74, 11 }, { 75, 11 }, { 76, 10 }, + { 57, 6 }, { 73, 6 }, + }, + { /* AC lowquant table group 1, table 2 */ + { 0, 3 }, { 1, 4 }, { 2, 5 }, { 3, 6 }, { 4, 7 }, + { 5, 8 }, { 6, 8 }, { 7, 8 }, { 8, 10 }, { 10, 10 }, + { 9, 9 }, { 11, 10 }, { 12, 16 }, { 15, 16 }, { 38, 16 }, + { 44, 16 }, { 46, 15 }, { 47, 15 }, { 50, 15 }, { 51, 15 }, + { 59, 15 }, { 60, 15 }, { 61, 15 }, { 62, 15 }, { 64, 15 }, + { 68, 15 }, { 69, 15 }, { 70, 15 }, { 71, 15 }, { 72, 15 }, + { 37, 11 }, { 13, 10 }, { 14, 10 }, { 19, 8 }, { 18, 6 }, + { 17, 5 }, { 21, 5 }, { 23, 7 }, { 24, 9 }, { 25, 9 }, + { 26, 9 }, { 27, 9 }, { 28, 9 }, { 29, 10 }, { 30, 10 }, + { 31, 10 }, { 32, 10 }, { 33, 10 }, { 34, 10 }, { 35, 9 }, + { 36, 10 }, { 39, 10 }, { 40, 11 }, { 42, 11 }, { 41, 10 }, + { 43, 10 }, { 45, 11 }, { 63, 11 }, { 16, 3 }, { 20, 3 }, + { 22, 4 }, { 48, 7 }, { 49, 9 }, { 65, 11 }, { 66, 11 }, + { 67, 11 }, { 74, 11 }, { 56, 8 }, { 54, 6 }, { 55, 6 }, + { 58, 7 }, { 75, 8 }, { 76, 8 }, { 52, 3 }, { 53, 4 }, + { 57, 5 }, { 73, 5 }, + }, + { /* AC lowquant table group 1, table 3 */ + { 0, 2 }, { 1, 3 }, { 2, 4 }, { 3, 4 }, { 4, 5 }, + { 5, 5 }, { 6, 6 }, { 7, 6 }, { 8, 6 }, { 9, 6 }, + { 10, 7 }, { 11, 7 }, { 12, 8 }, { 13, 8 }, { 14, 8 }, + { 15, 9 }, { 19, 9 }, { 17, 6 }, { 18, 7 }, { 21, 8 }, + { 36, 8 }, { 16, 4 }, { 20, 6 }, { 22, 7 }, { 28, 7 }, + { 23, 6 }, { 24, 6 }, { 25, 6 }, { 26, 6 }, { 27, 6 }, + { 29, 7 }, { 30, 7 }, { 31, 7 }, { 32, 7 }, { 33, 7 }, + { 34, 7 }, { 35, 7 }, { 37, 8 }, { 38, 9 }, { 39, 11 }, + { 41, 15 }, { 42, 15 }, { 43, 15 }, { 44, 15 }, { 45, 15 }, + { 51, 15 }, { 54, 15 }, { 55, 15 }, { 49, 12 }, { 40, 10 }, + { 46, 7 }, { 47, 8 }, { 48, 8 }, { 50, 9 }, { 53, 9 }, + { 56, 15 }, { 67, 15 }, { 68, 15 }, { 69, 15 }, { 70, 14 }, + { 71, 14 }, { 72, 14 }, { 74, 14 }, { 75, 14 }, { 76, 14 }, + { 58, 11 }, { 65, 11 }, { 66, 11 }, { 64, 9 }, { 52, 7 }, + { 57, 8 }, { 61, 8 }, { 60, 7 }, { 59, 6 }, { 62, 8 }, + { 73, 8 }, { 63, 7 }, + }, + { /* AC lowquant table group 1, table 4 */ + { 0, 2 }, { 1, 4 }, { 2, 5 }, { 3, 6 }, { 4, 6 }, + { 5, 7 }, { 6, 7 }, { 7, 8 }, { 8, 8 }, { 9, 8 }, + { 10, 9 }, { 11, 9 }, { 12, 10 }, { 13, 10 }, { 14, 14 }, + { 69, 14 }, { 70, 14 }, { 72, 14 }, { 15, 12 }, { 44, 11 }, + { 37, 10 }, { 29, 8 }, { 19, 7 }, { 18, 6 }, { 17, 5 }, + { 21, 6 }, { 24, 6 }, { 16, 3 }, { 20, 4 }, { 22, 5 }, + { 23, 5 }, { 25, 6 }, { 26, 6 }, { 27, 7 }, { 28, 7 }, + { 30, 7 }, { 31, 8 }, { 32, 8 }, { 33, 8 }, { 34, 8 }, + { 35, 8 }, { 36, 9 }, { 38, 10 }, { 43, 10 }, { 39, 7 }, + { 40, 8 }, { 41, 9 }, { 42, 9 }, { 45, 9 }, { 46, 9 }, + { 47, 10 }, { 50, 12 }, { 51, 12 }, { 62, 11 }, { 56, 9 }, + { 48, 7 }, { 49, 8 }, { 54, 8 }, { 55, 8 }, { 58, 8 }, + { 52, 4 }, { 53, 6 }, { 57, 6 }, { 59, 9 }, { 60, 10 }, + { 61, 10 }, { 63, 10 }, { 64, 11 }, { 67, 11 }, { 65, 9 }, + { 66, 9 }, { 68, 11 }, { 71, 11 }, { 76, 10 }, { 74, 9 }, + { 75, 9 }, { 73, 6 }, + }, + { /* AC lowquant table group 1, table 5 */ + { 0, 2 }, { 1, 3 }, { 2, 4 }, { 3, 5 }, { 4, 5 }, + { 5, 6 }, { 6, 6 }, { 7, 7 }, { 8, 7 }, { 9, 7 }, + { 10, 8 }, { 11, 8 }, { 12, 8 }, { 13, 9 }, { 14, 10 }, + { 39, 11 }, { 40, 12 }, { 41, 12 }, { 15, 9 }, { 37, 9 }, + { 19, 8 }, { 18, 7 }, { 21, 7 }, { 17, 5 }, { 16, 3 }, + { 20, 5 }, { 22, 6 }, { 24, 6 }, { 23, 5 }, { 25, 7 }, + { 26, 7 }, { 27, 7 }, { 28, 8 }, { 29, 8 }, { 30, 7 }, + { 31, 8 }, { 32, 8 }, { 33, 8 }, { 34, 8 }, { 35, 8 }, + { 36, 8 }, { 38, 9 }, { 42, 15 }, { 44, 15 }, { 45, 15 }, + { 56, 15 }, { 43, 13 }, { 51, 13 }, { 66, 13 }, { 58, 11 }, + { 49, 10 }, { 46, 8 }, { 47, 9 }, { 50, 9 }, { 48, 8 }, + { 53, 7 }, { 54, 9 }, { 55, 9 }, { 59, 8 }, { 52, 5 }, + { 57, 7 }, { 60, 8 }, { 61, 8 }, { 62, 9 }, { 64, 11 }, + { 65, 12 }, { 67, 15 }, { 68, 15 }, { 69, 15 }, { 70, 15 }, + { 71, 15 }, { 72, 15 }, { 74, 14 }, { 75, 11 }, { 76, 11 }, + { 63, 8 }, { 73, 7 }, + }, + { /* AC lowquant table group 1, table 6 */ + { 0, 3 }, { 1, 4 }, { 2, 4 }, { 3, 5 }, { 4, 5 }, + { 5, 6 }, { 6, 6 }, { 7, 7 }, { 8, 8 }, { 9, 8 }, + { 10, 8 }, { 11, 9 }, { 12, 9 }, { 13, 9 }, { 14, 11 }, + { 15, 12 }, { 45, 12 }, { 38, 10 }, { 33, 8 }, { 16, 3 }, + { 17, 5 }, { 18, 6 }, { 19, 7 }, { 27, 7 }, { 20, 4 }, + { 21, 6 }, { 25, 6 }, { 22, 5 }, { 23, 4 }, { 24, 5 }, + { 26, 6 }, { 28, 7 }, { 29, 7 }, { 30, 7 }, { 31, 7 }, + { 32, 7 }, { 34, 8 }, { 35, 8 }, { 36, 9 }, { 41, 9 }, + { 37, 8 }, { 39, 7 }, { 40, 8 }, { 42, 11 }, { 47, 15 }, + { 50, 15 }, { 51, 15 }, { 56, 15 }, { 64, 15 }, { 67, 15 }, + { 68, 15 }, { 69, 15 }, { 70, 14 }, { 71, 14 }, { 72, 14 }, + { 76, 14 }, { 44, 10 }, { 43, 9 }, { 46, 9 }, { 54, 9 }, + { 55, 11 }, { 63, 11 }, { 61, 10 }, { 58, 9 }, { 48, 6 }, + { 49, 7 }, { 53, 7 }, { 52, 5 }, { 57, 6 }, { 59, 8 }, + { 60, 9 }, { 62, 10 }, { 74, 10 }, { 65, 8 }, { 66, 9 }, + { 75, 9 }, { 73, 5 }, + }, + { /* AC lowquant table group 1, table 7 */ + { 0, 2 }, { 1, 4 }, { 2, 5 }, { 3, 6 }, { 4, 7 }, + { 5, 7 }, { 6, 8 }, { 7, 8 }, { 8, 9 }, { 9, 9 }, + { 10, 9 }, { 11, 10 }, { 12, 15 }, { 13, 15 }, { 14, 15 }, + { 15, 15 }, { 32, 15 }, { 36, 15 }, { 38, 15 }, { 41, 15 }, + { 42, 15 }, { 45, 15 }, { 47, 15 }, { 50, 15 }, { 51, 15 }, + { 61, 15 }, { 62, 14 }, { 34, 11 }, { 18, 6 }, { 17, 5 }, + { 19, 7 }, { 23, 8 }, { 24, 8 }, { 21, 6 }, { 25, 9 }, + { 26, 10 }, { 28, 10 }, { 27, 9 }, { 29, 9 }, { 30, 10 }, + { 31, 10 }, { 33, 10 }, { 35, 11 }, { 40, 11 }, { 37, 10 }, + { 43, 11 }, { 44, 11 }, { 39, 9 }, { 46, 11 }, { 60, 11 }, + { 49, 10 }, { 56, 9 }, { 59, 9 }, { 63, 14 }, { 64, 14 }, + { 67, 14 }, { 68, 14 }, { 69, 14 }, { 70, 14 }, { 71, 14 }, + { 72, 14 }, { 74, 11 }, { 76, 10 }, { 48, 7 }, { 16, 3 }, + { 20, 4 }, { 22, 4 }, { 52, 3 }, { 53, 5 }, { 54, 7 }, + { 55, 7 }, { 58, 7 }, { 65, 9 }, { 66, 9 }, { 75, 8 }, + { 57, 5 }, { 73, 5 }, + }, + }, }, }; #define MAX_AC_VLC_BITS 16 From patchwork Fri Nov 20 07:32: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: 23879 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 73854449298 for ; Fri, 20 Nov 2020 09:49:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3A07668BD1F; Fri, 20 Nov 2020 09:34:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0520968BD04 for ; Fri, 20 Nov 2020 09:34:34 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id f20so11519342ejz.4 for ; Thu, 19 Nov 2020 23:34:34 -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=aY8omiRdr4hZ40WZs+m5ZhHstJNAyYnKgoizHqNNEbM=; b=qpUfmlCPPdasfCyiuqRq+PV1MtcmUpUi9Dy6rzZAbhnZLU5z0RVeS4BOOyaHmxhmHm cPV8ez8tIxkJJeQM+6tgpctzo6q2ZOA4lNkiRp/SRu9qw7H6gL70/sMmU1oEgDvzMTAk EygOF/1wSl6kZFAyW0z/2mf576usg/PwjmEMKT1+3yPdeaO7qJ/XCAyRDEeqBwSRaXkj PrER4wZX9EWL7tn0lA7FXJP5LaAAqB9umNw2+VKkhUvJnu7OjKVwWADwW1JtVsBchKCg +A2Wy7PP2TdRlgmNY73lOTwJWE2Xb56qmd3Cp4PTsaNqBR2+6udWUTM7LUPrqrEjTkWv RmKA== 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=aY8omiRdr4hZ40WZs+m5ZhHstJNAyYnKgoizHqNNEbM=; b=oyTytiYopBvxuguMfIfbMrx0tF/4D8sFNWAavEXFEaIQAF05LtVVLCQDQiXHvsjHAO XBtl1D1pchDtFA2ZBCn0qRcWJbbcqvGv5eXJOl0PvYGB5nfeqRKWlB7otM1bExEmRCTO vlFBqTKXBuaNZ/rh7wG5qmiq+EBYhZPnWpUdleeCElNIEbsGKK6q48kHdYfoaxvLv1ra dz4EV6evx5YoGUD1Ion8n70qkJXon93OHzVWi7sZHM65uvugh0XI5hF75D6quOCV7mJf otK3+bKAP0p0WfQ4SG70G3MzTExfW1TIfZUHJQS3wVYu3Dee7wzuMYRa0k4XaiHoi08N IWMQ== X-Gm-Message-State: AOAM530yhepQhFYJPHBXC07mk2SCRRdgd6DDGRNrYnpJLNi0PorRPPJZ S4cQK0EPdwOXbyLj0lnyThPvuPE6/Or4DA== X-Google-Smtp-Source: ABdhPJynDete/Q19gQD1AAkP6vNo0glEpaenhvnj8yFkP6nxRen+nCvy+6c8tP4v8EkVj6ClQ1rAkQ== X-Received: by 2002:a17:906:7c95:: with SMTP id w21mr9018628ejo.304.1605857674188; Thu, 19 Nov 2020 23:34:34 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:33 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:55 +0100 Message-Id: <20201120073327.820745-31-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 130/162] avcodec/intrax8: Make ff_intrax8_common_init() thread-safe 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" In particular, don't reinitialize VLCs every time an IntraX8Context is initialized. Signed-off-by: Andreas Rheinhardt --- libavcodec/intrax8.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index b62bff3b48..0bd0db29c4 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -22,6 +22,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "get_bits.h" #include "idctdsp.h" @@ -696,6 +697,8 @@ av_cold int ff_intrax8_common_init(AVCodecContext *avctx, int block_last_index[12], int mb_width, int mb_height) { + static AVOnce init_static_once = AV_ONCE_INIT; + w->avctx = avctx; w->idsp = *idsp; w->mb_width = mb_width; @@ -723,7 +726,7 @@ av_cold int ff_intrax8_common_init(AVCodecContext *avctx, ff_intrax8dsp_init(&w->dsp); ff_blockdsp_init(&w->bdsp, avctx); - x8_vlc_init(); + ff_thread_once(&init_static_once, x8_vlc_init); return 0; } From patchwork Fri Nov 20 07:32:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23880 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 4F744449298 for ; Fri, 20 Nov 2020 09:49:47 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0131668BCBD; Fri, 20 Nov 2020 09:34:46 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 788CC68BD0E for ; Fri, 20 Nov 2020 09:34:36 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id o9so11568325ejg.1 for ; Thu, 19 Nov 2020 23:34:36 -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=mhWJc9GUOz0h9ARYcnFVBktsuQjJ5DgWo/pSEdu+9eY=; b=PFc51RVJTqQc264tPPaaWUMyRnDk6cNy2mZe2PLKwRuuCOZ+9fDgKpovGk6wUudD6z FLZcEMOFh+/THGj1j+2MsHa8ALDgO/hkbYd7YuT3YnukaxNJkafwwIojVcyN1h5AIDF0 8eUvZPqQlQGe5Vg7HQdMhGv15LEcFrj0wQYhWsS3yhlzlmz4PZAldZzu4QRxuRP5nxe+ 8rLovcNcV7VI/pyDy7XLls7O5j2cRKoJBtReu7GrkcJu/qihd3RUSIHHsUVMixpPXX6m 3qoH4QFsvXyx0orUJYnx55l2lTm4tK6jJ7Y3lJuh1nrX8TWCw8+BTiqGDtQEaTIQDjrE m2/g== 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=mhWJc9GUOz0h9ARYcnFVBktsuQjJ5DgWo/pSEdu+9eY=; b=dZp6ICslLzxya/GwvXCeuFLbG1+KPSbLeZMcP7yzkrvp7Hyl9GDV+R7eQrbU5Qj7Eb Fz7aHNrfqSiq6XIPJfZwSvz92j3Vc/azqs8jDNmCBczyv3bHuLxHBCzPaAu3xe/NI/1Q B9dnMh+dMXR89lcl36q6t6sSgUjkD5sO0N8ySp2+7vUCx0c4i6FWujsgAyAzMqGjZNwr teVqS9xih3CxONRWUFq2ZuxhZ1EdN1VNjWGegA9i4eqZD6lWHajbvmw9GMreN2qq3pLf IS/Q4OEiZeMviSfR+yybmaG9x/U1tS0cgrRoHXbC9IPFXdbF0JX5g+30RwUkt8lEa/cP iRXw== X-Gm-Message-State: AOAM5303INU8oD3gK62ZeE1G9CiEDOLsSoz8xdU/26gvc4yBRohuZ5dv UwjLiF4Up7GShGk4SlDCnFj0TXSMqyhnIg== X-Google-Smtp-Source: ABdhPJy7qheVpBcRUjxkggBOkSziXwvVRYnhB3buPojcTYVwaaTvNwxXwHLJjWxQHkVDe3ITpThfow== X-Received: by 2002:a17:906:7698:: with SMTP id o24mr30585282ejm.447.1605857675315; Thu, 19 Nov 2020 23:34:35 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:34 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:56 +0100 Message-Id: <20201120073327.820745-32-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 131/162] avcodec/atrac3: Use symbols 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" Expressions like array[get_vlc2()] can be optimized by using a symbols table if the array is always the same for a given VLC. This requirement is fulfilled for several VLCs used by ATRAC3, therefore this commit implements this. This comes without any additional costs when using ff_init_vlc_from_lengths() as one can then remove the codes tables. While at it, remove the arrays of pointers to the individual arrays and put all lengths+symbol pairs in one big array. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac3.c | 18 ++++---- libavcodec/atrac3data.h | 100 ++++++++++++++-------------------------- 2 files changed, 43 insertions(+), 75 deletions(-) diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index 1e884a56b6..00a0232d84 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -246,13 +246,8 @@ static void read_quant_spectral_coeffs(GetBitContext *gb, int selector, /* variable length coding (VLC) */ if (selector != 1) { for (i = 0; i < num_codes; i++) { - huff_symb = get_vlc2(gb, spectral_coeff_tab[selector-1].table, - ATRAC3_VLC_BITS, 1); - huff_symb += 1; - code = huff_symb >> 1; - if (huff_symb & 1) - code = -code; - mantissas[i] = code; + mantissas[i] = get_vlc2(gb, spectral_coeff_tab[selector-1].table, + ATRAC3_VLC_BITS, 1); } } else { for (i = 0; i < num_codes; i++) { @@ -854,6 +849,7 @@ static int atrac3al_decode_frame(AVCodecContext *avctx, void *data, static av_cold void atrac3_init_static_data(void) { VLC_TYPE (*table)[2] = atrac3_vlc_table; + const uint8_t (*hufftabs)[2] = atrac3_hufftabs; int i; init_imdct_window(); @@ -863,9 +859,11 @@ static av_cold void atrac3_init_static_data(void) for (i = 0; i < 7; i++) { spectral_coeff_tab[i].table = table; spectral_coeff_tab[i].table_allocated = 256; - init_vlc(&spectral_coeff_tab[i], ATRAC3_VLC_BITS, huff_tab_sizes[i], - huff_bits[i], 1, 1, - huff_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&spectral_coeff_tab[i], ATRAC3_VLC_BITS, huff_tab_sizes[i], + &hufftabs[0][1], 2, + &hufftabs[0][0], 2, 1, + -31, INIT_VLC_USE_NEW_STATIC, NULL); + hufftabs += huff_tab_sizes[i]; table += 256; } } diff --git a/libavcodec/atrac3data.h b/libavcodec/atrac3data.h index a731fb7c4a..d050c0f380 100644 --- a/libavcodec/atrac3data.h +++ b/libavcodec/atrac3data.h @@ -32,77 +32,47 @@ /* VLC tables */ -static const uint8_t huffcode1[9] = { - 0x0, 0x4, 0x5, 0xC, 0xD, 0x1C, 0x1D, 0x1E, 0x1F -}; - -static const uint8_t huffbits1[9] = { 1, 3, 3, 4, 4, 5, 5, 5, 5 }; - -static const uint8_t huffcode2[5] = { 0x0, 0x4, 0x5, 0x6, 0x7 }; - -static const uint8_t huffbits2[5] = { 1, 3, 3, 3, 3 }; - -static const uint8_t huffcode3[7] = { 0x0, 0x4, 0x5, 0xC, 0xD, 0xE, 0xF }; - -static const uint8_t huffbits3[7] = { 1, 3, 3, 4, 4, 4, 4 }; - -static const uint8_t huffcode4[9] = { - 0x0, 0x4, 0x5, 0xC, 0xD, 0x1C, 0x1D, 0x1E, 0x1F -}; - -static const uint8_t huffbits4[9] = { 1, 3, 3, 4, 4, 5, 5, 5, 5 }; - -static const uint8_t huffcode5[15] = { - 0x00, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B, 0x1C, - 0x1D, 0x3C, 0x3D, 0x3E, 0x3F, 0x0C, 0x0D -}; - -static const uint8_t huffbits5[15] = { - 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 4, 4 -}; - -static const uint8_t huffcode6[31] = { - 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x14, - 0x15, 0x16, 0x17, 0x18, 0x19, 0x34, 0x35, 0x36, - 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x78, 0x79, 0x7A, - 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0x08, 0x09 -}; - -static const uint8_t huffbits6[31] = { - 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 4, 4 -}; - -static const uint8_t huffcode7[63] = { - 0x00, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0F, 0x10, 0x11, 0x24, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, - 0x31, 0x32, 0x33, 0x68, 0x69, 0x6A, 0x6B, 0x6C, - 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, - 0x75, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, - 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, - 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, 0x02, 0x03 -}; - -static const uint8_t huffbits7[63] = { - 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 4, 4 +static const uint8_t atrac3_hufftabs[][2] = { + /* Spectral coefficient 1 - 9 entries */ + { 31, 1 }, { 32, 3 }, { 33, 3 }, { 34, 4 }, { 35, 4 }, + { 36, 5 }, { 37, 5 }, { 38, 5 }, { 39, 5 }, + /* Spectral coefficient 2 - 5 entries */ + { 31, 1 }, { 32, 3 }, { 30, 3 }, { 33, 3 }, { 29, 3 }, + /* Spectral coefficient 3 - 7 entries */ + { 31, 1 }, { 32, 3 }, { 30, 3 }, { 33, 4 }, + { 29, 4 }, { 34, 4 }, { 28, 4 }, + /* Spectral coefficient 4 - 9 entries */ + { 31, 1 }, { 32, 3 }, { 30, 3 }, { 33, 4 }, { 29, 4 }, + { 34, 5 }, { 28, 5 }, { 35, 5 }, { 27, 5 }, + /* Spectral coefficient 5 - 15 entries */ + { 31, 2 }, { 32, 3 }, { 30, 3 }, { 33, 4 }, { 29, 4 }, + { 34, 4 }, { 28, 4 }, { 38, 4 }, { 24, 4 }, { 35, 5 }, + { 27, 5 }, { 36, 6 }, { 26, 6 }, { 37, 6 }, { 25, 6 }, + /* Spectral coefficient 6 - 31 entries */ + { 31, 3 }, { 32, 4 }, { 30, 4 }, { 33, 4 }, { 29, 4 }, { 34, 4 }, + { 28, 4 }, { 46, 4 }, { 16, 4 }, { 35, 5 }, { 27, 5 }, { 36, 5 }, + { 26, 5 }, { 37, 5 }, { 25, 5 }, { 38, 6 }, { 24, 6 }, { 39, 6 }, + { 23, 6 }, { 40, 6 }, { 22, 6 }, { 41, 6 }, { 21, 6 }, { 42, 7 }, + { 20, 7 }, { 43, 7 }, { 19, 7 }, { 44, 7 }, { 18, 7 }, { 45, 7 }, + { 17, 7 }, + /* Spectral coefficient 7 - 63 entries */ + { 31, 3 }, { 62, 4 }, { 0, 4 }, { 32, 5 }, { 30, 5 }, { 33, 5 }, + { 29, 5 }, { 34, 5 }, { 28, 5 }, { 35, 5 }, { 27, 5 }, { 36, 5 }, + { 26, 5 }, { 37, 6 }, { 25, 6 }, { 38, 6 }, { 24, 6 }, { 39, 6 }, + { 23, 6 }, { 40, 6 }, { 22, 6 }, { 41, 6 }, { 21, 6 }, { 42, 6 }, + { 20, 6 }, { 43, 6 }, { 19, 6 }, { 44, 6 }, { 18, 6 }, { 45, 7 }, + { 17, 7 }, { 46, 7 }, { 16, 7 }, { 47, 7 }, { 15, 7 }, { 48, 7 }, + { 14, 7 }, { 49, 7 }, { 13, 7 }, { 50, 7 }, { 12, 7 }, { 51, 7 }, + { 11, 7 }, { 52, 8 }, { 10, 8 }, { 53, 8 }, { 9, 8 }, { 54, 8 }, + { 8, 8 }, { 55, 8 }, { 7, 8 }, { 56, 8 }, { 6, 8 }, { 57, 8 }, + { 5, 8 }, { 58, 8 }, { 4, 8 }, { 59, 8 }, { 3, 8 }, { 60, 8 }, + { 2, 8 }, { 61, 8 }, { 1, 8 }, }; static const uint8_t huff_tab_sizes[7] = { 9, 5, 7, 9, 15, 31, 63, }; -static const uint8_t* const huff_codes[7] = { - huffcode1, huffcode2, huffcode3, huffcode4, huffcode5, huffcode6, huffcode7 -}; - -static const uint8_t* const huff_bits[7] = { - huffbits1, huffbits2, huffbits3, huffbits4, huffbits5, huffbits6, huffbits7, -}; - /* selector tables */ static const uint8_t clc_length_tab[8] = { 0, 4, 3, 3, 4, 4, 5, 6 }; From patchwork Fri Nov 20 07:32:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23883 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 37366449F85 for ; Fri, 20 Nov 2020 09:50:14 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 017F368BD25; Fri, 20 Nov 2020 09:34:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5DCF668BD13 for ; Fri, 20 Nov 2020 09:34:37 +0200 (EET) Received: by mail-ej1-f42.google.com with SMTP id o9so11568373ejg.1 for ; Thu, 19 Nov 2020 23:34:37 -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=p/oMjQvxdx07FZpYLcfD90CVwtTdtlHcIvAfgrtfdhg=; b=mlqL/6hX7J521g2WZ1cmG6fCUUl3gGzJgRHHHeumadhF8JIg1OWvs+H6sAb5OtQIpn /AEDPHv1IhgPssk3ChK8lb7TCfg83BUq4NaKhLiHgOLSjrNLPd78pS3JKh0HckAxsjAw d8UkampzLdOgSQwsLqBrx7vvAUJ3zMSWSP9vyBgzlTf+On6iFy0zCatLQ9gL7bEjemZZ pLlJJrji6S6O282BGIIhKfihnfwVrmEYXAz+nRMM9d4UIEPKuVzxe1fTe3l+kMSxFPS4 DDurtP8Wc+svYyEzCVt3kWo5XPHoT4rt4eDlH2iAOwYRZzPHmr2EMwmIWEGPwEFc/IwC WZbg== 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=p/oMjQvxdx07FZpYLcfD90CVwtTdtlHcIvAfgrtfdhg=; b=UBIOaQxkDZzfiGzXHceomY5ixkUsWRZDh+jLp3xv/n+XmXV5cAL1kNFiw1nunJ8m02 5HUt25tf8J9W82VTrMwhCZLtTQHmMzsT9uttm0mc3AP653TjCf7i4pMMXvoT/i7TuYgx JOXszg2PM56RsWZCcO/EqbTj91hwghH3fRm0MUcts3p3+Gav9WtFUZ1l4PxlAAOxgmRm huQqEfU4XOz89ZymWQuLL2XocDIRAlXfCdujksAQuB50fYxVd4fH9xLwJ3ryWxtwu/nL GjOmznJWJxrZRo6ehCoYWrccK6frQZGg8J/e1g4huAWoaer9YSn0t0aD2C/lssKHDBQJ i7DQ== X-Gm-Message-State: AOAM530CJNhYpKPgQPdV6NNgqvoeSvitfS/5DdYxStNyHk6qoA7+xxMz 2g43Zv1L4DwYjHT7BQ9n/YTIcn94B+1b+Q== X-Google-Smtp-Source: ABdhPJwgtWcxlfOKj4iNd7atLPvO+lf4UfD92P7GC0renmb4cIhlrH/yMAQtwkn6LOPXXM5gcs1Hcw== X-Received: by 2002:a17:906:9448:: with SMTP id z8mr9484473ejx.105.1605857676487; Thu, 19 Nov 2020 23:34:36 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:35 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:57 +0100 Message-Id: <20201120073327.820745-33-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 132/162] avcodec/hqx: Inline constants 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/hqx.c | 4 ++-- libavcodec/hqx.h | 1 + libavcodec/hqxvlc.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c index e2b895ac40..44c6c1883c 100644 --- a/libavcodec/hqx.c +++ b/libavcodec/hqx.c @@ -197,7 +197,7 @@ static int hqx_decode_422a(HQXContext *ctx, int slice_no, int x, int y) int i, ret; int cbp; - cbp = get_vlc2(gb, ctx->cbp_vlc.table, ctx->cbp_vlc.bits, 1); + cbp = get_vlc2(gb, ctx->cbp_vlc.table, HQX_CBP_VLC_BITS, 1); for (i = 0; i < 12; i++) memset(slice->block[i], 0, sizeof(**slice->block) * 64); @@ -283,7 +283,7 @@ static int hqx_decode_444a(HQXContext *ctx, int slice_no, int x, int y) int i, ret; int cbp; - cbp = get_vlc2(gb, ctx->cbp_vlc.table, ctx->cbp_vlc.bits, 1); + cbp = get_vlc2(gb, ctx->cbp_vlc.table, HQX_CBP_VLC_BITS, 1); for (i = 0; i < 16; i++) memset(slice->block[i], 0, sizeof(**slice->block) * 64); diff --git a/libavcodec/hqx.h b/libavcodec/hqx.h index 42d382de1f..50d60f9e03 100644 --- a/libavcodec/hqx.h +++ b/libavcodec/hqx.h @@ -77,6 +77,7 @@ typedef struct HQXContext { VLC dc_vlc[3]; } HQXContext; +#define HQX_CBP_VLC_BITS 5 #define HQX_DC_VLC_BITS 9 extern const HQXAC ff_hqx_ac[NUM_HQX_AC]; diff --git a/libavcodec/hqxvlc.c b/libavcodec/hqxvlc.c index 06a8073661..7ab2427660 100644 --- a/libavcodec/hqxvlc.c +++ b/libavcodec/hqxvlc.c @@ -2150,7 +2150,7 @@ const HQXAC ff_hqx_ac[NUM_HQX_AC] = { av_cold int ff_hqx_init_vlcs(HQXContext *ctx) { - int ret = init_vlc(&ctx->cbp_vlc, 5, FF_ARRAY_ELEMS(cbp_vlc_lens), + int ret = init_vlc(&ctx->cbp_vlc, HQX_CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_vlc_lens), cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0); if (ret < 0) return ret; From patchwork Fri Nov 20 07:32:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23884 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 D8922449F85 for ; Fri, 20 Nov 2020 09:50:27 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2158568BB0D; Fri, 20 Nov 2020 09:34:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6817C68BCF6 for ; Fri, 20 Nov 2020 09:34:38 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id l5so8475484edq.11 for ; Thu, 19 Nov 2020 23:34:38 -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=NUWunh/Vuw8QnyHgizMGWl8l5Q7fVLNKXS/IPJyWBrw=; b=NWVaXSXfCvdwcnQVG+gV89ly7PIh9HKRhVVVN7omNOMVZl+BbSkryyKKpmpOfFQTz/ 1d/AREqhriV1Ig+qswCroC0Rjdg4F3IVNRazhkgp7U4Bim9v0RrMCoOp/TgfJ4roIN6O MHhR1n5qF0yo58jzasDP2VWwoU+j3LnxdPhDIOwjkB2lNWYXv4uYWgQSVT3UpDPhSvKM mRYjy2oLY+eXiQ2SJEfb3Iu7HFmJDPUJ7UPwD427/GZ0Ns8kn0ARXgqOBJ2p07BFqLMp K3AYcNhMlNz7/3IoE4nFN5fSi+f79dcK/mDiZYBteLncsLAqU6ic4ABq88qzj1gKN84S 1qJw== 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=NUWunh/Vuw8QnyHgizMGWl8l5Q7fVLNKXS/IPJyWBrw=; b=Vmmzy0HCDyOQsCntcv1Z/mHpUfDO6Gl4eK6OpXcYIBxTgFBdrdeh5S9rTkb4wFJvzb EYzaKOsBR88Z9TXnl46UH24qwOamLDM+DIFgh2dw0N2pTUhJjCjRQKaCuRiHVK0WGRzq ywHae+eFTUTZLUlMaYsiccc563fQyxXV0poQ2A3h+cD+AfJTpAJFRw7DHK+Fm4StcY3Q /ZJ2C6Ld9REKy2z84d7HIUBe+R1u/wyicuhUb3n/n5GZNIE1rM7viPsQJUG8yEj7O7Rj V86+IlogVvPUGnCIS123sky5f08g3MefGJi1RTZVlx2VdNCcXOybi+l9kf2y2SEqkS1d L0sg== X-Gm-Message-State: AOAM5310uOFCLNRdf79Xm6tX+rSP8ZhvYn8eB89E5lgYtMzI/m0WmBk9 g0czEOmOkz991nx2+PmMOV7vaZo6Ku1mHw== X-Google-Smtp-Source: ABdhPJyoBFaBky0rcl3upMRa2m3fwhNuGN0mNMnQDOW0ik/uXjg/cw6LR9LKZrFo8yVvAjyBd/RllA== X-Received: by 2002:a50:d315:: with SMTP id g21mr34828887edh.84.1605857677556; Thu, 19 Nov 2020 23:34:37 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:36 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:58 +0100 Message-Id: <20201120073327.820745-34-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 133/162] avcodec/hqx: Don't check for errors for complete 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/hqx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c index 44c6c1883c..aa4ff22a8f 100644 --- a/libavcodec/hqx.c +++ b/libavcodec/hqx.c @@ -122,8 +122,6 @@ static int decode_block(GetBitContext *gb, VLC *vlc, memset(block, 0, 64 * sizeof(*block)); dc = get_vlc2(gb, vlc->table, HQX_DC_VLC_BITS, 2); - if (dc < 0) - return AVERROR_INVALIDDATA; *last_dc += dc; block[0] = sign_extend(*last_dc << (12 - dcb), 12); From patchwork Fri Nov 20 07:32:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23885 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 E955C449F85 for ; Fri, 20 Nov 2020 09:50:39 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1233668BD55; Fri, 20 Nov 2020 09:34:50 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F1FC468B95A for ; Fri, 20 Nov 2020 09:34:39 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id t11so8467225edj.13 for ; Thu, 19 Nov 2020 23:34:39 -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=QwnmtLn2KfSDlZRJj2JaJbCJVNaR2D4ZJrfIqnB44MQ=; b=tVzPWtBxFHYVqc+Oey2v2xIIxH24bakzOqQxdGKDJ9Nek8EkqK8cnRYNmZJKh6boKM AKA4FinZveEj/e9BZHEMxM9lsDamCQxl+BPC/kMvaRI4qt3Pub17BD2SjrfuVFcvj60h XGkkgRVyiyYhjcrLG//fb9tdsrYs2rBLviaJ3+MT66JZ57zSC9Gb+LXtHLCJGAEj7+P/ nBAgZr6YQFW5ud5jt/PzWf6aB4E+AU67Yyz/tw4leX/v7aAv/bw3MFCzCMSEVRPY+26/ zQTKOc+R/OhJI7/dxxB77ABSrukT7VbsqrOSYfzGwA1JtcwW6vLKJ5nPTco+V1v0JZvF F15A== 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=QwnmtLn2KfSDlZRJj2JaJbCJVNaR2D4ZJrfIqnB44MQ=; b=fiiB+huTL2lhgIKDwxAI8Vks9u9bHwxze4kcULjQwCkgriahzs41Zft12YLkhng4sp 9Bxj3aTmeaPFsI7RBETPNfpgzm52nm8I2OXbLmYaoLhLbV9TfjKSXL77ZPL4IpZz08E4 v17CqDX224j8HNuHFrlw5lZXpavlz1mSNx6tadi1A1ZWRsoDXW6+rMXbQveM146YSULX fZxEDdEORMdw5rqB7G3FzAyssq1K80gAFiMAG+ZPqIezrjAO0BC3k4oLSiRpGAhvLg0N eb9sgeqJAcnpbRde5UtzUkU6HRMmj4VoyLnoW01jZkx3BFdYx6uZW6LOGL9gjdz2Rpnp KqzQ== X-Gm-Message-State: AOAM533KYNjceBQEutg+HPZVu4a6YQfLeELh96JCZGhzbQnh1e0jKLCV Gzi5fZnQlBqO2ugsfQOrdO6O3CpsygCA0Q== X-Google-Smtp-Source: ABdhPJzP4opkj3x1Ir+tRbGI8WnOHLoWoC3uBX+2zRUDHSyyMKpkXUAUdbry7ae9btZ4p5jai5mcww== X-Received: by 2002:a05:6402:54c:: with SMTP id i12mr35749451edx.9.1605857678963; Thu, 19 Nov 2020 23:34:38 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:38 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:32:59 +0100 Message-Id: <20201120073327.820745-35-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 134/162] avcodec/utvideodec: Avoid implicit qsort when creating Huffman tables 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 Huffman trees used by Ut Video have two important characteristics: (i) Longer codes are on the left of the tree and (ii) for codes of the same length, the symbol is descending from left to right in the tree. Therefore all the information that needs to be transmitted is how long the code corresponding to a given symbol is; and this is also all that is transmitted. Before 341914495e5c2f60bc920b0c6f660e5948a47f5a, the decoder used qsort to sort the (length, symbol) pairs by ascending length and for equal lengths by ascending symbol. Since said commit, the decoder uses a first pass over the lengths table to count how many symbols of each length there are; with (i) one can then easily calculate the code of the left-most code with a given length in the tree and from there one can calculate the codes for all entries, using one running counter for each possible length. This eliminated the explicit qsort in build_huff(). Yet ff_init_vlc_sparse() sorts the table itself as it has to ensure that all the entries that will be placed in the same subtable are contiguous. The tables created now are non-contiguous (they are ordered by symbol and codes of different length aren't ordered at all; only codes of the same length are ordered according to (ii)). This commit therefore modifies the algorithm used to automatically create tables whose codes are sorted from left to right in the tree. The key to do so is the observation that the counts obtained in the first pass can be used to contain the range of the codes of each length in the second pass: If counts[i] is the count of codes with length i, then the first counts[32] codes are of length 32, the next counts[31] codes are of length 31 etc. So one knows the index of the lowest symbol whose code has length 32 (if any): It is counts[32] - 1 due to (ii), whereas the index of the lowest symbol whose code has length 31 (if any) is counts[32] + counts[31] - 1; the index of the second-to-lowest symbol of length 32 (if existing) is counts[32] - 2 etc. If one follows the algorithm outlined above, one can switch to ff_init_vlc_from_lengths() which has no implicit qsort; it also means that one can offload the computation of the codes. This turned out to be beneficial for performance: For the sample from ticket #4044 it decreased the decicycles spent on one call to build_huff() from 508480 to 340688 (GCC 9.3, looping 10 times over the file to get enough runs and then repeating this ten times); for another sample (YUV420p, natural content, 5500 frames, also ten iterations) the time went down from 382346 to 275533 decicycles. Signed-off-by: Andreas Rheinhardt --- libavcodec/utvideodec.c | 42 ++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 8b47c14d98..1b10b3bd06 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -40,10 +40,16 @@ #include "thread.h" #include "utvideo.h" -static int build_huff(const uint8_t *src, VLC *vlc, int *fsym, unsigned nb_elems) +typedef struct HuffEntry { + uint8_t len; + uint16_t sym; +} HuffEntry; + +static int build_huff(UtvideoContext *c, const uint8_t *src, VLC *vlc, + int *fsym, unsigned nb_elems) { int i; - uint32_t codes[1024]; + HuffEntry he[1024]; uint8_t bits[1024]; uint16_t codes_count[33] = { 0 }; @@ -64,23 +70,21 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym, unsigned nb_elems if (codes_count[0] == nb_elems) return AVERROR_INVALIDDATA; - for (unsigned i = 32, nb_codes = 0; i > 0; i--) { - uint16_t curr = codes_count[i]; // # of leafs of length i - codes_count[i] = nb_codes / 2; // # of non-leaf nodes on level i - nb_codes = codes_count[i] + curr; // # of nodes on level i - } + /* For Ut Video, longer codes are to the left of the tree and + * for codes with the same length the symbol is descending from + * left to right. So after the next loop --codes_count[i] will + * be the index of the first (lowest) symbol of length i when + * indexed by the position in the tree with left nodes being first. */ + for (int i = 31; i >= 0; i--) + codes_count[i] += codes_count[i + 1]; + + for (unsigned i = 0; i < nb_elems; i++) + he[--codes_count[bits[i]]] = (HuffEntry) { bits[i], i }; - for (unsigned i = nb_elems; i-- > 0;) { - if (!bits[i]) { - codes[i] = 0; - continue; - } - codes[i] = codes_count[bits[i]]++; - } #define VLC_BITS 11 - return init_vlc(vlc, VLC_BITS, nb_elems, - bits, sizeof(*bits), sizeof(*bits), - codes, sizeof(*codes), sizeof(*codes), 0); + return ff_init_vlc_from_lengths(vlc, VLC_BITS, codes_count[0], + &he[0].len, sizeof(*he), + &he[0].sym, sizeof(*he), 2, 0, 0, c->avctx); } static int decode_plane10(UtvideoContext *c, int plane_no, @@ -95,7 +99,7 @@ static int decode_plane10(UtvideoContext *c, int plane_no, GetBitContext gb; int prev, fsym; - if ((ret = build_huff(huff, &vlc, &fsym, 1024)) < 0) { + if ((ret = build_huff(c, huff, &vlc, &fsym, 1024)) < 0) { av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return ret; } @@ -255,7 +259,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, return 0; } - if (build_huff(src, &vlc, &fsym, 256)) { + if (build_huff(c, src, &vlc, &fsym, 256)) { av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return AVERROR_INVALIDDATA; } From patchwork Fri Nov 20 07:33:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23886 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 5D76D449F85 for ; Fri, 20 Nov 2020 09:50:54 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7DF1C68BD77; Fri, 20 Nov 2020 09:34:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1073568BCE0 for ; Fri, 20 Nov 2020 09:34:41 +0200 (EET) Received: by mail-ed1-f68.google.com with SMTP id e18so8513179edy.6 for ; Thu, 19 Nov 2020 23:34:40 -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=/EPxxp6P0fD8Er99p5ewIDMl1C59ZybSZ3ss59ZcTKU=; b=GpKE8FlOFdmjrZeQ8O0hOpUpuOCQ1nwIVRvPx3V57btfwgq8h906OO/tOgjguKOmC9 16xUUBR5zoTgUfryjsmucmx7DohPgy9CctdKb5KFVTPU4qSTp96Gv50yUQvYXxfFtqL3 /tWv0IZXatvff61O2Nb2kVGGiE7ookI3cpV4lrkoVIgObD6/quVGL5Ln5UcXjNg4MN5/ UL+a1Sa/nTMz8917pKtZZiNXPS+YB/H3r54E2PLPyNugbcaWn4XL1NOy0msVMmpTF9N6 y+utmcSmiYktxBzgIie42DldX3GANM1EwGSgEWzMGkb5YJR1DQmezae4TJCJye+SEgTl YztQ== 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=/EPxxp6P0fD8Er99p5ewIDMl1C59ZybSZ3ss59ZcTKU=; b=Mt3+OTkkoxzpFBhk97BK7TRpYB7wC1cY1gBt20IaQp4Vb2DWezoXG4I8vlrSXw2+H0 WmNriDycgeql7HiI7cmvwOCtuzTwXP/YneyK4pDF0/RWOW8bylcGQSguqvnvWbkHd/D+ suMk4qOl3xrs/3xsprEzgAxsF/YJ1s1G5KIuUM/WKyNCGir1HZ6JXebOSQYrbmPR9626 daewQTdmetCNY6UXNvmA0/MZB0Q0bXQc+P81gaIGAn4sMyaOM3NL6JaMf0jlDt6MRqc9 odm4dC6AV8l9sJp67+CYU4W+45VXWzSo7g5WjCS2Ntt7M1K8YH9wgKUFTVAoOHblh1dC Mbtw== X-Gm-Message-State: AOAM531R6gqr0u1bXoLDQ4AZDOEyVLaIWcrvY+wLI/FivkUKhNe48e0j Tw7bUxDxHJtqwZxEdazokFWSOFqEYW36MQ== X-Google-Smtp-Source: ABdhPJw61SZdAYtjN9Y4BRWY4MwAlDVHJuIajbA1gxjFMZSbWojvTl2jkV90nLF7oq9Hz+uEektVlw== X-Received: by 2002:a50:8a8e:: with SMTP id j14mr23099983edj.87.1605857679984; Thu, 19 Nov 2020 23:34:39 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:39 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:00 +0100 Message-Id: <20201120073327.820745-36-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 135/162] avcodec/magicyuv: Optimize creating Huffman tables 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" MagicYUV transmits its Huffman trees by providing the length of the code corresponding to each symbol; then the decoder has to assemble the table in such a way that (i) longer codes are to the left of the tree and (ii) for codes of the same length the symbols are ascending from left to right. Up until now the decoder did this as follows: It counted the number of codes of each length and derived the first code of a given length via (ii). Then the array of lengths is traversed a second time to create the codes; there is one running counter for each length to do so. This process creates a default symbol table (that is omitted). This commit changes this as follows: Everything is indexed by the position in the tree (with codes to the left first); given (i), we can calculate the ranges occupied by the codes of each length; and with (ii) we can derive the actual symbols of each code; the running counters for each length are now used for the symbols and not for the codes. Doing so allows us to switch to ff_init_vlc_from_lengths(); this has the advantage that the codes table needs only be traversed once and that the codes need not be sorted any more (right now, the codes that are so long that they will be put into subtables need to be sorted so that codes that end up in the same subtable are contiguous). For a sample produced by our encoder (natural content, 4000 frames, YUV420p, ten iterations, GCC 9.3) this decreased the amount of decicycles for each call to build_huffman() from 1336049 to 1309401. Notice that our encoder restricts the code lengths to 12 and our decoder only uses subtables when the code is longer than 12 bits, so the sorting that can be avoided does not happen at the moment. If one reduces the decoder's tables to nine bits, the performance improvement becomes more apparent: The amount of decicycles for build_huffman() decreased from 1165210 to 654055. Signed-off-by: Andreas Rheinhardt --- libavcodec/magicyuv.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index c7e2754c44..13cb346119 100644 --- a/libavcodec/magicyuv.c +++ b/libavcodec/magicyuv.c @@ -47,7 +47,7 @@ typedef enum Prediction { typedef struct HuffEntry { uint8_t len; - uint16_t code; + uint16_t sym; } HuffEntry; typedef struct MagicYUVContext { @@ -72,27 +72,22 @@ typedef struct MagicYUVContext { LLVidDSPContext llviddsp; } MagicYUVContext; -static int huff_build(HuffEntry he[], uint16_t codes_count[33], - VLC *vlc, int nb_elems) +static int huff_build(const uint8_t len[], uint16_t codes_pos[33], + VLC *vlc, int nb_elems, void *logctx) { - unsigned nb_codes = 0, max = 0; - - for (int i = 32; i > 0; i--) { - uint16_t curr = codes_count[i]; // # of leafs of length i - codes_count[i] = nb_codes / 2; // # of non-leaf nodes on level i - nb_codes = codes_count[i] + curr; // # of nodes on level i - if (curr && !max) - max = i; - } + HuffEntry he[4096]; + + for (int i = 31; i > 0; i--) + codes_pos[i] += codes_pos[i + 1]; + + for (unsigned i = nb_elems; i-- > 0;) + he[--codes_pos[len[i]]] = (HuffEntry){ len[i], i }; - for (unsigned i = 0; i < nb_elems; i++) { - he[i].code = codes_count[he[i].len]; - codes_count[he[i].len]++; - } ff_free_vlc(vlc); - return init_vlc(vlc, FFMIN(max, 12), nb_elems, - &he[0].len, sizeof(he[0]), sizeof(he[0].len), - &he[0].code, sizeof(he[0]), sizeof(he[0].code), 0); + return ff_init_vlc_from_lengths(vlc, FFMIN(he[0].len, 12), nb_elems, + &he[0].len, sizeof(he[0]), + &he[0].sym, sizeof(he[0]), sizeof(he[0].sym), + 0, 0, logctx); } static void magicyuv_median_pred16(uint16_t *dst, const uint16_t *src1, @@ -384,7 +379,7 @@ static int build_huffman(AVCodecContext *avctx, const uint8_t *table, { MagicYUVContext *s = avctx->priv_data; GetByteContext gb; - HuffEntry he[4096]; + uint8_t len[4096]; uint16_t length_count[33] = { 0 }; int i = 0, j = 0, k; @@ -408,11 +403,11 @@ static int build_huffman(AVCodecContext *avctx, const uint8_t *table, length_count[x] += l; for (; j < k; j++) - he[j].len = x; + len[j] = x; if (j == max) { j = 0; - if (huff_build(he, length_count, &s->vlc[i], max)) { + if (huff_build(len, length_count, &s->vlc[i], max, avctx)) { av_log(avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return AVERROR_INVALIDDATA; } From patchwork Fri Nov 20 07:33:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23887 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 06C0F449F85 for ; Fri, 20 Nov 2020 09:51:07 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5F52168BD5D; Fri, 20 Nov 2020 09:34:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D83E968BD31 for ; Fri, 20 Nov 2020 09:34:41 +0200 (EET) Received: by mail-ed1-f66.google.com with SMTP id e18so8513213edy.6 for ; Thu, 19 Nov 2020 23:34: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=X1NJ13m65STiu+wnUEc83y9aMTCjbu88EoCQPgM2Loc=; b=LCBCINFmRfRlOIHtZUi6VWatix7/mbQik7fDrO0lKlkhYQCgkG21amwiGoQSvF8F1Y io7r/wQVS0l85WbJxmJT1mKC0lLj46lX6O9tg7YrfS6nxZkOj3343F8HlPMoNFk5DVnm FHZkmH1YG7OxpG6QS1SYFNhpajEmHUVG3JKyh+QvBFJWqTwMb5PBl+mWD0kdmeL9OSWc yUFFPk122GrS0o0EC/EnhIzzFqR8fMo3M6jv9+ldsCP6TPo99BiUggcD/7g/lQsOP+cd 7eMhw9KfPTy98TbnRtXj6CFdifC0xxhrh179eTcI6XZxn1ClOCvzRdg2iRV7I0foSq33 irsQ== 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=X1NJ13m65STiu+wnUEc83y9aMTCjbu88EoCQPgM2Loc=; b=bsqgXcgLpbxzT6UtTbfTaysgjnDiNBXF4+wlnlRnXVhPvizeups3wMPaLd3S0T0oOh HhvMHBIBv71GEhOQhKYY/H0S/IFYdSe4IkCY3X1Ls8S/u2jvmf5MAhxA/wbHFHj3JLVk i5Pp8FeKKJHSAIlrvwZgInZe3PvIKt3UsETzHM6j6AmLPifh0TTMfuSIdO4W8qcFnJiE MgoDGGLUoEuf5hPM7EWQZLgqiN0NIHEnsTZAy6hecS55m6A0pvbUkLmVRRPSH1M0yzBP 6+GhEk3bGcjYiAyHe9AzlIYDPndaO+23dqMbsdksyFKbYgeJoSwvVNxmCauFbTtcxSnn +bKg== X-Gm-Message-State: AOAM5306SAbH4ZLprTCXW/SK5iqpNfMQcG4sg7o/l18rnzrq1jPbAl2H 4RhkXjlxpbGlSO4P39/97oLpu5GGVxFjCw== X-Google-Smtp-Source: ABdhPJzqFEnhOH8+z4B1uGSyxBPrnfFVVgscvQ190Mj0Y9FrMqMSJ4UC5jVJ0hQqWwc7df43nzHuvQ== X-Received: by 2002:aa7:c358:: with SMTP id j24mr34687305edr.265.1605857681181; Thu, 19 Nov 2020 23:34:41 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:40 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:01 +0100 Message-Id: <20201120073327.820745-37-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 136/162] avcodec/qdmc: Don't check for errors for complete 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/qdmc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c index ff1cc86c6b..f4e507fa60 100644 --- a/libavcodec/qdmc.c +++ b/libavcodec/qdmc.c @@ -370,8 +370,6 @@ static int qdmc_get_vlc(GetBitContext *gb, VLC *table, int flag) if (get_bits_left(gb) < 1) return AVERROR_INVALIDDATA; v = get_vlc2(gb, table->table, table->bits, 2); - if (v < 0) - return AVERROR_INVALIDDATA; if (v) v = v - 1; else From patchwork Fri Nov 20 07:33:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23888 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 D9B9844A412 for ; Fri, 20 Nov 2020 09:51:18 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 33AD668BD6A; Fri, 20 Nov 2020 09:34:54 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5F17368BACD for ; Fri, 20 Nov 2020 09:34:43 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id o9so11568659ejg.1 for ; Thu, 19 Nov 2020 23:34:43 -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=slfBDbBID+hZkmigRqplltMYvGPET1v/OnCz2Fw3O4A=; b=W70s0Uz9JbkMI9wNIJU7oYc9PTICrNNgxTGvTam2UfsayFnOvdqGg263IIGkK/go7t f9sdb/2w9m99opxpVrLcJtn35d8BptKeddaaZkVUG/1DiJfCSTtWc6Ta8XULBep5R2ST peyQvRbiiGxi0dqjGkDQfJ0V1IsX73/pRKgsKqAcWJd2W1aFTqfnvJg13duOrulngQiq ohD1JPJiVU9nJrf9JBjm52RbQ5YIMhSW+FmCxAF03a03DRwBnp6UibRvISUoxnSSresT 2AL91ol98G0Qk//NbAqvtAbCSqLZBhR3TinzeiZu4l8zAJQohv6aP1FuawArAGhXm/s2 t3eg== 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=slfBDbBID+hZkmigRqplltMYvGPET1v/OnCz2Fw3O4A=; b=ZwHQejKR7BCqpGme+2nzDMJB75zzTp/Psz7SBI1z4/PTt5gAn/+FHVt3U9ygryhiTQ H8qRAOXyLnI8uhKVJKHE1UaXh97qGKJt/B1QW1V1Ev+TkWwecvv/itWl4M/v9jmFUG79 2h4S6Ka9Gx0ujqAslkkSS1nulbVeglmRalLvwpzWEHNRhRkhJqbjuSaG8CEmT0XEaYII KCyygI4gIx6tUVDSr6+2OSUwIidMGuJKTbzcgLbthlRvqS3S0roKo/JkQBoMZSkPBJu7 6fWsUFpb2+RzAei8ti3M9AWBi/GvJx7DF6JhdmcHA8b5dJ6d/YhcWQX8WWE2ebtRe+q9 y3sw== X-Gm-Message-State: AOAM533hFVBbNZJIw9wIKztiFsgCvfJD+RusPo/t91hgsA0Me8EAUxnD Ljs7ECDarJvcnc2/iOztlFBnRCd5FPFHEA== X-Google-Smtp-Source: ABdhPJwe7bIGOVYbmQHuWKK+P4duHuNr48XFFlf2E4K2eFO4FngHdGCYX5F+G50p570el37VIsEr3Q== X-Received: by 2002:a17:906:ce2a:: with SMTP id sd10mr13482108ejb.21.1605857682225; Thu, 19 Nov 2020 23:34:42 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:41 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:02 +0100 Message-Id: <20201120073327.820745-38-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 137/162] avcodec/qdmc: Make tables used to initialize VLCs 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" This is possible by switching to ff_init_vlc_from_lengths() which allows to replace tables of codes of size uint16_t or uint32_t by tables of symbols of size uint8_t; in case there already were symbols tables the savings are even bigger. Signed-off-by: Andreas Rheinhardt --- libavcodec/qdmc.c | 91 +++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 55 deletions(-) diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c index f4e507fa60..8b50fbf30a 100644 --- a/libavcodec/qdmc.c +++ b/libavcodec/qdmc.c @@ -119,58 +119,36 @@ static const uint8_t noise_bands_selector[] = { 4, 3, 2, 1, 0, 0, 0, }; -static const uint8_t noise_value_bits[] = { - 12, 7, 9, 7, 10, 9, 11, 9, 9, 2, 9, 9, 9, 9, - 9, 3, 9, 10, 10, 12, 2, 3, 3, 5, 5, 6, 7, +static const uint8_t noise_value[][2] = { + { 1, 2 }, { 10, 7 }, { 26, 9 }, { 22, 9 }, { 24, 9 }, { 14, 9 }, + { 8, 6 }, { 6, 5 }, { 7, 5 }, { 9, 7 }, { 30, 9 }, { 32, 10 }, + { 13, 10 }, { 20, 9 }, { 28, 9 }, { 12, 7 }, { 15, 11 }, { 36, 12 }, + { 0, 12 }, { 34, 10 }, { 18, 9 }, { 11, 9 }, { 16, 9 }, { 5, 3 }, + { 2, 3 }, { 4, 3 }, { 3, 2 }, }; -static const uint8_t noise_value_symbols[] = { - 0, 10, 11, 12, 13, 14, 15, 16, 18, 1, 20, 22, 24, - 26, 28, 2, 30, 32, 34, 36, 3, 4, 5, 6, 7, 8, 9, +static const uint8_t noise_segment_length[][2] = { + { 1, 1 }, { 2, 2 }, { 3, 4 }, { 8, 9 }, { 9, 10 }, { 0, 10 }, + { 13, 8 }, { 7, 7 }, { 6, 6 }, { 17, 5 }, { 4, 4 }, { 5, 4 }, }; -static const uint16_t noise_value_codes[] = { - 0xC7A, 0x002, 0x0FA, 0x03A, 0x35A, 0x1C2, 0x07A, 0x1FA, - 0x17A, 0x000, 0x0DA, 0x142, 0x0C2, 0x042, 0x1DA, 0x001, - 0x05A, 0x15A, 0x27A, 0x47A, 0x003, 0x005, 0x006, 0x012, - 0x00A, 0x022, 0x01A, +static const uint8_t amplitude[][2] = { + { 18, 3 }, { 16, 3 }, { 22, 7 }, { 8, 10 }, { 4, 10 }, { 3, 9 }, + { 2, 8 }, { 23, 8 }, { 10, 8 }, { 11, 7 }, { 21, 5 }, { 20, 4 }, + { 1, 7 }, { 7, 10 }, { 5, 10 }, { 9, 9 }, { 6, 10 }, { 25, 11 }, + { 26, 12 }, { 27, 13 }, { 0, 13 }, { 24, 9 }, { 12, 6 }, { 13, 5 }, + { 14, 4 }, { 19, 3 }, { 15, 3 }, { 17, 2 }, }; -static const uint8_t noise_segment_length_bits[] = { - 10, 8, 5, 1, 2, 4, 4, 4, 6, 7, 9, 10, -}; - -static const uint8_t noise_segment_length_symbols[] = { - 0, 13, 17, 1, 2, 3, 4, 5, 6, 7, 8, 9, -}; - -static const uint16_t noise_segment_length_codes[] = { - 0x30B, 0x8B, 0x1B, 0x0, 0x1, 0x3, 0x7, 0xF, 0x2b, 0x4B, 0xB, 0x10B, -}; - -static const uint8_t freq_diff_bits[] = { - 18, 2, 4, 4, 5, 4, 4, 5, 5, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 6, - 7, 6, 6, 6, 7, 7, 7, 7, 7, 8, 9, 9, 8, 9, 11, 11, 12, 12, 13, 12, - 14, 15, 18, 16, 17, -}; - -static const uint32_t freq_diff_codes[] = { - 0x2AD46, 0x1, 0x0, 0x3, 0xC, 0xA, 0x7, 0x18, 0x12, 0xE, 0x4, 0x16, - 0xF, 0x1C, 0x8, 0x22, 0x26, 0x2, 0x3B, 0x34, 0x74, 0x1F, 0x14, 0x2B, - 0x1B, 0x3F, 0x28, 0x54, 0x6, 0x4B, 0xB, 0x68, 0xE8, 0x46, 0xC6, 0x1E8, - 0x146, 0x346, 0x546, 0x746, 0x1D46, 0xF46, 0xD46, 0x6D46, 0xAD46, 0x2D46, - 0x1AD46, -}; - -static const uint8_t amplitude_bits[] = { - 13, 7, 8, 9, 10, 10, 10, 10, 10, 9, 8, 7, 6, - 5, 4, 3, 3, 2, 3, 3, 4, 5, 7, 8, 9, 11, 12, 13, -}; - -static const uint16_t amplitude_codes[] = { - 0x1EC6, 0x6, 0xC2, 0x142, 0x242, 0x246, 0xC6, 0x46, 0x42, 0x146, 0xA2, - 0x62, 0x26, 0x16, 0xE, 0x5, 0x4, 0x3, 0x0, 0x1, 0xA, 0x12, 0x2, 0x22, - 0x1C6, 0x2C6, 0x6C6, 0xEC6, +static const uint8_t freq_diff[][2] = { + { 2, 4 }, { 14, 6 }, { 26, 7 }, { 31, 8 }, { 32, 9 }, { 35, 9 }, + { 7, 5 }, { 10, 5 }, { 22, 7 }, { 27, 7 }, { 19, 7 }, { 20, 7 }, + { 4, 5 }, { 13, 5 }, { 17, 6 }, { 15, 6 }, { 8, 5 }, { 5, 4 }, + { 28, 7 }, { 33, 9 }, { 36, 11 }, { 38, 12 }, { 42, 14 }, { 45, 16 }, + { 44, 18 }, { 0, 18 }, { 46, 17 }, { 43, 15 }, { 40, 13 }, { 37, 11 }, + { 39, 12 }, { 41, 12 }, { 34, 8 }, { 16, 6 }, { 11, 5 }, { 9, 4 }, + { 1, 2 }, { 3, 4 }, { 30, 7 }, { 29, 7 }, { 23, 6 }, { 24, 6 }, + { 18, 6 }, { 6, 4 }, { 12, 5 }, { 21, 6 }, { 25, 6 }, }; static const uint8_t amplitude_diff_bits[] = { @@ -209,15 +187,18 @@ static av_cold void qdmc_init_static_data(void) { int i; - INIT_VLC_STATIC_LE(&vtable[0], 12, FF_ARRAY_ELEMS(noise_value_bits), - noise_value_bits, 1, 1, noise_value_codes, 2, 2, noise_value_symbols, 1, 1, 4096); - INIT_VLC_STATIC_LE(&vtable[1], 10, FF_ARRAY_ELEMS(noise_segment_length_bits), - noise_segment_length_bits, 1, 1, noise_segment_length_codes, 2, 2, - noise_segment_length_symbols, 1, 1, 1024); - INIT_VLC_STATIC_LE(&vtable[2], 12, FF_ARRAY_ELEMS(amplitude_bits), - amplitude_bits, 1, 1, amplitude_codes, 2, 2, NULL, 0, 0, 4098); - INIT_VLC_STATIC_LE(&vtable[3], 12, FF_ARRAY_ELEMS(freq_diff_bits), - freq_diff_bits, 1, 1, freq_diff_codes, 4, 4, NULL, 0, 0, 4160); + INIT_VLC_STATIC_FROM_LENGTHS(&vtable[0], 12, FF_ARRAY_ELEMS(noise_value), + &noise_value[0][1], 2, + &noise_value[0][0], 2, 1, 0, INIT_VLC_LE, 4096); + INIT_VLC_STATIC_FROM_LENGTHS(&vtable[1], 10, FF_ARRAY_ELEMS(noise_segment_length), + &noise_segment_length[0][1], 2, + &noise_segment_length[0][0], 2, 1, 0, INIT_VLC_LE, 1024); + INIT_VLC_STATIC_FROM_LENGTHS(&vtable[2], 12, FF_ARRAY_ELEMS(amplitude), + &litude[0][1], 2, + &litude[0][0], 2, 1, 0, INIT_VLC_LE, 4098); + INIT_VLC_STATIC_FROM_LENGTHS(&vtable[3], 12, FF_ARRAY_ELEMS(freq_diff), + &freq_diff[0][1], 2, + &freq_diff[0][0], 2, 1, 0, INIT_VLC_LE, 4160); INIT_VLC_STATIC_LE(&vtable[4], 8, FF_ARRAY_ELEMS(amplitude_diff_bits), amplitude_diff_bits, 1, 1, amplitude_diff_codes, 1, 1, NULL, 0, 0, 256); INIT_VLC_STATIC_LE(&vtable[5], 6, FF_ARRAY_ELEMS(phase_diff_bits), From patchwork Fri Nov 20 07:33:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23889 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 9947944A412 for ; Fri, 20 Nov 2020 09:51:30 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 04C9F68BCEF; Fri, 20 Nov 2020 09:34:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8C43968BCD9 for ; Fri, 20 Nov 2020 09:34:44 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id o21so11523038ejb.3 for ; Thu, 19 Nov 2020 23:34:44 -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=9eIYFmpUyQ6Ix4KgJ7cpCFKR2v3Dfk4bdgr4NZdU9Gg=; b=ZLy2Q0NC7qkoGXiclAPMT2WWvDQuCfMxc2d+AH2iMmId7rTZMSwKrpvkkfIDvFCa9g azlT6+04S06NQsaCb2a7V/yG2JOSYvNWpaDxINJJe3K0BBdp9zWCsq0oYkWJ2eJywHv6 UHe9lXrJ1xGM7zftA+BIMAtY9ONkwsl4kkRMoX+kFGX2yrEwC7GreY+Y0BJz+aJ9z4lb NNvEDMOFafZHNDL57i9UV9QmZe9ElFfL6WfR6tvqYxdJGZMROJ9TZumcDRDC+Z/bY5fp E0JfarncxyF7sba7Mduu0xY6rFPHiMAlIecsPRcT0IlB3CwCoOuN7UT0IadGMxEvjfqm Hqrw== 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=9eIYFmpUyQ6Ix4KgJ7cpCFKR2v3Dfk4bdgr4NZdU9Gg=; b=JdrGUOTE5HT7cA90xdy4XT75Z89R7dfCm0OR7gt9EEzewZK4Snmxq+L4e3yTAathgI EkF2e8rUkKtbPqXJ6ViwedbcH1S7RHcCd+LpiQiZANXCEspsOZwKcn8hm/9xy02Ul/iK QYT2P++t91mzD+Zl2UczyOh0REC4EoUyKpO08dIpDxhoY5gpHjCrAzw18FnH8ArtQMfC hABWVNsTNqtjAh3JfeeOl1KQ9VwGLRGyuewCXbvOIWQTTFofoZFHFDrrXbVlk/2Qyl1h yvIDH8cMCdQ//uUeKVFNktFez9XwJibWPrsk8CkpjhOLcCSLhu/rqLCQsGqWhOOY5G98 qQFg== X-Gm-Message-State: AOAM533Nat/4jI2TXegQrg6k4m7R01sLPTJo2vtGDgwQcIkI6gUKcokn 9qcEpOra/m4orVYnQ+RuU+gDr1P0Gfd9Zw== X-Google-Smtp-Source: ABdhPJxmlJO9ySQEnMg5JU1/8ZiPnfms6uoNQqo4SSzidaHm7SiSt5RNBb4GMfboRf7senmFJvMlqA== X-Received: by 2002:a17:906:7f95:: with SMTP id f21mr30696551ejr.340.1605857683422; Thu, 19 Nov 2020 23:34:43 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:42 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:03 +0100 Message-Id: <20201120073327.820745-39-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 138/162] avcodec/qdmc: Apply offset when creating 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/qdmc.c | 56 ++++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 39 deletions(-) diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c index 8b50fbf30a..2c870fcc1b 100644 --- a/libavcodec/qdmc.c +++ b/libavcodec/qdmc.c @@ -151,58 +151,38 @@ static const uint8_t freq_diff[][2] = { { 18, 6 }, { 6, 4 }, { 12, 5 }, { 21, 6 }, { 25, 6 }, }; -static const uint8_t amplitude_diff_bits[] = { - 8, 2, 1, 3, 4, 5, 6, 7, 8, +static const uint8_t amplitude_diff[][2] = { + { 1, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 6, 6 }, { 7, 7 }, + { 8, 8 }, { 0, 8 }, { 2, 1 }, }; -static const uint8_t amplitude_diff_codes[] = { - 0xFE, 0x0, 0x1, 0x2, 0x6, 0xE, 0x1E, 0x3E, 0x7E, +static const uint8_t phase_diff[][2] = { + { 2, 2 }, { 1, 2 }, { 3, 4 }, { 7, 4 }, { 6, 5 }, { 5, 6 }, + { 0, 6 }, { 4, 4 }, { 8, 2 }, }; -static const uint8_t phase_diff_bits[] = { - 6, 2, 2, 4, 4, 6, 5, 4, 2, -}; - -static const uint8_t phase_diff_codes[] = { - 0x35, 0x2, 0x0, 0x1, 0xD, 0x15, 0x5, 0x9, 0x3, -}; - -#define INIT_VLC_STATIC_LE(vlc, nb_bits, nb_codes, \ - bits, bits_wrap, bits_size, \ - codes, codes_wrap, codes_size, \ - symbols, symbols_wrap, symbols_size, \ - static_size) \ - do { \ - static VLC_TYPE table[static_size][2]; \ - (vlc)->table = table; \ - (vlc)->table_allocated = static_size; \ - ff_init_vlc_sparse(vlc, nb_bits, nb_codes, \ - bits, bits_wrap, bits_size, \ - codes, codes_wrap, codes_size, \ - symbols, symbols_wrap, symbols_size, \ - INIT_VLC_LE | INIT_VLC_USE_NEW_STATIC); \ - } while (0) - static av_cold void qdmc_init_static_data(void) { int i; INIT_VLC_STATIC_FROM_LENGTHS(&vtable[0], 12, FF_ARRAY_ELEMS(noise_value), &noise_value[0][1], 2, - &noise_value[0][0], 2, 1, 0, INIT_VLC_LE, 4096); + &noise_value[0][0], 2, 1, -1, INIT_VLC_LE, 4096); INIT_VLC_STATIC_FROM_LENGTHS(&vtable[1], 10, FF_ARRAY_ELEMS(noise_segment_length), &noise_segment_length[0][1], 2, - &noise_segment_length[0][0], 2, 1, 0, INIT_VLC_LE, 1024); + &noise_segment_length[0][0], 2, 1, -1, INIT_VLC_LE, 1024); INIT_VLC_STATIC_FROM_LENGTHS(&vtable[2], 12, FF_ARRAY_ELEMS(amplitude), &litude[0][1], 2, - &litude[0][0], 2, 1, 0, INIT_VLC_LE, 4098); + &litude[0][0], 2, 1, -1, INIT_VLC_LE, 4098); INIT_VLC_STATIC_FROM_LENGTHS(&vtable[3], 12, FF_ARRAY_ELEMS(freq_diff), &freq_diff[0][1], 2, - &freq_diff[0][0], 2, 1, 0, INIT_VLC_LE, 4160); - INIT_VLC_STATIC_LE(&vtable[4], 8, FF_ARRAY_ELEMS(amplitude_diff_bits), - amplitude_diff_bits, 1, 1, amplitude_diff_codes, 1, 1, NULL, 0, 0, 256); - INIT_VLC_STATIC_LE(&vtable[5], 6, FF_ARRAY_ELEMS(phase_diff_bits), - phase_diff_bits, 1, 1, phase_diff_codes, 1, 1, NULL, 0, 0, 64); + &freq_diff[0][0], 2, 1, -1, INIT_VLC_LE, 4160); + INIT_VLC_STATIC_FROM_LENGTHS(&vtable[4], 8, FF_ARRAY_ELEMS(amplitude_diff), + &litude_diff[0][1], 2, + &litude_diff[0][0], 2, 1, -1, INIT_VLC_LE, 256); + INIT_VLC_STATIC_FROM_LENGTHS(&vtable[5], 6, FF_ARRAY_ELEMS(phase_diff), + &phase_diff[0][1], 2, + &phase_diff[0][0], 2, 1, -1, INIT_VLC_LE, 64); for (i = 0; i < 512; i++) sin_table[i] = sin(2.0f * i * M_PI * 0.001953125f); @@ -351,9 +331,7 @@ static int qdmc_get_vlc(GetBitContext *gb, VLC *table, int flag) if (get_bits_left(gb) < 1) return AVERROR_INVALIDDATA; v = get_vlc2(gb, table->table, table->bits, 2); - if (v) - v = v - 1; - else + if (v < 0) v = get_bits(gb, get_bits(gb, 3) + 1); if (flag) { From patchwork Fri Nov 20 07:33:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23890 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 55CF344A412 for ; Fri, 20 Nov 2020 09:51:42 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C317168BD68; Fri, 20 Nov 2020 09:34:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6F93368BD40 for ; Fri, 20 Nov 2020 09:34:45 +0200 (EET) Received: by mail-ej1-f46.google.com with SMTP id o21so11523075ejb.3 for ; Thu, 19 Nov 2020 23:34:45 -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=gtQnnBG3z0Rc7P6tfl+mKBUlsaMsBQFmHJSUXHg0yqA=; b=EOEdjCkmipoLA9U1VP2rBn2VKbKVVoiCRCmSkRlZzvTnQd7Im69+dnTT5Hd+yejmvM UgUg55D3M/fPoV2XCzjqieVkT0rGGmG7Fk60HDMxR95Syfk5MsRwjF166kBHqaKa0aXf yAEj3qI2bNgFHGRbInjuYxe/5TlNFRrK4ttfFWY8Gc8qWNAn5/x7xRDVxQX+VRMfXxQS 5MuLTUH0t9wwDh9nEB3VCkn/0XU/7FR3r/pbspVKDLj5w7ppQqOZXBMdIfRyxNLADCNn vLJzjlh1oXIiG849KJuQYNwIZ2LKbR5eIkoGCNI4iI4+Mrw17Cy0VS2dPkfIn/qKCdyz 0Viw== 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=gtQnnBG3z0Rc7P6tfl+mKBUlsaMsBQFmHJSUXHg0yqA=; b=O6QVhwuuBcrN6yAK3UhQMs5gcqtuZhJ49k8MJjpZwIgcAbDCX4DRCr1gPKdndR531m DRdGTqiYMeGvF2Ihfarwi8AsAEuueUuSUBEyHEqK4LsxdJ+TdMzsa7i1Iv5cUls3zM+j OwpaUsVHGvgu3nhSJOGACybZayE7OMMiUdaVyGdz+/caG2hUKCjTKKTAUGjqkDdOYdC2 LDnnHolLxk73NnknjSHirqNGPVr4fSt6yV+4jeIcfZUxZBf1XdWUjjKCzCgv1SEpDThA dDbtRmlqY9YN5v8yYyJu4Ipy3unKbeqly3fOd5j26RtK45CEqJKCKxFJdL0I0Bkn7miQ No7w== X-Gm-Message-State: AOAM533KHP5L4ypH6r7XYd9KsJ5QaGFFAmH1vbIbFAXe3mXvolB5iTyA k9nkqQ+tJQ2suRGDezaXY3dkV3ifZUrzeQ== X-Google-Smtp-Source: ABdhPJxCaVsqJFcGwoJnSrPOQAFvUqAA0qu4pmLn/xPOqiiBKisG4RPrP+PmzOfZZRObb3vMhVwwFg== X-Received: by 2002:a17:906:1542:: with SMTP id c2mr21234849ejd.382.1605857684546; Thu, 19 Nov 2020 23:34:44 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:43 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:04 +0100 Message-Id: <20201120073327.820745-40-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 139/162] avcodec/qdmc: Avoid code duplication 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/qdmc.c | 60 ++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c index 2c870fcc1b..eca64b056e 100644 --- a/libavcodec/qdmc.c +++ b/libavcodec/qdmc.c @@ -119,28 +119,23 @@ static const uint8_t noise_bands_selector[] = { 4, 3, 2, 1, 0, 0, 0, }; -static const uint8_t noise_value[][2] = { +static const uint8_t qdmc_hufftab[][2] = { + /* Noise value - 27 entries */ { 1, 2 }, { 10, 7 }, { 26, 9 }, { 22, 9 }, { 24, 9 }, { 14, 9 }, { 8, 6 }, { 6, 5 }, { 7, 5 }, { 9, 7 }, { 30, 9 }, { 32, 10 }, { 13, 10 }, { 20, 9 }, { 28, 9 }, { 12, 7 }, { 15, 11 }, { 36, 12 }, { 0, 12 }, { 34, 10 }, { 18, 9 }, { 11, 9 }, { 16, 9 }, { 5, 3 }, { 2, 3 }, { 4, 3 }, { 3, 2 }, -}; - -static const uint8_t noise_segment_length[][2] = { + /* Noise segment length - 12 entries */ { 1, 1 }, { 2, 2 }, { 3, 4 }, { 8, 9 }, { 9, 10 }, { 0, 10 }, { 13, 8 }, { 7, 7 }, { 6, 6 }, { 17, 5 }, { 4, 4 }, { 5, 4 }, -}; - -static const uint8_t amplitude[][2] = { + /* Amplitude - 28 entries */ { 18, 3 }, { 16, 3 }, { 22, 7 }, { 8, 10 }, { 4, 10 }, { 3, 9 }, { 2, 8 }, { 23, 8 }, { 10, 8 }, { 11, 7 }, { 21, 5 }, { 20, 4 }, { 1, 7 }, { 7, 10 }, { 5, 10 }, { 9, 9 }, { 6, 10 }, { 25, 11 }, { 26, 12 }, { 27, 13 }, { 0, 13 }, { 24, 9 }, { 12, 6 }, { 13, 5 }, { 14, 4 }, { 19, 3 }, { 15, 3 }, { 17, 2 }, -}; - -static const uint8_t freq_diff[][2] = { + /* Frequency differences - 47 entries */ { 2, 4 }, { 14, 6 }, { 26, 7 }, { 31, 8 }, { 32, 9 }, { 35, 9 }, { 7, 5 }, { 10, 5 }, { 22, 7 }, { 27, 7 }, { 19, 7 }, { 20, 7 }, { 4, 5 }, { 13, 5 }, { 17, 6 }, { 15, 6 }, { 8, 5 }, { 5, 4 }, @@ -149,40 +144,37 @@ static const uint8_t freq_diff[][2] = { { 39, 12 }, { 41, 12 }, { 34, 8 }, { 16, 6 }, { 11, 5 }, { 9, 4 }, { 1, 2 }, { 3, 4 }, { 30, 7 }, { 29, 7 }, { 23, 6 }, { 24, 6 }, { 18, 6 }, { 6, 4 }, { 12, 5 }, { 21, 6 }, { 25, 6 }, -}; - -static const uint8_t amplitude_diff[][2] = { + /* Amplitude differences - 9 entries */ { 1, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 6, 6 }, { 7, 7 }, { 8, 8 }, { 0, 8 }, { 2, 1 }, -}; - -static const uint8_t phase_diff[][2] = { + /* Phase differences - 9 entries */ { 2, 2 }, { 1, 2 }, { 3, 4 }, { 7, 4 }, { 6, 5 }, { 5, 6 }, { 0, 6 }, { 4, 4 }, { 8, 2 }, }; +static const uint8_t huff_sizes[] = { + 27, 12, 28, 47, 9, 9 +}; + +static const uint8_t huff_bits[] = { + 12, 10, 12, 12, 8, 6 +}; + static av_cold void qdmc_init_static_data(void) { + const uint8_t (*hufftab)[2] = qdmc_hufftab; int i; - INIT_VLC_STATIC_FROM_LENGTHS(&vtable[0], 12, FF_ARRAY_ELEMS(noise_value), - &noise_value[0][1], 2, - &noise_value[0][0], 2, 1, -1, INIT_VLC_LE, 4096); - INIT_VLC_STATIC_FROM_LENGTHS(&vtable[1], 10, FF_ARRAY_ELEMS(noise_segment_length), - &noise_segment_length[0][1], 2, - &noise_segment_length[0][0], 2, 1, -1, INIT_VLC_LE, 1024); - INIT_VLC_STATIC_FROM_LENGTHS(&vtable[2], 12, FF_ARRAY_ELEMS(amplitude), - &litude[0][1], 2, - &litude[0][0], 2, 1, -1, INIT_VLC_LE, 4098); - INIT_VLC_STATIC_FROM_LENGTHS(&vtable[3], 12, FF_ARRAY_ELEMS(freq_diff), - &freq_diff[0][1], 2, - &freq_diff[0][0], 2, 1, -1, INIT_VLC_LE, 4160); - INIT_VLC_STATIC_FROM_LENGTHS(&vtable[4], 8, FF_ARRAY_ELEMS(amplitude_diff), - &litude_diff[0][1], 2, - &litude_diff[0][0], 2, 1, -1, INIT_VLC_LE, 256); - INIT_VLC_STATIC_FROM_LENGTHS(&vtable[5], 6, FF_ARRAY_ELEMS(phase_diff), - &phase_diff[0][1], 2, - &phase_diff[0][0], 2, 1, -1, INIT_VLC_LE, 64); + for (unsigned i = 0, offset = 0; i < FF_ARRAY_ELEMS(vtable); i++) { + static VLC_TYPE vlc_buffer[13698][2]; + vtable[i].table = &vlc_buffer[offset]; + vtable[i].table_allocated = FF_ARRAY_ELEMS(vlc_buffer) - offset; + ff_init_vlc_from_lengths(&vtable[i], huff_bits[i], huff_sizes[i], + &hufftab[0][1], 2, &hufftab[0][0], 2, 1, -1, + INIT_VLC_LE | INIT_VLC_STATIC_OVERLONG, NULL); + hufftab += huff_sizes[i]; + offset += vtable[i].table_size; + } for (i = 0; i < 512; i++) sin_table[i] = sin(2.0f * i * M_PI * 0.001953125f); From patchwork Fri Nov 20 07:33:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23891 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 DD61544A412 for ; Fri, 20 Nov 2020 09:51:53 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C8EFC68BD63; Fri, 20 Nov 2020 09:34:56 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2DD4C68BCF9 for ; Fri, 20 Nov 2020 09:34:46 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id o21so11523108ejb.3 for ; Thu, 19 Nov 2020 23:34:46 -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=HQX6poTq2NrdZPHW8iRvg46XxBpP4YhSVvwoXsf+B9E=; b=Unk5jqICA7P8siZPRwM9z/I5rt8NGLNjwPfywy8enjmHnqbVyap2tGvd3eWjIg6h/x yQudCDhp4qG+U83JGIaz5j2nY0UmRIk8faXuyhNixNoWrLpWsxqVL/Y91Br6lZq5wJL3 wsIC9LRaFEHmfcADuMRNxSCClvgIiD2ZKb9EWQVbVIdQ8VLmepc+Aob/mOf2NTGTZPaZ v4PnLswdz6ao2oy2KpLfRIv2FFlZ3ea/7KBqE3v/rYZn42u8EiBcES4hlY79rfSzUaHG vzZ9IfMkv9fxAavnuTsFOpQ6IIXv0qKJVpgdjscXYNglrsd/uwl0wUyNwnziih00T6ky gCvw== 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=HQX6poTq2NrdZPHW8iRvg46XxBpP4YhSVvwoXsf+B9E=; b=Jov4yEqxNfc/hUkutU3AF+I4z90E0Sf3mU9leHc0DfeFX+l6EjMwSuTwZHyM1tAa75 WR/KMy3k+4VtHT7Yhb6O0neHza5HOkn/fhf22S2c7gx/9yqUbKXM6QNvjkpy5Yeu4CkG Povl1TYwnPO3s2XWwZlOLP0+qxNpffXiiK+rbz458V6uRiGT0GXNxF8QmSYX2lIRQhlN 8MkzHlONLRaB17XG9G7BFo9MY+Fn9SBviXG0sT1q32DhXzw9k5OqIUWoO74i9Lxi2VmW wvCoinCfqxa0r9/bDij3D10r+uGnsfbVsdG/YbC0IV9jEApM8mkPfaAGQAMxgCPB9gYt eBTg== X-Gm-Message-State: AOAM5333s+k94JfDGRmXm0hbpm21aGeUP5eex/CnHPi5UwiNMoAwcIji EeobO44hKVX610B/aojgHCiy4L0PlyUyqw== X-Google-Smtp-Source: ABdhPJydKgYDSNAyKdgI1+jEyeaA2t9AP7PVTrkTitnooW6gUxyP17qeXeB9/RMl0zOio6wFKgXaFA== X-Received: by 2002:a17:906:7016:: with SMTP id n22mr33394710ejj.402.1605857685481; Thu, 19 Nov 2020 23:34:45 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:44 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:05 +0100 Message-Id: <20201120073327.820745-41-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 140/162] avcodec/aacdec_template: 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/aacdec_template.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 76fffedfcb..473a075201 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -1195,29 +1195,23 @@ static void reset_predictor_group(PredictorState *ps, int group_num) reset_predict_state(&ps[i]); } -#define AAC_INIT_VLC_STATIC(num, size) \ - INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \ - ff_aac_spectral_bits[num], sizeof(ff_aac_spectral_bits[num][0]), \ - sizeof(ff_aac_spectral_bits[num][0]), \ - ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), \ - sizeof(ff_aac_spectral_codes[num][0]), \ - size); - static void aacdec_init(AACContext *ac); static av_cold void aac_static_table_init(void) { - AAC_INIT_VLC_STATIC( 0, 304); - AAC_INIT_VLC_STATIC( 1, 270); - AAC_INIT_VLC_STATIC( 2, 550); - AAC_INIT_VLC_STATIC( 3, 300); - AAC_INIT_VLC_STATIC( 4, 328); - AAC_INIT_VLC_STATIC( 5, 294); - AAC_INIT_VLC_STATIC( 6, 306); - AAC_INIT_VLC_STATIC( 7, 268); - AAC_INIT_VLC_STATIC( 8, 510); - AAC_INIT_VLC_STATIC( 9, 366); - AAC_INIT_VLC_STATIC(10, 462); + static VLC_TYPE vlc_buf[304 + 270 + 550 + 300 + 328 + + 294 + 306 + 268 + 510 + 366 + 462][2]; + for (unsigned i = 0, offset = 0; i < 11; i++) { + vlc_spectral[i].table = &vlc_buf[offset]; + vlc_spectral[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; + init_vlc(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i], + ff_aac_spectral_bits[i], sizeof(ff_aac_spectral_bits[i][0]), + sizeof(ff_aac_spectral_bits[i][0]), + ff_aac_spectral_codes[i], sizeof(ff_aac_spectral_codes[i][0]), + sizeof(ff_aac_spectral_codes[i][0]), + INIT_VLC_STATIC_OVERLONG); + offset += vlc_spectral[i].table_size; + } AAC_RENAME(ff_aac_sbr_init)(); From patchwork Fri Nov 20 07:33:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23892 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 3211644A412 for ; Fri, 20 Nov 2020 09:52:06 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B4F7568BD87; Fri, 20 Nov 2020 09:34:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 42DDD68BD06 for ; Fri, 20 Nov 2020 09:34:47 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id s25so11525360ejy.6 for ; Thu, 19 Nov 2020 23:34:47 -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=gmcigc7yjHrNxdfWKdEvT5JPnyY3oS6VMBly1M8tDnA=; b=lOiJLYMduYdDiVS0xfCcfsEH1OYXleiOBNcZXkKLiC5MERo2fX+vMvzSqMNczoguaJ lRZH9oS++rmoL5vIBw4lcWMBBDv3ZWzhH8NUXfrZYwonABFpOTaSYleLJXokbbYi2zzI fYBWfZQ2UFwou4fTO3aWnIA0ie0j4EdW40YXcVY5lsm8eLGXI4WZnajJLe/OwbCjqk/P z/idE0jFhOsBX4NCFZUnQEj3IIHWMgbPG0SjFi1bFXiUhA/44j0qLwcdhV+KtuswuXwN gkxOTkoS0nOSYRAHEVtW5+OFeSlV4cl0r8Usaj+YovI9x9z0SkWRGf8XvC4D/KKM0x13 YcbA== 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=gmcigc7yjHrNxdfWKdEvT5JPnyY3oS6VMBly1M8tDnA=; b=KPok7Qz1eEfEkGq8ijJEkm+XZEaIbvMsb6q4Ngm6zXij0XEx7u7TB/Sl9YBqNkdgyY Mi1IimyEfP9/Ccja+uW3Hx802zdEuqb7Tfhd38v3tCdxD0QDEjLLyZUypkMjGmm+dYmO VV7rmEhQqGxu+xd4lAVveT67px3b491yZbYH5ipUXWlarHPV6VCHa+Cb93JTnSRCng+q +HyG50E1C7lRG+FUy060ADqtYG4aEiq6Xsz+mA5LNsoIlJgXvFvxwEGGAQXUsa3FmeYq NaRIe62uNdBWKOH77LrhFhoe7pQKY0KFJN9bqpLgZOsO/G4RetIVG+gN7++RZJxgacYQ YQRA== X-Gm-Message-State: AOAM5310DSAoctXiNebdtyYXqLjwGSysR+dppO63sGQciIPCfuqxtQmz 1mhBDQoFaUXZYH27X216Lm8c6sdATSzR3Q== X-Google-Smtp-Source: ABdhPJwpGZHwUHWvGhpKY0dwrj3gZhpvgfsS9UlzqFg98qjz1aEza9GZiNlpvP4JAr/5qYjkZUabHQ== X-Received: by 2002:a17:906:580e:: with SMTP id m14mr30540351ejq.237.1605857686390; Thu, 19 Nov 2020 23:34:46 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:45 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:06 +0100 Message-Id: <20201120073327.820745-42-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 141/162] avcodec/aacdec_template: Use VLC symbols 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" Expressions like array[get_vlc2()] can be optimized by using a symbols table if the array is always the same for a given VLC. This requirement is fulfilled for several VLCs used by the AAC decoders. Signed-off-by: Andreas Rheinhardt --- libavcodec/aacdec_template.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 473a075201..186175e6e6 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -1204,11 +1204,13 @@ static av_cold void aac_static_table_init(void) for (unsigned i = 0, offset = 0; i < 11; i++) { vlc_spectral[i].table = &vlc_buf[offset]; vlc_spectral[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - init_vlc(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i], - ff_aac_spectral_bits[i], sizeof(ff_aac_spectral_bits[i][0]), - sizeof(ff_aac_spectral_bits[i][0]), - ff_aac_spectral_codes[i], sizeof(ff_aac_spectral_codes[i][0]), - sizeof(ff_aac_spectral_codes[i][0]), + ff_init_vlc_sparse(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i], + ff_aac_spectral_bits[i], sizeof(ff_aac_spectral_bits[i][0]), + sizeof(ff_aac_spectral_bits[i][0]), + ff_aac_spectral_codes[i], sizeof(ff_aac_spectral_codes[i][0]), + sizeof(ff_aac_spectral_codes[i][0]), + ff_aac_codebook_vector_idx[i], sizeof(ff_aac_codebook_vector_idx[i][0]), + sizeof(ff_aac_codebook_vector_idx[i][0]), INIT_VLC_STATIC_OVERLONG); offset += vlc_spectral[i].table_size; } @@ -1796,7 +1798,6 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024], #if !USE_FIXED const float *vq = ff_aac_codebook_vector_vals[cbt_m1]; #endif /* !USE_FIXED */ - const uint16_t *cb_vector_idx = ff_aac_codebook_vector_idx[cbt_m1]; VLC_TYPE (*vlc_tab)[2] = vlc_spectral[cbt_m1].table; OPEN_READER(re, gb); @@ -1812,7 +1813,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024], UPDATE_CACHE(re, gb); GET_VLC(code, re, gb, vlc_tab, 8, 2); - cb_idx = cb_vector_idx[code]; + cb_idx = code; #if USE_FIXED cf = DEC_SQUAD(cf, cb_idx); #else @@ -1835,7 +1836,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024], UPDATE_CACHE(re, gb); GET_VLC(code, re, gb, vlc_tab, 8, 2); - cb_idx = cb_vector_idx[code]; + cb_idx = code; nnz = cb_idx >> 8 & 15; bits = nnz ? GET_CACHE(re, gb) : 0; LAST_SKIP_BITS(re, gb, nnz); @@ -1859,7 +1860,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024], UPDATE_CACHE(re, gb); GET_VLC(code, re, gb, vlc_tab, 8, 2); - cb_idx = cb_vector_idx[code]; + cb_idx = code; #if USE_FIXED cf = DEC_SPAIR(cf, cb_idx); #else @@ -1883,7 +1884,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024], UPDATE_CACHE(re, gb); GET_VLC(code, re, gb, vlc_tab, 8, 2); - cb_idx = cb_vector_idx[code]; + cb_idx = code; nnz = cb_idx >> 8 & 15; sign = nnz ? SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12) : 0; LAST_SKIP_BITS(re, gb, nnz); @@ -1916,14 +1917,14 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024], UPDATE_CACHE(re, gb); GET_VLC(code, re, gb, vlc_tab, 8, 2); + cb_idx = code; - if (!code) { + if (cb_idx == 0x0000) { *icf++ = 0; *icf++ = 0; continue; } - cb_idx = cb_vector_idx[code]; nnz = cb_idx >> 12; nzt = cb_idx >> 8; bits = SHOW_UBITS(re, gb, nnz) << (32-nnz); From patchwork Fri Nov 20 07:33:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23893 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 2D1F2448F1E for ; Fri, 20 Nov 2020 09:52:18 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6C93368BD73; Fri, 20 Nov 2020 09:34:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 10A2B68BD45 for ; Fri, 20 Nov 2020 09:34:48 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id f23so11549749ejk.2 for ; Thu, 19 Nov 2020 23:34:47 -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=BJYSyyAz7qIKZeU8fgGKp7iSe7I/12B5LgbtQiR+EFw=; b=KTDY2uqoZ6Zl4FFjkSL8NB+PMtImrNiKylkJGG82y/U+gd+Rj+OOIkLc4Rxywcme61 M1miRammc9HBRoDVPiOV2QmYlOUr3POuKe511oCTKO194s50ZuUQJUvMCO3oqFeD3dTa /0YSzOe3IT8KdHUt/DbZjj6IM3QCdrknRWWV5tgblJeEAQH9Y4/vFjo8PFa59V5TnmLt aER0cP3OxaQ1AuYTPVmCLMY9yZgVDHyCPg8cZFaN6xUwSkpFzwfNx5DQsaYrVWwUbNyw VInjMK52qO+wCWULPtuhF3wGJrJusdn83TtRkbNNp5WS/AI5kCe+gStbJCsqXxcuEQgh eo0w== 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=BJYSyyAz7qIKZeU8fgGKp7iSe7I/12B5LgbtQiR+EFw=; b=XIBYAMidofQ6Hkwzkchyx10ocDxBVlGconGf5tvkZSDa3AHOclQugHXGc39JQyZKfD uDQ+Rq3gFgWe2bnGXZOO0VYxhfr7lxHhGTroUas69VCLvZWROc21dEkKetXmyJKr3wEn jGSem3swEYOshAP96WIqwJj03X61FhkHe0RIJUkevWYrTZxFp/h532P/+cRdOoizKEVv WiLDWk2d+1yzfkvELPvHjau8xASeB550+FLGFnRwQtvCNxopL02T0l51nO/Tb66yVRU0 uh/hCxSgf/x0Yf+CE2nPcGRbMQM+k0/74k+FbzSFO2YEZrOmtmArPpJkwriHCO+EOgpF 00cg== X-Gm-Message-State: AOAM531GmTeHvMJ7CtZv7zIfqpSNMjElUJPTOLxb5zOtebIlNE1KBn7D 0HSe4B0xtmSgI0U1ts/4/1AaI1yXFUcbQQ== X-Google-Smtp-Source: ABdhPJz1/ZiojtleeSW7ejcK2qqHoS8ZMZZ0nv1oAptwxeobIPwys7QC/A+vJb/5AoFBo6nWW3giuQ== X-Received: by 2002:a17:906:5017:: with SMTP id s23mr33427495ejj.359.1605857687227; Thu, 19 Nov 2020 23:34:47 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:46 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:07 +0100 Message-Id: <20201120073327.820745-43-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 142/162] avcodec/aactab: Fix conflicting types for ff_aac_codebook* 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 header missed that these are arrays of const pointers (to const data). Signed-off-by: Andreas Rheinhardt --- libavcodec/aactab.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h index 7cd8128231..29df6a43f0 100644 --- a/libavcodec/aactab.h +++ b/libavcodec/aactab.h @@ -167,9 +167,9 @@ extern const uint16_t * const ff_aac_spectral_codes[11]; extern const uint8_t * const ff_aac_spectral_bits [11]; extern const uint16_t ff_aac_spectral_sizes[11]; -extern const float *ff_aac_codebook_vectors[]; -extern const float *ff_aac_codebook_vector_vals[]; -extern const uint16_t *ff_aac_codebook_vector_idx[]; +extern const float *const ff_aac_codebook_vectors[]; +extern const float *const ff_aac_codebook_vector_vals[]; +extern const uint16_t *const ff_aac_codebook_vector_idx[]; extern const uint16_t * const ff_swb_offset_1024[13]; extern const uint16_t * const ff_swb_offset_960 [13]; From patchwork Fri Nov 20 07:33:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23894 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 1CD5E448F1E for ; Fri, 20 Nov 2020 09:52:30 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 680E268BD86; Fri, 20 Nov 2020 09:34:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0995968BD4A for ; Fri, 20 Nov 2020 09:34:48 +0200 (EET) Received: by mail-ej1-f50.google.com with SMTP id o21so11523239ejb.3 for ; Thu, 19 Nov 2020 23:34:48 -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=nHHrCFtvDDlLS5tGV/VsBeALsN8XNsrUngeDMa/N0Yo=; b=PvNXiTxi3tPy64+ijob/pSmQevCAIPyBm99qsaKqNVfey6+/81QzlLLG5vcUX0NGeW s6FcVGcCeDyNPn2fT0+qLUgGDTIIfnizP2hJzomXWnMb2VbQsabi21fMaBQm1845sJ4s DqYRyXn9K6QgY4RScpXfZLhH7mI9Xhr3ez8N84ontN0QMh6mYq797ij+861E15o9pr6K 0RDy5sZtuIoKY1y2p/gmngbo/GgbepJmcsySqumkzbVhUCGAGZ5hT7azmyhxpii/G/E1 ACm39BUC66o9BVdohz7g6gjj5/+s3ZWqV+sK3lyXwLqNHHuW8XzXiE6DtAMrsrqnKXtX 7HcQ== 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=nHHrCFtvDDlLS5tGV/VsBeALsN8XNsrUngeDMa/N0Yo=; b=cceU7ahgWH6O1OUXYG0+KOdqZ8PvWdsfXS5n+TdDOIp5CJ7XYfIItUFIv/X5ezKezW 1NslSVqEZd3kiLvHmzPnV584105kC9CwJQBrv5sLB5g61+yZqdvjjLA3SdyPyDKsKtFo NBSplaMTo8c0a0wXo3E+5bc4BprBZ+CvehmxXfcvlXWpXFTl3Y25QfN2CeWqkNaVPz2b 2EjLTp15VAXjAuJonPGkX2ChPY7fyRoikTB0yGyNB5OFjfLvAvhinC3vk5UEOgZBzVtw E1iJFqN7C61nSos2tT5CkdluqMEIq2lnbgCCZUTcsWNjZBwR8IfG6fPwoJSQ0q4C/p43 znjw== X-Gm-Message-State: AOAM530+TIBagwO67J5tduu5axkhAz3vFduSyEQjQKssDopWBPpIpp8x +oO6uPHb3p5MjqcFZLvH72tAH+3bZq1WbQ== X-Google-Smtp-Source: ABdhPJy385guKlcEJywBRfM1P+Fb8Vl/teV6pMs89skH/HLiqoDuxa5YeaDI7WhLstOHiyGNeLlvIA== X-Received: by 2002:a17:906:d0cd:: with SMTP id bq13mr30600089ejb.372.1605857688233; Thu, 19 Nov 2020 23:34:48 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:47 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:08 +0100 Message-Id: <20201120073327.820745-44-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 143/162] avcodec/aac*: Make initializing ff_aac_pow*sf_tab thread-safe 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" This table is currently initialized up to three times: Once by the encoder and twice by the decoders (once by the fixed and once by the floating-point decoder); each of these initializations is guarded by an AVOnce, yet the fact that there are three of them implies that there might be data races (the fact that each entry is only written to once (to its final value) when initializing means that this is safe in practice, yet it is still undefined behaviour). Fix this by only initializing the table from one place that is guarded by one AVOnce. This also avoids unnecessary duplications of the init code. Signed-off-by: Andreas Rheinhardt --- libavcodec/aacenc.c | 12 +---------- libavcodec/aactab.c | 52 +++++++++++++++++++++++++++++++++++++++++++++ libavcodec/aactab.h | 46 +-------------------------------------- 3 files changed, 54 insertions(+), 56 deletions(-) diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index bb203981b2..274e5ca294 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -30,7 +30,6 @@ ***********************************/ #include "libavutil/libm.h" -#include "libavutil/thread.h" #include "libavutil/float_dsp.h" #include "libavutil/opt.h" #include "avcodec.h" @@ -49,8 +48,6 @@ #include "psymodel.h" -static AVOnce aac_table_init = AV_ONCE_INIT; - static void put_pce(PutBitContext *pb, AVCodecContext *avctx) { int i, j; @@ -951,11 +948,6 @@ static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s) return 0; } -static av_cold void aac_encode_init_tables(void) -{ - ff_aac_tableinit(); -} - static av_cold int aac_encode_init(AVCodecContext *avctx) { AACEncContext *s = avctx->priv_data; @@ -1107,10 +1099,8 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) if (HAVE_MIPSDSP) ff_aac_coder_init_mips(s); - if ((ret = ff_thread_once(&aac_table_init, &aac_encode_init_tables)) != 0) - return AVERROR_UNKNOWN; - ff_af_queue_init(avctx, &s->afq); + ff_aac_tableinit(); return 0; } diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c index df551b058f..79dd13d9cb 100644 --- a/libavcodec/aactab.c +++ b/libavcodec/aactab.c @@ -28,7 +28,9 @@ */ #include "libavutil/mem.h" +#include "libavutil/thread.h" #include "aac.h" +#include "aactab.h" #include @@ -3280,3 +3282,53 @@ const DECLARE_ALIGNED(32, int, ff_aac_eld_window_480_fixed)[1800] = { 0xffecff1c, 0xffed391e, 0xffed740c, 0xffedafb1, 0xffedebe1, 0xffee287d, 0xffee654e, 0xffeea23f, }; + +static void aac_tableinit(void) +{ + /* 2^(i/16) for 0 <= i <= 15 */ + static const float exp2_lut[] = { + 1.00000000000000000000, + 1.04427378242741384032, + 1.09050773266525765921, + 1.13878863475669165370, + 1.18920711500272106672, + 1.24185781207348404859, + 1.29683955465100966593, + 1.35425554693689272830, + 1.41421356237309504880, + 1.47682614593949931139, + 1.54221082540794082361, + 1.61049033194925430818, + 1.68179283050742908606, + 1.75625216037329948311, + 1.83400808640934246349, + 1.91520656139714729387, + }; + float t1 = 8.8817841970012523233890533447265625e-16; // 2^(-50) + float t2 = 3.63797880709171295166015625e-12; // 2^(-38) + int t1_inc_cur, t2_inc_cur; + int t1_inc_prev = 0; + int t2_inc_prev = 8; + + for (int i = 0; i < 428; i++) { + t1_inc_cur = 4 * (i % 4); + t2_inc_cur = (8 + 3*i) % 16; + if (t1_inc_cur < t1_inc_prev) + t1 *= 2; + if (t2_inc_cur < t2_inc_prev) + t2 *= 2; + // A much more efficient and accurate way of doing: + // ff_aac_pow2sf_tab[i] = pow(2, (i - POW_SF2_ZERO) / 4.0); + // ff_aac_pow34sf_tab[i] = pow(ff_aac_pow2sf_tab[i], 3.0/4.0); + ff_aac_pow2sf_tab[i] = t1 * exp2_lut[t1_inc_cur]; + ff_aac_pow34sf_tab[i] = t2 * exp2_lut[t2_inc_cur]; + t1_inc_prev = t1_inc_cur; + t2_inc_prev = t2_inc_cur; + } +} + +void ff_aac_tableinit(void) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + ff_thread_once(&init_static_once, aac_tableinit); +} diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h index 29df6a43f0..ce6a7ba1d2 100644 --- a/libavcodec/aactab.h +++ b/libavcodec/aactab.h @@ -42,51 +42,7 @@ extern float ff_aac_pow2sf_tab[428]; extern float ff_aac_pow34sf_tab[428]; -static inline void ff_aac_tableinit(void) -{ - int i; - - /* 2^(i/16) for 0 <= i <= 15 */ - static const float exp2_lut[] = { - 1.00000000000000000000, - 1.04427378242741384032, - 1.09050773266525765921, - 1.13878863475669165370, - 1.18920711500272106672, - 1.24185781207348404859, - 1.29683955465100966593, - 1.35425554693689272830, - 1.41421356237309504880, - 1.47682614593949931139, - 1.54221082540794082361, - 1.61049033194925430818, - 1.68179283050742908606, - 1.75625216037329948311, - 1.83400808640934246349, - 1.91520656139714729387, - }; - float t1 = 8.8817841970012523233890533447265625e-16; // 2^(-50) - float t2 = 3.63797880709171295166015625e-12; // 2^(-38) - int t1_inc_cur, t2_inc_cur; - int t1_inc_prev = 0; - int t2_inc_prev = 8; - - for (i = 0; i < 428; i++) { - t1_inc_cur = 4 * (i % 4); - t2_inc_cur = (8 + 3*i) % 16; - if (t1_inc_cur < t1_inc_prev) - t1 *= 2; - if (t2_inc_cur < t2_inc_prev) - t2 *= 2; - // A much more efficient and accurate way of doing: - // ff_aac_pow2sf_tab[i] = pow(2, (i - POW_SF2_ZERO) / 4.0); - // ff_aac_pow34sf_tab[i] = pow(ff_aac_pow2sf_tab[i], 3.0/4.0); - ff_aac_pow2sf_tab[i] = t1 * exp2_lut[t1_inc_cur]; - ff_aac_pow34sf_tab[i] = t2 * exp2_lut[t2_inc_cur]; - t1_inc_prev = t1_inc_cur; - t2_inc_prev = t2_inc_cur; - } -} +void ff_aac_tableinit(void); /* @name ltp_coef * Table of the LTP coefficients From patchwork Fri Nov 20 07:33:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23895 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 3CC84448F1E for ; Fri, 20 Nov 2020 09:52:42 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2777E68BD94; Fri, 20 Nov 2020 09:35:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C0AF668BD55 for ; Fri, 20 Nov 2020 09:34:49 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id f23so11549834ejk.2 for ; Thu, 19 Nov 2020 23:34:49 -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=9qPcwxVR3qUgm3RJMg3kInFhOR9o6oNDuubVshH/XSs=; b=T1T5GJx65ignGgfAJXFJEjXQOZanUiUq2F/goTBO7vDljgdxwy/6D2Zm5RRRYEbwyN +H6oqS7ka208riSFUzPzufCdCBqKS9qog4M5VYN/y5CLGkyVa96xLSpbwWbkYNkrmowA B9iWQ8rr1DqL7W0Yu44RodjboVXKcqF9V5BD6Jxw5P5VBYx+DNngPgErof4nqWW3/VFU v6YJUH5jdgtCKrUawRR12ijsxMy6S3/xX9H035zMg7eg0UTJ1um/Kq3uDRTm5rGuXB4/ z+EnrEyuRv1CL0hiB8wzwCQTPRqzlQpAijk6AqJSg9rX6K253dQmpjX3f7fRkPts3d93 NHIg== 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=9qPcwxVR3qUgm3RJMg3kInFhOR9o6oNDuubVshH/XSs=; b=ciiseGpjV3lzc5IOmr6ht3WEziDz3mcl9ER6EBz4T8lyPANj+2Sjmz2lmnZHvEqMHI GOQd4YbVeNCFDPlqJW4hH3RvUFMK16gXmvCxtyBJEAAm+38Rl2CTDd9UhvrP3VcbmDjv 2DCoKHh/m7YF7HF3HxDhDrtLbic5VJZvnkfVpfmKlq8w0DMWz4qvkSGawMj80O/W883A uHKm9MkC744U/Ns3zfxoshiu4dMtSkP1fBAcWZgnmypmanFh3wu9ktews1b6+HqV2D2/ iOsNpDRoDD3MwIfJKQmxUh3sUmM8WgpTTwsHFOBvDkDFjqQj8OZqbHg/FFkydzB9IjOu UEjQ== X-Gm-Message-State: AOAM533lZQggbTvEogoO1U8n12hvOHpXx3cOZTPot4QEMY+UbdQpALxv oaCWyhn6jfixwIHXhdjxKCrsA6/1uqE/1Q== X-Google-Smtp-Source: ABdhPJzgrUWE7QEcW9VDbOQNl+r+qqV/GXPTeFZWkG/BUHFcx9QJn3ZpGr10HKy3gzDukDzvgXl3vg== X-Received: by 2002:a17:906:b292:: with SMTP id q18mr31022179ejz.93.1605857689087; Thu, 19 Nov 2020 23:34:49 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:48 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:09 +0100 Message-Id: <20201120073327.820745-45-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 144/162] avcodec/imm4: Don't use too big VLC 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" Using more bits than the longest code has makes no sense. Signed-off-by: Andreas Rheinhardt --- libavcodec/imm4.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c index d92bc30ddc..85d8526bc8 100644 --- a/libavcodec/imm4.c +++ b/libavcodec/imm4.c @@ -33,6 +33,8 @@ #include "idctdsp.h" #include "internal.h" +#define CBPLO_VLC_BITS 6 + typedef struct IMM4Context { BswapDSPContext bdsp; GetBitContext gb; @@ -488,8 +490,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, static av_cold void imm4_init_static_data(void) { - INIT_VLC_SPARSE_STATIC(&cbplo_tab, 9, FF_ARRAY_ELEMS(cbplo_bits), - cbplo_bits, 1, 1, cbplo_codes, 1, 1, cbplo_symbols, 1, 1, 512); + INIT_VLC_SPARSE_STATIC(&cbplo_tab, CBPLO_VLC_BITS, FF_ARRAY_ELEMS(cbplo_bits), + cbplo_bits, 1, 1, cbplo_codes, 1, 1, cbplo_symbols, 1, 1, + 1 << CBPLO_VLC_BITS); INIT_VLC_SPARSE_STATIC(&cbphi_tab, 6, FF_ARRAY_ELEMS(cbphi_bits), cbphi_bits, 1, 1, cbphi_codes, 1, 1, NULL, 0, 0, 64); From patchwork Fri Nov 20 07:33:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23896 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 3757E448F1E for ; Fri, 20 Nov 2020 09:52:53 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C13968BCED; Fri, 20 Nov 2020 09:35:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0E97868BCB9 for ; Fri, 20 Nov 2020 09:34:51 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id gj5so11528040ejb.8 for ; Thu, 19 Nov 2020 23:34:50 -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=aYiSF4BwyQIXylqnfNh/iAtGGmNSt2ok2sUiyVCAzvw=; b=iaSbPZbX9CHqMxL4LBHBXCF1KcI1s+A9YszL9C2XfLAZs77UpqllY6rse+7JixCoyl C7dMpYIIoFRtVgVmZxQU+5QYTh4Yh617W+iIW5ZN24t/9QsH5x0OWGKaLkS/Wh9YUvhO PWXSacYRGOyIojNZCMqfPo4O1ZL8zr1dlMfvIbmGXyMV9QUw57cmiKzLUYy76WcSgxIu QH2uP9OTu9QxBSC0lzp9t0vIw6yTbIarwpgO0asex9dduxP6p6cjTezHYiaLWP6bjpDS ZByHbfsJF/c7B/LgWTLIWttzKDtsjr4GS182+uNDmqhH/1LfkTD+0r17UBmobhA42ii+ 5TKA== 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=aYiSF4BwyQIXylqnfNh/iAtGGmNSt2ok2sUiyVCAzvw=; b=fXL7t3g9X6JNIuYf72o8vVYLMnqqce5oBLgbGkswU4KE3agU8Q5UX3tOD8+dEO1HFp boswtpA/ydevhb41vRA2svG9N6y+iuyEffLnYjYs7UByDITdfc8sTfMh3JpA88eOQe1F fReZP7O3yVbmAIATjYhmOD7QF7JkJuLeFT9vXIIufjZUUNCZJyao32qFyCcXrG4cUvHn YTdh2C7mGihUgop45HVoeNdZV7rmPsG9qlgz4F3xQ8FOmSnKRwJnieRINlicpH6mqUyQ W2QBcfodJ3dNC9DYxtnO9EfdKFXulc318vxTPjRu2m62/8G5ikigZTHu8rq30yguFHdi Z0JQ== X-Gm-Message-State: AOAM532iC2s/+gRP+YJ2Dnl1S6WqWksf3+HWr33Hgqc8EDpFZgkxBCXF I0NJnwR5WXyySo43Lyj2Ac9buknPUq+Yqg== X-Google-Smtp-Source: ABdhPJwB6tLXfjQe/wyWxNwCWQsXDWrCMt07QHv+jpbLbcdxvk6l+2CW/GEe/B6uS0Dq1P1myOfrlQ== X-Received: by 2002:a17:906:3ac4:: with SMTP id z4mr31662444ejd.92.1605857690194; Thu, 19 Nov 2020 23:34:50 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:49 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:10 +0100 Message-Id: <20201120073327.820745-46-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 145/162] avcodec/imm4: Make better use of symbols 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" Also inline the VLC's number of bits while at it. Signed-off-by: Andreas Rheinhardt --- libavcodec/imm4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c index 85d8526bc8..85046f7d06 100644 --- a/libavcodec/imm4.c +++ b/libavcodec/imm4.c @@ -61,7 +61,7 @@ static const uint8_t inter_cb[] = { }; static const uint8_t cbplo_symbols[] = { - 3, 4, 19, 20, 35, 36, 51, 52 + 0, 0, 1, 1, 2, 2, 3, 3 }; static const uint8_t cbplo_bits[] = { @@ -236,7 +236,7 @@ static int decode_intra(AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame for (x = 0; x < avctx->width; x += 16) { unsigned flag, cbphi, cbplo; - cbplo = get_vlc2(gb, cbplo_tab.table, cbplo_tab.bits, 1) >> 4; + cbplo = get_vlc2(gb, cbplo_tab.table, CBPLO_VLC_BITS, 1); flag = get_bits1(gb); cbphi = get_cbphi(gb, 1); From patchwork Fri Nov 20 07:33:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23897 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 40C4B448F1E for ; Fri, 20 Nov 2020 09:53:04 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6BC4668BD9F; Fri, 20 Nov 2020 09:35:02 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0EBC768BD42 for ; Fri, 20 Nov 2020 09:34:52 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id i19so11501529ejx.9 for ; Thu, 19 Nov 2020 23:34:51 -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=9RfhEhuBwmEjddjS68NRpx81+0Fd5EbuZvqsO6o2D7Y=; b=tXAviAjlansRFJDNwzhrqKgjDeUAjkk1u0wrXccS8zL8lUMHlF3kfpc2flyxWy+7or IclRgekMW1WRQvYGGbOaeQ65+jQvwKC3fGI15kVTtbpv+DFoAuj4PTWt/CTjhNTOxm/l RGU2sU0r5W477euuz5/lpxnxB/EKzss3/kTdXQTTVvflqZm+8hpGAPkD/TjmiCaTmM0F hiwI2in7D5NJdg1AF5U6bmex4f9ykoT8XtEp+sVxPpw2xnHN7TzkApyJQkFSd5A1GJHJ t+hheh55P55dIU4O7KyS74nS3Tz1h9iOIxYfzCiY0poy4ElJVfWB1FJvS62C73g0RGLB EV9Q== 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=9RfhEhuBwmEjddjS68NRpx81+0Fd5EbuZvqsO6o2D7Y=; b=Cl8p/KhQfFA67KUpr6/zoRioorNLmhoiHPj2Eq6CWgLwGwQ+M9bAD7X2E/2jUKJfzr DTX5ZmIk48m6XMd4E5umu1F8tD21JxiJTNd6nWJCQz5tIV4eovtZ6n1dwxk6Ow/MQKUI KOWb78bo8tzCP0VGwK75l1eavqGTaAa9kDayC3NAXbTWcfqy22tRZSXxgfrx0q2bR17r EO4QMlXlrjrJYfT6v1IWkY4gRyPRG4MhXnNJD6xfxzRP5rM7cNTYufNnt7SmGIO/2UDr KI+dIWojseXoiagZzbt4ARC0/ouPQcx7Pk5FrQI1GfzvpLXC9supEKtS8JKoTltuFazX 4CMw== X-Gm-Message-State: AOAM532XGdwZ17y5xbYlhzK17prLwbZ+QJrkSuQduStvdAOB/PdllEtr PjXgGdeHvE4tUNhOpewBsWSyYrJv84oV8w== X-Google-Smtp-Source: ABdhPJzLt8S6P+6T6J3/4A06P/shSfLECmWQtMrbNbmrprwGy6+FaN8VmSTB+TkYTDgG0y30yX0K+A== X-Received: by 2002:a17:906:9448:: with SMTP id z8mr9485107ejx.105.1605857691086; Thu, 19 Nov 2020 23:34:51 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:50 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:11 +0100 Message-Id: <20201120073327.820745-47-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 146/162] avcodec/imm4: Reduce the size of tables used to initialize 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" By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one can remove arrays of codes in cases where there were already symbols tables. Signed-off-by: Andreas Rheinhardt --- libavcodec/imm4.c | 90 ++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 52 deletions(-) diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c index 85046f7d06..cee8e39773 100644 --- a/libavcodec/imm4.c +++ b/libavcodec/imm4.c @@ -34,6 +34,8 @@ #include "internal.h" #define CBPLO_VLC_BITS 6 +#define BLKTYPE_VLC_BITS 9 +#define BLOCK_VLC_BITS 12 typedef struct IMM4Context { BswapDSPContext bdsp; @@ -60,16 +62,9 @@ static const uint8_t inter_cb[] = { 30, 20, 15 }; -static const uint8_t cbplo_symbols[] = { - 0, 0, 1, 1, 2, 2, 3, 3 -}; - -static const uint8_t cbplo_bits[] = { - 1, 4, 3, 6, 3, 6, 3, 6 -}; - -static const uint8_t cbplo_codes[] = { - 1, 1, 1, 1, 2, 2, 3, 3 +static const uint8_t cbplo[][2] = { + { 0,-6 }, { 0x01, 6 }, { 0x02, 6 }, { 0x03, 6 }, { 0x00, 4 }, + { 0x01, 3 }, { 0x02, 3 }, { 0x03, 3 }, { 0x00, 1 }, }; static const uint8_t cbphi_bits[] = { @@ -80,47 +75,36 @@ static const uint8_t cbphi_codes[] = { 3, 5, 4, 9, 3, 7, 2, 11, 2, 3, 5, 10, 4, 8, 6, 3 }; -static const uint8_t blktype_symbols[] = { - 0, 1, 2, 3, 4, 16, 17, 18, 19, 20, 32, 33, 34, 35, 48, 50, 51, 52 -}; - -static const uint8_t blktype_bits[] = { - 1, 3, 3, 5, 6, 4, 7, 7, 8, 9, 4, 7, 7, 8, 6, 8, 7, 9 -}; - -static const uint8_t blktype_codes[] = { - 1, 3, 2, 3, 4, 3, 7, 5, 4, 4, 2, 6, 4, 3, 5, 5, 3, 2 +static const uint8_t blktype[][2] = { + { 0,-8 }, { 0x34, 9 }, { 0,-9 }, { 0x14, 9 }, { 0,-9 }, + { 0x23, 8 }, { 0x13, 8 }, { 0x32, 8 }, { 0x33, 7 }, { 0x22, 7 }, + { 0x12, 7 }, { 0x21, 7 }, { 0x11, 7 }, { 0x04, 6 }, { 0x30, 6 }, + { 0x03, 5 }, { 0x20, 4 }, { 0x10, 4 }, { 0x02, 3 }, { 0x01, 3 }, + { 0x00, 1 }, }; static const uint16_t block_symbols[] = { - 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0x81, 0x82, 0x83, - 0x84, 0x85, 0x86, 0x101, 0x102, 0x103, 0x104, 0x181, 0x182, 0x183, 0x201, 0x202, - 0x203, 0x281, 0x282, 0x283, 0x301, 0x302, 0x303, 0x381, 0x382, 0x401, 0x402, - 0x481, 0x482, 0x501, 0x502, 0x581, 0x601, 0x681, 0x701, 0x781, 0x801, 0x881, - 0x901, 0x981, 0xA01, 0xA81, 0xB01, 0xB81, 0xC01, 0xC81, 0xD01, 0x4001, 0x4002, - 0x4003, 0x4081, 0x4082, 0x4101, 0x4181, 0x4201, 0x4281, 0x4301, 0x4381, 0x4401, - 0x4481, 0x4501, 0x4581, 0x4601, 0x4681, 0x4701, 0x4781, 0x4801, 0x4881, 0x4901, - 0x4981, 0x4A01, 0x4A81, 0x4B01, 0x4B81, 0x4C01, 0x4C81, 0x4D01, 0x4D81, 0x4E01, - 0x4E81, 0x4F01, 0x4F81, 0x5001, 0x5081, 0x5101, 0x5181, 0x5201, 0x5281, 0x5301, - 0x5381, 0x5401 + 0, 0x4082, 0x4003, 0x000B, 0x000A, 0x4E01, 0x4D81, 0x4D01, 0x4C81, + 0x0482, 0x0402, 0x0382, 0x0302, 0x0282, 0x0183, 0x0103, 0x0084, 0x000C, + 0x0085, 0x0B81, 0x0C01, 0x4E81, 0x4F01, 0x4F81, 0x5001, 0x0086, 0x0104, + 0x0203, 0x0283, 0x0303, 0x0502, 0x0C81, 0x0D01, 0x5081, 0x5101, 0x5181, + 0x5201, 0x5281, 0x5301, 0x5381, 0x5401, 0x0000, 0x0009, 0x0008, 0x4C01, + 0x4B81, 0x4B01, 0x4A81, 0x4A01, 0x4981, 0x4901, 0x4881, 0x4002, 0x0B01, + 0x0A81, 0x0A01, 0x0981, 0x0901, 0x0881, 0x0801, 0x0781, 0x0202, 0x0182, + 0x0007, 0x0006, 0x4801, 0x4781, 0x4701, 0x4681, 0x4601, 0x4581, 0x4501, + 0x4481, 0x0701, 0x0681, 0x0102, 0x0083, 0x0005, 0x4401, 0x4381, 0x4301, + 0x4281, 0x0601, 0x0581, 0x0501, 0x0004, 0x4201, 0x4181, 0x4101, 0x4081, + 0x0481, 0x0401, 0x0381, 0x0301, 0x0082, 0x0003, 0x0281, 0x0201, 0x0181, + 0x4001, 0x0001, 0x0081, 0x0101, 0x0002, }; static const uint8_t block_bits[] = { - 7, 2, 4, 6, 7, 8, 9, 9, 10, 10, 11, 11, 11, 3, 6, 8, 10, 11, 12, 4, 8, - 10, 12, 5, 9, 10, 5, 9, 12, 5, 10, 12, 6, 10, 12, 6, 10, 6, 10, 6, - 10, 7, 12, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 12, 12, 4, 9, - 11, 6, 11, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, - 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, - 12, 12 -}; - -static const uint8_t block_codes[] = { - 3, 2, 15, 21, 23, 31, 37, 36, 33, 32, 7, 6, 32, 6, 20, 30, 15, 33, 80, - 14, 29, 14, 81, 13, 35, 13, 12, 34, 82, 11, 12, 83, 19, 11, 84, 18, - 10, 17, 9, 16, 8, 22, 85, 21, 20, 28, 27, 33, 32, 31, 30, 29, 28, - 27, 26, 34, 35, 86, 87, 7, 25, 5, 15, 4, 14, 13, 12, 19, 18, 17, 16, - 26, 25, 24, 23, 22, 21, 20, 19, 24, 23, 22, 21, 20, 19, 18, 17, 7, - 6, 5, 4, 36, 37, 38, 39, 88, 89, 90, 91, 92, 93, 94, 95 + -9, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, + 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 7, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 5, 5, 5, 4, 2, 3, 4, 4, }; static VLC cbplo_tab; @@ -490,18 +474,20 @@ static int decode_frame(AVCodecContext *avctx, void *data, static av_cold void imm4_init_static_data(void) { - INIT_VLC_SPARSE_STATIC(&cbplo_tab, CBPLO_VLC_BITS, FF_ARRAY_ELEMS(cbplo_bits), - cbplo_bits, 1, 1, cbplo_codes, 1, 1, cbplo_symbols, 1, 1, - 1 << CBPLO_VLC_BITS); + INIT_VLC_STATIC_FROM_LENGTHS(&cbplo_tab, CBPLO_VLC_BITS, FF_ARRAY_ELEMS(cbplo), + &cbplo[0][1], 2, &cbplo[0][0], 2, 1, + 0, 0, 1 << CBPLO_VLC_BITS); INIT_VLC_SPARSE_STATIC(&cbphi_tab, 6, FF_ARRAY_ELEMS(cbphi_bits), cbphi_bits, 1, 1, cbphi_codes, 1, 1, NULL, 0, 0, 64); - INIT_VLC_SPARSE_STATIC(&blktype_tab, 9, FF_ARRAY_ELEMS(blktype_bits), - blktype_bits, 1, 1, blktype_codes, 1, 1, blktype_symbols, 1, 1, 512); + INIT_VLC_STATIC_FROM_LENGTHS(&blktype_tab, BLKTYPE_VLC_BITS, FF_ARRAY_ELEMS(blktype), + &blktype[0][1], 2, &blktype[0][0], 2, 1, + 0, 0, 1 << BLKTYPE_VLC_BITS); - INIT_VLC_SPARSE_STATIC(&block_tab, 12, FF_ARRAY_ELEMS(block_bits), - block_bits, 1, 1, block_codes, 1, 1, block_symbols, 2, 2, 4096); + INIT_VLC_STATIC_FROM_LENGTHS(&block_tab, BLOCK_VLC_BITS, FF_ARRAY_ELEMS(block_bits), + block_bits, 1, block_symbols, 2, 2, + 0, 0, 1 << BLOCK_VLC_BITS); } static av_cold int decode_init(AVCodecContext *avctx) From patchwork Fri Nov 20 07:33:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23898 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 E0191449F1B for ; Fri, 20 Nov 2020 09:53:15 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 575B968BD99; Fri, 20 Nov 2020 09:35:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 12E4068BD7E for ; Fri, 20 Nov 2020 09:34:53 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id bo9so5777167ejb.13 for ; Thu, 19 Nov 2020 23:34:53 -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=7ucOcmKFVcPewOXCLKh4air0ydHCJsbwaonjXx6AJzQ=; b=YbymncsyQXU+cLfTIe75bbdjhsGTO/2EyXs3Or3A2jdElMEZH5JjkR7SHjXXCRmDSK bn/xNSUz05hdl4Z8i20U1V30beFZ+2iqreCz9Id50rLrmqXD6VtKvF1VgH8y0zCAb2tv BC6vkwsljCl3KZHWQVuB/Jce8CKNScK1X5vC/OiQcGEHcL3RwGnYH7DHRLU8tE70dqAc /OGjb22LzrGl6MAWn69YkE89HXgUX1WZI39lwNYD2hHKo8DGfkz7w2azFvZkpNGTyskN /UUKxZTVvRiWPTiNB+KnhjpyOh5alBNAh7WBhjtFUt77zSoN7WEzqCJUIqTtXCaOUEBv 0fCg== 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=7ucOcmKFVcPewOXCLKh4air0ydHCJsbwaonjXx6AJzQ=; b=Ojruv4NzMuq1XOQYNq9uh9ZOCMrm2tEsQnbqj3aCyQwBwC7ieHWNbXOGtTBMbt+mRN UB3ylIHdxkWK1tuTD807D1d8zslJYDp4bcctdTNUBonsLkj2uW7tU5olIMNySKr/1yOj +vr0oqQFAaBWm/i3XbvmKzNbPtnuneTcheZZuSEkxjSUQTOP2SqOfN4NN2ol1aCgG2EP zGkrmm1AAJXZqegSD9zPFT4beH4HfRcA0WvX1F+bmpj8j35VOdZy7L93y3ON9nCypdbg vPOgepvbyI9cG+lX0mLrSk8YKdsEfnvcaD+LiAifUv3h6zA0lWI9Vg/p/TV2cK3wFG5r UhkA== X-Gm-Message-State: AOAM531yKpdGghNaQ9LvRndRywdP/kpsLsZf/bb4hO66ORvSTHYyu1n1 4jiuwU0wik1exJ8Vd3UA6fsmXdfZqp/7VA== X-Google-Smtp-Source: ABdhPJxdJA3e1Df2iZppu2y5ZU4W3QTdl8bVF/XYmYT3XATa/2lie9nvFX5mJYWO1vFWYaKJvVTZ+g== X-Received: by 2002:a17:906:3153:: with SMTP id e19mr5461726eje.17.1605857692260; Thu, 19 Nov 2020 23:34:52 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:51 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:12 +0100 Message-Id: <20201120073327.820745-48-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 147/162] avcodec/imm4: Inline constants 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/imm4.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c index cee8e39773..4cbafffd9d 100644 --- a/libavcodec/imm4.c +++ b/libavcodec/imm4.c @@ -34,6 +34,7 @@ #include "internal.h" #define CBPLO_VLC_BITS 6 +#define CBPHI_VLC_BITS 6 #define BLKTYPE_VLC_BITS 9 #define BLOCK_VLC_BITS 12 @@ -116,7 +117,7 @@ static int get_cbphi(GetBitContext *gb, int x) { int value; - value = get_vlc2(gb, cbphi_tab.table, cbphi_tab.bits, 1); + value = get_vlc2(gb, cbphi_tab.table, CBPHI_VLC_BITS, 1); if (value < 0) return AVERROR_INVALIDDATA; @@ -133,7 +134,7 @@ static int decode_block(AVCodecContext *avctx, GetBitContext *gb, for (i = !flag; i < 64; i++) { int value; - value = get_vlc2(gb, block_tab.table, block_tab.bits, 1); + value = get_vlc2(gb, block_tab.table, BLOCK_VLC_BITS, 1); if (value < 0) return AVERROR_INVALIDDATA; if (value == 0) { @@ -286,7 +287,7 @@ static int decode_inter(AVCodecContext *avctx, GetBitContext *gb, continue; } - value = get_vlc2(gb, blktype_tab.table, blktype_tab.bits, 1); + value = get_vlc2(gb, blktype_tab.table, BLKTYPE_VLC_BITS, 1); if (value < 0) return AVERROR_INVALIDDATA; @@ -478,7 +479,7 @@ static av_cold void imm4_init_static_data(void) &cbplo[0][1], 2, &cbplo[0][0], 2, 1, 0, 0, 1 << CBPLO_VLC_BITS); - INIT_VLC_SPARSE_STATIC(&cbphi_tab, 6, FF_ARRAY_ELEMS(cbphi_bits), + INIT_VLC_SPARSE_STATIC(&cbphi_tab, CBPHI_VLC_BITS, FF_ARRAY_ELEMS(cbphi_bits), cbphi_bits, 1, 1, cbphi_codes, 1, 1, NULL, 0, 0, 64); INIT_VLC_STATIC_FROM_LENGTHS(&blktype_tab, BLKTYPE_VLC_BITS, FF_ARRAY_ELEMS(blktype), From patchwork Fri Nov 20 07:33:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23899 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 D18E4449F1B for ; Fri, 20 Nov 2020 09:53:26 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 13CA168BDB2; Fri, 20 Nov 2020 09:35:06 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E63FB68BD6A for ; Fri, 20 Nov 2020 09:34:53 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id k27so11482756ejs.10 for ; Thu, 19 Nov 2020 23:34:53 -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=JgKFA0xF7WAmrcmdwFSTSz7+n282KkiF/n31i5DfQ44=; b=hkibbUIdCzkxSkkxyWPdKgKdaE0QR8pRawCZkJuniG7TfQt/eebWovIL8BGz2NcChy u5PIr5JP0Gyb4kfFL5av4bbMtJWw1LehcUAYVUGJgGBX5IzvZ+/YCkY55duMthm53jtp NRBPMujKezo37F7cqLkaL+vMbxmP7650rvEZOsnZyxOVGDzDD3kB8OVFeaBLlvq38Uyk OrL+o92JD+Ig5Bdhwmo+OUVtUOfNpTQbj9QOMHg/mDX13aBGUZtVYezzvg7BZ5ljuSP8 xrxL2h6bn60QG5WW9oSHW6sKyjAdXzr7hOTe509rSXnjBWwKZZeEawQndh8V9Pd9RLu7 32dQ== 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=JgKFA0xF7WAmrcmdwFSTSz7+n282KkiF/n31i5DfQ44=; b=SqY/0CIdJdM92cEFQHgeTxRtBoDBLWnKLRd7eh1TwJ7ajb7edhxqRVaswDh12P+W1V RQSEhrs+DbnJ6ePsnmobR8tFbGZYYunu8lXHyc260d9Fvgk8Cp35r7Kf57eZtc1ymu1/ BJdWBa1kUIeoQ1B/GrHxKI8WdUEShDpsceNnfIUfPTQez0jQLyqG8ULbVdhcBQ1um+Lr VuM7suT2q8qpxaPvrORWBXOJQofBXGqQ+H3Z9kuRVss85qbSRS2VMJ10Po/22vxQDmqK 9DrT4/5MHMPAKZyxLtVfHIBVfln/tPM8Gqf4AbeAVr8F0qK1+tqtLeE6Dh1M3nqLsK6Y Voqw== X-Gm-Message-State: AOAM532NpHkG2qWXjmNMHi/T5GRZ20Dw2XXW4SWSGgw4A30SWzxHemKD dJNDXjwK202kXZFE+kTvmclExDVwM2fGmg== X-Google-Smtp-Source: ABdhPJxyNhT4kmpv0RRiAJ0Z6Z0IgABQg3aGcIYyHlJz1YSeAaeVtiKB05Er341nFB8cgsG0Y6wl7A== X-Received: by 2002:a17:906:77c5:: with SMTP id m5mr32237806ejn.424.1605857693147; Thu, 19 Nov 2020 23:34:53 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:52 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:13 +0100 Message-Id: <20201120073327.820745-49-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 148/162] avcodec/mv30: Don't check for errors for complete 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/mv30.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c index 9f28199478..5bfe4b0614 100644 --- a/libavcodec/mv30.c +++ b/libavcodec/mv30.c @@ -379,9 +379,6 @@ static int decode_coeffs(GetBitContext *gb, int16_t *coeffs, int nb_codes) for (int i = 0; i < nb_codes;) { int value = get_vlc2(gb, cbp_tab.table, cbp_tab.bits, 1); - if (value < 0) - return AVERROR_INVALIDDATA; - if (value > 0) { int x = get_bits(gb, value); From patchwork Fri Nov 20 07:33:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23900 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 7E79F449F1B for ; Fri, 20 Nov 2020 09:53:37 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 13D3068BD65; Fri, 20 Nov 2020 09:35:07 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 13AF068BD4C for ; Fri, 20 Nov 2020 09:34:54 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id s25so11525748ejy.6 for ; Thu, 19 Nov 2020 23:34:54 -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=NO94hvtgm9AmBChvVz/OOYUNNS89wDGoGuSgJgOiQIg=; b=k4v3eJu87iZ4eQ5dS2zf5Y8zfzifioRHkLNa9XTmwAokhrCIo7FFOrxo+RuUVuzNws GmdAAuDWN03yuMbi3gTXrfIO32oDy1ig8J0wE7Q4ov2LVShENBKA3yDwG+EyM/Mrhmlp uBqZnDLI/lrGqqcWEh90gf9qaRap361fdk15UHHgfdI+6f/nUGAlmMTvdREdMbhhXGRf FigYHBCDlZTUFVNUTTOepmA/P3kQbH8hVgV4W+L+eqU9t+pu/ETzt0/sENRJDrTqg1gC cvqiEe+uhd1DWTp3fvyzmhQyr1AaUpFRzTUw3Im/es1mg1/L2xCNbZZ2hVWqSaypcpWe acPA== 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=NO94hvtgm9AmBChvVz/OOYUNNS89wDGoGuSgJgOiQIg=; b=OGwaMef5Yk65nX5MD8Vp+KsHd9mdoKus7/scqQx9Xi8mb9IC13mPqQd/gmzD39RHhD cNWK7bS4GXJOQpkNgmsoQt0CaMLYnl5IOtH101troNdkmGAypTsNVE+MufwQzfwbgfrM DbDoFLpbPDRMpZ588qDRLjJ1M0lxnEnhS3MEM4YjpnR1P9UaLHgGc6DGTGrDzK+ur5Le CqqJuFkYY11/bQmWl6eLo8yEcDH6r/LHfVV9dhiyutl5rtLeUysuXYrFN7Iz0GdiaRkh 3FAAGfBdN2yT1SmR758zOlHRHD7UegLX3p3CTAW7iO2rAPK5PtcMQpM5PzzwNq9N+Wb1 r7JA== X-Gm-Message-State: AOAM533GXSaxSrhgmx2UwL5LBtlw5eNKDIqXJuOgAX/Esn3ot+Bw2T0B 4CqzZkjdcXUUhbLuq34IobF3AQQnpWkK9A== X-Google-Smtp-Source: ABdhPJwfczRxCz/ALW3NaOZvnRdZxYamyS1op5lJeDKJzO5IvbvI2wfMCDMme621N/LlhoobFQuy/w== X-Received: by 2002:a17:906:ce2a:: with SMTP id sd10mr13482603ejb.21.1605857694140; Thu, 19 Nov 2020 23:34:54 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:53 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:14 +0100 Message-Id: <20201120073327.820745-50-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 149/162] avcodec/mv30: Reduce the size of tables used to initialize 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" By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one can remove the array of codes of type uint16_t here; given that the symbols are the default ones (0,1,2,...), no explicit symbols table needs to be added. Signed-off-by: Andreas Rheinhardt --- libavcodec/mv30.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c index 5bfe4b0614..1ee6be0c99 100644 --- a/libavcodec/mv30.c +++ b/libavcodec/mv30.c @@ -35,6 +35,8 @@ #include "internal.h" #include "aandcttab.h" +#define CBP_VLC_BITS 9 + typedef struct MV30Context { GetBitContext gb; @@ -651,18 +653,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -static const uint16_t cbp_codes[] = { - 0, 1, 4, 5, 6, 0xE, 0x1E, 0x3E, 0x7E, 0xFE, 0x1FE, 0x1FF, -}; - static const uint8_t cbp_bits[] = { 2, 2, 3, 3, 3, 4, 5, 6, 7, 8, 9, 9, }; static av_cold void init_static_data(void) { - INIT_VLC_SPARSE_STATIC(&cbp_tab, 9, FF_ARRAY_ELEMS(cbp_bits), - cbp_bits, 1, 1, cbp_codes, 2, 2, NULL, 0, 0, 512); + INIT_VLC_STATIC_FROM_LENGTHS(&cbp_tab, CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_bits), + cbp_bits, 1, NULL, 0, 0, 0, 0, 1 << CBP_VLC_BITS); } static av_cold int decode_init(AVCodecContext *avctx) From patchwork Fri Nov 20 07:33:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23901 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 5897D449F1B for ; Fri, 20 Nov 2020 09:53:48 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1059968BDB6; Fri, 20 Nov 2020 09:35:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DF05668BD73 for ; Fri, 20 Nov 2020 09:34:55 +0200 (EET) Received: by mail-ed1-f48.google.com with SMTP id q16so8483845edv.10 for ; Thu, 19 Nov 2020 23:34:55 -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=ml2WY5tF9bKXemOvRtiIK9yAH+PnEsfwHigRA7agPGU=; b=Cn6Lfwe9sfn56KYWUo73qTNeIop85AjgWKwl4mN56jlHUYO/6zMUZUAPXRQj2gwrFB SiQ/5r4Fteu7PTVf1L1MwJsPOhkOIOn0vav666PB/rqHwJIrb04Tt7LDvOPuJscT+v70 HMURcntO6eyTP6lyQDuXF0RqYtofanG28x4aHOzLqzZfNZ1SMUQUNSfD0hM6jybFdXEE NciUUuzNEPLPkdECdg5J225ZoRlSGEbI0tCkS4B/YDa/VR2Pus1VMXn9tf8I+dkFexq2 HTzKwBS/swBH9GyJk/HUiC8gCn0oIIHxrlPXN8xuCvPixLChpDESqxqzJAd7clcJF21A PAvA== 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=ml2WY5tF9bKXemOvRtiIK9yAH+PnEsfwHigRA7agPGU=; b=bkagT8GQrhkHkq3/I5JAjpFY9JXk/fNwaqnp5RJRKzV7rpLTuRPd8UZQFKGoz4ANMo Wns5g6qoKyYHrC3gTk5fFHpVvLzzR/SRb9ONjgd431TEKmeiSW/mwsSm5sTdGdqnO4wB WRH6Ck5KymLFli245HfLHK8AyXZ2qApJhXOXDcBxF/E1Md+3DvMa3uV/iChNxLt9Os9x yVnwQF+PAnaD6It2VqaZAH/gaTK0sgPNnK1OuUpIlAwfVV44RgJivQKWx7iT1cCDWQ8Z aErU71NqICkROM7ZHgvIJ7Nx+oJz1oCwfvwNJdyphuh8Jw4URBIICqGsP+ZxicYa17zJ 3ypg== X-Gm-Message-State: AOAM533n38iOKFBW6YnUTqdcIyUvORFcgNthUy9uc69rk8wIIP2wDKVp TFoyogjTgvm0EIr4yD5tabbqRoqO++Wcdw== X-Google-Smtp-Source: ABdhPJxLu7bk/DL4FC/5VdGb0xpp2HDtO1iMkn5RieCVGJgE0Gack54vi5KOiAY6EUc2mHVbFl30KQ== X-Received: by 2002:a50:bb06:: with SMTP id y6mr35898346ede.278.1605857695154; Thu, 19 Nov 2020 23:34:55 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:54 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:15 +0100 Message-Id: <20201120073327.820745-51-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 150/162] avcodec/mv30: Inline constants 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/mv30.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c index 1ee6be0c99..0894a4f88d 100644 --- a/libavcodec/mv30.c +++ b/libavcodec/mv30.c @@ -379,7 +379,7 @@ static int decode_coeffs(GetBitContext *gb, int16_t *coeffs, int nb_codes) memset(coeffs, 0, nb_codes * sizeof(*coeffs)); for (int i = 0; i < nb_codes;) { - int value = get_vlc2(gb, cbp_tab.table, cbp_tab.bits, 1); + int value = get_vlc2(gb, cbp_tab.table, CBP_VLC_BITS, 1); if (value > 0) { int x = get_bits(gb, value); From patchwork Fri Nov 20 07:33:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23902 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 79A6A449F1B for ; Fri, 20 Nov 2020 09:53:59 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 020CC68BDA2; Fri, 20 Nov 2020 09:35:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DC1B568BD78 for ; Fri, 20 Nov 2020 09:34:56 +0200 (EET) Received: by mail-ej1-f68.google.com with SMTP id a16so11542297ejj.5 for ; Thu, 19 Nov 2020 23:34:56 -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=+c4CCO85KmQgb+oPI5RYpTlXmvufZf8nGupQ/yjP0F8=; b=sz0lqWvWGTTD8ved4Uh+5P3bp1gcE/4xDoCyFzTc69qDOCRXNoc+dTviM4T0oR3aiL mCGG+BXqiMjeoiBf+0PiOVs22YFRIu/tfbqxPoNK0pu8B2MAbCH2KQhFGoCyRL7VeV6J dvmqoaIghuQn30rZar8oluCgPmWiA/YqssndSpwJ0wDqYAaeSQhTuwq35RzP0aBjtCPs VWqp8PRqFszupZh3a5Vb8uAoT0FZn865UNs+uBHQO3UVRRiHob8aN8ESLWUndLaVvA18 p6xGc35Q+/UH7PezsAbtYCS5V4iQOCATQ/O29dPyeYFXYM6Tcg/JUdv2PBlz/vAExl49 0vkQ== 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=+c4CCO85KmQgb+oPI5RYpTlXmvufZf8nGupQ/yjP0F8=; b=hP1lPnZRnXYu0MwEPfOlilpv57hYl2dUDh0HDP83NfC/0+k/3Tro9cmv2BXtfR/gae s7vkETT7xiwVo++6O6Mp17k1okVzK55WzjUKiObT+Lml11GnK/w/TOB0PdJ+dndzYZRf hZ0igh/e1fZOONmH0Ewyq++3y6nrAx2yFfUJi8bOE/2ZnTxn+GDhT3duP/LxLc/h1cKz znSrjdPTRHQ+ic+wezyPkLV9sUt3rMLezrDj9lPMlR1itZAvqkuFTjYmngI7irFnWvXI OXnlI3nAzQEYbalebtAETudzEce27ey0OeXuBsaDgWYfG7ZLleBxcYc//uLrEYmEkGcS MCWA== X-Gm-Message-State: AOAM5338eg+Ot9r4Yc6HS+2X/lSul054AlBRKSN/qsvrK1l5l2HKOxAV zHzX7swD/WIN3K2t7XWQHpSiEJzJx+5uTw== X-Google-Smtp-Source: ABdhPJzx9uilmX9XoNYwXNWvKqAKKqiNs5Cw4cZThgZ+JztZK6FWKsYJANba0d7FNbhM3GbwEpkvVQ== X-Received: by 2002:a17:906:c04d:: with SMTP id bm13mr1154773ejb.519.1605857696142; Thu, 19 Nov 2020 23:34:56 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:55 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:16 +0100 Message-Id: <20201120073327.820745-52-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 151/162] avcodec/mpegaudiodec_template: Don't use unnecessarily many VLC bits 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/mpegaudiodec_template.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 849e3e5c09..0634f70b05 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -108,8 +108,8 @@ static const int huff_vlc_tables_sizes[16] = { 142, 204, 190, 170, 542, 460, 662, 414 }; static VLC huff_quad_vlc[2]; -static VLC_TYPE huff_quad_vlc_tables[128+16][2]; -static const int huff_quad_vlc_tables_sizes[2] = { 128, 16 }; +static VLC_TYPE huff_quad_vlc_tables[64+16][2]; +static const int huff_quad_vlc_tables_sizes[2] = { 64, 16 }; /* computed from band_size_long */ static uint16_t band_index_long[9][23]; #include "mpegaudio_tablegen.h" @@ -321,7 +321,7 @@ static av_cold void decode_init_static(void) for (i = 0; i < 2; i++) { huff_quad_vlc[i].table = huff_quad_vlc_tables+offset; huff_quad_vlc[i].table_allocated = huff_quad_vlc_tables_sizes[i]; - init_vlc(&huff_quad_vlc[i], i == 0 ? 7 : 4, 16, + init_vlc(&huff_quad_vlc[i], i == 0 ? 6 : 4, 16, mpa_quad_bits[i], 1, 1, mpa_quad_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); offset += huff_quad_vlc_tables_sizes[i]; From patchwork Fri Nov 20 07:33:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23904 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 BB3F144AB03 for ; Fri, 20 Nov 2020 09:54:10 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C3A0C68BDC3; Fri, 20 Nov 2020 09:35:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BA83268BD88 for ; Fri, 20 Nov 2020 09:34:57 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id lv15so5671852ejb.12 for ; Thu, 19 Nov 2020 23:34:57 -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=vL44dhGOeuqMmGtlv1p8q1ZEpy/SGjr50z59i2hLITg=; b=ZU+yu/UYs+rbD7Qbns5GjtU6RKoiPMuAOA8BHLPfW8U/XXNK416usJL03ErB8U08F6 ttArGTqTiUsHHtOB0C0RaJ+fgQ0MU9Pei12ILkOmRSw50pMLfBsAqi5Q7qa6H8NmEH6O CR+y2d3yCnD5oQenf9Y0SYqywOpEQx06y+ikRdeQpLdBRvXdND324EMcFxj3vJ4feoNb SftMP3jfzxuB4lYDDJ1cn9dwukvikQ4fHBETSNGAXWkNzgQEQe6OxGAJcylTrxDHe+4p gETSK8Y91P7q3pk8H+pTkhoE/sbWUzUvfJrec+oXRJg6eMq9+LQqZXlbyq1sH6xZA+1C oDGA== 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=vL44dhGOeuqMmGtlv1p8q1ZEpy/SGjr50z59i2hLITg=; b=MnmjoFAsFf3/fGrMllz0H6vIAgD7boJNnUWPQKaO34xXJO7wzVWK2cfqF5nn17A9ru 9XGEDQokPhV/yxTmCTisOE2Wp4stcVi43USQL/Ek00FTUS8pA7Ze/aVlUSKQYeihi8Vb CIlEZOZxi7G1Tw41LmisFtqPi7d8iowd/eop3xy35S3IUH91BgVngn+CVTd/8a7ijTZ8 Sd/HxtnJeZaP3JSjQXyki7qjhEM8YFEoqKe7xOvIqZ3oVkjPfsZAZWSJbN+eS4Pu1fxF nyCxVcxfBE9654+qGAyu/D/u6Ih8i7rplAtZkUQQ4WAD+7Z8jK2LiME9ogfkl5ZPyB67 +/Ig== X-Gm-Message-State: AOAM532zMTtqz+SLukMQybBG8QP5CQzgSFZR19ly56XLCs3AjHlRf16v dNW6Lxm7bvHVlQPcRWccMKnEOERN0LT9UA== X-Google-Smtp-Source: ABdhPJyeMlIVlfNWvvSyegZZgGMkzM9UVSd37LpnXl7lyOjuiEGJEdGFq9Od/GTSd89sX9u+q3djOA== X-Received: by 2002:a17:906:e254:: with SMTP id gq20mr32188586ejb.520.1605857696983; Thu, 19 Nov 2020 23:34:56 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:56 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:17 +0100 Message-Id: <20201120073327.820745-53-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 152/162] avcodec/mpegaudiodec_template: Avoid VLC size tables 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/mpegaudiodec_template.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 0634f70b05..53db13d0d4 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -103,13 +103,8 @@ static VLC_TYPE huff_vlc_tables[ 0 + 128 + 128 + 128 + 130 + 128 + 154 + 166 + 142 + 204 + 190 + 170 + 542 + 460 + 662 + 414 ][2]; -static const int huff_vlc_tables_sizes[16] = { - 0, 128, 128, 128, 130, 128, 154, 166, - 142, 204, 190, 170, 542, 460, 662, 414 -}; static VLC huff_quad_vlc[2]; static VLC_TYPE huff_quad_vlc_tables[64+16][2]; -static const int huff_quad_vlc_tables_sizes[2] = { 64, 16 }; /* computed from band_size_long */ static uint16_t band_index_long[9][23]; #include "mpegaudio_tablegen.h" @@ -309,22 +304,23 @@ static av_cold void decode_init_static(void) /* XXX: fail test */ huff_vlc[i].table = huff_vlc_tables+offset; - huff_vlc[i].table_allocated = huff_vlc_tables_sizes[i]; + huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset; init_vlc(&huff_vlc[i], 7, 512, tmp_bits, 1, 1, tmp_codes, 2, 2, - INIT_VLC_USE_NEW_STATIC); - offset += huff_vlc_tables_sizes[i]; + INIT_VLC_STATIC_OVERLONG); + offset += huff_vlc[i].table_size; } av_assert0(offset == FF_ARRAY_ELEMS(huff_vlc_tables)); offset = 0; for (i = 0; i < 2; i++) { + int bits = i == 0 ? 6 : 4; huff_quad_vlc[i].table = huff_quad_vlc_tables+offset; - huff_quad_vlc[i].table_allocated = huff_quad_vlc_tables_sizes[i]; - init_vlc(&huff_quad_vlc[i], i == 0 ? 6 : 4, 16, + huff_quad_vlc[i].table_allocated = 1 << bits; + offset += 1 << bits; + init_vlc(&huff_quad_vlc[i], bits, 16, mpa_quad_bits[i], 1, 1, mpa_quad_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); - offset += huff_quad_vlc_tables_sizes[i]; } av_assert0(offset == FF_ARRAY_ELEMS(huff_quad_vlc_tables)); From patchwork Fri Nov 20 07:33: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: 23905 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 EE03A44AB03 for ; Fri, 20 Nov 2020 09:54:21 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3436068BD83; Fri, 20 Nov 2020 09:35:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8CC9368BD8E for ; Fri, 20 Nov 2020 09:34:58 +0200 (EET) Received: by mail-ed1-f44.google.com with SMTP id v22so8487720edt.9 for ; Thu, 19 Nov 2020 23:34:58 -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=bH6FbEc2PyAxCsLHrGMvwVqN+xAejxdWdLfBUdMHe6c=; b=qk2EbE1Mykz6n7OLP9eqH81v8p48Es3QJKg6darZPQrkPHIfJ4eelYxa0Bh5CvohPY oq3rtGHsvU4zxa9rm9WALLSZShIwzL/h/0Znfytta+S9h1Kpqh29W56t24saAnVB4/t8 gWjJK/ETZuzkP087fqE6chhulNcIISlPgdHltCQSQeNf0sBpKQ8nWPWMdFeRGAPB+M4t TVNtGf0uTSc6/FlQOuJDSZH5ut/F41PYwUO4+ob4OTHNXogYgSO7JHQTLHi+Aa8WrIif 6Zhrnuy+1fJRzzObGC16FMZ2LoKaa1J+hmsfGkM/ugGMB/iZp6oxfmQ9RutaRRxzxCxi 2+ug== 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=bH6FbEc2PyAxCsLHrGMvwVqN+xAejxdWdLfBUdMHe6c=; b=D4N33ZbduX10+vamZjzHyCfEtae/GDHsUHAJfX1y+OB3y37+P7yFiqbFvpeWoK7von 3xnVqeCTeEWUoJABj9Xl1fL7ah2+xEeFz4dQrzxS2kIvgvWLK+97tymm7oN82Q1Tz5jr ZfVJHibXly93DBjKj+n4HWtzzQaixOq2WTtHTZQtG1DLI36QrxTi4q4ME7IxpgUAnnGL irIv/X7cwFtBU3tXOUia2tAjAAQboqrWB9NKGrrj0+cxP3ftJhayVYDqSL8SlwI72cs/ JbLLo+7U2uNe+RY/ggMDtUbhO2vECZ+/N2K+XfSJaE7g16uDaP5/YpslpoOj1CLak/Tq Z2xg== X-Gm-Message-State: AOAM530IBcGW4O9FGRqJOuudM0oEA6b11jYVDT8JvzEp3q028FcBKSwh l5WfatyCQasDEsK5lqMGyqNrg/r3/Jq8Xw== X-Google-Smtp-Source: ABdhPJw2TL05uCht7rU2wB5biHdOKemjvjYiLzLk3bgA51RILcETqkqo0Ddb8BZlAeP1Cidz7UGpcA== X-Received: by 2002:a50:9e8a:: with SMTP id a10mr35499646edf.150.1605857697873; Thu, 19 Nov 2020 23:34:57 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:57 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:18 +0100 Message-Id: <20201120073327.820745-54-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 153/162] avcodec/mpegaudiotab: Avoid unused entry in 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/mpegaudiodec_template.c | 6 +++--- libavcodec/mpegaudiodectab.h | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 53db13d0d4..88679723fc 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -100,7 +100,7 @@ typedef struct MPADecodeContext { /* vlc structure for decoding layer 3 huffman tables */ static VLC huff_vlc[16]; static VLC_TYPE huff_vlc_tables[ - 0 + 128 + 128 + 128 + 130 + 128 + 154 + 166 + + 128 + 128 + 128 + 130 + 128 + 154 + 166 + 142 + 204 + 190 + 170 + 542 + 460 + 662 + 414 ][2]; static VLC huff_quad_vlc[2]; @@ -286,7 +286,7 @@ static av_cold void decode_init_static(void) /* huffman decode tables */ offset = 0; - for (i = 1; i < 16; i++) { + for (int i = 0; i < 15;) { const HuffTable *h = &mpa_huff_tables[i]; int xsize, x, y; uint8_t tmp_bits [512] = { 0 }; @@ -303,7 +303,7 @@ static av_cold void decode_init_static(void) } /* XXX: fail test */ - huff_vlc[i].table = huff_vlc_tables+offset; + huff_vlc[++i].table = huff_vlc_tables + offset; huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset; init_vlc(&huff_vlc[i], 7, 512, tmp_bits, 1, 1, tmp_codes, 2, 2, diff --git a/libavcodec/mpegaudiodectab.h b/libavcodec/mpegaudiodectab.h index accd12b8e2..e1468c5e89 100644 --- a/libavcodec/mpegaudiodectab.h +++ b/libavcodec/mpegaudiodectab.h @@ -502,8 +502,7 @@ static const uint8_t mpa_huffbits_24[256] = { 7, 7, 7, 8, 8, 8, 8, 4, }; -static const HuffTable mpa_huff_tables[16] = { -{ 1, NULL, NULL }, +static const HuffTable mpa_huff_tables[] = { { 2, mpa_huffbits_1, mpa_huffcodes_1 }, { 3, mpa_huffbits_2, mpa_huffcodes_2 }, { 3, mpa_huffbits_3, mpa_huffcodes_3 }, From patchwork Fri Nov 20 07:33:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23907 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 E568944AB03 for ; Fri, 20 Nov 2020 09:54:44 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4A2C968BDCC; Fri, 20 Nov 2020 09:35:13 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1100F68BD8F for ; Fri, 20 Nov 2020 09:35:00 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id o21so11523789ejb.3 for ; Thu, 19 Nov 2020 23:35:00 -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=1ht9taJ5Jqd5ysBcL4awd1AFOxhUmo2XYtIpfvBqpTM=; b=a3ubqurrsJaiFDiGa0DbWvII8AUU954CkLl2Y2znf+UWVEVyK2Y+etirirMLl1GFto LH1VTYBllORvXQQy9M2vllkLJaP8uFEOJA6RFCKmPHtH7QeKUJaEQkpoj2/mlOwwvS23 1b3Q31/OmYO7a5qOPWOClvrZ7eZ8m14CoxWHW8nuUPlun7cOxwqpF8iRI8vIBo6OVwBf vtjWhgQ3A/b8SW02Yhv5QEjYMkdEmdfC+WAxd1fhpolSqblwUsYb2mp8oSWPmIoPuNgv U4Uaizdv7ZO9HHtXKX42jt+jyNyg6gsZ3D97ItU1Oe+xCVXJR47F+etm3ICaxVQKncg7 W2mQ== 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=1ht9taJ5Jqd5ysBcL4awd1AFOxhUmo2XYtIpfvBqpTM=; b=F1mg3iv2pDJPnxpK5CSOYFdSGDMkqesAKasw2vVU2fxt8X9RbTZM9UOfXepu8xqWAd dgeHVWllBBRpH4na+WLZV5ulUL1/vnbRPFD5rhclcJSGEFi24L5FDd2+KjxeWboDEUC5 PYUrO3g/56Of3hI7kmgLxpfSjgj7XCga1LoNKwQ5NcOGkMVAf56coixVYHKlHTDiq/+L gnrhkjl73ku8+dalBR6Bb1a1UgDgo/X4CfiBAL4kGepsZO3EAf6dgQgX8hcHWJNwsiME 8Ei8fns24qqPGVoszSNyjsk0kqvua2ObhJ8rb7bncCf6nIMS71PyxiyPcoOy/qWrMFmM b5mg== X-Gm-Message-State: AOAM531nq6w4OL2mg84I3LiVK2deIfgKHr4bhtyr/V2oyHjGNacyPhnN xAWG82Vrqr5zIOimok51d4pKrMeLXk3uLw== X-Google-Smtp-Source: ABdhPJz7bwK8/ZrIIIlO/t7NoUT8+I46hiOnpXbaYQlu0HTdzfzACcAeKUc6enxFju5x6Bv7IQ68Vg== X-Received: by 2002:a17:906:2857:: with SMTP id s23mr21995640ejc.218.1605857698993; Thu, 19 Nov 2020 23:34:58 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:58 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:19 +0100 Message-Id: <20201120073327.820745-55-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 154/162] avcodec/mpegaudiodec: Reduce the size of tables used to initialize 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" By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one can replace tables of codes of type uint16_t by tables of symbols of type uint8_t; this saves about 1.3KB for both the fixed and floating point decoders (if enabled). Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegaudiodec_template.c | 21 +- libavcodec/mpegaudiodectab.h | 678 +++++++++++------------------ 2 files changed, 271 insertions(+), 428 deletions(-) diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 88679723fc..edd69684da 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -288,26 +288,21 @@ static av_cold void decode_init_static(void) offset = 0; for (int i = 0; i < 15;) { const HuffTable *h = &mpa_huff_tables[i]; - int xsize, x, y; - uint8_t tmp_bits [512] = { 0 }; - uint16_t tmp_codes[512] = { 0 }; + uint16_t tmp_symbols[256]; + int nb_codes = h->nb_codes; - xsize = h->xsize; + for (int j = 0; j < nb_codes; j++) { + uint8_t high = h->symbols[j] & 0xF0, low = h->symbols[j] & 0xF; - j = 0; - for (x = 0; x < xsize; x++) { - for (y = 0; y < xsize; y++) { - tmp_bits [(x << 5) | y | ((x && y) << 4)]= h->bits [j ]; - tmp_codes[(x << 5) | y | ((x && y) << 4)]= h->codes[j++]; - } + tmp_symbols[j] = high << 1 | ((high && low) << 4) | low; } /* XXX: fail test */ huff_vlc[++i].table = huff_vlc_tables + offset; huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset; - init_vlc(&huff_vlc[i], 7, 512, - tmp_bits, 1, 1, tmp_codes, 2, 2, - INIT_VLC_STATIC_OVERLONG); + ff_init_vlc_from_lengths(&huff_vlc[i], 7, nb_codes, + h->bits, 1, tmp_symbols, 2, 2, + 0, INIT_VLC_STATIC_OVERLONG, NULL); offset += huff_vlc[i].table_size; } av_assert0(offset == FF_ARRAY_ELEMS(huff_vlc_tables)); diff --git a/libavcodec/mpegaudiodectab.h b/libavcodec/mpegaudiodectab.h index e1468c5e89..8d2b8af150 100644 --- a/libavcodec/mpegaudiodectab.h +++ b/libavcodec/mpegaudiodectab.h @@ -37,9 +37,9 @@ /* layer 3 huffman tables */ typedef struct HuffTable { - int xsize; + int nb_codes; const uint8_t *bits; - const uint16_t *codes; + const uint8_t *symbols; } HuffTable; /* layer3 scale factor size */ @@ -59,465 +59,313 @@ static const uint8_t lsf_nsf_table[6][3][4] = { }; /* mpegaudio layer 3 huffman tables */ - -static const uint16_t mpa_huffcodes_1[4] = { - 0x0001, 0x0001, 0x0001, 0x0000, -}; - static const uint8_t mpa_huffbits_1[4] = { - 1, 3, 2, 3, -}; - -static const uint16_t mpa_huffcodes_2[9] = { - 0x0001, 0x0002, 0x0001, 0x0003, 0x0001, 0x0001, 0x0003, 0x0002, - 0x0000, + 3, 3, 2, 1, }; static const uint8_t mpa_huffbits_2[9] = { - 1, 3, 6, 3, 3, 5, 5, 5, - 6, -}; - -static const uint16_t mpa_huffcodes_3[9] = { - 0x0003, 0x0002, 0x0001, 0x0001, 0x0001, 0x0001, 0x0003, 0x0002, - 0x0000, + 6, 6, 5, 5, 5, 3, 3, 3, 1, }; static const uint8_t mpa_huffbits_3[9] = { - 2, 2, 6, 3, 2, 5, 5, 5, - 6, -}; - -static const uint16_t mpa_huffcodes_5[16] = { - 0x0001, 0x0002, 0x0006, 0x0005, 0x0003, 0x0001, 0x0004, 0x0004, - 0x0007, 0x0005, 0x0007, 0x0001, 0x0006, 0x0001, 0x0001, 0x0000, + 6, 6, 5, 5, 5, 3, 2, 2, 2, }; static const uint8_t mpa_huffbits_5[16] = { - 1, 3, 6, 7, 3, 3, 6, 7, - 6, 6, 7, 8, 7, 6, 7, 8, -}; - -static const uint16_t mpa_huffcodes_6[16] = { - 0x0007, 0x0003, 0x0005, 0x0001, 0x0006, 0x0002, 0x0003, 0x0002, - 0x0005, 0x0004, 0x0004, 0x0001, 0x0003, 0x0003, 0x0002, 0x0000, + 8, 8, 7, 6, 7, 7, 7, 7, 6, 6, 6, 6, 3, 3, 3, 1, }; static const uint8_t mpa_huffbits_6[16] = { - 3, 3, 5, 7, 3, 2, 4, 5, - 4, 4, 5, 6, 6, 5, 6, 7, -}; - -static const uint16_t mpa_huffcodes_7[36] = { - 0x0001, 0x0002, 0x000a, 0x0013, 0x0010, 0x000a, 0x0003, 0x0003, - 0x0007, 0x000a, 0x0005, 0x0003, 0x000b, 0x0004, 0x000d, 0x0011, - 0x0008, 0x0004, 0x000c, 0x000b, 0x0012, 0x000f, 0x000b, 0x0002, - 0x0007, 0x0006, 0x0009, 0x000e, 0x0003, 0x0001, 0x0006, 0x0004, - 0x0005, 0x0003, 0x0002, 0x0000, + 7, 7, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 3, 2, 3, 3, }; static const uint8_t mpa_huffbits_7[36] = { - 1, 3, 6, 8, 8, 9, 3, 4, - 6, 7, 7, 8, 6, 5, 7, 8, - 8, 9, 7, 7, 8, 9, 9, 9, - 7, 7, 8, 9, 9, 10, 8, 8, - 9, 10, 10, 10, -}; - -static const uint16_t mpa_huffcodes_8[36] = { - 0x0003, 0x0004, 0x0006, 0x0012, 0x000c, 0x0005, 0x0005, 0x0001, - 0x0002, 0x0010, 0x0009, 0x0003, 0x0007, 0x0003, 0x0005, 0x000e, - 0x0007, 0x0003, 0x0013, 0x0011, 0x000f, 0x000d, 0x000a, 0x0004, - 0x000d, 0x0005, 0x0008, 0x000b, 0x0005, 0x0001, 0x000c, 0x0004, - 0x0004, 0x0001, 0x0001, 0x0000, + 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 9, 9, 8, 9, 9, 8, 8, 7, 7, + 7, 8, 8, 8, 8, 7, 7, 7, 7, 6, 5, 6, 6, 4, 3, 3, 1, }; static const uint8_t mpa_huffbits_8[36] = { - 2, 3, 6, 8, 8, 9, 3, 2, - 4, 8, 8, 8, 6, 4, 6, 8, - 8, 9, 8, 8, 8, 9, 9, 10, - 8, 7, 8, 9, 10, 10, 9, 8, - 9, 9, 11, 11, -}; - -static const uint16_t mpa_huffcodes_9[36] = { - 0x0007, 0x0005, 0x0009, 0x000e, 0x000f, 0x0007, 0x0006, 0x0004, - 0x0005, 0x0005, 0x0006, 0x0007, 0x0007, 0x0006, 0x0008, 0x0008, - 0x0008, 0x0005, 0x000f, 0x0006, 0x0009, 0x000a, 0x0005, 0x0001, - 0x000b, 0x0007, 0x0009, 0x0006, 0x0004, 0x0001, 0x000e, 0x0004, - 0x0006, 0x0002, 0x0006, 0x0000, + 11, 11, 10, 9, 10, 10, 9, 9, 9, 8, 8, 9, 9, 9, 9, 8, 8, 8, 7, + 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 6, 4, 4, 2, 3, 3, 2, }; static const uint8_t mpa_huffbits_9[36] = { - 3, 3, 5, 6, 8, 9, 3, 3, - 4, 5, 6, 8, 4, 4, 5, 6, - 7, 8, 6, 5, 6, 7, 7, 8, - 7, 6, 7, 7, 8, 9, 8, 7, - 8, 8, 9, 9, -}; - -static const uint16_t mpa_huffcodes_10[64] = { - 0x0001, 0x0002, 0x000a, 0x0017, 0x0023, 0x001e, 0x000c, 0x0011, - 0x0003, 0x0003, 0x0008, 0x000c, 0x0012, 0x0015, 0x000c, 0x0007, - 0x000b, 0x0009, 0x000f, 0x0015, 0x0020, 0x0028, 0x0013, 0x0006, - 0x000e, 0x000d, 0x0016, 0x0022, 0x002e, 0x0017, 0x0012, 0x0007, - 0x0014, 0x0013, 0x0021, 0x002f, 0x001b, 0x0016, 0x0009, 0x0003, - 0x001f, 0x0016, 0x0029, 0x001a, 0x0015, 0x0014, 0x0005, 0x0003, - 0x000e, 0x000d, 0x000a, 0x000b, 0x0010, 0x0006, 0x0005, 0x0001, - 0x0009, 0x0008, 0x0007, 0x0008, 0x0004, 0x0004, 0x0002, 0x0000, + 9, 9, 8, 8, 9, 9, 8, 8, 8, 8, 7, 7, 7, 8, 8, 7, 7, 7, 7, + 6, 6, 6, 6, 5, 5, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, }; static const uint8_t mpa_huffbits_10[64] = { - 1, 3, 6, 8, 9, 9, 9, 10, - 3, 4, 6, 7, 8, 9, 8, 8, - 6, 6, 7, 8, 9, 10, 9, 9, - 7, 7, 8, 9, 10, 10, 9, 10, - 8, 8, 9, 10, 10, 10, 10, 10, - 9, 9, 10, 10, 11, 11, 10, 11, - 8, 8, 9, 10, 10, 10, 11, 11, - 9, 8, 9, 10, 10, 11, 11, 11, -}; - -static const uint16_t mpa_huffcodes_11[64] = { - 0x0003, 0x0004, 0x000a, 0x0018, 0x0022, 0x0021, 0x0015, 0x000f, - 0x0005, 0x0003, 0x0004, 0x000a, 0x0020, 0x0011, 0x000b, 0x000a, - 0x000b, 0x0007, 0x000d, 0x0012, 0x001e, 0x001f, 0x0014, 0x0005, - 0x0019, 0x000b, 0x0013, 0x003b, 0x001b, 0x0012, 0x000c, 0x0005, - 0x0023, 0x0021, 0x001f, 0x003a, 0x001e, 0x0010, 0x0007, 0x0005, - 0x001c, 0x001a, 0x0020, 0x0013, 0x0011, 0x000f, 0x0008, 0x000e, - 0x000e, 0x000c, 0x0009, 0x000d, 0x000e, 0x0009, 0x0004, 0x0001, - 0x000b, 0x0004, 0x0006, 0x0006, 0x0006, 0x0003, 0x0002, 0x0000, + 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 11, 11, 10, 9, 9, 10, + 10, 9, 9, 10, 10, 9, 10, 10, 8, 8, 9, 9, 10, 10, 9, 9, 10, 10, 8, + 8, 8, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 6, + 6, 6, 6, 4, 3, 3, 1, }; static const uint8_t mpa_huffbits_11[64] = { - 2, 3, 5, 7, 8, 9, 8, 9, - 3, 3, 4, 6, 8, 8, 7, 8, - 5, 5, 6, 7, 8, 9, 8, 8, - 7, 6, 7, 9, 8, 10, 8, 9, - 8, 8, 8, 9, 9, 10, 9, 10, - 8, 8, 9, 10, 10, 11, 10, 11, - 8, 7, 7, 8, 9, 10, 10, 10, - 8, 7, 8, 9, 10, 10, 10, 10, -}; - -static const uint16_t mpa_huffcodes_12[64] = { - 0x0009, 0x0006, 0x0010, 0x0021, 0x0029, 0x0027, 0x0026, 0x001a, - 0x0007, 0x0005, 0x0006, 0x0009, 0x0017, 0x0010, 0x001a, 0x000b, - 0x0011, 0x0007, 0x000b, 0x000e, 0x0015, 0x001e, 0x000a, 0x0007, - 0x0011, 0x000a, 0x000f, 0x000c, 0x0012, 0x001c, 0x000e, 0x0005, - 0x0020, 0x000d, 0x0016, 0x0013, 0x0012, 0x0010, 0x0009, 0x0005, - 0x0028, 0x0011, 0x001f, 0x001d, 0x0011, 0x000d, 0x0004, 0x0002, - 0x001b, 0x000c, 0x000b, 0x000f, 0x000a, 0x0007, 0x0004, 0x0001, - 0x001b, 0x000c, 0x0008, 0x000c, 0x0006, 0x0003, 0x0001, 0x0000, + 10, 10, 10, 10, 10, 10, 10, 11, 11, 10, 10, 9, 9, 9, 10, 10, 10, 10, 8, + 8, 9, 9, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 8, 7, 8, 8, 7, 7, + 8, 8, 8, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, 6, 6, 7, 7, 6, 5, + 4, 5, 5, 3, 3, 3, 2, }; static const uint8_t mpa_huffbits_12[64] = { - 4, 3, 5, 7, 8, 9, 9, 9, - 3, 3, 4, 5, 7, 7, 8, 8, - 5, 4, 5, 6, 7, 8, 7, 8, - 6, 5, 6, 6, 7, 8, 8, 8, - 7, 6, 7, 7, 8, 8, 8, 9, - 8, 7, 8, 8, 8, 9, 8, 9, - 8, 7, 7, 8, 8, 9, 9, 10, - 9, 8, 8, 9, 9, 9, 9, 10, -}; - -static const uint16_t mpa_huffcodes_13[256] = { - 0x0001, 0x0005, 0x000e, 0x0015, 0x0022, 0x0033, 0x002e, 0x0047, - 0x002a, 0x0034, 0x0044, 0x0034, 0x0043, 0x002c, 0x002b, 0x0013, - 0x0003, 0x0004, 0x000c, 0x0013, 0x001f, 0x001a, 0x002c, 0x0021, - 0x001f, 0x0018, 0x0020, 0x0018, 0x001f, 0x0023, 0x0016, 0x000e, - 0x000f, 0x000d, 0x0017, 0x0024, 0x003b, 0x0031, 0x004d, 0x0041, - 0x001d, 0x0028, 0x001e, 0x0028, 0x001b, 0x0021, 0x002a, 0x0010, - 0x0016, 0x0014, 0x0025, 0x003d, 0x0038, 0x004f, 0x0049, 0x0040, - 0x002b, 0x004c, 0x0038, 0x0025, 0x001a, 0x001f, 0x0019, 0x000e, - 0x0023, 0x0010, 0x003c, 0x0039, 0x0061, 0x004b, 0x0072, 0x005b, - 0x0036, 0x0049, 0x0037, 0x0029, 0x0030, 0x0035, 0x0017, 0x0018, - 0x003a, 0x001b, 0x0032, 0x0060, 0x004c, 0x0046, 0x005d, 0x0054, - 0x004d, 0x003a, 0x004f, 0x001d, 0x004a, 0x0031, 0x0029, 0x0011, - 0x002f, 0x002d, 0x004e, 0x004a, 0x0073, 0x005e, 0x005a, 0x004f, - 0x0045, 0x0053, 0x0047, 0x0032, 0x003b, 0x0026, 0x0024, 0x000f, - 0x0048, 0x0022, 0x0038, 0x005f, 0x005c, 0x0055, 0x005b, 0x005a, - 0x0056, 0x0049, 0x004d, 0x0041, 0x0033, 0x002c, 0x002b, 0x002a, - 0x002b, 0x0014, 0x001e, 0x002c, 0x0037, 0x004e, 0x0048, 0x0057, - 0x004e, 0x003d, 0x002e, 0x0036, 0x0025, 0x001e, 0x0014, 0x0010, - 0x0035, 0x0019, 0x0029, 0x0025, 0x002c, 0x003b, 0x0036, 0x0051, - 0x0042, 0x004c, 0x0039, 0x0036, 0x0025, 0x0012, 0x0027, 0x000b, - 0x0023, 0x0021, 0x001f, 0x0039, 0x002a, 0x0052, 0x0048, 0x0050, - 0x002f, 0x003a, 0x0037, 0x0015, 0x0016, 0x001a, 0x0026, 0x0016, - 0x0035, 0x0019, 0x0017, 0x0026, 0x0046, 0x003c, 0x0033, 0x0024, - 0x0037, 0x001a, 0x0022, 0x0017, 0x001b, 0x000e, 0x0009, 0x0007, - 0x0022, 0x0020, 0x001c, 0x0027, 0x0031, 0x004b, 0x001e, 0x0034, - 0x0030, 0x0028, 0x0034, 0x001c, 0x0012, 0x0011, 0x0009, 0x0005, - 0x002d, 0x0015, 0x0022, 0x0040, 0x0038, 0x0032, 0x0031, 0x002d, - 0x001f, 0x0013, 0x000c, 0x000f, 0x000a, 0x0007, 0x0006, 0x0003, - 0x0030, 0x0017, 0x0014, 0x0027, 0x0024, 0x0023, 0x0035, 0x0015, - 0x0010, 0x0017, 0x000d, 0x000a, 0x0006, 0x0001, 0x0004, 0x0002, - 0x0010, 0x000f, 0x0011, 0x001b, 0x0019, 0x0014, 0x001d, 0x000b, - 0x0011, 0x000c, 0x0010, 0x0008, 0x0001, 0x0001, 0x0000, 0x0001, + 10, 10, 9, 9, 9, 9, 9, 9, 9, 8, 8, 9, 9, 8, 8, 8, 8, 8, 8, + 9, 9, 8, 8, 8, 8, 8, 9, 9, 7, 7, 7, 8, 8, 8, 8, 8, 8, 7, + 7, 7, 7, 8, 8, 7, 7, 7, 6, 6, 6, 6, 7, 7, 6, 5, 5, 5, 4, + 4, 5, 5, 4, 3, 3, 3, }; static const uint8_t mpa_huffbits_13[256] = { - 1, 4, 6, 7, 8, 9, 9, 10, - 9, 10, 11, 11, 12, 12, 13, 13, - 3, 4, 6, 7, 8, 8, 9, 9, - 9, 9, 10, 10, 11, 12, 12, 12, - 6, 6, 7, 8, 9, 9, 10, 10, - 9, 10, 10, 11, 11, 12, 13, 13, - 7, 7, 8, 9, 9, 10, 10, 10, - 10, 11, 11, 11, 11, 12, 13, 13, - 8, 7, 9, 9, 10, 10, 11, 11, - 10, 11, 11, 12, 12, 13, 13, 14, - 9, 8, 9, 10, 10, 10, 11, 11, - 11, 11, 12, 11, 13, 13, 14, 14, - 9, 9, 10, 10, 11, 11, 11, 11, - 11, 12, 12, 12, 13, 13, 14, 14, - 10, 9, 10, 11, 11, 11, 12, 12, - 12, 12, 13, 13, 13, 14, 16, 16, - 9, 8, 9, 10, 10, 11, 11, 12, - 12, 12, 12, 13, 13, 14, 15, 15, - 10, 9, 10, 10, 11, 11, 11, 13, - 12, 13, 13, 14, 14, 14, 16, 15, - 10, 10, 10, 11, 11, 12, 12, 13, - 12, 13, 14, 13, 14, 15, 16, 17, - 11, 10, 10, 11, 12, 12, 12, 12, - 13, 13, 13, 14, 15, 15, 15, 16, - 11, 11, 11, 12, 12, 13, 12, 13, - 14, 14, 15, 15, 15, 16, 16, 16, - 12, 11, 12, 13, 13, 13, 14, 14, - 14, 14, 14, 15, 16, 15, 16, 16, - 13, 12, 12, 13, 13, 13, 15, 14, - 14, 17, 15, 15, 15, 17, 16, 16, - 12, 12, 13, 14, 14, 14, 15, 14, - 15, 15, 16, 16, 19, 18, 19, 16, -}; - -static const uint16_t mpa_huffcodes_15[256] = { - 0x0007, 0x000c, 0x0012, 0x0035, 0x002f, 0x004c, 0x007c, 0x006c, - 0x0059, 0x007b, 0x006c, 0x0077, 0x006b, 0x0051, 0x007a, 0x003f, - 0x000d, 0x0005, 0x0010, 0x001b, 0x002e, 0x0024, 0x003d, 0x0033, - 0x002a, 0x0046, 0x0034, 0x0053, 0x0041, 0x0029, 0x003b, 0x0024, - 0x0013, 0x0011, 0x000f, 0x0018, 0x0029, 0x0022, 0x003b, 0x0030, - 0x0028, 0x0040, 0x0032, 0x004e, 0x003e, 0x0050, 0x0038, 0x0021, - 0x001d, 0x001c, 0x0019, 0x002b, 0x0027, 0x003f, 0x0037, 0x005d, - 0x004c, 0x003b, 0x005d, 0x0048, 0x0036, 0x004b, 0x0032, 0x001d, - 0x0034, 0x0016, 0x002a, 0x0028, 0x0043, 0x0039, 0x005f, 0x004f, - 0x0048, 0x0039, 0x0059, 0x0045, 0x0031, 0x0042, 0x002e, 0x001b, - 0x004d, 0x0025, 0x0023, 0x0042, 0x003a, 0x0034, 0x005b, 0x004a, - 0x003e, 0x0030, 0x004f, 0x003f, 0x005a, 0x003e, 0x0028, 0x0026, - 0x007d, 0x0020, 0x003c, 0x0038, 0x0032, 0x005c, 0x004e, 0x0041, - 0x0037, 0x0057, 0x0047, 0x0033, 0x0049, 0x0033, 0x0046, 0x001e, - 0x006d, 0x0035, 0x0031, 0x005e, 0x0058, 0x004b, 0x0042, 0x007a, - 0x005b, 0x0049, 0x0038, 0x002a, 0x0040, 0x002c, 0x0015, 0x0019, - 0x005a, 0x002b, 0x0029, 0x004d, 0x0049, 0x003f, 0x0038, 0x005c, - 0x004d, 0x0042, 0x002f, 0x0043, 0x0030, 0x0035, 0x0024, 0x0014, - 0x0047, 0x0022, 0x0043, 0x003c, 0x003a, 0x0031, 0x0058, 0x004c, - 0x0043, 0x006a, 0x0047, 0x0036, 0x0026, 0x0027, 0x0017, 0x000f, - 0x006d, 0x0035, 0x0033, 0x002f, 0x005a, 0x0052, 0x003a, 0x0039, - 0x0030, 0x0048, 0x0039, 0x0029, 0x0017, 0x001b, 0x003e, 0x0009, - 0x0056, 0x002a, 0x0028, 0x0025, 0x0046, 0x0040, 0x0034, 0x002b, - 0x0046, 0x0037, 0x002a, 0x0019, 0x001d, 0x0012, 0x000b, 0x000b, - 0x0076, 0x0044, 0x001e, 0x0037, 0x0032, 0x002e, 0x004a, 0x0041, - 0x0031, 0x0027, 0x0018, 0x0010, 0x0016, 0x000d, 0x000e, 0x0007, - 0x005b, 0x002c, 0x0027, 0x0026, 0x0022, 0x003f, 0x0034, 0x002d, - 0x001f, 0x0034, 0x001c, 0x0013, 0x000e, 0x0008, 0x0009, 0x0003, - 0x007b, 0x003c, 0x003a, 0x0035, 0x002f, 0x002b, 0x0020, 0x0016, - 0x0025, 0x0018, 0x0011, 0x000c, 0x000f, 0x000a, 0x0002, 0x0001, - 0x0047, 0x0025, 0x0022, 0x001e, 0x001c, 0x0014, 0x0011, 0x001a, - 0x0015, 0x0010, 0x000a, 0x0006, 0x0008, 0x0006, 0x0002, 0x0000, + 19, 19, 18, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 15, 15, 16, + 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 15, 16, 16, 14, 14, 15, + 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 14, 13, 14, + 14, 13, 13, 14, 14, 13, 14, 14, 13, 14, 14, 13, 14, 14, 13, 13, 14, 14, 12, + 12, 12, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 12, 12, 13, 13, 12, 12, 12, 12, 13, 13, 13, 13, 12, + 13, 13, 12, 11, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 12, 12, 11, + 11, 12, 12, 11, 12, 12, 12, 12, 11, 11, 12, 12, 11, 12, 12, 11, 12, 12, 11, + 12, 12, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11, 11, + 10, 11, 11, 10, 11, 11, 11, 11, 10, 10, 11, 11, 10, 10, 11, 11, 11, 11, 11, + 11, 9, 9, 10, 10, 10, 10, 10, 11, 11, 9, 9, 9, 10, 10, 9, 9, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 8, 9, 9, 9, 9, 9, 9, 10, 10, 9, 9, + 9, 8, 8, 9, 9, 9, 9, 9, 9, 8, 7, 8, 8, 8, 8, 7, 7, 7, 7, + 7, 6, 6, 6, 6, 4, 4, 3, 1, }; static const uint8_t mpa_huffbits_15[256] = { - 3, 4, 5, 7, 7, 8, 9, 9, - 9, 10, 10, 11, 11, 11, 12, 13, - 4, 3, 5, 6, 7, 7, 8, 8, - 8, 9, 9, 10, 10, 10, 11, 11, - 5, 5, 5, 6, 7, 7, 8, 8, - 8, 9, 9, 10, 10, 11, 11, 11, - 6, 6, 6, 7, 7, 8, 8, 9, - 9, 9, 10, 10, 10, 11, 11, 11, - 7, 6, 7, 7, 8, 8, 9, 9, - 9, 9, 10, 10, 10, 11, 11, 11, - 8, 7, 7, 8, 8, 8, 9, 9, - 9, 9, 10, 10, 11, 11, 11, 12, - 9, 7, 8, 8, 8, 9, 9, 9, - 9, 10, 10, 10, 11, 11, 12, 12, - 9, 8, 8, 9, 9, 9, 9, 10, - 10, 10, 10, 10, 11, 11, 11, 12, - 9, 8, 8, 9, 9, 9, 9, 10, - 10, 10, 10, 11, 11, 12, 12, 12, - 9, 8, 9, 9, 9, 9, 10, 10, - 10, 11, 11, 11, 11, 12, 12, 12, - 10, 9, 9, 9, 10, 10, 10, 10, - 10, 11, 11, 11, 11, 12, 13, 12, - 10, 9, 9, 9, 10, 10, 10, 10, - 11, 11, 11, 11, 12, 12, 12, 13, - 11, 10, 9, 10, 10, 10, 11, 11, - 11, 11, 11, 11, 12, 12, 13, 13, - 11, 10, 10, 10, 10, 11, 11, 11, - 11, 12, 12, 12, 12, 12, 13, 13, - 12, 11, 11, 11, 11, 11, 11, 11, - 12, 12, 12, 12, 13, 13, 12, 13, - 12, 11, 11, 11, 11, 11, 11, 12, - 12, 12, 12, 12, 13, 13, 13, 13, -}; - -static const uint16_t mpa_huffcodes_16[256] = { - 0x0001, 0x0005, 0x000e, 0x002c, 0x004a, 0x003f, 0x006e, 0x005d, - 0x00ac, 0x0095, 0x008a, 0x00f2, 0x00e1, 0x00c3, 0x0178, 0x0011, - 0x0003, 0x0004, 0x000c, 0x0014, 0x0023, 0x003e, 0x0035, 0x002f, - 0x0053, 0x004b, 0x0044, 0x0077, 0x00c9, 0x006b, 0x00cf, 0x0009, - 0x000f, 0x000d, 0x0017, 0x0026, 0x0043, 0x003a, 0x0067, 0x005a, - 0x00a1, 0x0048, 0x007f, 0x0075, 0x006e, 0x00d1, 0x00ce, 0x0010, - 0x002d, 0x0015, 0x0027, 0x0045, 0x0040, 0x0072, 0x0063, 0x0057, - 0x009e, 0x008c, 0x00fc, 0x00d4, 0x00c7, 0x0183, 0x016d, 0x001a, - 0x004b, 0x0024, 0x0044, 0x0041, 0x0073, 0x0065, 0x00b3, 0x00a4, - 0x009b, 0x0108, 0x00f6, 0x00e2, 0x018b, 0x017e, 0x016a, 0x0009, - 0x0042, 0x001e, 0x003b, 0x0038, 0x0066, 0x00b9, 0x00ad, 0x0109, - 0x008e, 0x00fd, 0x00e8, 0x0190, 0x0184, 0x017a, 0x01bd, 0x0010, - 0x006f, 0x0036, 0x0034, 0x0064, 0x00b8, 0x00b2, 0x00a0, 0x0085, - 0x0101, 0x00f4, 0x00e4, 0x00d9, 0x0181, 0x016e, 0x02cb, 0x000a, - 0x0062, 0x0030, 0x005b, 0x0058, 0x00a5, 0x009d, 0x0094, 0x0105, - 0x00f8, 0x0197, 0x018d, 0x0174, 0x017c, 0x0379, 0x0374, 0x0008, - 0x0055, 0x0054, 0x0051, 0x009f, 0x009c, 0x008f, 0x0104, 0x00f9, - 0x01ab, 0x0191, 0x0188, 0x017f, 0x02d7, 0x02c9, 0x02c4, 0x0007, - 0x009a, 0x004c, 0x0049, 0x008d, 0x0083, 0x0100, 0x00f5, 0x01aa, - 0x0196, 0x018a, 0x0180, 0x02df, 0x0167, 0x02c6, 0x0160, 0x000b, - 0x008b, 0x0081, 0x0043, 0x007d, 0x00f7, 0x00e9, 0x00e5, 0x00db, - 0x0189, 0x02e7, 0x02e1, 0x02d0, 0x0375, 0x0372, 0x01b7, 0x0004, - 0x00f3, 0x0078, 0x0076, 0x0073, 0x00e3, 0x00df, 0x018c, 0x02ea, - 0x02e6, 0x02e0, 0x02d1, 0x02c8, 0x02c2, 0x00df, 0x01b4, 0x0006, - 0x00ca, 0x00e0, 0x00de, 0x00da, 0x00d8, 0x0185, 0x0182, 0x017d, - 0x016c, 0x0378, 0x01bb, 0x02c3, 0x01b8, 0x01b5, 0x06c0, 0x0004, - 0x02eb, 0x00d3, 0x00d2, 0x00d0, 0x0172, 0x017b, 0x02de, 0x02d3, - 0x02ca, 0x06c7, 0x0373, 0x036d, 0x036c, 0x0d83, 0x0361, 0x0002, - 0x0179, 0x0171, 0x0066, 0x00bb, 0x02d6, 0x02d2, 0x0166, 0x02c7, - 0x02c5, 0x0362, 0x06c6, 0x0367, 0x0d82, 0x0366, 0x01b2, 0x0000, - 0x000c, 0x000a, 0x0007, 0x000b, 0x000a, 0x0011, 0x000b, 0x0009, - 0x000d, 0x000c, 0x000a, 0x0007, 0x0005, 0x0003, 0x0001, 0x0003, + 13, 13, 13, 13, 12, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, + 13, 11, 11, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 12, 12, 11, 11, 11, 11, + 11, 11, 11, 11, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 11, 11, 11, 11, 11, + 11, 10, 11, 11, 11, 11, 11, 11, 10, 10, 11, 11, 10, 10, 10, 10, 11, 11, 10, + 10, 10, 10, 10, 10, 10, 11, 11, 10, 10, 10, 10, 10, 11, 11, 9, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 10, 10, 10, 10, 9, 10, 10, 9, 10, + 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 10, 10, 9, 9, 9, + 9, 9, 9, 10, 10, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, + 8, 8, 9, 9, 8, 8, 8, 8, 8, 8, 8, 9, 9, 8, 7, 8, 8, 7, 7, + 7, 7, 8, 8, 7, 7, 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 6, 6, + 5, 5, 5, 5, 5, 3, 4, 4, 3, }; static const uint8_t mpa_huffbits_16[256] = { - 1, 4, 6, 8, 9, 9, 10, 10, - 11, 11, 11, 12, 12, 12, 13, 9, - 3, 4, 6, 7, 8, 9, 9, 9, - 10, 10, 10, 11, 12, 11, 12, 8, - 6, 6, 7, 8, 9, 9, 10, 10, - 11, 10, 11, 11, 11, 12, 12, 9, - 8, 7, 8, 9, 9, 10, 10, 10, - 11, 11, 12, 12, 12, 13, 13, 10, - 9, 8, 9, 9, 10, 10, 11, 11, - 11, 12, 12, 12, 13, 13, 13, 9, - 9, 8, 9, 9, 10, 11, 11, 12, - 11, 12, 12, 13, 13, 13, 14, 10, - 10, 9, 9, 10, 11, 11, 11, 11, - 12, 12, 12, 12, 13, 13, 14, 10, - 10, 9, 10, 10, 11, 11, 11, 12, - 12, 13, 13, 13, 13, 15, 15, 10, - 10, 10, 10, 11, 11, 11, 12, 12, - 13, 13, 13, 13, 14, 14, 14, 10, - 11, 10, 10, 11, 11, 12, 12, 13, - 13, 13, 13, 14, 13, 14, 13, 11, - 11, 11, 10, 11, 12, 12, 12, 12, - 13, 14, 14, 14, 15, 15, 14, 10, - 12, 11, 11, 11, 12, 12, 13, 14, - 14, 14, 14, 14, 14, 13, 14, 11, - 12, 12, 12, 12, 12, 13, 13, 13, - 13, 15, 14, 14, 14, 14, 16, 11, - 14, 12, 12, 12, 13, 13, 14, 14, - 14, 16, 15, 15, 15, 17, 15, 11, - 13, 13, 11, 12, 14, 14, 13, 14, - 14, 15, 16, 15, 17, 15, 14, 11, - 9, 8, 8, 9, 9, 10, 10, 10, - 11, 11, 11, 11, 11, 11, 11, 8, -}; - -static const uint16_t mpa_huffcodes_24[256] = { - 0x000f, 0x000d, 0x002e, 0x0050, 0x0092, 0x0106, 0x00f8, 0x01b2, - 0x01aa, 0x029d, 0x028d, 0x0289, 0x026d, 0x0205, 0x0408, 0x0058, - 0x000e, 0x000c, 0x0015, 0x0026, 0x0047, 0x0082, 0x007a, 0x00d8, - 0x00d1, 0x00c6, 0x0147, 0x0159, 0x013f, 0x0129, 0x0117, 0x002a, - 0x002f, 0x0016, 0x0029, 0x004a, 0x0044, 0x0080, 0x0078, 0x00dd, - 0x00cf, 0x00c2, 0x00b6, 0x0154, 0x013b, 0x0127, 0x021d, 0x0012, - 0x0051, 0x0027, 0x004b, 0x0046, 0x0086, 0x007d, 0x0074, 0x00dc, - 0x00cc, 0x00be, 0x00b2, 0x0145, 0x0137, 0x0125, 0x010f, 0x0010, - 0x0093, 0x0048, 0x0045, 0x0087, 0x007f, 0x0076, 0x0070, 0x00d2, - 0x00c8, 0x00bc, 0x0160, 0x0143, 0x0132, 0x011d, 0x021c, 0x000e, - 0x0107, 0x0042, 0x0081, 0x007e, 0x0077, 0x0072, 0x00d6, 0x00ca, - 0x00c0, 0x00b4, 0x0155, 0x013d, 0x012d, 0x0119, 0x0106, 0x000c, - 0x00f9, 0x007b, 0x0079, 0x0075, 0x0071, 0x00d7, 0x00ce, 0x00c3, - 0x00b9, 0x015b, 0x014a, 0x0134, 0x0123, 0x0110, 0x0208, 0x000a, - 0x01b3, 0x0073, 0x006f, 0x006d, 0x00d3, 0x00cb, 0x00c4, 0x00bb, - 0x0161, 0x014c, 0x0139, 0x012a, 0x011b, 0x0213, 0x017d, 0x0011, - 0x01ab, 0x00d4, 0x00d0, 0x00cd, 0x00c9, 0x00c1, 0x00ba, 0x00b1, - 0x00a9, 0x0140, 0x012f, 0x011e, 0x010c, 0x0202, 0x0179, 0x0010, - 0x014f, 0x00c7, 0x00c5, 0x00bf, 0x00bd, 0x00b5, 0x00ae, 0x014d, - 0x0141, 0x0131, 0x0121, 0x0113, 0x0209, 0x017b, 0x0173, 0x000b, - 0x029c, 0x00b8, 0x00b7, 0x00b3, 0x00af, 0x0158, 0x014b, 0x013a, - 0x0130, 0x0122, 0x0115, 0x0212, 0x017f, 0x0175, 0x016e, 0x000a, - 0x028c, 0x015a, 0x00ab, 0x00a8, 0x00a4, 0x013e, 0x0135, 0x012b, - 0x011f, 0x0114, 0x0107, 0x0201, 0x0177, 0x0170, 0x016a, 0x0006, - 0x0288, 0x0142, 0x013c, 0x0138, 0x0133, 0x012e, 0x0124, 0x011c, - 0x010d, 0x0105, 0x0200, 0x0178, 0x0172, 0x016c, 0x0167, 0x0004, - 0x026c, 0x012c, 0x0128, 0x0126, 0x0120, 0x011a, 0x0111, 0x010a, - 0x0203, 0x017c, 0x0176, 0x0171, 0x016d, 0x0169, 0x0165, 0x0002, - 0x0409, 0x0118, 0x0116, 0x0112, 0x010b, 0x0108, 0x0103, 0x017e, - 0x017a, 0x0174, 0x016f, 0x016b, 0x0168, 0x0166, 0x0164, 0x0000, - 0x002b, 0x0014, 0x0013, 0x0011, 0x000f, 0x000d, 0x000b, 0x0009, - 0x0007, 0x0006, 0x0004, 0x0007, 0x0005, 0x0003, 0x0001, 0x0003, + 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 10, 10, 10, 10, 10, 8, + 10, 10, 9, 9, 9, 9, 10, 16, 17, 17, 15, 15, 16, 16, 14, 15, 15, 14, 14, + 15, 15, 14, 14, 15, 15, 15, 15, 14, 15, 15, 14, 13, 8, 9, 9, 8, 8, 13, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 14, 14, 14, 14, 13, 14, 14, + 13, 13, 13, 14, 14, 14, 14, 13, 13, 14, 14, 13, 14, 14, 12, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 13, 13, 13, 13, 12, 13, + 13, 12, 12, 13, 13, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 11, 12, 12, 12, + 12, 11, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 11, 11, 11, 12, 12, + 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 12, 12, 11, 12, 12, 11, 12, 12, 11, + 10, 10, 11, 11, 11, 11, 11, 11, 10, 10, 11, 11, 10, 10, 11, 11, 11, 11, 11, + 11, 11, 11, 10, 11, 11, 10, 10, 10, 11, 11, 10, 10, 11, 11, 10, 10, 11, 11, + 10, 9, 9, 10, 10, 10, 10, 10, 10, 9, 9, 9, 10, 10, 9, 10, 10, 9, 9, + 8, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 9, 9, 8, 8, 7, 7, 8, 8, + 7, 6, 6, 6, 6, 4, 4, 3, 1, }; static const uint8_t mpa_huffbits_24[256] = { - 4, 4, 6, 7, 8, 9, 9, 10, - 10, 11, 11, 11, 11, 11, 12, 9, - 4, 4, 5, 6, 7, 8, 8, 9, - 9, 9, 10, 10, 10, 10, 10, 8, - 6, 5, 6, 7, 7, 8, 8, 9, - 9, 9, 9, 10, 10, 10, 11, 7, - 7, 6, 7, 7, 8, 8, 8, 9, - 9, 9, 9, 10, 10, 10, 10, 7, - 8, 7, 7, 8, 8, 8, 8, 9, - 9, 9, 10, 10, 10, 10, 11, 7, - 9, 7, 8, 8, 8, 8, 9, 9, - 9, 9, 10, 10, 10, 10, 10, 7, - 9, 8, 8, 8, 8, 9, 9, 9, - 9, 10, 10, 10, 10, 10, 11, 7, - 10, 8, 8, 8, 9, 9, 9, 9, - 10, 10, 10, 10, 10, 11, 11, 8, - 10, 9, 9, 9, 9, 9, 9, 9, - 9, 10, 10, 10, 10, 11, 11, 8, - 10, 9, 9, 9, 9, 9, 9, 10, - 10, 10, 10, 10, 11, 11, 11, 8, - 11, 9, 9, 9, 9, 10, 10, 10, - 10, 10, 10, 11, 11, 11, 11, 8, - 11, 10, 9, 9, 9, 10, 10, 10, - 10, 10, 10, 11, 11, 11, 11, 8, - 11, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 11, 11, 11, 11, 8, - 11, 10, 10, 10, 10, 10, 10, 10, - 11, 11, 11, 11, 11, 11, 11, 8, - 12, 10, 10, 10, 10, 10, 10, 11, - 11, 11, 11, 11, 11, 11, 11, 8, - 8, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 8, 8, 8, 8, 4, + 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 7, 7, 8, 8, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 9, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 4, 11, 11, 11, 11, 12, 12, 11, 10, 11, 11, 10, 10, 10, 10, 11, 11, 10, + 10, 10, 10, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 11, 11, 10, 11, 11, 10, 9, 10, 10, 10, 10, 11, 11, 10, 9, 9, 10, + 10, 9, 10, 10, 10, 10, 9, 9, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 9, 9, 9, 10, 10, 8, 9, 9, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 8, 8, 8, 8, 8, + 8, 9, 9, 7, 8, 8, 7, 7, 7, 7, 7, 8, 8, 7, 7, 6, 6, 7, 7, + 6, 5, 5, 6, 6, 4, 4, 4, 4, +}; + +static const uint8_t mpa_huffsyms_1[4] = { + 0x11, 0x01, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_2[9] = { + 0x22, 0x02, 0x12, 0x21, 0x20, 0x11, 0x01, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_3[9] = { + 0x22, 0x02, 0x12, 0x21, 0x20, 0x10, 0x11, 0x01, 0x00, +}; + +static const uint8_t mpa_huffsyms_5[16] = { + 0x33, 0x23, 0x32, 0x31, 0x13, 0x03, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, + 0x11, 0x01, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_6[16] = { + 0x33, 0x03, 0x23, 0x32, 0x30, 0x13, 0x31, 0x22, 0x02, 0x12, 0x21, 0x20, + 0x01, 0x11, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_7[36] = { + 0x55, 0x45, 0x54, 0x53, 0x35, 0x44, 0x25, 0x52, 0x15, 0x51, 0x05, 0x34, + 0x50, 0x43, 0x33, 0x24, 0x42, 0x14, 0x41, 0x40, 0x04, 0x23, 0x32, 0x03, + 0x13, 0x31, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_8[36] = { + 0x55, 0x54, 0x45, 0x53, 0x35, 0x44, 0x25, 0x52, 0x05, 0x15, 0x51, 0x34, + 0x43, 0x50, 0x33, 0x24, 0x42, 0x14, 0x41, 0x04, 0x40, 0x23, 0x32, 0x13, + 0x31, 0x03, 0x30, 0x22, 0x02, 0x20, 0x12, 0x21, 0x11, 0x01, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_9[36] = { + 0x55, 0x45, 0x35, 0x53, 0x54, 0x05, 0x44, 0x25, 0x52, 0x15, 0x51, 0x34, + 0x43, 0x50, 0x04, 0x24, 0x42, 0x33, 0x40, 0x14, 0x41, 0x23, 0x32, 0x13, + 0x31, 0x03, 0x30, 0x22, 0x02, 0x12, 0x21, 0x20, 0x11, 0x01, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_10[64] = { + 0x77, 0x67, 0x76, 0x57, 0x75, 0x66, 0x47, 0x74, 0x56, 0x65, 0x37, 0x73, + 0x46, 0x55, 0x54, 0x63, 0x27, 0x72, 0x64, 0x07, 0x70, 0x62, 0x45, 0x35, + 0x06, 0x53, 0x44, 0x17, 0x71, 0x36, 0x26, 0x25, 0x52, 0x15, 0x51, 0x34, + 0x43, 0x16, 0x61, 0x60, 0x05, 0x50, 0x24, 0x42, 0x33, 0x04, 0x14, 0x41, + 0x40, 0x23, 0x32, 0x03, 0x13, 0x31, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, + 0x11, 0x01, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_11[64] = { + 0x77, 0x67, 0x76, 0x75, 0x66, 0x47, 0x74, 0x57, 0x55, 0x56, 0x65, 0x37, + 0x73, 0x46, 0x45, 0x54, 0x35, 0x53, 0x27, 0x72, 0x64, 0x07, 0x71, 0x17, + 0x70, 0x36, 0x63, 0x60, 0x44, 0x25, 0x52, 0x05, 0x15, 0x62, 0x26, 0x06, + 0x16, 0x61, 0x51, 0x34, 0x50, 0x43, 0x33, 0x24, 0x42, 0x14, 0x41, 0x04, + 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x21, 0x12, 0x02, 0x20, + 0x11, 0x01, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_12[64] = { + 0x77, 0x67, 0x76, 0x57, 0x75, 0x66, 0x47, 0x74, 0x65, 0x56, 0x37, 0x73, + 0x55, 0x27, 0x72, 0x46, 0x64, 0x17, 0x71, 0x07, 0x70, 0x36, 0x63, 0x45, + 0x54, 0x44, 0x06, 0x05, 0x26, 0x62, 0x61, 0x16, 0x60, 0x35, 0x53, 0x25, + 0x52, 0x15, 0x51, 0x34, 0x43, 0x50, 0x04, 0x24, 0x42, 0x14, 0x33, 0x41, + 0x23, 0x32, 0x40, 0x03, 0x30, 0x13, 0x31, 0x22, 0x12, 0x21, 0x02, 0x20, + 0x00, 0x11, 0x01, 0x10, +}; + +static const uint8_t mpa_huffsyms_13[256] = { + 0xFE, 0xFC, 0xFD, 0xED, 0xFF, 0xEF, 0xDF, 0xEE, 0xCF, 0xDE, 0xBF, 0xFB, + 0xCE, 0xDC, 0xAF, 0xE9, 0xEC, 0xDD, 0xFA, 0xCD, 0xBE, 0xEB, 0x9F, 0xF9, + 0xEA, 0xBD, 0xDB, 0x8F, 0xF8, 0xCC, 0xAE, 0x9E, 0x8E, 0x7F, 0x7E, 0xF7, + 0xDA, 0xAD, 0xBC, 0xCB, 0xF6, 0x6F, 0xE8, 0x5F, 0x9D, 0xD9, 0xF5, 0xE7, + 0xAC, 0xBB, 0x4F, 0xF4, 0xCA, 0xE6, 0xF3, 0x3F, 0x8D, 0xD8, 0x2F, 0xF2, + 0x6E, 0x9C, 0x0F, 0xC9, 0x5E, 0xAB, 0x7D, 0xD7, 0x4E, 0xC8, 0xD6, 0x3E, + 0xB9, 0x9B, 0xAA, 0x1F, 0xF1, 0xF0, 0xBA, 0xE5, 0xE4, 0x8C, 0x6D, 0xE3, + 0xE2, 0x2E, 0x0E, 0x1E, 0xE1, 0xE0, 0x5D, 0xD5, 0x7C, 0xC7, 0x4D, 0x8B, + 0xB8, 0xD4, 0x9A, 0xA9, 0x6C, 0xC6, 0x3D, 0xD3, 0x7B, 0x2D, 0xD2, 0x1D, + 0xB7, 0x5C, 0xC5, 0x99, 0x7A, 0xC3, 0xA7, 0x97, 0x4B, 0xD1, 0x0D, 0xD0, + 0x8A, 0xA8, 0x4C, 0xC4, 0x6B, 0xB6, 0x3C, 0x2C, 0xC2, 0x5B, 0xB5, 0x89, + 0x1C, 0xC1, 0x98, 0x0C, 0xC0, 0xB4, 0x6A, 0xA6, 0x79, 0x3B, 0xB3, 0x88, + 0x5A, 0x2B, 0xA5, 0x69, 0xA4, 0x78, 0x87, 0x94, 0x77, 0x76, 0xB2, 0x1B, + 0xB1, 0x0B, 0xB0, 0x96, 0x4A, 0x3A, 0xA3, 0x59, 0x95, 0x2A, 0xA2, 0x1A, + 0xA1, 0x0A, 0x68, 0xA0, 0x86, 0x49, 0x93, 0x39, 0x58, 0x85, 0x67, 0x29, + 0x92, 0x57, 0x75, 0x38, 0x83, 0x66, 0x47, 0x74, 0x56, 0x65, 0x73, 0x19, + 0x91, 0x09, 0x90, 0x48, 0x84, 0x72, 0x46, 0x64, 0x28, 0x82, 0x18, 0x37, + 0x27, 0x17, 0x71, 0x55, 0x07, 0x70, 0x36, 0x63, 0x45, 0x54, 0x26, 0x62, + 0x35, 0x81, 0x08, 0x80, 0x16, 0x61, 0x06, 0x60, 0x53, 0x44, 0x25, 0x52, + 0x05, 0x15, 0x51, 0x34, 0x43, 0x50, 0x24, 0x42, 0x33, 0x14, 0x41, 0x04, + 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, + 0x11, 0x01, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_15[256] = { + 0xFF, 0xEF, 0xFE, 0xDF, 0xEE, 0xFD, 0xCF, 0xFC, 0xDE, 0xED, 0xBF, 0xFB, + 0xCE, 0xEC, 0xDD, 0xAF, 0xFA, 0xBE, 0xEB, 0xCD, 0xDC, 0x9F, 0xF9, 0xEA, + 0xBD, 0xDB, 0x8F, 0xF8, 0xCC, 0x9E, 0xE9, 0x7F, 0xF7, 0xAD, 0xDA, 0xBC, + 0x6F, 0xAE, 0x0F, 0xCB, 0xF6, 0x8E, 0xE8, 0x5F, 0x9D, 0xF5, 0x7E, 0xE7, + 0xAC, 0xCA, 0xBB, 0xD9, 0x8D, 0x4F, 0xF4, 0x3F, 0xF3, 0xD8, 0xE6, 0x2F, + 0xF2, 0x6E, 0xF0, 0x1F, 0xF1, 0x9C, 0xC9, 0x5E, 0xAB, 0xBA, 0xE5, 0x7D, + 0xD7, 0x4E, 0xE4, 0x8C, 0xC8, 0x3E, 0x6D, 0xD6, 0xE3, 0x9B, 0xB9, 0x2E, + 0xAA, 0xE2, 0x1E, 0xE1, 0x0E, 0xE0, 0x5D, 0xD5, 0x7C, 0xC7, 0x4D, 0x8B, + 0xD4, 0xB8, 0x9A, 0xA9, 0x6C, 0xC6, 0x3D, 0xD3, 0xD2, 0x2D, 0x0D, 0x1D, + 0x7B, 0xB7, 0xD1, 0x5C, 0xD0, 0xC5, 0x8A, 0xA8, 0x4C, 0xC4, 0x6B, 0xB6, + 0x99, 0x0C, 0x3C, 0xC3, 0x7A, 0xA7, 0xA6, 0xC0, 0x0B, 0xC2, 0x2C, 0x5B, + 0xB5, 0x1C, 0x89, 0x98, 0xC1, 0x4B, 0xB4, 0x6A, 0x3B, 0x79, 0xB3, 0x97, + 0x88, 0x2B, 0x5A, 0xB2, 0xA5, 0x1B, 0xB1, 0xB0, 0x69, 0x96, 0x4A, 0xA4, + 0x78, 0x87, 0x3A, 0xA3, 0x59, 0x95, 0x2A, 0xA2, 0x1A, 0xA1, 0x0A, 0xA0, + 0x68, 0x86, 0x49, 0x94, 0x39, 0x93, 0x77, 0x09, 0x58, 0x85, 0x29, 0x67, + 0x76, 0x92, 0x91, 0x19, 0x90, 0x48, 0x84, 0x57, 0x75, 0x38, 0x83, 0x66, + 0x47, 0x28, 0x82, 0x18, 0x81, 0x74, 0x08, 0x80, 0x56, 0x65, 0x37, 0x73, + 0x46, 0x27, 0x72, 0x64, 0x17, 0x55, 0x71, 0x07, 0x70, 0x36, 0x63, 0x45, + 0x54, 0x26, 0x62, 0x16, 0x06, 0x60, 0x35, 0x61, 0x53, 0x44, 0x25, 0x52, + 0x15, 0x51, 0x05, 0x50, 0x34, 0x43, 0x24, 0x42, 0x33, 0x41, 0x14, 0x04, + 0x23, 0x32, 0x40, 0x03, 0x13, 0x31, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, + 0x11, 0x01, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_16[256] = { + 0xEF, 0xFE, 0xDF, 0xFD, 0xCF, 0xFC, 0xBF, 0xFB, 0xAF, 0xFA, 0x9F, 0xF9, + 0xF8, 0x8F, 0x7F, 0xF7, 0x6F, 0xF6, 0xFF, 0x5F, 0xF5, 0x4F, 0xF4, 0xF3, + 0xF0, 0x3F, 0xCE, 0xEC, 0xDD, 0xDE, 0xE9, 0xEA, 0xD9, 0xEE, 0xED, 0xEB, + 0xBE, 0xCD, 0xDC, 0xDB, 0xAE, 0xCC, 0xAD, 0xDA, 0x7E, 0xAC, 0xCA, 0xC9, + 0x7D, 0x5E, 0xBD, 0xF2, 0x2F, 0x0F, 0x1F, 0xF1, 0x9E, 0xBC, 0xCB, 0x8E, + 0xE8, 0x9D, 0xE7, 0xBB, 0x8D, 0xD8, 0x6E, 0xE6, 0x9C, 0xAB, 0xBA, 0xE5, + 0xD7, 0x4E, 0xE4, 0x8C, 0xC8, 0x3E, 0x6D, 0xD6, 0x9B, 0xB9, 0xAA, 0xE1, + 0xD4, 0xB8, 0xA9, 0x7B, 0xB7, 0xD0, 0xE3, 0x0E, 0xE0, 0x5D, 0xD5, 0x7C, + 0xC7, 0x4D, 0x8B, 0x9A, 0x6C, 0xC6, 0x3D, 0x5C, 0xC5, 0x0D, 0x8A, 0xA8, + 0x99, 0x4C, 0xB6, 0x7A, 0x3C, 0x5B, 0x89, 0x1C, 0xC0, 0x98, 0x79, 0xE2, + 0x2E, 0x1E, 0xD3, 0x2D, 0xD2, 0xD1, 0x3B, 0x97, 0x88, 0x1D, 0xC4, 0x6B, + 0xC3, 0xA7, 0x2C, 0xC2, 0xB5, 0xC1, 0x0C, 0x4B, 0xB4, 0x6A, 0xA6, 0xB3, + 0x5A, 0xA5, 0x2B, 0xB2, 0x1B, 0xB1, 0x0B, 0xB0, 0x69, 0x96, 0x4A, 0xA4, + 0x78, 0x87, 0xA3, 0x3A, 0x59, 0x2A, 0x95, 0x68, 0xA1, 0x86, 0x77, 0x94, + 0x49, 0x57, 0x67, 0xA2, 0x1A, 0x0A, 0xA0, 0x39, 0x93, 0x58, 0x85, 0x29, + 0x92, 0x76, 0x09, 0x19, 0x91, 0x90, 0x48, 0x84, 0x75, 0x38, 0x83, 0x66, + 0x28, 0x82, 0x47, 0x74, 0x18, 0x81, 0x80, 0x08, 0x56, 0x37, 0x73, 0x65, + 0x46, 0x27, 0x72, 0x64, 0x55, 0x07, 0x17, 0x71, 0x70, 0x36, 0x63, 0x45, + 0x54, 0x26, 0x62, 0x16, 0x61, 0x06, 0x60, 0x53, 0x35, 0x44, 0x25, 0x52, + 0x51, 0x15, 0x05, 0x34, 0x43, 0x50, 0x24, 0x42, 0x33, 0x14, 0x41, 0x04, + 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, + 0x11, 0x01, 0x10, 0x00, +}; + +static const uint8_t mpa_huffsyms_24[256] = { + 0xEF, 0xFE, 0xDF, 0xFD, 0xCF, 0xFC, 0xBF, 0xFB, 0xFA, 0xAF, 0x9F, 0xF9, + 0xF8, 0x8F, 0x7F, 0xF7, 0x6F, 0xF6, 0x5F, 0xF5, 0x4F, 0xF4, 0x3F, 0xF3, + 0x2F, 0xF2, 0xF1, 0x1F, 0xF0, 0x0F, 0xEE, 0xDE, 0xED, 0xCE, 0xEC, 0xDD, + 0xBE, 0xEB, 0xCD, 0xDC, 0xAE, 0xEA, 0xBD, 0xDB, 0xCC, 0x9E, 0xE9, 0xAD, + 0xDA, 0xBC, 0xCB, 0x8E, 0xE8, 0x9D, 0xD9, 0x7E, 0xE7, 0xAC, 0xFF, 0xCA, + 0xBB, 0x8D, 0xD8, 0x0E, 0xE0, 0x0D, 0xE6, 0x6E, 0x9C, 0xC9, 0x5E, 0xBA, + 0xE5, 0xAB, 0x7D, 0xD7, 0xE4, 0x8C, 0xC8, 0x4E, 0x2E, 0x3E, 0x6D, 0xD6, + 0xE3, 0x9B, 0xB9, 0xAA, 0xE2, 0x1E, 0xE1, 0x5D, 0xD5, 0x7C, 0xC7, 0x4D, + 0x8B, 0xB8, 0xD4, 0x9A, 0xA9, 0x6C, 0xC6, 0x3D, 0xD3, 0x2D, 0xD2, 0x1D, + 0x7B, 0xB7, 0xD1, 0x5C, 0xC5, 0x8A, 0xA8, 0x99, 0x4C, 0xC4, 0x6B, 0xB6, + 0xD0, 0x0C, 0x3C, 0xC3, 0x7A, 0xA7, 0x2C, 0xC2, 0x5B, 0xB5, 0x1C, 0x89, + 0x98, 0xC1, 0x4B, 0xC0, 0x0B, 0x3B, 0xB0, 0x0A, 0x1A, 0xB4, 0x6A, 0xA6, + 0x79, 0x97, 0xA0, 0x09, 0x90, 0xB3, 0x88, 0x2B, 0x5A, 0xB2, 0xA5, 0x1B, + 0xB1, 0x69, 0x96, 0xA4, 0x4A, 0x78, 0x87, 0x3A, 0xA3, 0x59, 0x95, 0x2A, + 0xA2, 0xA1, 0x68, 0x86, 0x77, 0x49, 0x94, 0x39, 0x93, 0x58, 0x85, 0x29, + 0x67, 0x76, 0x92, 0x19, 0x91, 0x48, 0x84, 0x57, 0x75, 0x38, 0x83, 0x66, + 0x28, 0x82, 0x18, 0x47, 0x74, 0x81, 0x08, 0x80, 0x56, 0x65, 0x17, 0x07, + 0x70, 0x73, 0x37, 0x27, 0x72, 0x46, 0x64, 0x55, 0x71, 0x36, 0x63, 0x45, + 0x54, 0x26, 0x62, 0x16, 0x61, 0x06, 0x60, 0x35, 0x53, 0x44, 0x25, 0x52, + 0x15, 0x05, 0x50, 0x51, 0x34, 0x43, 0x24, 0x42, 0x33, 0x14, 0x41, 0x04, + 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, + 0x11, 0x01, 0x10, 0x00, }; static const HuffTable mpa_huff_tables[] = { -{ 2, mpa_huffbits_1, mpa_huffcodes_1 }, -{ 3, mpa_huffbits_2, mpa_huffcodes_2 }, -{ 3, mpa_huffbits_3, mpa_huffcodes_3 }, -{ 4, mpa_huffbits_5, mpa_huffcodes_5 }, -{ 4, mpa_huffbits_6, mpa_huffcodes_6 }, -{ 6, mpa_huffbits_7, mpa_huffcodes_7 }, -{ 6, mpa_huffbits_8, mpa_huffcodes_8 }, -{ 6, mpa_huffbits_9, mpa_huffcodes_9 }, -{ 8, mpa_huffbits_10, mpa_huffcodes_10 }, -{ 8, mpa_huffbits_11, mpa_huffcodes_11 }, -{ 8, mpa_huffbits_12, mpa_huffcodes_12 }, -{ 16, mpa_huffbits_13, mpa_huffcodes_13 }, -{ 16, mpa_huffbits_15, mpa_huffcodes_15 }, -{ 16, mpa_huffbits_16, mpa_huffcodes_16 }, -{ 16, mpa_huffbits_24, mpa_huffcodes_24 }, + { 4, mpa_huffbits_1, mpa_huffsyms_1 }, + { 9, mpa_huffbits_2, mpa_huffsyms_2 }, + { 9, mpa_huffbits_3, mpa_huffsyms_3 }, + { 16, mpa_huffbits_5, mpa_huffsyms_5 }, + { 16, mpa_huffbits_6, mpa_huffsyms_6 }, + { 36, mpa_huffbits_7, mpa_huffsyms_7 }, + { 36, mpa_huffbits_8, mpa_huffsyms_8 }, + { 36, mpa_huffbits_9, mpa_huffsyms_9 }, + { 64, mpa_huffbits_10, mpa_huffsyms_10 }, + { 64, mpa_huffbits_11, mpa_huffsyms_11 }, + { 64, mpa_huffbits_12, mpa_huffsyms_12 }, + { 256, mpa_huffbits_13, mpa_huffsyms_13 }, + { 256, mpa_huffbits_15, mpa_huffsyms_15 }, + { 256, mpa_huffbits_16, mpa_huffsyms_16 }, + { 256, mpa_huffbits_24, mpa_huffsyms_24 }, }; static const uint8_t mpa_huff_data[32][2] = { From patchwork Fri Nov 20 07:33:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23906 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 757A944AB03 for ; Fri, 20 Nov 2020 09:54:33 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 75D0668BDC9; Fri, 20 Nov 2020 09:35:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0D54C68BCED for ; Fri, 20 Nov 2020 09:35:00 +0200 (EET) Received: by mail-ed1-f66.google.com with SMTP id k4so8529656edl.0 for ; Thu, 19 Nov 2020 23:35:00 -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=OuxYqJ/QBmqOWcNwpkg2vXDoqXk/nBiqfzEMbI36hq4=; b=bG0PpU2vLMGf9VCkLS5YRKPLH9PTgwNVk3QhKfXTBaSfY7cdCl2GrZNiolK813zu21 fai6GQACnERu+7d3SG5rwUe0rMtqNIH+OOidSUkb9z1xB/9R5KJH8axpJQxSv4qS9b8/ uPPEvlAv2IpeY0ZkQPZoffYEl0c0tkdCecZyei3eQsXtweW1MBiXAcOQYs4n1GKxK2M0 8XVjam6WC8rf2EwRUR6kCULtoY1flY6GpwHDtBoTeKAXTpS7xyKp3vjWD16jYFugPNn9 BOKrNfRO0t7iThKcUKlA5GnO/In9cpojB5T8c2ZArL845XkZ1jgmP/XKQfXCoKSJOUg6 4t6A== 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=OuxYqJ/QBmqOWcNwpkg2vXDoqXk/nBiqfzEMbI36hq4=; b=VMZFYigVPm1vEUL3MRxn7WRJ4mO6JASufBijO6vQVXTJ2mAM+8J34piH6441s5PUEz wCnUc9BJW+FG4dyI2XjaxAJrYlHqMwikD+ES5nFz/E8J+sTHNM5rsA2MAb1mZNGJLUY+ bIXIQ5bYDlen6f5lH+eS1Z3Mai2NYvUPefkdtaxsmLYCSJnhppl+Chv2vO/OQseF82wL +30ZwEgyynpzzvx9SC6PdGpJZupcDAGXMS6MsXt+V0NjANqntrkeKq42RohjJS6XntnK dDqPv8C4mG63VcVXyyPd/I70SYZVC3KOoE0rOp1sVZvYwuwFqFKLw9+wQLt8+FoAEV8U ieYw== X-Gm-Message-State: AOAM5303me14CKRog6oxAPyxvrAxU39RvbJv9xOwBl8U//VpPoQDFs2I FvAuCxV0iQR+W9z+Gs5w/XxNY48elMRiiQ== X-Google-Smtp-Source: ABdhPJwQfoQWx48k7r1bQ+WRB2yzj1UJsaD5u7q0prixy3/KD5/thcq95rX7Tc0K/87VaFjl3krwxQ== X-Received: by 2002:aa7:d2c4:: with SMTP id k4mr15646495edr.367.1605857699866; Thu, 19 Nov 2020 23:34:59 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:59 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:20 +0100 Message-Id: <20201120073327.820745-56-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 155/162] avcodec/mpegaudiodec: Combine tables used to initialize 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" Up until now, there were several indiviual tables which were accessed via pointers to them; by combining the tables, one can avoid said pointers, saving space. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegaudiodec_template.c | 15 +-- libavcodec/mpegaudiodectab.h | 144 +++++++---------------------- 2 files changed, 44 insertions(+), 115 deletions(-) diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index edd69684da..b03f7cfc33 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -257,6 +257,7 @@ static inline int l3_unscale(int value, int exponent) static av_cold void decode_init_static(void) { + const uint8_t *huff_sym = mpa_huffsymbols, *huff_lens = mpa_hufflens; int i, j, k; int offset; @@ -287,12 +288,12 @@ static av_cold void decode_init_static(void) /* huffman decode tables */ offset = 0; for (int i = 0; i < 15;) { - const HuffTable *h = &mpa_huff_tables[i]; uint16_t tmp_symbols[256]; - int nb_codes = h->nb_codes; + int nb_codes_minus_one = mpa_huff_sizes_minus_one[i]; + int j; - for (int j = 0; j < nb_codes; j++) { - uint8_t high = h->symbols[j] & 0xF0, low = h->symbols[j] & 0xF; + for (j = 0; j <= nb_codes_minus_one; j++) { + uint8_t high = huff_sym[j] & 0xF0, low = huff_sym[j] & 0xF; tmp_symbols[j] = high << 1 | ((high && low) << 4) | low; } @@ -300,10 +301,12 @@ static av_cold void decode_init_static(void) /* XXX: fail test */ huff_vlc[++i].table = huff_vlc_tables + offset; huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset; - ff_init_vlc_from_lengths(&huff_vlc[i], 7, nb_codes, - h->bits, 1, tmp_symbols, 2, 2, + ff_init_vlc_from_lengths(&huff_vlc[i], 7, j, + huff_lens, 1, tmp_symbols, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); offset += huff_vlc[i].table_size; + huff_lens += j; + huff_sym += j; } av_assert0(offset == FF_ARRAY_ELEMS(huff_vlc_tables)); diff --git a/libavcodec/mpegaudiodectab.h b/libavcodec/mpegaudiodectab.h index 8d2b8af150..f895ad8eaa 100644 --- a/libavcodec/mpegaudiodectab.h +++ b/libavcodec/mpegaudiodectab.h @@ -35,13 +35,6 @@ /*******************************************************/ /* layer 3 tables */ -/* layer 3 huffman tables */ -typedef struct HuffTable { - int nb_codes; - const uint8_t *bits; - const uint8_t *symbols; -} HuffTable; - /* layer3 scale factor size */ static const uint8_t slen_table[2][16] = { { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }, @@ -59,63 +52,42 @@ static const uint8_t lsf_nsf_table[6][3][4] = { }; /* mpegaudio layer 3 huffman tables */ -static const uint8_t mpa_huffbits_1[4] = { +static const uint8_t mpa_hufflens[] = { + /* Huffman table 1 - 4 entries */ 3, 3, 2, 1, -}; - -static const uint8_t mpa_huffbits_2[9] = { + /* Huffman table 2 - 9 entries */ 6, 6, 5, 5, 5, 3, 3, 3, 1, -}; - -static const uint8_t mpa_huffbits_3[9] = { + /* Huffman table 3 - 9 entries */ 6, 6, 5, 5, 5, 3, 2, 2, 2, -}; - -static const uint8_t mpa_huffbits_5[16] = { + /* Huffman table 5 - 16 entries */ 8, 8, 7, 6, 7, 7, 7, 7, 6, 6, 6, 6, 3, 3, 3, 1, -}; - -static const uint8_t mpa_huffbits_6[16] = { + /* Huffman table 6 - 16 entries */ 7, 7, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 3, 2, 3, 3, -}; - -static const uint8_t mpa_huffbits_7[36] = { + /* Huffman table 7 - 36 entries */ 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 9, 9, 8, 9, 9, 8, 8, 7, 7, 7, 8, 8, 8, 8, 7, 7, 7, 7, 6, 5, 6, 6, 4, 3, 3, 1, -}; - -static const uint8_t mpa_huffbits_8[36] = { + /* Huffman table 8 - 36 entries */ 11, 11, 10, 9, 10, 10, 9, 9, 9, 8, 8, 9, 9, 9, 9, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 6, 4, 4, 2, 3, 3, 2, -}; - -static const uint8_t mpa_huffbits_9[36] = { + /* Huffman table 9 - 36 entries */ 9, 9, 8, 8, 9, 9, 8, 8, 8, 8, 7, 7, 7, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, -}; - -static const uint8_t mpa_huffbits_10[64] = { + /* Huffman table 10 - 64 entries */ 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 11, 11, 10, 9, 9, 10, 10, 9, 9, 10, 10, 9, 10, 10, 8, 8, 9, 9, 10, 10, 9, 9, 10, 10, 8, 8, 8, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 4, 3, 3, 1, -}; - -static const uint8_t mpa_huffbits_11[64] = { + /* Huffman table 11 - 64 entries */ 10, 10, 10, 10, 10, 10, 10, 11, 11, 10, 10, 9, 9, 9, 10, 10, 10, 10, 8, 8, 9, 9, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 8, 7, 8, 8, 7, 7, 8, 8, 8, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, 6, 6, 7, 7, 6, 5, 4, 5, 5, 3, 3, 3, 2, -}; - -static const uint8_t mpa_huffbits_12[64] = { + /* Huffman table 12 - 64 entries */ 10, 10, 9, 9, 9, 9, 9, 9, 9, 8, 8, 9, 9, 8, 8, 8, 8, 8, 8, 9, 9, 8, 8, 8, 8, 8, 9, 9, 7, 7, 7, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 8, 8, 7, 7, 7, 6, 6, 6, 6, 7, 7, 6, 5, 5, 5, 4, 4, 5, 5, 4, 3, 3, 3, -}; - -static const uint8_t mpa_huffbits_13[256] = { + /* Huffman table 13 - 256 entries */ 19, 19, 18, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 15, 15, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 15, 16, 16, 14, 14, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 14, 13, 14, @@ -130,9 +102,7 @@ static const uint8_t mpa_huffbits_13[256] = { 10, 10, 10, 10, 10, 10, 10, 10, 8, 9, 9, 9, 9, 9, 9, 10, 10, 9, 9, 9, 8, 8, 9, 9, 9, 9, 9, 9, 8, 7, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 4, 4, 3, 1, -}; - -static const uint8_t mpa_huffbits_15[256] = { + /* Huffman table 15 - 256 entries */ 13, 13, 13, 13, 12, 13, 13, 13, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 11, 11, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 12, 12, 11, 11, 11, 11, @@ -147,9 +117,7 @@ static const uint8_t mpa_huffbits_15[256] = { 8, 8, 9, 9, 8, 8, 8, 8, 8, 8, 8, 9, 9, 8, 7, 8, 8, 7, 7, 7, 7, 8, 8, 7, 7, 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 6, 6, 5, 5, 5, 5, 5, 3, 4, 4, 3, -}; - -static const uint8_t mpa_huffbits_16[256] = { + /* Huffman table 16 - 256 entries */ 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 10, 10, 10, 10, 10, 8, 10, 10, 9, 9, 9, 9, 10, 16, 17, 17, 15, 15, 16, 16, 14, 15, 15, 14, 14, 15, 15, 14, 14, 15, 15, 15, 15, 14, 15, 15, 14, 13, 8, 9, 9, 8, 8, 13, @@ -164,9 +132,7 @@ static const uint8_t mpa_huffbits_16[256] = { 10, 9, 9, 10, 10, 10, 10, 10, 10, 9, 9, 9, 10, 10, 9, 10, 10, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 9, 9, 8, 8, 7, 7, 8, 8, 7, 6, 6, 6, 6, 4, 4, 3, 1, -}; - -static const uint8_t mpa_huffbits_24[256] = { + /* Huffman table 24 - 256 entries */ 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 7, 7, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, @@ -183,74 +149,53 @@ static const uint8_t mpa_huffbits_24[256] = { 6, 5, 5, 6, 6, 4, 4, 4, 4, }; -static const uint8_t mpa_huffsyms_1[4] = { +static const uint8_t mpa_huffsymbols[] = { + /* Huffman table 1 - 4 entries */ 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_2[9] = { + /* Huffman table 2 - 9 entries */ 0x22, 0x02, 0x12, 0x21, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_3[9] = { + /* Huffman table 3 - 9 entries */ 0x22, 0x02, 0x12, 0x21, 0x20, 0x10, 0x11, 0x01, 0x00, -}; - -static const uint8_t mpa_huffsyms_5[16] = { + /* Huffman table 5 - 16 entries */ 0x33, 0x23, 0x32, 0x31, 0x13, 0x03, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_6[16] = { + /* Huffman table 6 - 16 entries */ 0x33, 0x03, 0x23, 0x32, 0x30, 0x13, 0x31, 0x22, 0x02, 0x12, 0x21, 0x20, 0x01, 0x11, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_7[36] = { + /* Huffman table 7 - 36 entries */ 0x55, 0x45, 0x54, 0x53, 0x35, 0x44, 0x25, 0x52, 0x15, 0x51, 0x05, 0x34, 0x50, 0x43, 0x33, 0x24, 0x42, 0x14, 0x41, 0x40, 0x04, 0x23, 0x32, 0x03, 0x13, 0x31, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_8[36] = { + /* Huffman table 8 - 36 entries */ 0x55, 0x54, 0x45, 0x53, 0x35, 0x44, 0x25, 0x52, 0x05, 0x15, 0x51, 0x34, 0x43, 0x50, 0x33, 0x24, 0x42, 0x14, 0x41, 0x04, 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x02, 0x20, 0x12, 0x21, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_9[36] = { + /* Huffman table 9 - 36 entries */ 0x55, 0x45, 0x35, 0x53, 0x54, 0x05, 0x44, 0x25, 0x52, 0x15, 0x51, 0x34, 0x43, 0x50, 0x04, 0x24, 0x42, 0x33, 0x40, 0x14, 0x41, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x02, 0x12, 0x21, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_10[64] = { + /* Huffman table 10 - 64 entries */ 0x77, 0x67, 0x76, 0x57, 0x75, 0x66, 0x47, 0x74, 0x56, 0x65, 0x37, 0x73, 0x46, 0x55, 0x54, 0x63, 0x27, 0x72, 0x64, 0x07, 0x70, 0x62, 0x45, 0x35, 0x06, 0x53, 0x44, 0x17, 0x71, 0x36, 0x26, 0x25, 0x52, 0x15, 0x51, 0x34, 0x43, 0x16, 0x61, 0x60, 0x05, 0x50, 0x24, 0x42, 0x33, 0x04, 0x14, 0x41, 0x40, 0x23, 0x32, 0x03, 0x13, 0x31, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_11[64] = { + /* Huffman table 11 - 64 entries */ 0x77, 0x67, 0x76, 0x75, 0x66, 0x47, 0x74, 0x57, 0x55, 0x56, 0x65, 0x37, 0x73, 0x46, 0x45, 0x54, 0x35, 0x53, 0x27, 0x72, 0x64, 0x07, 0x71, 0x17, 0x70, 0x36, 0x63, 0x60, 0x44, 0x25, 0x52, 0x05, 0x15, 0x62, 0x26, 0x06, 0x16, 0x61, 0x51, 0x34, 0x50, 0x43, 0x33, 0x24, 0x42, 0x14, 0x41, 0x04, 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x21, 0x12, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_12[64] = { + /* Huffman table 12 - 64 entries */ 0x77, 0x67, 0x76, 0x57, 0x75, 0x66, 0x47, 0x74, 0x65, 0x56, 0x37, 0x73, 0x55, 0x27, 0x72, 0x46, 0x64, 0x17, 0x71, 0x07, 0x70, 0x36, 0x63, 0x45, 0x54, 0x44, 0x06, 0x05, 0x26, 0x62, 0x61, 0x16, 0x60, 0x35, 0x53, 0x25, 0x52, 0x15, 0x51, 0x34, 0x43, 0x50, 0x04, 0x24, 0x42, 0x14, 0x33, 0x41, 0x23, 0x32, 0x40, 0x03, 0x30, 0x13, 0x31, 0x22, 0x12, 0x21, 0x02, 0x20, 0x00, 0x11, 0x01, 0x10, -}; - -static const uint8_t mpa_huffsyms_13[256] = { + /* Huffman table 13 - 256 entries */ 0xFE, 0xFC, 0xFD, 0xED, 0xFF, 0xEF, 0xDF, 0xEE, 0xCF, 0xDE, 0xBF, 0xFB, 0xCE, 0xDC, 0xAF, 0xE9, 0xEC, 0xDD, 0xFA, 0xCD, 0xBE, 0xEB, 0x9F, 0xF9, 0xEA, 0xBD, 0xDB, 0x8F, 0xF8, 0xCC, 0xAE, 0x9E, 0x8E, 0x7F, 0x7E, 0xF7, @@ -273,9 +218,7 @@ static const uint8_t mpa_huffsyms_13[256] = { 0x05, 0x15, 0x51, 0x34, 0x43, 0x50, 0x24, 0x42, 0x33, 0x14, 0x41, 0x04, 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_15[256] = { + /* Huffman table 15 - 256 entries */ 0xFF, 0xEF, 0xFE, 0xDF, 0xEE, 0xFD, 0xCF, 0xFC, 0xDE, 0xED, 0xBF, 0xFB, 0xCE, 0xEC, 0xDD, 0xAF, 0xFA, 0xBE, 0xEB, 0xCD, 0xDC, 0x9F, 0xF9, 0xEA, 0xBD, 0xDB, 0x8F, 0xF8, 0xCC, 0x9E, 0xE9, 0x7F, 0xF7, 0xAD, 0xDA, 0xBC, @@ -298,9 +241,7 @@ static const uint8_t mpa_huffsyms_15[256] = { 0x15, 0x51, 0x05, 0x50, 0x34, 0x43, 0x24, 0x42, 0x33, 0x41, 0x14, 0x04, 0x23, 0x32, 0x40, 0x03, 0x13, 0x31, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_16[256] = { + /* Huffman table 16 - 256 entries */ 0xEF, 0xFE, 0xDF, 0xFD, 0xCF, 0xFC, 0xBF, 0xFB, 0xAF, 0xFA, 0x9F, 0xF9, 0xF8, 0x8F, 0x7F, 0xF7, 0x6F, 0xF6, 0xFF, 0x5F, 0xF5, 0x4F, 0xF4, 0xF3, 0xF0, 0x3F, 0xCE, 0xEC, 0xDD, 0xDE, 0xE9, 0xEA, 0xD9, 0xEE, 0xED, 0xEB, @@ -323,9 +264,7 @@ static const uint8_t mpa_huffsyms_16[256] = { 0x51, 0x15, 0x05, 0x34, 0x43, 0x50, 0x24, 0x42, 0x33, 0x14, 0x41, 0x04, 0x40, 0x23, 0x32, 0x13, 0x31, 0x03, 0x30, 0x22, 0x12, 0x21, 0x02, 0x20, 0x11, 0x01, 0x10, 0x00, -}; - -static const uint8_t mpa_huffsyms_24[256] = { + /* Huffman table 24 - 256 entries */ 0xEF, 0xFE, 0xDF, 0xFD, 0xCF, 0xFC, 0xBF, 0xFB, 0xFA, 0xAF, 0x9F, 0xF9, 0xF8, 0x8F, 0x7F, 0xF7, 0x6F, 0xF6, 0x5F, 0xF5, 0x4F, 0xF4, 0x3F, 0xF3, 0x2F, 0xF2, 0xF1, 0x1F, 0xF0, 0x0F, 0xEE, 0xDE, 0xED, 0xCE, 0xEC, 0xDD, @@ -350,22 +289,9 @@ static const uint8_t mpa_huffsyms_24[256] = { 0x11, 0x01, 0x10, 0x00, }; -static const HuffTable mpa_huff_tables[] = { - { 4, mpa_huffbits_1, mpa_huffsyms_1 }, - { 9, mpa_huffbits_2, mpa_huffsyms_2 }, - { 9, mpa_huffbits_3, mpa_huffsyms_3 }, - { 16, mpa_huffbits_5, mpa_huffsyms_5 }, - { 16, mpa_huffbits_6, mpa_huffsyms_6 }, - { 36, mpa_huffbits_7, mpa_huffsyms_7 }, - { 36, mpa_huffbits_8, mpa_huffsyms_8 }, - { 36, mpa_huffbits_9, mpa_huffsyms_9 }, - { 64, mpa_huffbits_10, mpa_huffsyms_10 }, - { 64, mpa_huffbits_11, mpa_huffsyms_11 }, - { 64, mpa_huffbits_12, mpa_huffsyms_12 }, - { 256, mpa_huffbits_13, mpa_huffsyms_13 }, - { 256, mpa_huffbits_15, mpa_huffsyms_15 }, - { 256, mpa_huffbits_16, mpa_huffsyms_16 }, - { 256, mpa_huffbits_24, mpa_huffsyms_24 }, +static const uint8_t mpa_huff_sizes_minus_one[] = +{ + 3, 8, 8, 15, 15, 35, 35, 35, 63, 63, 63, 255, 255, 255, 255 }; static const uint8_t mpa_huff_data[32][2] = { From patchwork Fri Nov 20 07:33:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23908 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 605B744AB03 for ; Fri, 20 Nov 2020 09:54:58 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 31E9E68BDAC; Fri, 20 Nov 2020 09:35:14 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DE76768BCF1 for ; Fri, 20 Nov 2020 09:35:01 +0200 (EET) Received: by mail-ed1-f65.google.com with SMTP id t9so8494404edq.8 for ; Thu, 19 Nov 2020 23:35:01 -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=kVoS/eviu9eDF2hezAx6m8lvxGMmu5if0jfbxhoNp7g=; b=Tm8/3I930iNpEoIrRP1h7N4yBA/T35x2T7BSVG9DRtT0gQvU6HDjEGsCiHli9G+CeL Qx6ewetwIKIMOum2M/kxexQu+YXgscLwQFAEslM8tEnw2KaNIGJzvIoEU6eCTH6M4iLf tARUEYNYHkMurDjwpsgHh21D2sLvSKuQ2XxECxTZ6XC0GsVSOd4rSId85fScnBETPBI3 z5q7LEw0ad16bbn5oyPSz+47uJsBdSJkRoOItaUJMLOqafzpBGh/KLC0CBGtIyDWuSny MYFLWyDBp0tH8GLnEFviX4dX27DI/lrx70uh6UBkQNOD6BOFC3NVG2wRGEMhu6IofkgN /vmQ== 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=kVoS/eviu9eDF2hezAx6m8lvxGMmu5if0jfbxhoNp7g=; b=U4XA4skeZA0f+Z1h0UpUfAe0Yd1viVM/zqkSmif954SibPg6gKxOOliAL205rbiA8T 7v/u9IOQEcfMyNmr0h0CVvV4AVKOCjXutUNROWa1nZX7LRQ071nmaYVtfMy3Cu7T+/zG c9G4z96/05AZNwh4Z/dIvMSuWLEmoXOw10ZjhYPLH830DDGOrN61U8K+YOkayN6XJ5h8 R+y6ugJlx43+opQ8mpKOS9D1QklICrvXTTdEczqCO/5HW4NUhMZhIWITQ59+iD6UGJ++ p3u2WmqLipFXy3WkjRz10jwRRRC+Lgzv8xxXsJIP59o/a6H0FNQCabyldDQKSsjown/3 1yMQ== X-Gm-Message-State: AOAM533kN+pIFxlIMrNdZJX1XUsSmrR1UyXizCCsWbfpnFmoUTc3cKz+ +i/F4BybXM3HaGyhGE9gZGblYl8k3eZrQQ== X-Google-Smtp-Source: ABdhPJxxXXvEEm9OwWCA/bffoBbTRX3hjLVoDKEnydwi+qzF+5th53Nf7NcIj6ee9QUNu8NPIuneOQ== X-Received: by 2002:a05:6402:22af:: with SMTP id cx15mr33260985edb.207.1605857701112; Thu, 19 Nov 2020 23:35:01 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:35:00 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:21 +0100 Message-Id: <20201120073327.820745-57-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 156/162] avcodec/mpegaudiodec: Make decoders init-threadsafe 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" Simple now that ff_mpadsp_init() and ff_mpa_synth_init_* are thread-safe. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegaudiodec_fixed.c | 6 +++++- libavcodec/mpegaudiodec_float.c | 6 +++++- libavcodec/mpegaudiodec_template.c | 10 ++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/libavcodec/mpegaudiodec_fixed.c b/libavcodec/mpegaudiodec_fixed.c index a2c433954b..853c55528d 100644 --- a/libavcodec/mpegaudiodec_fixed.c +++ b/libavcodec/mpegaudiodec_fixed.c @@ -52,6 +52,7 @@ AVCodec ff_mp1_decoder = { .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP2_DECODER @@ -68,6 +69,7 @@ AVCodec ff_mp2_decoder = { .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3_DECODER @@ -84,6 +86,7 @@ AVCodec ff_mp3_decoder = { .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ADU_DECODER @@ -100,6 +103,7 @@ AVCodec ff_mp3adu_decoder = { .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ON4_DECODER @@ -116,6 +120,6 @@ AVCodec ff_mp3on4_decoder = { .flush = flush_mp3on4, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/mpegaudiodec_float.c b/libavcodec/mpegaudiodec_float.c index 4aa52d4f53..88438ea21a 100644 --- a/libavcodec/mpegaudiodec_float.c +++ b/libavcodec/mpegaudiodec_float.c @@ -52,6 +52,7 @@ AVCodec ff_mp1float_decoder = { .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP2FLOAT_DECODER @@ -68,6 +69,7 @@ AVCodec ff_mp2float_decoder = { .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3FLOAT_DECODER @@ -84,6 +86,7 @@ AVCodec ff_mp3float_decoder = { .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ADUFLOAT_DECODER @@ -100,6 +103,7 @@ AVCodec ff_mp3adufloat_decoder = { .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ON4FLOAT_DECODER @@ -116,6 +120,6 @@ AVCodec ff_mp3on4float_decoder = { .flush = flush_mp3on4, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index b03f7cfc33..1faaa0ae52 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -30,6 +30,7 @@ #include "libavutil/crc.h" #include "libavutil/float_dsp.h" #include "libavutil/libm.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "get_bits.h" #include "internal.h" @@ -405,14 +406,9 @@ static av_cold void decode_init_static(void) static av_cold int decode_init(AVCodecContext * avctx) { - static int initialized_tables = 0; + static AVOnce init_static_once = AV_ONCE_INIT; MPADecodeContext *s = avctx->priv_data; - if (!initialized_tables) { - decode_init_static(); - initialized_tables = 1; - } - s->avctx = avctx; #if USE_FLOATS @@ -438,6 +434,8 @@ static av_cold int decode_init(AVCodecContext * avctx) if (avctx->codec_id == AV_CODEC_ID_MP3ADU) s->adu_mode = 1; + ff_thread_once(&init_static_once, decode_init_static); + return 0; } From patchwork Fri Nov 20 07:33:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23910 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 1F85644AD6B for ; Fri, 20 Nov 2020 09:55:10 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0469B68BDD0; Fri, 20 Nov 2020 09:35:15 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1D96868BD99 for ; Fri, 20 Nov 2020 09:35:03 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id o21so11523888ejb.3 for ; Thu, 19 Nov 2020 23:35:03 -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=8vvS84SvE5tPZ/6wESk9s93w3eeMCie4nZBP4tIj8uM=; b=AeZie+pebqOcfXWbsu0ggWSvJC5bQ/6v96L80j6QbOkmu95TwvNRNg9YtxVAhcV50k Kh7y3R3cfFMzUDVAUCIGSBhfpsHkk+1QWQ4jb7ZuXfJsPMmxN1y4Ee68clHqMHQOadQ0 A8OsumdpGRc9vOU9sGOKFsm/5SzyByvQNrc07zFqzyQ6EBeXQnmZDY4qei9OpTE4CQhk 7WhFJIyg1XulwUNvG0hnh2aJl2QVU00Pvf6+5Zszb6CN0DiIhCCPipoy70KHy/HHzA5T pApI9n9FIuon/uSUHti/GIlHOgkKQZrDkC6/M52PVxMBa083wx3VgvHUcmk2k2ARenKd wW1g== 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=8vvS84SvE5tPZ/6wESk9s93w3eeMCie4nZBP4tIj8uM=; b=rwzhJ35PGOJlBM56PiTJ/loTSI9GA/VFBzZN114+R4jHoZff8K0DODRmHZmpXV+UZx haPmjAGPRBlwdFfxKbl9H+FZo+LR9i9k7xkvyILBc1u6EqdnfeGGCFqPCpnIO6cqatPs RNbfD5O6G5oMEna/lTIZLWx1bZkDC9QiXfllnVp6TR0B9GWCf5k0cwgSuqe5I1KFWgUI ZAg/Zwr0+YlAP+1junb8RdPH9Wq7DNtSWpMuDMQex4bnmyUQodVxdQGw2gBwVRv+vOAp PAJ6o7BDGfy2hc0Tzw9Sx8r8zznLs8tCUxeyfYitkafLtjIZHsnyHYATKE6+6+1I/OqK TwkQ== X-Gm-Message-State: AOAM533nJ83TmnbNB/3AwhXkYU4BkXG3iCj6AtGAuowwxgd6w713qfJ3 bdsQYNi1vgMzRvTDPlMPobvSFlcUDiJbuQ== X-Google-Smtp-Source: ABdhPJyUf2uNB1KzoPn77yTFrppXJLZA6VEw841HnbuqQQW02i3ECBBGwqhlSxysHc4EQ/iH1znxDw== X-Received: by 2002:a17:906:12cf:: with SMTP id l15mr33443859ejb.540.1605857702181; Thu, 19 Nov 2020 23:35:02 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:35:01 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:22 +0100 Message-Id: <20201120073327.820745-58-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 157/162] avcodec/mpegaudiodec_template: Apply shift during init 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/mpegaudiodec_template.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 1faaa0ae52..3fb09511bc 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -174,10 +174,10 @@ static void init_long_region(MPADecodeContext *s, GranuleDef *g, int ra1, int ra2) { int l; - g->region_size[0] = band_index_long[s->sample_rate_index][ra1 + 1] >> 1; + g->region_size[0] = band_index_long[s->sample_rate_index][ra1 + 1]; /* should not overflow */ l = FFMIN(ra1 + ra2 + 2, 22); - g->region_size[1] = band_index_long[s->sample_rate_index][ l] >> 1; + g->region_size[1] = band_index_long[s->sample_rate_index][ l]; } static void compute_band_indexes(MPADecodeContext *s, GranuleDef *g) @@ -327,7 +327,7 @@ static av_cold void decode_init_static(void) k = 0; for (j = 0; j < 22; j++) { band_index_long[i][j] = k; - k += band_size_long[i][j]; + k += band_size_long[i][j] >> 1; } band_index_long[i][22] = k; } From patchwork Fri Nov 20 07:33:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23912 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 2FBEE44AD6B for ; Fri, 20 Nov 2020 09:55:21 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E170968BDCE; Fri, 20 Nov 2020 09:35:15 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B2B768BD13 for ; Fri, 20 Nov 2020 09:35:04 +0200 (EET) Received: by mail-ej1-f47.google.com with SMTP id f20so11520775ejz.4 for ; Thu, 19 Nov 2020 23:35:04 -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=oP4HfWtRVTT9qy/SNN5PHvfnBHtNOzpJ0HYKykE9Bcw=; b=bWy7Ss5TPhCYdWANW8193AeHkVBABrBrygGQw20NPIJY0zxzauUrrj569mp95dSTeU 3JJBSQTo6rp58jKJfsXJGEwqO5m+BGsfYARQqtQXVF0D61RgXmwHp+WzAoEeAdDN8FIv ZFzLk3/ZL3CcYY9PcinQC8xvRQM0pkDjZ6cbJJSLQGZYf5sIrmm+j4S11TOcEyLyjd+B M62UGLobmZbsYEQlz5rScvhAwd89lQONHPyLXGL60Kuyvu/YRkAQWy9whpy3Q+E8kN9x 7Pz4kHJdjpCKYC6pOBgw2EhZvkT2Q/A+yVCq9K8QoNquGpFoNEIgy3YbOh7C44tBEuCA HebQ== 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=oP4HfWtRVTT9qy/SNN5PHvfnBHtNOzpJ0HYKykE9Bcw=; b=iUIwSOZ08sSortLgaXTnLQMSpyP4kwXqguieplzjCWsSvYxN1FH8zfVCvoiUbmOoJh MZya39RYSk9YNO0bO2LOh0EY5uOlMommt9YfmxhfojFdPKL7tj5i2T2OpgDFm/vUM3sK r1TBSo5mzRtX2+71xzetxqeJzujM23B47VYRuxMZRtzgHuzJVjt1j+2OKTW8vj2YANTZ XHpIKaSVKk8pd267HtGUGerGJZN74npMvLmTy4Ee056OgzoIwj0RVA9eKB1+eGmHOwCn 8OC155nOShcO6KO8OUzuCxCw+pGWWnb4zbGOl5KuNUAnoozh7CJ462NJ7t11qVpwvjSI 1Vyw== X-Gm-Message-State: AOAM532rDuwItOqBJcJCBG9rRuM/9PjVQM5DYCJywzt5vi+DDEsYMpsy dHvfAA6EjhADfmfSMJlAUNzNm8jC+1MTnA== X-Google-Smtp-Source: ABdhPJwA0RyEB3SHaR3xhcnqvSBAYZwvXGFOdMcSqA2rQo+70+oEnPrYsYPZX/j3zzhGfPpcgCMWEQ== X-Received: by 2002:a17:906:2806:: with SMTP id r6mr24916972ejc.130.1605857703370; Thu, 19 Nov 2020 23:35:03 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:35:02 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:23 +0100 Message-Id: <20201120073327.820745-59-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 158/162] avcodec/mpegaudiodec: Share fixed and floating point data and init code 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/Makefile | 2 +- libavcodec/mpegaudiodata.h | 31 ++++ ...pegaudiodectab.h => mpegaudiodec_common.c} | 127 ++++++++++++++-- libavcodec/mpegaudiodec_template.c | 137 +++--------------- 4 files changed, 165 insertions(+), 132 deletions(-) rename libavcodec/{mpegaudiodectab.h => mpegaudiodec_common.c} (84%) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index b4777be4d4..a851a0a3b2 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -118,7 +118,7 @@ OBJS-$(CONFIG_MDCT) += mdct_fixed.o mdct_float.o mdct_fixed_3 OBJS-$(CONFIG_ME_CMP) += me_cmp.o OBJS-$(CONFIG_MEDIACODEC) += mediacodecdec_common.o mediacodec_surface.o mediacodec_wrapper.o mediacodec_sw_buffer.o OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o -OBJS-$(CONFIG_MPEGAUDIO) += mpegaudio.o +OBJS-$(CONFIG_MPEGAUDIO) += mpegaudio.o mpegaudiodec_common.o OBJS-$(CONFIG_MPEGAUDIODSP) += mpegaudiodsp.o \ mpegaudiodsp_data.o \ mpegaudiodsp_fixed.o \ diff --git a/libavcodec/mpegaudiodata.h b/libavcodec/mpegaudiodata.h index a188150cbf..ec969353f3 100644 --- a/libavcodec/mpegaudiodata.h +++ b/libavcodec/mpegaudiodata.h @@ -30,6 +30,7 @@ #include #include "internal.h" +#include "vlc.h" #define MODE_EXT_MS_STEREO 2 #define MODE_EXT_I_STEREO 1 @@ -41,4 +42,34 @@ extern const int ff_mpa_quant_steps[17]; extern const int ff_mpa_quant_bits[17]; extern const unsigned char * const ff_mpa_alloc_tables[5]; +/* VLCs for decoding layer 3 huffman tables */ +extern VLC ff_huff_vlc[16]; +extern VLC ff_huff_quad_vlc[2]; + +/* layer3 scale factor size */ +extern const uint8_t ff_slen_table[2][16]; +/* number of lsf scale factors for a given size */ +extern const uint8_t ff_lsf_nsf_table[6][3][4]; +extern const uint8_t ff_mpa_huff_data[32][2]; + +/* band size tables */ +extern const uint8_t ff_band_size_long[9][22]; +extern const uint8_t ff_band_size_short[9][13]; +/* computed from ff_band_size_long */ +extern uint16_t ff_band_index_long[9][23]; + +extern int16_t *const ff_division_tabs[4]; + +/* lower 2 bits: modulo 3, higher bits: shift */ +extern uint16_t ff_scale_factor_modshift[64]; + +extern const uint8_t ff_mpa_pretab[2][22]; + +/* table for alias reduction (XXX: store it as integer !) */ +extern const float ff_ci_table[8]; + +/* Initialize tables shared between the fixed and + * floating point MPEG audio decoders. */ +void ff_mpegaudiodec_common_init_static(void); + #endif /* AVCODEC_MPEGAUDIODATA_H */ diff --git a/libavcodec/mpegaudiodectab.h b/libavcodec/mpegaudiodec_common.c similarity index 84% rename from libavcodec/mpegaudiodectab.h rename to libavcodec/mpegaudiodec_common.c index f895ad8eaa..2ac9bb95bc 100644 --- a/libavcodec/mpegaudiodectab.h +++ b/libavcodec/mpegaudiodec_common.c @@ -24,25 +24,34 @@ * mpeg audio layer decoder tables. */ -#ifndef AVCODEC_MPEGAUDIODECTAB_H -#define AVCODEC_MPEGAUDIODECTAB_H - #include #include -#include "mpegaudio.h" +#include "libavutil/avassert.h" +#include "libavutil/thread.h" + +#include "mpegaudiodata.h" + +uint16_t ff_scale_factor_modshift[64]; + +static int16_t division_tab3[1 << 6 ]; +static int16_t division_tab5[1 << 8 ]; +static int16_t division_tab9[1 << 11]; + +int16_t *const ff_division_tabs[4] = { + division_tab3, division_tab5, NULL, division_tab9 +}; + /*******************************************************/ /* layer 3 tables */ -/* layer3 scale factor size */ -static const uint8_t slen_table[2][16] = { +const uint8_t ff_slen_table[2][16] = { { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }, { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 }, }; -/* number of lsf scale factors for a given size */ -static const uint8_t lsf_nsf_table[6][3][4] = { +const uint8_t ff_lsf_nsf_table[6][3][4] = { { { 6, 5, 5, 5 }, { 9, 9, 9, 9 }, { 6, 9, 9, 9 } }, { { 6, 5, 7, 3 }, { 9, 9, 12, 6 }, { 6, 9, 12, 6 } }, { { 11, 10, 0, 0 }, { 18, 18, 0, 0 }, { 15, 18, 0, 0 } }, @@ -52,6 +61,12 @@ static const uint8_t lsf_nsf_table[6][3][4] = { }; /* mpegaudio layer 3 huffman tables */ +VLC ff_huff_vlc[16]; +static VLC_TYPE huff_vlc_tables[128 + 128 + 128 + 130 + 128 + 154 + 166 + 142 + + 204 + 190 + 170 + 542 + 460 + 662 + 414][2]; +VLC ff_huff_quad_vlc[2]; +static VLC_TYPE huff_quad_vlc_tables[64 + 16][2]; + static const uint8_t mpa_hufflens[] = { /* Huffman table 1 - 4 entries */ 3, 3, 2, 1, @@ -294,7 +309,7 @@ static const uint8_t mpa_huff_sizes_minus_one[] = 3, 8, 8, 15, 15, 35, 35, 35, 63, 63, 63, 255, 255, 255, 255 }; -static const uint8_t mpa_huff_data[32][2] = { +const uint8_t ff_mpa_huff_data[32][2] = { { 0, 0 }, { 1, 0 }, { 2, 0 }, @@ -341,8 +356,7 @@ static const uint8_t mpa_quad_bits[2][16] = { { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, }, }; -/* band size tables */ -static const uint8_t band_size_long[9][22] = { +const uint8_t ff_band_size_long[9][22] = { { 4, 4, 4, 4, 4, 4, 6, 6, 8, 8, 10, 12, 16, 20, 24, 28, 34, 42, 50, 54, 76, 158, }, /* 44100 */ { 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 10, @@ -363,7 +377,7 @@ static const uint8_t band_size_long[9][22] = { 40, 48, 56, 64, 76, 90, 2, 2, 2, 2, 2, }, /* 8000 */ }; -static const uint8_t band_size_short[9][13] = { +const uint8_t ff_band_size_short[9][13] = { { 4, 4, 4, 4, 6, 8, 10, 12, 14, 18, 22, 30, 56, }, /* 44100 */ { 4, 4, 4, 4, 6, 6, 10, 12, 14, 16, 20, 26, 66, }, /* 48000 */ { 4, 4, 4, 4, 6, 8, 12, 16, 20, 26, 34, 42, 12, }, /* 32000 */ @@ -375,14 +389,95 @@ static const uint8_t band_size_short[9][13] = { { 8, 8, 8, 12, 16, 20, 24, 28, 36, 2, 2, 2, 26, }, /* 8000 */ }; -static const uint8_t mpa_pretab[2][22] = { +uint16_t ff_band_index_long[9][23]; + +const uint8_t ff_mpa_pretab[2][22] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0 }, }; -/* table for alias reduction (XXX: store it as integer !) */ -static const float ci_table[8] = { +const float ff_ci_table[8] = { -0.6, -0.535, -0.33, -0.185, -0.095, -0.041, -0.0142, -0.0037, }; -#endif /* AVCODEC_MPEGAUDIODECTAB_H */ +static av_cold void mpegaudiodec_common_init_static(void) +{ + const uint8_t *huff_sym = mpa_huffsymbols, *huff_lens = mpa_hufflens; + int offset; + + /* scale factors table for layer 1/2 */ + for (int i = 0; i < 64; i++) { + int shift, mod; + /* 1.0 (i = 3) is normalized to 2 ^ FRAC_BITS */ + shift = i / 3; + mod = i % 3; + ff_scale_factor_modshift[i] = mod | (shift << 2); + } + + /* huffman decode tables */ + offset = 0; + for (int i = 0; i < 15;) { + uint16_t tmp_symbols[256]; + int nb_codes_minus_one = mpa_huff_sizes_minus_one[i]; + int j; + + for (j = 0; j <= nb_codes_minus_one; j++) { + uint8_t high = huff_sym[j] & 0xF0, low = huff_sym[j] & 0xF; + + tmp_symbols[j] = high << 1 | ((high && low) << 4) | low; + } + + ff_huff_vlc[++i].table = huff_vlc_tables + offset; + ff_huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset; + ff_init_vlc_from_lengths(&ff_huff_vlc[i], 7, j, + huff_lens, 1, tmp_symbols, 2, 2, + 0, INIT_VLC_STATIC_OVERLONG, NULL); + offset += ff_huff_vlc[i].table_size; + huff_lens += j; + huff_sym += j; + } + av_assert0(offset == FF_ARRAY_ELEMS(huff_vlc_tables)); + + offset = 0; + for (int i = 0; i < 2; i++) { + int bits = i == 0 ? 6 : 4; + ff_huff_quad_vlc[i].table = huff_quad_vlc_tables + offset; + ff_huff_quad_vlc[i].table_allocated = 1 << bits; + offset += 1 << bits; + init_vlc(&ff_huff_quad_vlc[i], bits, 16, + mpa_quad_bits[i], 1, 1, mpa_quad_codes[i], 1, 1, + INIT_VLC_USE_NEW_STATIC); + } + av_assert0(offset == FF_ARRAY_ELEMS(huff_quad_vlc_tables)); + + for (int i = 0; i < 9; i++) { + int k = 0; + for (int j = 0; j < 22; j++) { + ff_band_index_long[i][j] = k; + k += ff_band_size_long[i][j] >> 1; + } + ff_band_index_long[i][22] = k; + } + + for (int i = 0; i < 4; i++) { + if (ff_mpa_quant_bits[i] < 0) { + for (int j = 0; j < (1 << (-ff_mpa_quant_bits[i] + 1)); j++) { + int val1, val2, val3, steps; + int val = j; + steps = ff_mpa_quant_steps[i]; + val1 = val % steps; + val /= steps; + val2 = val % steps; + val3 = val / steps; + ff_division_tabs[i][j] = val1 + (val2 << 4) + (val3 << 8); + } + } + } +} + +av_cold void ff_mpegaudiodec_common_init_static(void) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + + ff_thread_once(&init_static_once, mpegaudiodec_common_init_static); +} diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 3fb09511bc..fa75445036 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -96,34 +96,13 @@ typedef struct MPADecodeContext { #define HEADER_SIZE 4 #include "mpegaudiodata.h" -#include "mpegaudiodectab.h" - -/* vlc structure for decoding layer 3 huffman tables */ -static VLC huff_vlc[16]; -static VLC_TYPE huff_vlc_tables[ - 128 + 128 + 128 + 130 + 128 + 154 + 166 + - 142 + 204 + 190 + 170 + 542 + 460 + 662 + 414 - ][2]; -static VLC huff_quad_vlc[2]; -static VLC_TYPE huff_quad_vlc_tables[64+16][2]; -/* computed from band_size_long */ -static uint16_t band_index_long[9][23]; + #include "mpegaudio_tablegen.h" /* intensity stereo coef table */ static INTFLOAT is_table[2][16]; static INTFLOAT is_table_lsf[2][2][16]; static INTFLOAT csa_table[8][4]; -static int16_t division_tab3[1 << 6 ]; -static int16_t division_tab5[1 << 8 ]; -static int16_t division_tab9[1 << 11]; - -static int16_t * const division_tabs[4] = { - division_tab3, division_tab5, NULL, division_tab9 -}; - -/* lower 2 bits: modulo 3, higher bits: shift */ -static uint16_t scale_factor_modshift[64]; /* [i][j]: 2^(-j/3) * FRAC_ONE * 2^(i+2) / (2^(i+2) - 1) */ static int32_t scale_factor_mult[15][3]; /* mult table for layer 2 group quantization */ @@ -174,10 +153,10 @@ static void init_long_region(MPADecodeContext *s, GranuleDef *g, int ra1, int ra2) { int l; - g->region_size[0] = band_index_long[s->sample_rate_index][ra1 + 1]; + g->region_size[0] = ff_band_index_long[s->sample_rate_index][ra1 + 1]; /* should not overflow */ l = FFMIN(ra1 + ra2 + 2, 22); - g->region_size[1] = band_index_long[s->sample_rate_index][ l]; + g->region_size[1] = ff_band_index_long[s->sample_rate_index][ l]; } static void compute_band_indexes(MPADecodeContext *s, GranuleDef *g) @@ -212,7 +191,7 @@ static inline int l1_unscale(int n, int mant, int scale_factor) int shift, mod; int64_t val; - shift = scale_factor_modshift[scale_factor]; + shift = ff_scale_factor_modshift[scale_factor]; mod = shift & 3; shift >>= 2; val = MUL64((int)(mant + (-1U << n) + 1), scale_factor_mult[n-1][mod]); @@ -225,7 +204,7 @@ static inline int l2_unscale_group(int steps, int mant, int scale_factor) { int shift, mod, val; - shift = scale_factor_modshift[scale_factor]; + shift = ff_scale_factor_modshift[scale_factor]; mod = shift & 3; shift >>= 2; @@ -258,18 +237,7 @@ static inline int l3_unscale(int value, int exponent) static av_cold void decode_init_static(void) { - const uint8_t *huff_sym = mpa_huffsymbols, *huff_lens = mpa_hufflens; - int i, j, k; - int offset; - - /* scale factors table for layer 1/2 */ - for (i = 0; i < 64; i++) { - int shift, mod; - /* 1.0 (i = 3) is normalized to 2 ^ FRAC_BITS */ - shift = i / 3; - mod = i % 3; - scale_factor_modshift[i] = mod | (shift << 2); - } + int i, j; /* scale factor multiply for layer 1 */ for (i = 0; i < 15; i++) { @@ -286,72 +254,10 @@ static av_cold void decode_init_static(void) scale_factor_mult[i][2]); } - /* huffman decode tables */ - offset = 0; - for (int i = 0; i < 15;) { - uint16_t tmp_symbols[256]; - int nb_codes_minus_one = mpa_huff_sizes_minus_one[i]; - int j; - - for (j = 0; j <= nb_codes_minus_one; j++) { - uint8_t high = huff_sym[j] & 0xF0, low = huff_sym[j] & 0xF; - - tmp_symbols[j] = high << 1 | ((high && low) << 4) | low; - } - - /* XXX: fail test */ - huff_vlc[++i].table = huff_vlc_tables + offset; - huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset; - ff_init_vlc_from_lengths(&huff_vlc[i], 7, j, - huff_lens, 1, tmp_symbols, 2, 2, - 0, INIT_VLC_STATIC_OVERLONG, NULL); - offset += huff_vlc[i].table_size; - huff_lens += j; - huff_sym += j; - } - av_assert0(offset == FF_ARRAY_ELEMS(huff_vlc_tables)); - - offset = 0; - for (i = 0; i < 2; i++) { - int bits = i == 0 ? 6 : 4; - huff_quad_vlc[i].table = huff_quad_vlc_tables+offset; - huff_quad_vlc[i].table_allocated = 1 << bits; - offset += 1 << bits; - init_vlc(&huff_quad_vlc[i], bits, 16, - mpa_quad_bits[i], 1, 1, mpa_quad_codes[i], 1, 1, - INIT_VLC_USE_NEW_STATIC); - } - av_assert0(offset == FF_ARRAY_ELEMS(huff_quad_vlc_tables)); - - for (i = 0; i < 9; i++) { - k = 0; - for (j = 0; j < 22; j++) { - band_index_long[i][j] = k; - k += band_size_long[i][j] >> 1; - } - band_index_long[i][22] = k; - } - /* compute n ^ (4/3) and store it in mantissa/exp format */ mpegaudio_tableinit(); - for (i = 0; i < 4; i++) { - if (ff_mpa_quant_bits[i] < 0) { - for (j = 0; j < (1 << (-ff_mpa_quant_bits[i] + 1)); j++) { - int val1, val2, val3, steps; - int val = j; - steps = ff_mpa_quant_steps[i]; - val1 = val % steps; - val /= steps; - val2 = val % steps; - val3 = val / steps; - division_tabs[i][j] = val1 + (val2 << 4) + (val3 << 8); - } - } - } - - for (i = 0; i < 7; i++) { float f; INTFLOAT v; @@ -386,7 +292,7 @@ static av_cold void decode_init_static(void) for (i = 0; i < 8; i++) { double ci, cs, ca; - ci = ci_table[i]; + ci = ff_ci_table[i]; cs = 1.0 / sqrt(1.0 + ci * ci); ca = cs * ci; #if !USE_FLOATS @@ -402,6 +308,7 @@ static av_cold void decode_init_static(void) #endif } RENAME(ff_mpa_synth_init)(); + ff_mpegaudiodec_common_init_static(); } static av_cold int decode_init(AVCodecContext * avctx) @@ -688,7 +595,7 @@ static int mp_decode_layer2(MPADecodeContext *s) int v2; /* 3 values at the same time */ v = get_bits(&s->gb, -bits); - v2 = division_tabs[qindex][v]; + v2 = ff_division_tabs[qindex][v]; steps = ff_mpa_quant_steps[qindex]; s->sb_samples[ch][k * 12 + l + 0][i] = @@ -816,8 +723,8 @@ static void exponents_from_scale_factors(MPADecodeContext *s, GranuleDef *g, gain = g->global_gain - 210; shift = g->scalefac_scale + 1; - bstab = band_size_long[s->sample_rate_index]; - pretab = mpa_pretab[g->preflag]; + bstab = ff_band_size_long[s->sample_rate_index]; + pretab = ff_mpa_pretab[g->preflag]; for (i = 0; i < g->long_end; i++) { v0 = gain - ((g->scale_factors[i] + pretab[i]) << shift) + 400; len = bstab[i]; @@ -826,7 +733,7 @@ static void exponents_from_scale_factors(MPADecodeContext *s, GranuleDef *g, } if (g->short_start < 13) { - bstab = band_size_short[s->sample_rate_index]; + bstab = ff_band_size_short[s->sample_rate_index]; gains[0] = gain - (g->subblock_gain[0] << 3); gains[1] = gain - (g->subblock_gain[1] << 3); gains[2] = gain - (g->subblock_gain[2] << 3); @@ -891,9 +798,9 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g, continue; /* select vlc table */ k = g->table_select[i]; - l = mpa_huff_data[k][0]; - linbits = mpa_huff_data[k][1]; - vlc = &huff_vlc[l]; + l = ff_mpa_huff_data[k][0]; + linbits = ff_mpa_huff_data[k][1]; + vlc = &ff_huff_vlc[l]; if (!l) { memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid) * 2 * j); @@ -966,7 +873,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g, } /* high frequencies */ - vlc = &huff_quad_vlc[g->count1table_select]; + vlc = &ff_huff_quad_vlc[g->count1table_select]; last_pos = 0; while (s_index <= 572) { int pos, code; @@ -1043,7 +950,7 @@ static void reorder_block(MPADecodeContext *s, GranuleDef *g) } for (i = g->short_start; i < 13; i++) { - len = band_size_short[s->sample_rate_index][i]; + len = ff_band_size_short[s->sample_rate_index][i]; ptr1 = ptr; dst = tmp; for (j = len; j > 0; j--) { @@ -1088,7 +995,7 @@ static void compute_stereo(MPADecodeContext *s, GranuleDef *g0, GranuleDef *g1) /* for last band, use previous scale factor */ if (i != 11) k -= 3; - len = band_size_short[s->sample_rate_index][i]; + len = ff_band_size_short[s->sample_rate_index][i]; for (l = 2; l >= 0; l--) { tab0 -= len; tab1 -= len; @@ -1132,7 +1039,7 @@ found1: non_zero_found_short[2]; for (i = g1->long_end - 1;i >= 0;i--) { - len = band_size_long[s->sample_rate_index][i]; + len = ff_band_size_long[s->sample_rate_index][i]; tab0 -= len; tab1 -= len; /* test if non zero band. if so, stop doing i-stereo */ @@ -1463,8 +1370,8 @@ static int mp_decode_layer3(MPADecodeContext *s) int slen, slen1, slen2; /* MPEG-1 scale factors */ - slen1 = slen_table[0][g->scalefac_compress]; - slen2 = slen_table[1][g->scalefac_compress]; + slen1 = ff_slen_table[0][g->scalefac_compress]; + slen2 = ff_slen_table[1][g->scalefac_compress]; ff_dlog(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2); if (g->block_type == 2) { n = g->switch_point ? 17 : 18; @@ -1549,7 +1456,7 @@ static int mp_decode_layer3(MPADecodeContext *s) j = 0; for (k = 0; k < 4; k++) { - n = lsf_nsf_table[tindex2][tindex][k]; + n = ff_lsf_nsf_table[tindex2][tindex][k]; sl = slen[k]; if (sl) { for (i = 0; i < n; i++) From patchwork Fri Nov 20 07:33:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23913 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 9F6DD44AD6B for ; Fri, 20 Nov 2020 09:55:32 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 08C1368BDDE; Fri, 20 Nov 2020 09:35:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0CE2068BD13 for ; Fri, 20 Nov 2020 09:35:05 +0200 (EET) Received: by mail-ej1-f65.google.com with SMTP id o21so11523999ejb.3 for ; Thu, 19 Nov 2020 23:35:04 -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=IjKlLUpa23iYyosm3Ri0FV6NTE4kA8Fr+9nQmLUt9B4=; b=nhvfRIBX7Nq3C8Y5H4TU/xFVDTTfAyD00+n83HYy3gvgRXowde2e2VtT8xxk9KUCgY h4GjU65dniNeOO9J7NUgMs6/zx7dHSlM2KrIL6M8tdE1oyO2a3K91uw8H1p1/4XAgLWT N9E02ObMcvlK3gZ4mOtUofCNtdshj6HQBr31ZWUDG0m9Wiz3rfTwKK8vrZcuGR2qhNJF to3g4z4l3Apps4TztM3TbEAqTigNGe0Uh9c8QOUug85gq3kjt4/nDsV0CoX7Qcu3clrR aByvuiLHTIBMknTgg+ds2W07aXvBtoloRf0WYQFt1V5qKnN7tA2Agacz2Fpw1OjL3XTR 7HGQ== 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=IjKlLUpa23iYyosm3Ri0FV6NTE4kA8Fr+9nQmLUt9B4=; b=DFyd8kvdcUptLed0AZJQlgGB5Tb8vKM37NHW5nsHtIQ94eu+ipo0FRczEE3hRGDYmD +mklXnnWnPeBao+Pb/goPmLHsYx0S28bvcnt4VeO7iSCWeSlfM4uiJOwqjuV7arFE4Vy 6NqB7mRdxHw6442hiXHa/oezWZ+hPnGEeIl427vt7IQBsN3/QROzJ5eel04Zf/vzA/Yl PQtqYp0VnkC0B6tPGLrERBZxtJtiH79OJMiSLnZRxPCIRhiiHPOkfbpPDabMYsMLXCIT 7N/I+Jsrb4ryIMD5jy2oUn+juOdJxZ8fBfrSuvFPj54WuHbZAI29iHBF9+VwPkOiLKAw mghQ== X-Gm-Message-State: AOAM531EQ4hxwehnDJHmpTgjfcEYm6pepHH14ewQYw/0hxXlmCScCdcn NtMVrwlMMPShmo0/wh+e5NMKPui1/dyQew== X-Google-Smtp-Source: ABdhPJzqOfl94BWzMgijnYEQpsbNmSG5Ns95IYbgafXnjf3nZvwRYuLavNeuGJ7piZXc9uZWNcZEmw== X-Received: by 2002:a17:906:4a02:: with SMTP id w2mr13911952eju.267.1605857704259; Thu, 19 Nov 2020 23:35:04 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:35:03 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:24 +0100 Message-Id: <20201120073327.820745-60-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 159/162] avcodec/mpegaudio_tablegen: Avoid write-only buffers 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 mpegaudio_tablegen header contains code to initialize several tables; it is included in both the fixed as well as the floating point mpegaudio decoders and some of these tables are only used by the fixed resp. floating point decoders; yet both types are always initialized, leaving the compiler to figure out that one of them is unused. GCC 9.3 fails at this (even with -O3): $ readelf -s mpegaudiodec_fixed.o|grep _float 28: 0000000000001660 32768 OBJECT LOCAL DEFAULT 4 expval_table_float An actually unused table (expval_table_fixed/float) of size 32KiB is kept and initialized (the reason for this is probably that this table is read from, namely to initialize another table: exp_table_fixed/float; of course the float resp. fixed tables are not used in the fixed resp. floating point decoder). Therefore #ifdef the unneeded tables away. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegaudio_tablegen.c | 1 + libavcodec/mpegaudio_tablegen.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/libavcodec/mpegaudio_tablegen.c b/libavcodec/mpegaudio_tablegen.c index ede7c8e221..bff0f031a1 100644 --- a/libavcodec/mpegaudio_tablegen.c +++ b/libavcodec/mpegaudio_tablegen.c @@ -22,6 +22,7 @@ #include #define CONFIG_HARDCODED_TABLES 0 +#define BOTH_TABLES #include "libavutil/tablegen.h" #include "mpegaudio_tablegen.h" #include "tableprint.h" diff --git a/libavcodec/mpegaudio_tablegen.h b/libavcodec/mpegaudio_tablegen.h index 0b0ea40682..c78d5b5d7c 100644 --- a/libavcodec/mpegaudio_tablegen.h +++ b/libavcodec/mpegaudio_tablegen.h @@ -34,10 +34,18 @@ #else static int8_t table_4_3_exp[TABLE_4_3_SIZE]; static uint32_t table_4_3_value[TABLE_4_3_SIZE]; + +#if defined(BOTH_TABLES) || !USE_FLOATS +#define FIXED_TABLE static uint32_t exp_table_fixed[512]; static uint32_t expval_table_fixed[512][16]; +#endif + +#if defined(BOTH_TABLES) || USE_FLOATS +#define FLOAT_TABLE static float exp_table_float[512]; static float expval_table_float[512][16]; +#endif #define FRAC_BITS 23 #define IMDCT_SCALAR 1.759 @@ -79,13 +87,23 @@ static av_cold void mpegaudio_tableinit(void) exp2_val = exp2_base * exp2_lut[exponent & 3] / IMDCT_SCALAR; for (value = 0; value < 16; value++) { double f = pow43_lut[value] * exp2_val; +#ifdef FIXED_TABLE expval_table_fixed[exponent][value] = (f < 0xFFFFFFFF ? llrint(f) : 0xFFFFFFFF); +#endif +#ifdef FLOAT_TABLE expval_table_float[exponent][value] = f; +#endif } +#ifdef FIXED_TABLE exp_table_fixed[exponent] = expval_table_fixed[exponent][1]; +#endif +#ifdef FLOAT_TABLE exp_table_float[exponent] = expval_table_float[exponent][1]; +#endif } } +#undef FLOAT_TABLE +#undef FIXED_TABLE #endif /* CONFIG_HARDCODED_TABLES */ #endif /* AVCODEC_MPEGAUDIO_TABLEGEN_H */ From patchwork Fri Nov 20 07:33: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: 23911 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 4621944AD6B for ; Fri, 20 Nov 2020 09:55:10 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 50F5D68BDE1; Fri, 20 Nov 2020 09:35:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E492B68BCF8 for ; Fri, 20 Nov 2020 09:35:05 +0200 (EET) Received: by mail-ej1-f66.google.com with SMTP id f23so11550619ejk.2 for ; Thu, 19 Nov 2020 23:35:05 -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=PUrVP9CiOAZI2iiAv84l0Qgorn4VRc/eT4EOdGXXF5s=; b=qsjCD/GRveNlPLMxVOOPRh+jdv7q8f8zW6b1LVJ++07NBRx/v3qk16h1fNyYUL3ZC6 pOz9Trku2RCglSsIYZE+mYLyrk2X5Ug1fRNQRMY+k93BMS4zRi23GeAn8Z4/mz8QyDq/ +r+spCGtNvrFkCl8OBVM6uYn+7eBpcMLYEFzQ+dolHiz71jPaUFUIrJ6y5Edvqql6B5s 9l9YtynG5Lj2XTEwXWM7JYKOpXQC7hDpSmPVLsdDDnMcI4oBnL1uSDFtmhYyzChpl6jG MrDj3qT6eeSuah+CSe6EZmT40Rqh65T5IepBlgFg5tmYPwK5hoYEi2QEHco/MDbZUct5 5BKQ== 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=PUrVP9CiOAZI2iiAv84l0Qgorn4VRc/eT4EOdGXXF5s=; b=TXzKpmvYvgSZxJvAL7NYX+CT0ebwDeTuRdrmu8l1Rngvb9Vqmx/B7oLb/QK9bL96Sr kF+PXzBujDQyxAZRTPfaNxbq3g8IPTn4ACMhI6IehpW4/N1vh5oWs5ARLBQmuuelcD+5 UK8G39Oea4F+I7+8np5RQw5+3g4n39Tu6W3cj6yZJm/1KNTvDHOcE9G/1d7y/7T2GZqv L0lXBEFpgszcr/+VBUDu7NbmC6a85Gwd8WGg4c2ax2ZhaKkRLWg1DOQ/H1zkabDroFut MxGOpXahSONR21hpH+w5AIO488fimufZs1IXwoSw/Ulonx2Q0gIGqtn0cmu9NYBt+00A fnPQ== X-Gm-Message-State: AOAM532ifgZnybXhzyoNNFpFx2BWm2wQmexh+ey4dL5JDwePlfLASFjL ZVKPFP9Q0AW4YcV594uPuoqDEc2pzUnGfg== X-Google-Smtp-Source: ABdhPJzfz/FHoJLoMVcu9YyIP3Uh7sBLRnxw9YMtDjvmODIIgdOSXWAZQkBykemgX7C+dDuUDvL48w== X-Received: by 2002:a17:906:b292:: with SMTP id q18mr31022873ejz.93.1605857705116; Thu, 19 Nov 2020 23:35:05 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:35:04 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:25 +0100 Message-Id: <20201120073327.820745-61-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 160/162] avcodec/mpegaudio_tablegen: Don't inappropriately use static array 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" Each invocation of this function is only entered once, so using a static array makes no sense (and given that the whole array is reinitialized at the beginning of this function, it wouldn't even make sense if the function were called multiple times). Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegaudio_tablegen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpegaudio_tablegen.h b/libavcodec/mpegaudio_tablegen.h index c78d5b5d7c..1a92bb4de6 100644 --- a/libavcodec/mpegaudio_tablegen.h +++ b/libavcodec/mpegaudio_tablegen.h @@ -59,7 +59,7 @@ static av_cold void mpegaudio_tableinit(void) M_SQRT2 , /* 2 ^ (2 * 0.25) */ 1.68179283050742908606, /* 2 ^ (3 * 0.25) */ }; - static double pow43_lut[16]; + double pow43_lut[16]; double exp2_base = 2.11758236813575084767080625169910490512847900390625e-22; // 2^(-72) double exp2_val; double pow43_val = 0; From patchwork Fri Nov 20 07:33:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23914 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 B4A7944AD6B for ; Fri, 20 Nov 2020 09:56:00 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6A32068BDE2; Fri, 20 Nov 2020 09:35:19 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AAFA968BDBB for ; Fri, 20 Nov 2020 09:35:07 +0200 (EET) Received: by mail-ej1-f48.google.com with SMTP id k27so11483401ejs.10 for ; Thu, 19 Nov 2020 23:35:07 -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=0ALCx5XPxwNqVgKFerPvypSpQfKWPkinFIOi3zikRv4=; b=NgI1TRLzvFF78Y/DICKMjiPMUaJ4MfBRfwNTK+tVIGHGk1Ho4SGlfXYrBDQ135Z+BK xke7O7v39eUZZAW5I96s6veCnx22kH6w14LlEosemyOhi/aAVYV5JGdG2r+bz0stJmAS bLcULx7xGFVFK6PvXjnv5NB3Y4Gkq+iaE+7jglHwDZU3SJKYt2HxKgwbcvBSy+sdjoj1 JMbs09FMj0sDIwF5UkHG2rEwVzbkBs6NZHLYLgmV2TVYTL46MeIK+naJzFISH1rvvTWW ncj+Bv9CzK0vzR2jm3q6cltOMnUWJ5Lhz+1XSCT/0Vx+FvnB7W2VyLCb9IKQk2X4/wue H6aA== 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=0ALCx5XPxwNqVgKFerPvypSpQfKWPkinFIOi3zikRv4=; b=lhJRug5su6FF+pthtuuUzJH8xTEZwDt7lCCQ/5xw7CynVmMK60qlV+tmcdhlQjmV86 ltQY7QP1Adj9OTM/YMSp8WPR47bBrRnsxLyfUC2ytvcpNTTKMrMygDgHAy//6axam7Q4 jWW3k7Jj9vzEDK/kWBcxZRcMJmZWmR3ymxFu5rOUjv7V0RBOMXrorb/kfU18KwFDe9YJ 6yGJxwRc0AmVeJZa950lFzYpys6weks4lzWMDpGqVvx2qo1CveMXx1qfjUBdyUb+FxXC uAM4aJ4fmuFOKIdKm0MKclfL7zO5q6QHy9nm4CGP/YCLiLy8SWX5vmxnj9a+D2CZxXJo JbFg== X-Gm-Message-State: AOAM530UWcuKLahy02erSdz4/DuY4LDSByvMVqy5yd5grQ6GqvAyA8fP Sy4ROU7cpZADrk/n5ubX3RItCE/gKgdgZQ== X-Google-Smtp-Source: ABdhPJyCCBYOuq9G/A6WoVUeo3Y8TlFoYyhnc2eMFgdTYON4TqFAHYKrK6n21kaZx3fkVQDpX1b8Xg== X-Received: by 2002:a17:906:a88:: with SMTP id y8mr33984893ejf.469.1605857706504; Thu, 19 Nov 2020 23:35:06 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.35.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:35:05 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:26 +0100 Message-Id: <20201120073327.820745-62-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 161/162] avcodec/mpegaudiodec: Hardcode tables to save space 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 csa_tables (which always consist of 32 entries of four byte each, but the type depends upon whether the decoder is fixed or floating-point) are currently initialized once during decoder initialization; yet it turns out that this is actually no benefit: The code used to initialize these tables takes up 153 (fixed point) and 122 (floating point) bytes when compiled with GCC 9.3 with -O3 on x64, so it is better to just hardcode these tables. Essentially the same applies to the is_tables: They have a size or 128 each and the code to initialize them occupies 149 (fixed point) resp. 140 (floating point) bytes. So hardcode them, too. Signed-off-by: Andreas Rheinhardt --- The MIPS changes are untested; they are intended to avoid a discard-qualifier warning. libavcodec/mips/compute_antialias_fixed.h | 3 +- libavcodec/mips/compute_antialias_float.h | 2 +- libavcodec/mpegaudiodata.h | 3 -- libavcodec/mpegaudiodec_common.c | 4 --- libavcodec/mpegaudiodec_fixed.c | 16 ++++++++++ libavcodec/mpegaudiodec_float.c | 28 ++++++++++++++++ libavcodec/mpegaudiodec_template.c | 39 ++--------------------- 7 files changed, 49 insertions(+), 46 deletions(-) diff --git a/libavcodec/mips/compute_antialias_fixed.h b/libavcodec/mips/compute_antialias_fixed.h index a967f67de7..1f395d2302 100644 --- a/libavcodec/mips/compute_antialias_fixed.h +++ b/libavcodec/mips/compute_antialias_fixed.h @@ -59,7 +59,8 @@ static void compute_antialias_mips_fixed(MPADecodeContext *s, GranuleDef *g) { - int32_t *ptr, *csa; + const int32_t *csa; + int32_t *ptr; int n, i; int MAX_lo = 0xffffffff; diff --git a/libavcodec/mips/compute_antialias_float.h b/libavcodec/mips/compute_antialias_float.h index e2b4f29f4a..633eb9589d 100644 --- a/libavcodec/mips/compute_antialias_float.h +++ b/libavcodec/mips/compute_antialias_float.h @@ -63,7 +63,7 @@ static void compute_antialias_mips_float(MPADecodeContext *s, GranuleDef *g) { float *ptr, *ptr_end; - float *csa = &csa_table[0][0]; + const float *csa = &csa_table[0][0]; /* temporary variables */ float in1, in2, in3, in4, in5, in6, in7, in8; float out1, out2, out3, out4; diff --git a/libavcodec/mpegaudiodata.h b/libavcodec/mpegaudiodata.h index ec969353f3..01b1f88cd0 100644 --- a/libavcodec/mpegaudiodata.h +++ b/libavcodec/mpegaudiodata.h @@ -65,9 +65,6 @@ extern uint16_t ff_scale_factor_modshift[64]; extern const uint8_t ff_mpa_pretab[2][22]; -/* table for alias reduction (XXX: store it as integer !) */ -extern const float ff_ci_table[8]; - /* Initialize tables shared between the fixed and * floating point MPEG audio decoders. */ void ff_mpegaudiodec_common_init_static(void); diff --git a/libavcodec/mpegaudiodec_common.c b/libavcodec/mpegaudiodec_common.c index 2ac9bb95bc..4333746e9a 100644 --- a/libavcodec/mpegaudiodec_common.c +++ b/libavcodec/mpegaudiodec_common.c @@ -396,10 +396,6 @@ const uint8_t ff_mpa_pretab[2][22] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0 }, }; -const float ff_ci_table[8] = { - -0.6, -0.535, -0.33, -0.185, -0.095, -0.041, -0.0142, -0.0037, -}; - static av_cold void mpegaudiodec_common_init_static(void) { const uint8_t *huff_sym = mpa_huffsymbols, *huff_lens = mpa_hufflens; diff --git a/libavcodec/mpegaudiodec_fixed.c b/libavcodec/mpegaudiodec_fixed.c index 853c55528d..26aaffe8a6 100644 --- a/libavcodec/mpegaudiodec_fixed.c +++ b/libavcodec/mpegaudiodec_fixed.c @@ -36,6 +36,22 @@ #define OUT_FMT AV_SAMPLE_FMT_S16 #define OUT_FMT_P AV_SAMPLE_FMT_S16P +static const int32_t is_table[2][16] = { + { 0x000000, 0x1B0CB1, 0x2ED9EC, 0x400000, 0x512614, 0x64F34F, 0x800000 }, + { 0x800000, 0x64F34F, 0x512614, 0x400000, 0x2ED9EC, 0x1B0CB1, 0x000000 } +}; + +static const int32_t csa_table[8][4] = { + { 0x36E129F8, 0xDF128056, 0x15F3AA4E, 0xA831565E }, + { 0x386E75F2, 0xE1CF24A5, 0x1A3D9A97, 0xA960AEB3 }, + { 0x3CC6B73A, 0xEBF19FA6, 0x28B856E0, 0xAF2AE86C }, + { 0x3EEEA054, 0xF45B88BC, 0x334A2910, 0xB56CE868 }, + { 0x3FB6905C, 0xF9F27F18, 0x39A90F74, 0xBA3BEEBC }, + { 0x3FF23F20, 0xFD60D1E4, 0x3D531104, 0xBD6E92C4 }, + { 0x3FFE5932, 0xFF175EE4, 0x3F15B816, 0xBF1905B2 }, + { 0x3FFFE34A, 0xFFC3612F, 0x3FC34479, 0xBFC37DE5 } +}; + #include "mpegaudiodec_template.c" #if CONFIG_MP1_DECODER diff --git a/libavcodec/mpegaudiodec_float.c b/libavcodec/mpegaudiodec_float.c index 88438ea21a..612ef55188 100644 --- a/libavcodec/mpegaudiodec_float.c +++ b/libavcodec/mpegaudiodec_float.c @@ -36,6 +36,34 @@ #define OUT_FMT AV_SAMPLE_FMT_FLT #define OUT_FMT_P AV_SAMPLE_FMT_FLTP +static const float is_table[2][16] = { + { 0.000000000000000000e+00, 2.113248705863952637e-01, 3.660253882408142090e-01, + 5.000000000000000000e-01, 6.339746117591857910e-01, 7.886751294136047363e-01, + 1.000000000000000000e+00 }, + { 1.000000000000000000e+00, 7.886751294136047363e-01, 6.339746117591857910e-01, + 5.000000000000000000e-01, 3.660253882408142090e-01, 2.113248705863952637e-01, + 0.000000000000000000e+00 } +}; + +static const float csa_table[8][4] = { + { 8.574929237365722656e-01, -5.144957900047302246e-01, + 3.429971337318420410e-01, -1.371988654136657715e+00 }, + { 8.817420005798339844e-01, -4.717319905757904053e-01, + 4.100100100040435791e-01, -1.353474020957946777e+00 }, + { 9.496286511421203613e-01, -3.133774697780609131e-01, + 6.362511515617370605e-01, -1.263006091117858887e+00 }, + { 9.833145737648010254e-01, -1.819131970405578613e-01, + 8.014013767242431641e-01, -1.165227770805358887e+00 }, + { 9.955177903175354004e-01, -9.457419067621231079e-02, + 9.009436368942260742e-01, -1.090092062950134277e+00 }, + { 9.991605877876281738e-01, -4.096558317542076111e-02, + 9.581949710845947266e-01, -1.040126085281372070e+00 }, + { 9.998992085456848145e-01, -1.419856864959001541e-02, + 9.857006072998046875e-01, -1.014097809791564941e+00 }, + { 9.999931454658508301e-01, -3.699974622577428818e-03, + 9.962931871414184570e-01, -1.003693103790283203e+00 } +}; + #include "mpegaudiodec_template.c" #if CONFIG_MP1FLOAT_DECODER diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index fa75445036..1e8fd6064f 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -99,9 +99,7 @@ typedef struct MPADecodeContext { #include "mpegaudio_tablegen.h" /* intensity stereo coef table */ -static INTFLOAT is_table[2][16]; static INTFLOAT is_table_lsf[2][2][16]; -static INTFLOAT csa_table[8][4]; /* [i][j]: 2^(-j/3) * FRAC_ONE * 2^(i+2) / (2^(i+2) - 1) */ static int32_t scale_factor_mult[15][3]; @@ -258,22 +256,6 @@ static av_cold void decode_init_static(void) mpegaudio_tableinit(); - for (i = 0; i < 7; i++) { - float f; - INTFLOAT v; - if (i != 6) { - f = tan((double)i * M_PI / 12.0); - v = FIXR(f / (1.0 + f)); - } else { - v = FIXR(1.0); - } - is_table[0][ i] = v; - is_table[1][6 - i] = v; - } - /* invalid values */ - for (i = 7; i < 16; i++) - is_table[0][i] = is_table[1][i] = 0.0; - for (i = 0; i < 16; i++) { double f; int e, k; @@ -289,24 +271,6 @@ static av_cold void decode_init_static(void) (float) is_table_lsf[j][1][i]); } } - - for (i = 0; i < 8; i++) { - double ci, cs, ca; - ci = ff_ci_table[i]; - cs = 1.0 / sqrt(1.0 + ci * ci); - ca = cs * ci; -#if !USE_FLOATS - csa_table[i][0] = FIXHR(cs/4); - csa_table[i][1] = FIXHR(ca/4); - csa_table[i][2] = FIXHR(ca/4) + FIXHR(cs/4); - csa_table[i][3] = FIXHR(ca/4) - FIXHR(cs/4); -#else - csa_table[i][0] = cs; - csa_table[i][1] = ca; - csa_table[i][2] = ca + cs; - csa_table[i][3] = ca - cs; -#endif - } RENAME(ff_mpa_synth_init)(); ff_mpegaudiodec_common_init_static(); } @@ -970,7 +934,8 @@ static void compute_stereo(MPADecodeContext *s, GranuleDef *g0, GranuleDef *g1) { int i, j, k, l; int sf_max, sf, len, non_zero_found; - INTFLOAT (*is_tab)[16], *tab0, *tab1, v1, v2; + INTFLOAT *tab0, *tab1, v1, v2; + const INTFLOAT (*is_tab)[16]; SUINTFLOAT tmp0, tmp1; int non_zero_found_short[3]; From patchwork Fri Nov 20 07:33:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23917 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 58FBB44AE04 for ; Fri, 20 Nov 2020 09:56:16 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 748E268BE07; Fri, 20 Nov 2020 09:35:20 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 51C6E68BDC1 for ; Fri, 20 Nov 2020 09:35:09 +0200 (EET) Received: by mail-ed1-f67.google.com with SMTP id l5so8476713edq.11 for ; Thu, 19 Nov 2020 23:35:09 -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=twLWwIfbquBffoL8p3adl3FdXlJZutOZvJ6CmtusWeU=; b=eaeM7Z0onIWTDQfWwleQmzfSvMIg0oIKyJSOU1zdkSeKDnQV4KVJHmqYXpPahGi471 dt69Bn17gnpdoMVYeXtf2TBFpdz/hgIolXq0k8a9xSN5Z7bdYlJyCKpg6GBZfChIldyu f2RYVJvWhLPxVtn0RD31Jtw+idXHHiBw9CjcFVNlNNwjhIMmmqojpPQ+4s9FW6Uf8xyJ AbOlhiMXkZXMxtXo41MQUn7GaNhr8MM2AwVrE5nvP1Ep5Ln3ES/yRTV/AxZ0IrVrk/am GCgHkVCc8YQpYoq3VT1jCauuAQ0WsnScu2YmU4nljVsltcIUe8Yl+HYNu4bY7hg1kcvE j6yw== 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=twLWwIfbquBffoL8p3adl3FdXlJZutOZvJ6CmtusWeU=; b=OWjBwTxScnxBtL9Qh0McBpyk8GqVAx1VOXD2tXgfm0CVKQVYraRHRxtikkAKNrBA25 8YezRR74f/oMTPlxjzWcbyL5XibTkb8UDgT70/jHmsi0WAMeUKyf9O65DTMzU44Pv7cO 0FXV3zZEIKjsZZjshFgTU9LQHYT2P0YIWqTe3pbeg+bATsU6bfV34VwLeWD1U7wac3bC wmAE+5roVRNLp4/981Qzth0n0PNZvQpa5cfn+6k502VErv6wKqyEX8ftUgfioodE5Cxp 0eKROTAy+5h1H97qe2WHEUnTeBSDZkGS9GPCrBq5ytDWPPXOP3QAUJJ97dhCzFNzXqD2 o5gA== X-Gm-Message-State: AOAM533RMZ+UizeeLSr+iNHsaMr7Wt1WkKuIJ86GYI9vgU6dF0CzJuPA tFJN3S1ZZPEb2ukDVMK40CipXlJPsPVr9g== X-Google-Smtp-Source: ABdhPJyywBoL8w8IyfEeF37ego5ESNj3ms6fr84uSGWkqtlHw0zdc1nzly4HFMrTPOOkZ8Z9w2MbiQ== X-Received: by 2002:a50:d681:: with SMTP id r1mr422072edi.290.1605857708120; Thu, 19 Nov 2020 23:35:08 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:35:07 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:27 +0100 Message-Id: <20201120073327.820745-63-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 162/162] avcodec/mpegaudio_tablegen: Make exponential LUT shared 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" Both the fixed as well as the floating point mpegaudio decoders use LUTs of type int8_t and uint32_t with 32K entries each; these tables are completely the same, yet they are not shared. This commit makes them shared. When both fixed as well as floating point decoders are enabled, this saves 160KiB from the bss segment for a normal build (translating into 160KiB less memory usage if both a shared as well as a floating point decoder have actually been used) and 160KiB from the binary for a build with hardcoded tables. It also means that the code to create said LUTs is no longer duplicated (for a normal build). Signed-off-by: Andreas Rheinhardt --- libavcodec/Makefile | 5 +- libavcodec/mpegaudio_tablegen.c | 2 - libavcodec/mpegaudio_tablegen.h | 22 +------ libavcodec/mpegaudiodata.h | 11 ++++ libavcodec/mpegaudiodec_common.c | 3 + libavcodec/mpegaudiodec_common_tablegen.c | 40 +++++++++++++ libavcodec/mpegaudiodec_common_tablegen.h | 72 +++++++++++++++++++++++ libavcodec/mpegaudiodec_template.c | 4 +- 8 files changed, 133 insertions(+), 26 deletions(-) create mode 100644 libavcodec/mpegaudiodec_common_tablegen.c create mode 100644 libavcodec/mpegaudiodec_common_tablegen.h diff --git a/libavcodec/Makefile b/libavcodec/Makefile index a851a0a3b2..4f6cc22034 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1238,6 +1238,7 @@ HOSTPROGS = aacps_tablegen \ dv_tablegen \ motionpixels_tablegen \ mpegaudio_tablegen \ + mpegaudiodec_common_tablegen \ pcm_tablegen \ qdm2_tablegen \ sinewin_tablegen \ @@ -1262,7 +1263,8 @@ endif GEN_HEADERS = cbrt_tables.h cbrt_fixed_tables.h aacps_tables.h aacps_fixed_tables.h \ dv_tables.h \ - sinewin_tables.h sinewin_fixed_tables.h mpegaudio_tables.h motionpixels_tables.h \ + sinewin_tables.h sinewin_fixed_tables.h mpegaudio_tables.h \ + mpegaudiodec_common_tables.h motionpixels_tables.h \ pcm_tables.h qdm2_tables.h GEN_HEADERS := $(addprefix $(SUBDIR), $(GEN_HEADERS)) @@ -1277,6 +1279,7 @@ $(SUBDIR)aacps_fixed.o: $(SUBDIR)aacps_fixed_tables.h $(SUBDIR)aactab_fixed.o: $(SUBDIR)aac_fixed_tables.h $(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h $(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables.h +$(SUBDIR)mpegaudiodec_common.o: $(SUBDIR)mpegaudiodec_common_tables.h $(SUBDIR)mpegaudiodec_fixed.o: $(SUBDIR)mpegaudio_tables.h $(SUBDIR)mpegaudiodec_float.o: $(SUBDIR)mpegaudio_tables.h $(SUBDIR)pcm.o: $(SUBDIR)pcm_tables.h diff --git a/libavcodec/mpegaudio_tablegen.c b/libavcodec/mpegaudio_tablegen.c index bff0f031a1..9721ae44e5 100644 --- a/libavcodec/mpegaudio_tablegen.c +++ b/libavcodec/mpegaudio_tablegen.c @@ -33,8 +33,6 @@ int main(void) write_fileheader(); - WRITE_ARRAY("static const", int8_t, table_4_3_exp); - WRITE_ARRAY("static const", uint32_t, table_4_3_value); WRITE_ARRAY("static const", uint32_t, exp_table_fixed); WRITE_ARRAY("static const", float, exp_table_float); WRITE_2D_ARRAY("static const", uint32_t, expval_table_fixed); diff --git a/libavcodec/mpegaudio_tablegen.h b/libavcodec/mpegaudio_tablegen.h index 1a92bb4de6..ed86257767 100644 --- a/libavcodec/mpegaudio_tablegen.h +++ b/libavcodec/mpegaudio_tablegen.h @@ -27,14 +27,10 @@ #include #include "libavutil/attributes.h" -#define TABLE_4_3_SIZE (8191 + 16)*4 #if CONFIG_HARDCODED_TABLES #define mpegaudio_tableinit() #include "libavcodec/mpegaudio_tables.h" #else -static int8_t table_4_3_exp[TABLE_4_3_SIZE]; -static uint32_t table_4_3_value[TABLE_4_3_SIZE]; - #if defined(BOTH_TABLES) || !USE_FLOATS #define FIXED_TABLE static uint32_t exp_table_fixed[512]; @@ -47,7 +43,6 @@ static float exp_table_float[512]; static float expval_table_float[512][16]; #endif -#define FRAC_BITS 23 #define IMDCT_SCALAR 1.759 static av_cold void mpegaudio_tableinit(void) @@ -62,25 +57,10 @@ static av_cold void mpegaudio_tableinit(void) double pow43_lut[16]; double exp2_base = 2.11758236813575084767080625169910490512847900390625e-22; // 2^(-72) double exp2_val; - double pow43_val = 0; + for (i = 0; i < 16; ++i) pow43_lut[i] = i * cbrt(i); - for (i = 1; i < TABLE_4_3_SIZE; i++) { - double f, fm; - int e, m; - double value = i / 4; - if ((i & 3) == 0) - pow43_val = value / IMDCT_SCALAR * cbrt(value); - f = pow43_val * exp2_lut[i & 3]; - fm = frexp(f, &e); - m = llrint(fm * (1LL << 31)); - e += FRAC_BITS - 31 + 5 - 100; - - /* normalized to FRAC_BITS */ - table_4_3_value[i] = m; - table_4_3_exp[i] = -e; - } for (exponent = 0; exponent < 512; exponent++) { if (exponent && (exponent & 3) == 0) exp2_base *= 2; diff --git a/libavcodec/mpegaudiodata.h b/libavcodec/mpegaudiodata.h index 01b1f88cd0..0a425ef6a8 100644 --- a/libavcodec/mpegaudiodata.h +++ b/libavcodec/mpegaudiodata.h @@ -29,6 +29,8 @@ #include +#include "config.h" + #include "internal.h" #include "vlc.h" @@ -42,6 +44,15 @@ extern const int ff_mpa_quant_steps[17]; extern const int ff_mpa_quant_bits[17]; extern const unsigned char * const ff_mpa_alloc_tables[5]; +#define TABLE_4_3_SIZE ((8191 + 16)*4) +#if CONFIG_HARDCODED_TABLES +extern const int8_t ff_table_4_3_exp [TABLE_4_3_SIZE]; +extern const uint32_t ff_table_4_3_value[TABLE_4_3_SIZE]; +#else +extern int8_t ff_table_4_3_exp [TABLE_4_3_SIZE]; +extern uint32_t ff_table_4_3_value[TABLE_4_3_SIZE]; +#endif + /* VLCs for decoding layer 3 huffman tables */ extern VLC ff_huff_vlc[16]; extern VLC ff_huff_quad_vlc[2]; diff --git a/libavcodec/mpegaudiodec_common.c b/libavcodec/mpegaudiodec_common.c index 4333746e9a..a963f6683a 100644 --- a/libavcodec/mpegaudiodec_common.c +++ b/libavcodec/mpegaudiodec_common.c @@ -32,6 +32,8 @@ #include "mpegaudiodata.h" +#include "mpegaudiodec_common_tablegen.h" + uint16_t ff_scale_factor_modshift[64]; static int16_t division_tab3[1 << 6 ]; @@ -469,6 +471,7 @@ static av_cold void mpegaudiodec_common_init_static(void) } } } + mpegaudiodec_common_tableinit(); } av_cold void ff_mpegaudiodec_common_init_static(void) diff --git a/libavcodec/mpegaudiodec_common_tablegen.c b/libavcodec/mpegaudiodec_common_tablegen.c new file mode 100644 index 0000000000..a319df65ab --- /dev/null +++ b/libavcodec/mpegaudiodec_common_tablegen.c @@ -0,0 +1,40 @@ +/* + * Generate a header file for hardcoded shared mpegaudiodec tables + * + * Copyright (c) 2009 Reimar Döffinger + * Copyright (c) 2020 Andreas Rheinhardt + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#define CONFIG_HARDCODED_TABLES 0 +#include "libavutil/tablegen.h" +#include "mpegaudiodec_common_tablegen.h" +#include "tableprint.h" + +int main(void) +{ + mpegaudiodec_common_tableinit(); + + write_fileheader(); + + WRITE_ARRAY("const", int8_t, ff_table_4_3_exp); + WRITE_ARRAY("const", uint32_t, ff_table_4_3_value); + + return 0; +} diff --git a/libavcodec/mpegaudiodec_common_tablegen.h b/libavcodec/mpegaudiodec_common_tablegen.h new file mode 100644 index 0000000000..bf402c9d84 --- /dev/null +++ b/libavcodec/mpegaudiodec_common_tablegen.h @@ -0,0 +1,72 @@ +/* + * Header file for hardcoded shared mpegaudiodec tables + * + * Copyright (c) 2009 Reimar Döffinger + * Copyright (c) 2020 Andreas Rheinhardt + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_MPEGAUDIODEC_COMMON_TABLEGEN_H +#define AVCODEC_MPEGAUDIODEC_COMMON_TABLEGEN_H + +#include + +#define TABLE_4_3_SIZE ((8191 + 16)*4) + +#if CONFIG_HARDCODED_TABLES +#define mpegaudiodec_common_tableinit() +#include "libavcodec/mpegaudiodec_common_tables.h" +#else +#include +#include "libavutil/attributes.h" + +int8_t ff_table_4_3_exp [TABLE_4_3_SIZE]; +uint32_t ff_table_4_3_value[TABLE_4_3_SIZE]; + +#define FRAC_BITS 23 +#define IMDCT_SCALAR 1.759 + +static av_cold void mpegaudiodec_common_tableinit(void) +{ + static const double exp2_lut[4] = { + 1.00000000000000000000, /* 2 ^ (0 * 0.25) */ + 1.18920711500272106672, /* 2 ^ (1 * 0.25) */ + M_SQRT2 , /* 2 ^ (2 * 0.25) */ + 1.68179283050742908606, /* 2 ^ (3 * 0.25) */ + }; + double pow43_val = 0; + + for (int i = 1; i < TABLE_4_3_SIZE; i++) { + double f, fm; + int e, m; + double value = i / 4; + if ((i & 3) == 0) + pow43_val = value / IMDCT_SCALAR * cbrt(value); + f = pow43_val * exp2_lut[i & 3]; + fm = frexp(f, &e); + m = llrint(fm * (1LL << 31)); + e += FRAC_BITS - 31 + 5 - 100; + + /* normalized to FRAC_BITS */ + ff_table_4_3_value[i] = m; + ff_table_4_3_exp [i] = -e; + } +} + +#endif /* CONFIG_HARDCODED_TABLES */ +#endif /* AVCODEC_MPEGAUDIODEC_COMMON_TABLEGEN_H */ diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 1e8fd6064f..0ceeee2d46 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -219,8 +219,8 @@ static inline int l3_unscale(int value, int exponent) unsigned int m; int e; - e = table_4_3_exp [4 * value + (exponent & 3)]; - m = table_4_3_value[4 * value + (exponent & 3)]; + e = ff_table_4_3_exp [4 * value + (exponent & 3)]; + m = ff_table_4_3_value[4 * value + (exponent & 3)]; e -= exponent >> 2; #ifdef DEBUG if(e < 1) From patchwork Mon Nov 23 19:37:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24013 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 6B85E44AF49 for ; Mon, 23 Nov 2020 21:43:40 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 49FA168BC05; Mon, 23 Nov 2020 21:43:40 +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 19FCA68BB17 for ; Mon, 23 Nov 2020 21:43:34 +0200 (EET) Received: by mail-wm1-f66.google.com with SMTP id p22so338213wmg.3 for ; Mon, 23 Nov 2020 11:43:34 -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=+GHgrmfDk5+cLtPmytkkAWyKBRfZgVNW7O/qwjn0mtY=; b=ZPpT8AZOT/vCJ0b7FdAbMMrXnjbSEbH1VguBKwpzJ3fTW5XWU/sLBrpEu3d4qlohzq LIZsbMhQzei6/+Tz+6XQ8JN5vQIALTRKdgGxS61gcFe6P5unYUoNsNcQ00gebMv2Shms tlYnJlh67qnUWsb2XLaTfFeakhZOwhcj8VfWPoRji5/3mvbiPyA06G9GKQL/iVJo1IOH F17eKxTidp6eXF5tJUFBfkDol/QenOydNPPt/oz3yQ4WTKUFI7+zf5ZZNbbGKNMSOMta pxWnsQroULFfWbAXrOPapgOyqxa3kYdYYAPNBIh1q4dyw7dESJBWuTPxCwSUoUvyuAWO KfcA== 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=+GHgrmfDk5+cLtPmytkkAWyKBRfZgVNW7O/qwjn0mtY=; b=C5+nYxn6wJw7x9XZTcEs9N3NV1s2PCBEqhquw2yRs9HV8TOibRAGzfBUSBpoiBZVlf BUGIJgudlm4anfjmmSQ0CCQYWWTUPd3dr+JPb7cSNw1VpaUqb/BlxabKBc76NHC+f6en jWD7VvoOB83hoixSqpHJgO0rk7sCsvV+zeUrFeJRWYsCLWI3HTVNiv7+Pn9pvlFupO07 wjycvnFSEtBuExkFJE9eOvHiSj1uEl0Vbz5I1j/hzuWc+jmwsOygYs7KjR0/pjjpf5Hw Qd7TpJgNAva6v4tmYbzqol4+SpnrnSxVvC0kQuXtvoMZdSJ719OgI/tRS6Dr/B2+ZNl2 tnmA== X-Gm-Message-State: AOAM530jx7stVXmBqkEUcxjEEFZVunCO95WZ5Q3V03Jgbt8v39ibXCP2 U8pnh+fdBABUIalEP4skh9eqdxsZPDQbzg== X-Google-Smtp-Source: ABdhPJwvBWUWAODrJS6hsSHyg6cf9XMeQ2IzHuaXHnHvdAm2VL1LcVG8h+2sclLQA4/XAk41YpSCgA== X-Received: by 2002:a7b:cc13:: with SMTP id f19mr492584wmh.44.1606160270936; Mon, 23 Nov 2020 11:37:50 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:37:50 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:11 +0100 Message-Id: <20201123193739.1249300-1-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 163/191] avcodec/atrac: Make generating tables thread-safe 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/atrac.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/libavcodec/atrac.c b/libavcodec/atrac.c index 12e8997dbc..bf9878be45 100644 --- a/libavcodec/atrac.c +++ b/libavcodec/atrac.c @@ -30,6 +30,8 @@ #include #include +#include "libavutil/thread.h" + #include "avcodec.h" #include "atrac.h" @@ -45,22 +47,23 @@ static const float qmf_48tap_half[24] = { -0.043596379, -0.099384367, 0.13207909, 0.46424159 }; -av_cold void ff_atrac_generate_tables(void) +static av_cold void atrac_generate_tables(void) { - int i; - float s; - /* Generate scale factors */ - if (!ff_atrac_sf_table[63]) - for (i=0 ; i<64 ; i++) - ff_atrac_sf_table[i] = pow(2.0, (i - 15) / 3.0); + for (int i = 0; i < 64; i++) + ff_atrac_sf_table[i] = pow(2.0, (i - 15) / 3.0); /* Generate the QMF window. */ - if (!qmf_window[47]) - for (i=0 ; i<24; i++) { - s = qmf_48tap_half[i] * 2.0; - qmf_window[i] = qmf_window[47 - i] = s; - } + for (int i = 0; i < 24; i++) { + float s = qmf_48tap_half[i] * 2.0; + qmf_window[i] = qmf_window[47 - i] = s; + } +} + +av_cold void ff_atrac_generate_tables(void) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + ff_thread_once(&init_static_once, atrac_generate_tables); } av_cold void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int id2exp_offset, From patchwork Mon Nov 23 19:37:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24015 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 AE6F8449A80 for ; Mon, 23 Nov 2020 22:44:00 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9872D68BBD8; Mon, 23 Nov 2020 22:44:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9AA7168BB27 for ; Mon, 23 Nov 2020 22:43:53 +0200 (EET) Received: by mail-lf1-f67.google.com with SMTP id d17so25660597lfq.10 for ; Mon, 23 Nov 2020 12:43:53 -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=cAhC7PgY+ANHiGi9mzbckt/TUJ42rI7mCLpDAOAAtLk=; b=MQ1WmWeKGp4K9GEIkURYeeHW0vjRopnVyLjThWUKUGxXuBqOlqK3SKfEZ2/ko7TCj6 j2hXesVq07BYDAVPfPmyyTK1moLSlk1iNgV2vCBnBwrGFaeHPcSEiwRTon5Tom3QAaHA KjgkJiwmVJzwke53/oyLbUZt9jDmJqeCPCG+v4M541cTZcuqtNGs2tGHKgR754fALonu PbLiBfALQRCFZ8ZyEwLQaNhV/hwqUIKx2GaYRfpbzXsMzzAhCUVAirqHQpGhwWpJgk3c an+6Kvy/vyNGJ6yNp267HcDMLKedSLhfhXEgeJU/a/YnB99pF/EzT71W+X8pQ68UBmOG ImnQ== 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=cAhC7PgY+ANHiGi9mzbckt/TUJ42rI7mCLpDAOAAtLk=; b=T9OthDq+PgbpuMYtR9GvLNFNc1A3tUaKcYECuRU+LuGSbakK2XcKVSOnTrPLBYeUxS T1HUMEIlqwd8OQnAYcAWYk+JoFuJO7TkP/TZZTYHiTKN/yfmZ/r3DX+OMjeqw+eGMNzv awgBQ3ERPCSmHXdu5fXxK22+gl/YnRyz8duUHgqMmQt5kETsNyh2gkTGn3/QE5ROUCG4 O1I4+oYWr/0wPYVa5OSIoQDiknQKh7vujAMz3f/UCn6FdWSNtkx+xxJ/V+yihKnt/pl6 JzQ4JgPa1QJ4sqlVTI/+H9UuEw4QMzKJwYXnLZLn+ryJgv/2ui/1gT4GFf0fi5i35Hd6 WuVg== X-Gm-Message-State: AOAM530m2YoKwfa5Lvi0SJWuZhajHTZJFpU79JFU1WWtxqMrycmGfuLp LQ1cfwtiHdyTeufk4/UjgXtyXJikqzS3XQ== X-Google-Smtp-Source: ABdhPJyY/yNn8wnx1ajsi6y94/5flwEg28oUaNkn4VifLVL5UJtCQ7SqTFyHW9zt2g7DTvYJ/XmKnQ== X-Received: by 2002:a5d:4b81:: with SMTP id b1mr1338406wrt.372.1606160274242; Mon, 23 Nov 2020 11:37:54 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:37:53 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:12 +0100 Message-Id: <20201123193739.1249300-2-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 164/191] avcodec/atrac3: Make decoders init-threadsafe 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/atrac3.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index 48f0f20a0a..e80c39d492 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -39,6 +39,8 @@ #include "libavutil/attributes.h" #include "libavutil/float_dsp.h" #include "libavutil/libm.h" +#include "libavutil/thread.h" + #include "avcodec.h" #include "bytestream.h" #include "fft.h" @@ -870,7 +872,7 @@ static av_cold void atrac3_init_static_data(void) static av_cold int atrac3_decode_init(AVCodecContext *avctx) { - static int static_init_done; + static AVOnce init_static_once = AV_ONCE_INIT; int i, js_pair, ret; int version, delay, samples_per_frame, frame_factor; const uint8_t *edata_ptr = avctx->extradata; @@ -882,10 +884,6 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - if (!static_init_done) - atrac3_init_static_data(); - static_init_done = 1; - /* Take care of the codec-specific extradata. */ if (avctx->codec_id == AV_CODEC_ID_ATRAC3AL) { version = 4; @@ -1009,6 +1007,8 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx) if (!q->units) return AVERROR(ENOMEM); + ff_thread_once(&init_static_once, atrac3_init_static_data); + return 0; } @@ -1024,7 +1024,7 @@ AVCodec ff_atrac3_decoder = { .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; AVCodec ff_atrac3al_decoder = { @@ -1039,5 +1039,5 @@ AVCodec ff_atrac3al_decoder = { .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Mon Nov 23 19:37:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23985 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 B1F3B44A49B for ; Mon, 23 Nov 2020 21:38:14 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9812468BB81; Mon, 23 Nov 2020 21:38:14 +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 6F36768B8D9 for ; Mon, 23 Nov 2020 21:38:08 +0200 (EET) Received: by mail-wm1-f68.google.com with SMTP id w24so405671wmi.0 for ; Mon, 23 Nov 2020 11:38:08 -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=MoPids1jFp47zzrOaMY1VYIaxDQsNg14Om3SnoImYF8=; b=rHkzjpX35noaZ03e66xJrxjZbzkhEclxrQWSPPaikHL5q8JH+pFr3Tn0CmEDCAPCwQ rDgtXIdCX7akekvss0HX6FhMXTWanNZcFfJPUuL8zXaeef5bQnqeyzpDD3Z+aJaWzA3F IbLHbmk1iw8+TNiR2zr9ReNqT1t5cSzqNnmiRH1LKOM2/CvJyk2wb5MyfdmwCxNM9Z6a Sxmpaa6gztNpPKCK9kZKqsv83KZDMhiKbN56Pl4HAPTkkVViX+TcQf9+Jbpr7LiNxm27 SmDzZakT3UH5Kf98z6iImbZObk90n4QSSpwx4KBYCNCgx16kY26w9mKqjv62hDDhm2Yq 599Q== 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=MoPids1jFp47zzrOaMY1VYIaxDQsNg14Om3SnoImYF8=; b=csDTtqI63oacl0C27tQFqYK4NFtELeeKdmgCfFjoDYwX8ajL8GgchQ2izKYlbi213P GN2iKHnmYE8OTz0z16g8au/9OgSBwokAnO+1+47Js/aUWgyFi7SwyOWYwiIdyiZjDXMK iEAagosapTQNvUMLsPwAuCNJTcr7NldJ9ucUGF/X9nl7Ink8QpZleh/HubU+perNb9Gv qrBOOsij0bmnHpNnRo9xnWp/Mwse96O2kuvTJqY5HhTCQZ/L5CNneuGqIJf3wxsLMaUe WW3kkDICFmYOyU2S+O7sSFKeoNyvtzp7eELptnrlji1GlWPo6vve5DZyHVkxPyobajfs JxRg== X-Gm-Message-State: AOAM53112O4RGXhLrDJ+0lMpROIk8cHgT4jNQtVufVsvnzgQA1LqO4lI oU2COkd0nqe/ebVVEYTNp/kd7QG8fgsSUQ== X-Google-Smtp-Source: ABdhPJyTeCuk3u21dzNvcIQktvhnt56J9SH8+vYINWxkQ0s8HRpC6Hc4lOkNCoU/kX406O48HQALYg== X-Received: by 2002:a7b:cf2b:: with SMTP id m11mr417175wmg.163.1606160287676; Mon, 23 Nov 2020 11:38:07 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:07 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:13 +0100 Message-Id: <20201123193739.1249300-3-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 165/191] avcodec/sinewin_tablegen: Use better check in assert 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" There are no ff_sine_windows for 2^i, 0 <= i < 5, so one should check for the index being >= 5. Signed-off-by: Andreas Rheinhardt --- libavcodec/sinewin_tablegen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/sinewin_tablegen.h b/libavcodec/sinewin_tablegen.h index dc52234ed0..3c11cb6282 100644 --- a/libavcodec/sinewin_tablegen.h +++ b/libavcodec/sinewin_tablegen.h @@ -74,7 +74,7 @@ av_cold void AAC_RENAME(ff_sine_window_init)(INTFLOAT *window, int n) { } av_cold void AAC_RENAME(ff_init_ff_sine_windows)(int index) { - assert(index >= 0 && index < FF_ARRAY_ELEMS(AAC_RENAME(ff_sine_windows))); + assert(index >= 5 && index < FF_ARRAY_ELEMS(AAC_RENAME(ff_sine_windows))); #if !CONFIG_HARDCODED_TABLES AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_windows)[index], 1 << index); #endif From patchwork Mon Nov 23 19:37:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23986 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 A740244A49B for ; Mon, 23 Nov 2020 21:38:17 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9062868BB9B; Mon, 23 Nov 2020 21:38:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7192368BB6C for ; Mon, 23 Nov 2020 21:38:09 +0200 (EET) Received: by mail-wm1-f67.google.com with SMTP id h21so394824wmb.2 for ; Mon, 23 Nov 2020 11:38:09 -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=8T6iB3EbyhLUSepVBTaTji7VNoXGzfoMwHj+6SdDHvw=; b=RByrn2DIiukvrtu3bMtvZMAA/sIFwbmyqiAiN+gLzWwkkDqRc86+Dj2fQTxyPZunRO K91yjClQU1ezihhld1j6PM3abaza9tF+NCjwygY6fSHj0YkWDn4Ulcd3VEAfy1x18/iF qJCrg0XuuAn0SZHPyPYzj8Hf80nk9EH26Pf56541a4XkC3qmILNeOYiOv1t4hbslprx1 RtcPIQn4DOVPJa4vzsZcIjl+429enZfDKZtrCLl+rqgwyTNT0Y+3LVxU7R5RU/DXLQ39 hp3Fz9JVJXa9qbFmFeYXIiYv8jxE0JOHKsFvRrbTpMBC9jYUl5zTPOdtKD0KOQlxKNqt ubvw== 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=8T6iB3EbyhLUSepVBTaTji7VNoXGzfoMwHj+6SdDHvw=; b=D6nyNxaUOFXYHvPDRpOZIKfvq17WRhuiIgMPOWwO/W5gBHLKu/TwFIPMMvSk+q1Bz/ PEJj6yH57JHZn17xRh/LHHrfUisLIxbzpRl/sqDX/hFq55OQrRpo82rHsrdzFgSp/4bR 2WNKvFArNozXKOgN7ylK05ER+lYWb4RMBjCV3TmzF7TE2QrpJP1ZtfnJqj5Rv4TQueya rbZfhei/2MxNHNiSJZK6tp/4fdWV4HO7cUdqrCOnneOLXDwzco3Hebq2obOd6qgQqT8r bj/Lj/jKhUAjMO92xd1xknAYiw5JxfSYN3gc4WvJn+oZA81+VA2ETOFZJZKZ5jaywNRb dJpQ== X-Gm-Message-State: AOAM5304V4XGvlFg0yi3fe9x3Y1YSbAOsHOOu7Nt/1lOSauxR3ji06aq FB1bQ32BStq+tGCMA0z5vQA39ZKUnQgVTQ== X-Google-Smtp-Source: ABdhPJz+RywEKlK5VmWNE4vfP0trDCCIkbIVGIHr92Ge5QNkGdAvWk6fed8qPjJdO35CMHeyXjdkgw== X-Received: by 2002:a7b:cc13:: with SMTP id f19mr493628wmh.44.1606160288605; Mon, 23 Nov 2020 11:38:08 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:08 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:14 +0100 Message-Id: <20201123193739.1249300-4-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 166/191] avcodec/aacdec, sinewin: Move 120 and 960 point sine tables to aacdec 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 floating point AAC decoder is the only user of these tables, so it makes sense to move them there. Furthermore, initializing the ordinary power-of-two sinetables is currently not thread-safe and if the 120- and 960-point sinetables were not moved, one would have to choose whether to guard initializing these two tables with their own AVOnces or not. Doing so would add unnecessary AVOnces as the AAC decoder already guards initializing its static data by an AVOnce; not doing so would be fragile if a second user of these tables were to be added. Signed-off-by: Andreas Rheinhardt --- libavcodec/aacdec.c | 3 +++ libavcodec/aacdec_template.c | 10 +++++----- libavcodec/sinewin.h | 5 ----- libavcodec/sinewin_tablegen.h | 4 ---- libavcodec/sinewin_tablegen_template.c | 2 -- 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index d17852d8ba..fd4805f6eb 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -69,6 +69,9 @@ # include "mips/aacdec_mips.h" #endif +DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(sine_120))[120]; +DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(sine_960))[960]; + static av_always_inline void reset_predict_state(PredictorState *ps) { ps->r0 = 0.0f; diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 186175e6e6..e6fe913a27 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -1235,8 +1235,8 @@ static av_cold void aac_static_table_init(void) #if !USE_FIXED AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_long_960), 4.0, 960); AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_short_120), 6.0, 120); - AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_960), 960); - AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_120), 120); + AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_960), 960); + AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_120), 120); #endif AAC_RENAME(ff_init_ff_sine_windows)(10); AAC_RENAME(ff_init_ff_sine_windows)( 9); @@ -2810,9 +2810,9 @@ static void imdct_and_windowing_960(AACContext *ac, SingleChannelElement *sce) INTFLOAT *in = sce->coeffs; INTFLOAT *out = sce->ret; INTFLOAT *saved = sce->saved; - const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_120) : AAC_RENAME(ff_sine_120); - const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_long_960) : AAC_RENAME(ff_sine_960); - const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_short_120) : AAC_RENAME(ff_sine_120); + const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_120) : AAC_RENAME(sine_120); + const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_long_960) : AAC_RENAME(sine_960); + const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_short_120) : AAC_RENAME(sine_120); INTFLOAT *buf = ac->buf_mdct; INTFLOAT *temp = ac->temp; int i; diff --git a/libavcodec/sinewin.h b/libavcodec/sinewin.h index 329e9bb5be..7b64096a71 100644 --- a/libavcodec/sinewin.h +++ b/libavcodec/sinewin.h @@ -38,9 +38,6 @@ #define SINETABLE(size) \ SINETABLE_CONST DECLARE_ALIGNED(32, INTFLOAT, AAC_RENAME(ff_sine_##size))[size] -#define SINETABLE120960(size) \ - DECLARE_ALIGNED(32, INTFLOAT, AAC_RENAME(ff_sine_##size))[size] - /** * Generate a sine window. * @param window pointer to half window @@ -55,11 +52,9 @@ void AAC_RENAME(ff_init_ff_sine_windows)(int index); extern SINETABLE( 32); extern SINETABLE( 64); -extern SINETABLE120960(120); extern SINETABLE( 128); extern SINETABLE( 256); extern SINETABLE( 512); -extern SINETABLE120960(960); extern SINETABLE(1024); extern SINETABLE(2048); extern SINETABLE(4096); diff --git a/libavcodec/sinewin_tablegen.h b/libavcodec/sinewin_tablegen.h index 3c11cb6282..1959074189 100644 --- a/libavcodec/sinewin_tablegen.h +++ b/libavcodec/sinewin_tablegen.h @@ -31,10 +31,6 @@ #include "libavutil/attributes.h" #include "libavutil/common.h" -#if !USE_FIXED -SINETABLE120960(120); -SINETABLE120960(960); -#endif #if !CONFIG_HARDCODED_TABLES SINETABLE( 32); SINETABLE( 64); diff --git a/libavcodec/sinewin_tablegen_template.c b/libavcodec/sinewin_tablegen_template.c index b8eb407bd8..43ce1ba82e 100644 --- a/libavcodec/sinewin_tablegen_template.c +++ b/libavcodec/sinewin_tablegen_template.c @@ -33,8 +33,6 @@ #define SINETABLE_CONST #define SINETABLE(size) \ INTFLOAT AAC_RENAME(ff_sine_##size)[size] -#define SINETABLE120960(size) \ - INTFLOAT AAC_RENAME(ff_sine_##size)[size] #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) #include "sinewin_tablegen.h" #include "tableprint.h" From patchwork Mon Nov 23 19:37:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23987 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 AE5C844A49B for ; Mon, 23 Nov 2020 21:38:18 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8DEA568BBBD; Mon, 23 Nov 2020 21:38:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6464768BB73 for ; Mon, 23 Nov 2020 21:38:10 +0200 (EET) Received: by mail-wm1-f65.google.com with SMTP id w24so405888wmi.0 for ; Mon, 23 Nov 2020 11:38:10 -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=wBoBvg12QPi3J+aqmD8gNIRWZgk26m2XISdLZT5W3cA=; b=ZTpE7iVi1PZ2Davdnjv5S9tJXqpHs3Yw5VwwEPO1QCogptF2JOZAFwi8QB8lsgkYKX hJkg77SfcsR/4HV0/jhX0A/MoqCou/qepf7JcSSqd6vF9+E260Z7L8NzdVwunYKAQL56 Kcy+2kdiD1s1ZXtT/qX49qfxGupScklaAqPWzNvTrCyXBAodP5CXfOqTu8nY77aLuEg3 h/IvjGJ0fC+fwkRHhUEks1VMA8/RTZjJWZ9qB8Q4YWq2E/GDKjp6sr+mTqid5WfW4ZcT PIkU7SKywm/24PyuaZFcyKz3BCMiZoOjOR8RxKJEp7Z+OFRh+uOoTmtxTcu6hLCBNUwM vZFQ== 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=wBoBvg12QPi3J+aqmD8gNIRWZgk26m2XISdLZT5W3cA=; b=dsIKh4VxJb2SVc2dBm64BHw9jLNJ3agB5VBM20aahiC/JssMaCkUKnn9iOIXnyKxqL 8UrqDyKt9CaZwtXE8pcfW5PPRNWx3j70KA0jV5NFazwX5Z02/NkrSNVvALkuRqQJmSOM CXA6Y9v2sRs19CDJp8FUTbvSrPhIswtU3i39Bp2QPJkWyEvdITHKoE2o6Q3TDd+XCmFD GdfTOIbScpQA7msA4OQZiKGaTHm8QRfVQXMr2KydS3fldhl7z0aqC8kQBVCxeC00doUq tLomvmJR3TI6ho3syB56Xxhgr/LK2xcMclKLyFrfTDUWkonDmtC84tZqGOZOTj6va+d6 YttA== X-Gm-Message-State: AOAM5307/vQeo/bnBZLb8eU3oPfkMQavnibv1nqKD1g0cKdoF9h8GlNs IkI8UzD9/eP507zr1XD8s/+JJ9WJ6Mc6Ag== X-Google-Smtp-Source: ABdhPJzctebQ7943eKy+xmJsLdpXHsqKIEH2U7huc9xg1RW+JtexJY5sCzo36yWp6q9naCAghX4BNA== X-Received: by 2002:a1c:2e48:: with SMTP id u69mr511418wmu.30.1606160289521; Mon, 23 Nov 2020 11:38:09 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:08 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:15 +0100 Message-Id: <20201123193739.1249300-5-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 167/191] avcodec/sinewin_tablegen: Make initializing ff_sine_windows thread-safe 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/sinewin_tablegen.h | 43 ++++++++++++++++++++++++++ libavcodec/sinewin_tablegen_template.c | 1 + 2 files changed, 44 insertions(+) diff --git a/libavcodec/sinewin_tablegen.h b/libavcodec/sinewin_tablegen.h index 1959074189..ced3b7874c 100644 --- a/libavcodec/sinewin_tablegen.h +++ b/libavcodec/sinewin_tablegen.h @@ -32,6 +32,10 @@ #include "libavutil/common.h" #if !CONFIG_HARDCODED_TABLES +#ifndef BUILD_TABLES +#include "libavutil/thread.h" +#endif + SINETABLE( 32); SINETABLE( 64); SINETABLE( 128); @@ -69,10 +73,49 @@ av_cold void AAC_RENAME(ff_sine_window_init)(INTFLOAT *window, int n) { window[i] = SIN_FIX(sinf((i + 0.5) * (M_PI / (2.0 * n)))); } +#if !CONFIG_HARDCODED_TABLES && !defined(BUILD_TABLES) +#define INIT_FF_SINE_WINDOW_INIT_FUNC(index) \ +static void init_ff_sine_window_ ## index(void) \ +{ \ + AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_windows)[index], 1 << index);\ +} + +INIT_FF_SINE_WINDOW_INIT_FUNC(5) +INIT_FF_SINE_WINDOW_INIT_FUNC(6) +INIT_FF_SINE_WINDOW_INIT_FUNC(7) +INIT_FF_SINE_WINDOW_INIT_FUNC(8) +INIT_FF_SINE_WINDOW_INIT_FUNC(9) +INIT_FF_SINE_WINDOW_INIT_FUNC(10) +INIT_FF_SINE_WINDOW_INIT_FUNC(11) +INIT_FF_SINE_WINDOW_INIT_FUNC(12) +INIT_FF_SINE_WINDOW_INIT_FUNC(13) + +static void (*const sine_window_init_func_array[])(void) = { + init_ff_sine_window_5, + init_ff_sine_window_6, + init_ff_sine_window_7, + init_ff_sine_window_8, + init_ff_sine_window_9, + init_ff_sine_window_10, + init_ff_sine_window_11, + init_ff_sine_window_12, + init_ff_sine_window_13, +}; + +static AVOnce init_sine_window_once[9] = { + AV_ONCE_INIT, AV_ONCE_INIT, AV_ONCE_INIT, AV_ONCE_INIT, AV_ONCE_INIT, + AV_ONCE_INIT, AV_ONCE_INIT, AV_ONCE_INIT, AV_ONCE_INIT +}; +#endif + av_cold void AAC_RENAME(ff_init_ff_sine_windows)(int index) { assert(index >= 5 && index < FF_ARRAY_ELEMS(AAC_RENAME(ff_sine_windows))); #if !CONFIG_HARDCODED_TABLES +#ifdef BUILD_TABLES AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_windows)[index], 1 << index); +#else + ff_thread_once(&init_sine_window_once[index - 5], sine_window_init_func_array[index - 5]); +#endif #endif } diff --git a/libavcodec/sinewin_tablegen_template.c b/libavcodec/sinewin_tablegen_template.c index 43ce1ba82e..7c3c1d8af2 100644 --- a/libavcodec/sinewin_tablegen_template.c +++ b/libavcodec/sinewin_tablegen_template.c @@ -23,6 +23,7 @@ #include #include "libavcodec/aac_defines.h" #define CONFIG_HARDCODED_TABLES 0 +#define BUILD_TABLES #if USE_FIXED #define WRITE_FUNC write_int32_t_array From patchwork Mon Nov 23 19:37:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23988 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 E319244A49B for ; Mon, 23 Nov 2020 21:38:19 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CDACD68BBA7; Mon, 23 Nov 2020 21:38:19 +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 8D4EA68B8D9 for ; Mon, 23 Nov 2020 21:38:11 +0200 (EET) Received: by mail-wr1-f66.google.com with SMTP id l1so19771951wrb.9 for ; Mon, 23 Nov 2020 11:38:11 -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=sYaTLm3UJcSTgM8Jr0GOXvGp91sWJalzF1sPw/XX90g=; b=TscEKHNYfspPfbpbbJqGXrnZ0etgqXi3QLnnAldYcsyinoDBDPEJ+xlQbXVLz/mtG2 b2gBYD5ucvb2DbSsYBIoEoYYMGuorbRVDcugrg7hWZDN6Z8P5cXHcSPWgMF2K1aa3Y1+ ewXXhhN9hBpwDt696Sz59IL+j0RIk/VrftIOP97x9m0aTHQu7DxHA6MAaaT3AMnKSDin HPc1Z53mtrUNzMJHex6r6ZDZ05wJ8spFhp/HsJEAycizMIfzk7eE8fLo016AO1pv5Mxm xvKgDJpqPjHq0aOrLdzSmgFg/kXSZPgKSm6OwRYBcXTPuCCVZlWalKiEXprAif2CWzjN 9uVw== 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=sYaTLm3UJcSTgM8Jr0GOXvGp91sWJalzF1sPw/XX90g=; b=WFUvZJwemyNL7vtOkzW2w5hVlI8kMG5fpTsKV6dMrp0A1xTtj913mq7b2JPwGWtxgu Cix+cqVrzcoLoIHUIX6LUXupKMbJzbzzZIsTNzhmA62isZr3+Nwpx07Hyx2/ULRgg9Da CfJNnUpN+8g/uhSWgpmWwTPnGQITIRyGirjzBOUVzsEQp4b3wHSNFr4rh4BYQTcqNOfe +nZKs0oac233b0zqmYPGryC1RmPbhguO2OU8n1I4KShTPgHZqOXP0eC+wlJrT1a15BYA uBmVk0eJmt/4sy38mjaEMCWVWE4B7b55gk1Bf5rWG9m2fxnWvhr5i5+jSy0iUMO8/vif b0AA== X-Gm-Message-State: AOAM5318FH/4pgCkAqrZLPWPXH5/W6xUDcydGaO599KUNprjI7bElus8 Q2v+4KsLxvYg+BD+jejX7uqR6fj30iRwGQ== X-Google-Smtp-Source: ABdhPJwwMq7cAjhls5fOYd39Le9r604kN9ovzFQLSODwTs1eOPvB26rre4eHdoUph2C+y3SU8UhSkw== X-Received: by 2002:a5d:4fc1:: with SMTP id h1mr1387961wrw.226.1606160290597; Mon, 23 Nov 2020 11:38:10 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:09 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:16 +0100 Message-Id: <20201123193739.1249300-6-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 168/191] avcodec/atrac1: Mark decoder as init-threadsafe 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" Possible because ff_init_ff_sine_windows() is now threadsafe. Signed-off-by: Andreas Rheinhardt --- libavcodec/atrac1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c index b2a2d5e6a1..31ec323370 100644 --- a/libavcodec/atrac1.c +++ b/libavcodec/atrac1.c @@ -392,5 +392,5 @@ AVCodec ff_atrac1_decoder = { .capabilities = AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Mon Nov 23 19:37:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23989 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 27D1B44A49B for ; Mon, 23 Nov 2020 21:38:22 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0887868BB9C; Mon, 23 Nov 2020 21:38:22 +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 B442C68BBAC for ; Mon, 23 Nov 2020 21:38:12 +0200 (EET) Received: by mail-wm1-f66.google.com with SMTP id 10so318387wml.2 for ; Mon, 23 Nov 2020 11:38:12 -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=2RlDaN8Gh4OtnrSjWoY8c73wDbt6d2HZ0qIaXwvcUG8=; b=XCSmzD/XVYkIiH1VADw/BQeuS8/xdwAMNr4xPalGykG3QaIkufioIWGppgPHhWBvjJ H618ntO0UY/nq7EZWzxFAvhRtfyrE4x2C3hZrFM4gEu/JEbIQCM3cVav0+e21n8JbzGl S1IQmLSoaVRGTJvxgk1Xu44Hs0G9GvB5V5F4vdWTIcszEywXN0H0cpjEZ+rmfISlLPn6 lQVZCKvJkd4Aq6VJVcsWA8ZbvnbNrUlRxjHYbSsrU1ZHUhwNGhnKCKmwD6/jTg0DoFA5 RM0HlX0R8gdBv53StbQZWYgD2xRgm6DTZsRMyu10upRJGBGk95jeu0v3hoDA3Gc3c+7X +BmQ== 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=2RlDaN8Gh4OtnrSjWoY8c73wDbt6d2HZ0qIaXwvcUG8=; b=dW1XpRb5t7UsJWc54peCBb4O20AQhKeZevIW6yUZuMBz9YZf08BmlUwK1c09DJ61f6 GOaRmWvFZy7PAO5IBlTMNi4FlQ6WmA36Th/8gHVI98VIb+18tIy/Wpg7wPaNnMCdvedO hC83dFiWneAvjs40JcOkG4lOSQvgA3SIihF3HhP+KOKUNszTuJQ1qpTopjApMWjSkGwU XvuIV/noHgZl2a6gqv4TSDuMFHy2iHYIirDqnRXg+mPTssAvSPo+dqOtz3G0dfB/S72a 4X1GQPZOUKB2U6GiY9PEhSID9tt5GXDvUOFoOzaEQNvkSh5hNwFwY+oAqFC9wBB/BJ/5 s9qQ== X-Gm-Message-State: AOAM530Xl11PMB+6Bsdetdj2qD0rfLGswrLjcLeoVQzYR00aS/pi2bKs aFier9M2yFEWR3R0VZmi+KH4OEq0+TaCvw== X-Google-Smtp-Source: ABdhPJyJDdUl76S6R6CK4EeZoBgNiiftmPKJJ1WlDXgVEGnhbYbuTx11BnvThl749ac86EMCKKkVYQ== X-Received: by 2002:a1c:c284:: with SMTP id s126mr454663wmf.109.1606160291869; Mon, 23 Nov 2020 11:38:11 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:10 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:17 +0100 Message-Id: <20201123193739.1249300-7-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 169/191] avcodec/atrac3plus: Make decoder init-threadsafe 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/atrac3plus.h | 4 ++-- libavcodec/atrac3plusdec.c | 16 +++++++++++----- libavcodec/atrac3plusdsp.c | 8 ++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/libavcodec/atrac3plus.h b/libavcodec/atrac3plus.h index 3c39e293c7..82fe0fe1f8 100644 --- a/libavcodec/atrac3plus.h +++ b/libavcodec/atrac3plus.h @@ -179,9 +179,9 @@ int ff_atrac3p_decode_channel_unit(GetBitContext *gb, Atrac3pChanUnitCtx *ctx, void ff_atrac3p_init_imdct(AVCodecContext *avctx, FFTContext *mdct_ctx); /** - * Initialize sine waves synthesizer. + * Initialize sine waves synthesizer and ff_sine_* tables. */ -void ff_atrac3p_init_wave_synth(void); +void ff_atrac3p_init_dsp_static(void); /** * Synthesize sine waves for a particular subband. diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c index 4b008ba0ee..b75f7eab5e 100644 --- a/libavcodec/atrac3plusdec.c +++ b/libavcodec/atrac3plusdec.c @@ -39,6 +39,7 @@ #include "libavutil/channel_layout.h" #include "libavutil/float_dsp.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "get_bits.h" #include "internal.h" @@ -144,8 +145,15 @@ static av_cold int set_channel_params(ATRAC3PContext *ctx, return 0; } +static av_cold void atrac3p_init_static(void) +{ + ff_atrac3p_init_vlcs(); + ff_atrac3p_init_dsp_static(); +} + static av_cold int atrac3p_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; ATRAC3PContext *ctx = avctx->priv_data; int i, ch, ret; @@ -154,8 +162,6 @@ static av_cold int atrac3p_decode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - ff_atrac3p_init_vlcs(); - /* initialize IPQF */ ff_mdct_init(&ctx->ipqf_dct_ctx, 5, 1, 32.0 / 32768.0); @@ -163,8 +169,6 @@ static av_cold int atrac3p_decode_init(AVCodecContext *avctx) ff_atrac_init_gain_compensation(&ctx->gainc_ctx, 6, 2); - ff_atrac3p_init_wave_synth(); - if ((ret = set_channel_params(ctx, avctx)) < 0) return ret; @@ -194,6 +198,8 @@ static av_cold int atrac3p_decode_init(AVCodecContext *avctx) avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; + ff_thread_once(&init_static_once, atrac3p_init_static); + return 0; } @@ -405,7 +411,7 @@ AVCodec ff_atrac3pal_decoder = { .type = AVMEDIA_TYPE_AUDIO, .id = AV_CODEC_ID_ATRAC3PAL, .capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, .priv_data_size = sizeof(ATRAC3PContext), .init = atrac3p_decode_init, .close = atrac3p_decode_close, diff --git a/libavcodec/atrac3plusdsp.c b/libavcodec/atrac3plusdsp.c index ca3154e133..7af1fa2141 100644 --- a/libavcodec/atrac3plusdsp.c +++ b/libavcodec/atrac3plusdsp.c @@ -79,9 +79,6 @@ const float ff_atrac3p_mant_tab[8] = { av_cold void ff_atrac3p_init_imdct(AVCodecContext *avctx, FFTContext *mdct_ctx) { - ff_init_ff_sine_windows(7); - ff_init_ff_sine_windows(6); - /* Initialize the MDCT transform. */ ff_mdct_init(mdct_ctx, 8, 1, -1.0); } @@ -94,7 +91,7 @@ static DECLARE_ALIGNED(32, float, sine_table)[2048]; ///< wave table static DECLARE_ALIGNED(32, float, hann_window)[256]; ///< Hann windowing function static float amp_sf_tab[64]; ///< scalefactors for quantized amplitudes -av_cold void ff_atrac3p_init_wave_synth(void) +av_cold void ff_atrac3p_init_dsp_static(void) { int i; @@ -109,6 +106,9 @@ av_cold void ff_atrac3p_init_wave_synth(void) /* generate amplitude scalefactors table */ for (i = 0; i < 64; i++) amp_sf_tab[i] = exp2f((i - 3) / 4.0f); + + ff_init_ff_sine_windows(7); + ff_init_ff_sine_windows(6); } /** From patchwork Mon Nov 23 19:37: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: 23991 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 7445944A49B for ; Mon, 23 Nov 2020 21:38:24 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2200168BBF8; Mon, 23 Nov 2020 21:38:24 +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 9894F68BBBE for ; Mon, 23 Nov 2020 21:38:13 +0200 (EET) Received: by mail-wm1-f66.google.com with SMTP id c198so331571wmd.0 for ; Mon, 23 Nov 2020 11:38:13 -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=Pc9qFEOjW0hbmSr90mQobBMLheeVLyrXf0yAJ9wiiLo=; b=hnMW2zfpf/NwuKn5PzQGZSaIt6TadwGxig/4MoitqD2GLnDARMJTbjD0PjssXLYz00 Ogp4/NekiHIn366GVzwxFDXZz1+qoKowOM2wJmzGon8leyfVqvruyaSJGnZXBjaxqnMo eFcaNW9ros/Z1rjFopdJOuVWhkOjpBaMtQ5o+fQ0rRp78i64MV7oXFyIrY7tjwEKEtvS hab2x7gsmdaj22P4FBGkQTReTYjeCtvsdL3a4cMKCUYr/op+5uXBEYXDBT4PRgUc+fqC 1RxMCzJWex7JwEmBCcFmsKQewOfw4ibTRCZaAC9qaCKDHOkQAGBfvFzKvTLVms2rs0uM 4TJQ== 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=Pc9qFEOjW0hbmSr90mQobBMLheeVLyrXf0yAJ9wiiLo=; b=gswhRJWy1DZjm2qHfawCjy7TvtTcPI7D0eQCDWc1XmNK7HTcOX1dYZR5/MUj9iV4Z1 AOt9yDMHMBjg/fovx2N+vqnpfiCX2c9xOkegS5Xkj5qDow4N/LJ5mBky4BmaW3y6GRh8 ChjyhrwjeL4XIRLErqMrT6DCHlMVdTtm2ltP/lzyLMMR5LywnsL7xC8LEmyRwx/qKpcD QY3RviFltfOJ1izUKnKVENr9lURPe5rLvK2NrLezl0Uydb9TEIDLO+CoRhEJ2UMKCeTi yXAVhV5Gan90R1rIuegupYi/HAFvrLOYe34uQvjSfFWfIpufGgPoG0sqLQr7dLlAU8W2 afFQ== X-Gm-Message-State: AOAM531RCiv3ZENJ7WwKL1Ase7XZAe5Itmd5ezx+b95FoxJmsVjcmqjy ngcACpFvn9HlVOafFqAhimLoi53vIQ4C5g== X-Google-Smtp-Source: ABdhPJxba9HW7MexcX6fXeHohvAyT7VMonoS4dO9kbUgu6wR8cNvzGBYnqBpfo2vUxZEKYp7nqdz6g== X-Received: by 2002:a1c:dd06:: with SMTP id u6mr449395wmg.155.1606160292774; Mon, 23 Nov 2020 11:38:12 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:12 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:18 +0100 Message-Id: <20201123193739.1249300-8-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 170/191] avcodec/nellymoserdec: Make decoder init-threadsafe 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" Easy now that initializing the ff_sine_* tables is thread-safe. Signed-off-by: Andreas Rheinhardt --- libavcodec/nellymoserdec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c index d667d9ce79..49a21b43ce 100644 --- a/libavcodec/nellymoserdec.c +++ b/libavcodec/nellymoserdec.c @@ -128,13 +128,12 @@ static av_cold int decode_init(AVCodecContext * avctx) { s->scale_bias = 1.0/(32768*8); avctx->sample_fmt = AV_SAMPLE_FMT_FLT; - /* Generate overlap window */ - if (!ff_sine_128[127]) - ff_init_ff_sine_windows(7); - avctx->channels = 1; avctx->channel_layout = AV_CH_LAYOUT_MONO; + /* Generate overlap window */ + ff_init_ff_sine_windows(7); + return 0; } @@ -198,4 +197,5 @@ AVCodec ff_nellymoser_decoder = { .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Mon Nov 23 19:37:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23993 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 C19EB44A49B for ; Mon, 23 Nov 2020 21:38:26 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 994ED68BC02; Mon, 23 Nov 2020 21:38:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 78D4668BBA7 for ; Mon, 23 Nov 2020 21:38:14 +0200 (EET) Received: by mail-wm1-f44.google.com with SMTP id a3so374450wmb.5 for ; Mon, 23 Nov 2020 11:38:14 -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=CTXHB2kJ38uEuVt8aJ+FyBLUjdvdb7psK2aoAAYzlVM=; b=vHCfe6aNB4txvoiT8HxfEGbxS/SCfY2VMgDMl3R4PYkPwjZa+6ZiGUXtpTtaHXoyAf XaDjjEGoEXYCplW7iaBGKNGmJfkBNEgd33sj8QNwThBUL4EU+48mRomdwn+9dknBV+ZS awVqZXrf+CdltrWLpiUUvgK7QntgPvWuKGFkkmoddGUbSyVR6m1ByQARb4bowSiOCIPa 9LBcrM0UFG6SQBRZgPtRYWouZ0KKgw647CY+aImHQosb0mxeGo2Y6gulz1sZhYCkEzcX iGZ5vUhA7KsvEfi9eOYeD9IPBr4dXd/7eZupdAjwC+AEA1nsB2FlUcz8b3kCNVTQQ3rK b5wA== 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=CTXHB2kJ38uEuVt8aJ+FyBLUjdvdb7psK2aoAAYzlVM=; b=FwInDaeXgQe/Zod9XEgGDTmf7htvMJ6MXd7/FGNbvwX1JNG79H2PNnMJJNvhRUF/63 Q6p28Trj7UXmvSV8moRfJQ3JGMa1YNbwiQapme6bJBdW1a0qvJcIx+gkCBGmzCju0Pzl Q5dx/qoYRIoBozxcVXFlbS0CULfw3cjCIG3YVZrtKzp0OFpRu4hteGYzrJ2su/xFGw2N JOsfLIM5im3kRnLPA7fOQiORsW85NXaH1Wahlb6PjU7a9biXZM84aeyLgGEa/BvedWTc IX2+gdHn3NIS5IuAX4RUjFjxe6EFdy976J0I9AvrzUuJVtE0QVhtyj6KGDZ9gwMADgE2 6JIQ== X-Gm-Message-State: AOAM533Puoux1s4jIS637eCZhPXJcfVZs6cpL8VuGRCcrmxj0pvUsoEQ pzU6oxVDymMn8tyRqB82wmWuuXLaJeb9iA== X-Google-Smtp-Source: ABdhPJzMLcg0ZaDQyNLaaXhfDWjlqGxI7EO99uSw5CYJILjuFVNZKT+nwVGT8ILgd8vgF2aBQUg2WA== X-Received: by 2002:a1c:2781:: with SMTP id n123mr479982wmn.49.1606160293677; Mon, 23 Nov 2020 11:38:13 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:13 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:19 +0100 Message-Id: <20201123193739.1249300-9-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 171/191] avcodec/nellymoserenc: Cleanup generically on init failure 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/nellymoserenc.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index 9d22ac8cca..e5c9806be8 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -170,12 +170,10 @@ static av_cold int encode_init(AVCodecContext *avctx) ff_af_queue_init(avctx, &s->afq); s->avctx = avctx; if ((ret = ff_mdct_init(&s->mdct_ctx, 8, 0, 32768.0)) < 0) - goto error; + return ret; s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); - if (!s->fdsp) { - ret = AVERROR(ENOMEM); - goto error; - } + if (!s->fdsp) + return AVERROR(ENOMEM); /* Generate overlap window */ ff_init_ff_sine_windows(7); @@ -195,16 +193,11 @@ static av_cold int encode_init(AVCodecContext *avctx) if (s->avctx->trellis) { s->opt = av_malloc(NELLY_BANDS * OPT_SIZE * sizeof(float )); s->path = av_malloc(NELLY_BANDS * OPT_SIZE * sizeof(uint8_t)); - if (!s->opt || !s->path) { - ret = AVERROR(ENOMEM); - goto error; - } + if (!s->opt || !s->path) + return AVERROR(ENOMEM); } return 0; -error: - encode_end(avctx); - return ret; } #define find_best(val, table, LUT, LUT_add, LUT_size) \ @@ -431,4 +424,5 @@ AVCodec ff_nellymoser_encoder = { .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; From patchwork Mon Nov 23 19:37:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23995 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 0781A44A49B for ; Mon, 23 Nov 2020 21:38:29 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E15A968BC0C; Mon, 23 Nov 2020 21:38:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6D0A768BB97 for ; Mon, 23 Nov 2020 21:38:15 +0200 (EET) Received: by mail-wm1-f67.google.com with SMTP id 10so318587wml.2 for ; Mon, 23 Nov 2020 11:38:15 -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=jXhAXZoiqJ/8WQ9CNsUe76xZ3cFx43bws9/cBqyaf7o=; b=rwCLIWFiy9Q3L/fshldFN0dOMR9r+9a1HFa3mwA4GsnlFuYCL0iauUVWAxFb/UtVGk U9BQ3ZT6ZalxslhthQayl4uzDsSxN2B3aMahcT0uaFXUYRQKgBxV8+cE687kth0JKMkN 4xLGdlEy8h0waPjZIVQqP4N1v5LieBEIyuWbuW5jB4MlkxtSliS4dq2KEiOK0ZFmjd1u OtvMsFfjnmcOV9K3af8YyIXWo4+YRcE/WKp5cX2ISdKv5FtsnEI9EHMRNfleFvllbOxl 5J8TijHlWajhuBMk6Cb3dQvlSt0iKvdBMdrAFDOioMJJ34U/RZ12KuDFlzzeX/1vbTUM UlJQ== 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=jXhAXZoiqJ/8WQ9CNsUe76xZ3cFx43bws9/cBqyaf7o=; b=Mgqa/672K0hJvBoWEY91FlCOIjB+/feybuH7fWabJ1nYrWKKNbCjQVf6zPdHG2uGNv u+FJxQPSGN6BIm6yUIsn+5EI2D4U/sqKPyksW6PcWz5JXAn751MjxebOAt+CdcJ7VBh4 sWV/PdQd8VQk6hKzwNWVx1FYmoYtjBgsUYZ5RgU9TA6rw+vHfwTcT8jnPMPNbif432TL alR8RddJwDTUQLWCYtS9sAkazCpxkY1IDmNYaFIXMqQwZtNLpXPfok5m4H/Rsd4RPvIO HQ8atJTUaNB2044Vtd4RpbfWQmJ1iN2pnpfxxrKKTeKLV6MORu5ITI7XsB9Jlu/cTXxr WIwA== X-Gm-Message-State: AOAM531bQYtzCRwwP2KmYWZfv5nQRdUsxapa/Sd61yu4yPtpjd3cAh8z IBz2oep0LJTKigKAHl9pfgLcAMS5C1tc5g== X-Google-Smtp-Source: ABdhPJyWXNz4lx6aAChMqwqBl+PpV7xeFQ3JxsP5030w0yRt0kIFoXv69oycODQUARrV+s0V4YASnQ== X-Received: by 2002:a1c:309:: with SMTP id 9mr476123wmd.80.1606160294682; Mon, 23 Nov 2020 11:38:14 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:14 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:20 +0100 Message-Id: <20201123193739.1249300-10-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 172/191] avcodec/nellymoserenc: Make encoder init-threadsafe 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/nellymoserenc.c | 41 ++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index e5c9806be8..aea9fe286c 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -38,6 +38,7 @@ #include "libavutil/common.h" #include "libavutil/float_dsp.h" #include "libavutil/mathematics.h" +#include "libavutil/thread.h" #include "audio_frame_queue.h" #include "avcodec.h" @@ -147,10 +148,29 @@ static av_cold int encode_end(AVCodecContext *avctx) return 0; } +static av_cold void nellymoser_init_static(void) +{ + /* faster way of doing + for (int i = 0; i < POW_TABLE_SIZE; i++) + pow_table[i] = 2^(-i / 2048.0 - 3.0 + POW_TABLE_OFFSET); */ + pow_table[0] = 1; + pow_table[1024] = M_SQRT1_2; + for (int i = 1; i < 513; i++) { + double tmp = exp2(-i / 2048.0); + pow_table[i] = tmp; + pow_table[1024-i] = M_SQRT1_2 / tmp; + pow_table[1024+i] = tmp * M_SQRT1_2; + pow_table[2048-i] = 0.5 / tmp; + } + /* Generate overlap window */ + ff_init_ff_sine_windows(7); +} + static av_cold int encode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; NellyMoserEncodeContext *s = avctx->priv_data; - int i, ret; + int ret; if (avctx->channels != 1) { av_log(avctx, AV_LOG_ERROR, "Nellymoser supports only 1 channel\n"); @@ -175,21 +195,6 @@ static av_cold int encode_init(AVCodecContext *avctx) if (!s->fdsp) return AVERROR(ENOMEM); - /* Generate overlap window */ - ff_init_ff_sine_windows(7); - /* faster way of doing - for (i = 0; i < POW_TABLE_SIZE; i++) - pow_table[i] = 2^(-i / 2048.0 - 3.0 + POW_TABLE_OFFSET); */ - pow_table[0] = 1; - pow_table[1024] = M_SQRT1_2; - for (i = 1; i < 513; i++) { - double tmp = exp2(-i / 2048.0); - pow_table[i] = tmp; - pow_table[1024-i] = M_SQRT1_2 / tmp; - pow_table[1024+i] = tmp * M_SQRT1_2; - pow_table[2048-i] = 0.5 / tmp; - } - if (s->avctx->trellis) { s->opt = av_malloc(NELLY_BANDS * OPT_SIZE * sizeof(float )); s->path = av_malloc(NELLY_BANDS * OPT_SIZE * sizeof(uint8_t)); @@ -197,6 +202,8 @@ static av_cold int encode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } + ff_thread_once(&init_static_once, nellymoser_init_static); + return 0; } @@ -424,5 +431,5 @@ AVCodec ff_nellymoser_encoder = { .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Mon Nov 23 19:37:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23997 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 4F66E44A49B for ; Mon, 23 Nov 2020 21:38:35 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2AE7468BC49; Mon, 23 Nov 2020 21:38:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 903DA68BBB7 for ; Mon, 23 Nov 2020 21:38:16 +0200 (EET) Received: by mail-wr1-f52.google.com with SMTP id m6so19780916wrg.7 for ; Mon, 23 Nov 2020 11:38:16 -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=xdC0uz9Wywv9T0vz49FhMjTEa3IIZHEIq/VLKJ07Fr4=; b=iDoayL6Ow0g/4khLbofkuohcm4W7oZePdHBuhfqZ9u+5sahdOd8+iy8cwKIyxRkM1Y WFjydQXchtjQuGzA/zwqzGwN7buSbVlRJrxSKbC+K5PksHuXHx4EE1UEVxxl9Ua/1JQf Yuvyh9C2VHXbwhg8rMayuhLY0pF1l04VR2+AnpeRHNCPgYB57cNFFwzaHo4DtJFcxBIt RdaHA4heYTtWNf+qbgfyBogdApihg0JMvXGtwYbCduqrakzEesdumEwxQ238uz5805Ph RoNYOCfnpuIVEW3NsG5t5fAI8cpZFwvfL+IIkL0rkTNNb2cFzbepBPU47UguZz1yXDPt Syvg== 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=xdC0uz9Wywv9T0vz49FhMjTEa3IIZHEIq/VLKJ07Fr4=; b=WhCQHyBK7QHrjQeJOgcoZfyKS/sraaupJYFw0PlYXE96WTrLeLxWGwlFeZZoN9A1oD iNeG/EztseusW8E5HJLg/6WGKHss3dwrV7NYvKFU9XcOkzVgmtbH0RO+9OVaJZib6cTa Zes5LBi9HHt//hNfWiIQOvgIfck3JIZYVlHJDr5aWgu8AlEab/RFflHuPwrYfgrNiAYy L94IHkY5svZykxbEW3UIfKSd7ShmwsIACT0dX/ZcFTiSE8zRr7urzeDcAhD9WLwX4I3G pvrP1I4B6IvQUvJVQxrfmTlrHH94UgXf5DOwKRqMzitkzkeyYu0tIdAjsVwtTvIiKx16 cXPg== X-Gm-Message-State: AOAM532PEvxVj0hQLL7xlDi3DYMFehcCjWfFMpAfkirvx+tTFUz0DunD tAcqKDyfHQ/ERYvfJnQ64mNlouZMzcdB8g== X-Google-Smtp-Source: ABdhPJxEloNYpm2nf+7t6hrzBUiDMzUYNdu9IveU4OGo6ryM4PEodf6+lcXz2adf4uEKAIuhc2E30A== X-Received: by 2002:a5d:4ccd:: with SMTP id c13mr1402455wrt.254.1606160295543; Mon, 23 Nov 2020 11:38:15 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:15 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:21 +0100 Message-Id: <20201123193739.1249300-11-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 173/191] avcodec/aactab: Remove declaration of inexistent array 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/aactab.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h index ce6a7ba1d2..f950c13eee 100644 --- a/libavcodec/aactab.h +++ b/libavcodec/aactab.h @@ -95,7 +95,6 @@ DECLARE_ALIGNED(32, extern float, ff_aac_kbd_short_128)[128]; DECLARE_ALIGNED(32, extern float, ff_aac_kbd_long_960)[960]; DECLARE_ALIGNED(32, extern float, ff_aac_kbd_short_120)[120]; DECLARE_ALIGNED(32, extern int, ff_aac_kbd_long_1024_fixed)[1024]; -DECLARE_ALIGNED(32, extern int, ff_aac_kbd_long_512_fixed)[512]; DECLARE_ALIGNED(32, extern int, ff_aac_kbd_short_128_fixed)[128]; DECLARE_ALIGNED(32, extern const float, ff_aac_eld_window_512)[1920]; DECLARE_ALIGNED(32, extern const int, ff_aac_eld_window_512_fixed)[1920]; From patchwork Mon Nov 23 19:37:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23990 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 2474E44A49B for ; Mon, 23 Nov 2020 21:38:23 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0A4C368BBF6; Mon, 23 Nov 2020 21:38:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C325468BBAD for ; Mon, 23 Nov 2020 21:38:17 +0200 (EET) Received: by mail-wm1-f67.google.com with SMTP id s13so380185wmh.4 for ; Mon, 23 Nov 2020 11:38:17 -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=EmHmtX6DyKCYxkTz2pkB5IlmDXIZF9wbW1LtCUJamh4=; b=PjbW4nWeDZZFu+ELq91HlIIgSUN493Ipvpl5bdyKJhzVA5shDfk1XPvXGQTp1GhsbK Xvv7odPFbWpe389EbiaOc8XVqir4JwXbVJdoBzNjv3FL6IK6I4ddS0UK2mjdZew7gUAF eadwSAt8WpA6AIF1azGlprXt/vq3dkrg4IiQME0xoM0pbxFSk+NF4/9eGyQmuX6XfUjW /NIR13OW86Ke9bMdW8zP6VraJva2nlsyn2qWfpspi4rdDON8wBvftiHdLyFayMUY/ahd vnkL+n4N3fQyfNSqnPk/WWSZQ41E7EXYqTE5gFvX1d8YL8Z5erwBLY6ioXsVbkiuFc7Q +wXA== 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=EmHmtX6DyKCYxkTz2pkB5IlmDXIZF9wbW1LtCUJamh4=; b=AQ3yVy1v7Ih+19VWCJUZVq1Pmnfmz4X4f6F8RYYnF8MohJNc6iwKnFk5gh+AMBjS0w P+lRfllE/nUPYzuVfVlF9QIOMXnPfmuElJwh18Q3eYK35c7x1JiUDeu1MllOpdhdRsde GIMV0ILyRL/HvYsrJRt36mxfKa2S6jnsS6GPYFflgqoRqp8/c9x2LjylT3CVOKK6qaHQ TtdFLIqtpAnaA2IOrBwcpzUHrfKmQbXbUPyplKw4trOShQilN+A9ZO9OQb+374oGZ4Md Nk4babwi+nQU+JCkMy2YxyRKGxF9IOm/iC7goe8AY6VZeDqOsVf4MLn6E8CHy85lFu0C koJA== X-Gm-Message-State: AOAM533Wb+TQbUPZYcxE5vIk7WWuM5NAmxF1tK4vw+4IrVGpvz2w3Z7O ekLSueBbjFfIiDq09/F+8AF3EwjmnkC0zA== X-Google-Smtp-Source: ABdhPJwz3puTiTPQora/u+zXaMutZZRoUY0broMdGsfV6blQ5/qq/9RtsfJunPCeb2GOo33HtVwfYg== X-Received: by 2002:a7b:c0d7:: with SMTP id s23mr517109wmh.54.1606160296840; Mon, 23 Nov 2020 11:38:16 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:16 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:22 +0100 Message-Id: <20201123193739.1249300-12-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 174/191] avcodec/aacdec, aactab: Move kbd tables to their only user 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 floating point kbd tables for 120 and 960 samples are only used by the floating point decoder whereas the fixed point kbd tables for 128 and 1024 samples are only used by the fixed point AAC decoder. So move these tables to their only users. This ensures that there are not accidentally used somewhere else without ensuring that initializing these tables stays thread-safe (as it is now because the only place from where they are initialized is guarded by an AVOnce). Signed-off-by: Andreas Rheinhardt --- libavcodec/aac_defines.h | 2 ++ libavcodec/aacdec.c | 2 ++ libavcodec/aacdec_fixed.c | 3 +++ libavcodec/aacdec_template.c | 32 ++++++++++++++++---------------- libavcodec/aactab.c | 4 ---- libavcodec/aactab.h | 2 -- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/libavcodec/aac_defines.h b/libavcodec/aac_defines.h index 438d78a7aa..74ac011785 100644 --- a/libavcodec/aac_defines.h +++ b/libavcodec/aac_defines.h @@ -34,6 +34,7 @@ #define AAC_RENAME(x) x ## _fixed #define AAC_RENAME_32(x) x ## _fixed_32 +#define AAC_KBD_RENAME(x) aac_ ## x ## _fixed typedef int INTFLOAT; typedef unsigned UINTFLOAT; ///< Equivalent to INTFLOAT, Used as temporal cast to avoid undefined sign overflow operations. typedef int64_t INT64FLOAT; @@ -83,6 +84,7 @@ typedef int AAC_SIGNE; #define AAC_RENAME(x) x #define AAC_RENAME_32(x) x +#define AAC_KBD_RENAME(x) ff_aac_ ## x typedef float INTFLOAT; typedef float UINTFLOAT; typedef float INT64FLOAT; diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index fd4805f6eb..0174bf8d5b 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -71,6 +71,8 @@ DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(sine_120))[120]; DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(sine_960))[960]; +DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(aac_kbd_long_960))[960]; +DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(aac_kbd_short_120))[120]; static av_always_inline void reset_predict_state(PredictorState *ps) { diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index daaf765e0c..4d82b7b1aa 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -86,6 +86,9 @@ #include #include +DECLARE_ALIGNED(32, static int, AAC_KBD_RENAME(kbd_long_1024))[1024]; +DECLARE_ALIGNED(32, static int, AAC_KBD_RENAME(kbd_short_128))[128]; + static av_always_inline void reset_predict_state(PredictorState *ps) { ps->r0.mant = 0; diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index e6fe913a27..3bf271af54 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -1230,11 +1230,11 @@ static av_cold void aac_static_table_init(void) 352); // window initialization - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_long_1024), 4.0, 1024); - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_short_128), 6.0, 128); + AAC_RENAME(ff_kbd_window_init)(AAC_KBD_RENAME(kbd_long_1024), 4.0, 1024); + AAC_RENAME(ff_kbd_window_init)(AAC_KBD_RENAME(kbd_short_128), 6.0, 128); #if !USE_FIXED - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_long_960), 4.0, 960); - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_short_120), 6.0, 120); + AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_long_960), 4.0, 960); + AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120); AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_960), 960); AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_120), 120); #endif @@ -2642,10 +2642,10 @@ static void apply_tns(INTFLOAT coef_param[1024], TemporalNoiseShaping *tns, static void windowing_and_mdct_ltp(AACContext *ac, INTFLOAT *out, INTFLOAT *in, IndividualChannelStream *ics) { - const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128); - const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_KBD_RENAME(kbd_long_1024) : AAC_RENAME(ff_sine_1024); + const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_KBD_RENAME(kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_KBD_RENAME(kbd_long_1024) : AAC_RENAME(ff_sine_1024); + const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_KBD_RENAME(kbd_short_128) : AAC_RENAME(ff_sine_128); if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) { ac->fdsp->vector_fmul(in, in, lwindow_prev, 1024); @@ -2702,8 +2702,8 @@ static void update_ltp(AACContext *ac, SingleChannelElement *sce) IndividualChannelStream *ics = &sce->ics; INTFLOAT *saved = sce->saved; INTFLOAT *saved_ltp = sce->coeffs; - const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_KBD_RENAME(kbd_long_1024) : AAC_RENAME(ff_sine_1024); + const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_KBD_RENAME(kbd_short_128) : AAC_RENAME(ff_sine_128); int i; if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { @@ -2741,9 +2741,9 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce) INTFLOAT *in = sce->coeffs; INTFLOAT *out = sce->ret; INTFLOAT *saved = sce->saved; - const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128); - const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_KBD_RENAME(kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_KBD_RENAME(kbd_long_1024) : AAC_RENAME(ff_sine_1024); + const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_KBD_RENAME(kbd_short_128) : AAC_RENAME(ff_sine_128); INTFLOAT *buf = ac->buf_mdct; INTFLOAT *temp = ac->temp; int i; @@ -2810,9 +2810,9 @@ static void imdct_and_windowing_960(AACContext *ac, SingleChannelElement *sce) INTFLOAT *in = sce->coeffs; INTFLOAT *out = sce->ret; INTFLOAT *saved = sce->saved; - const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_120) : AAC_RENAME(sine_120); - const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_long_960) : AAC_RENAME(sine_960); - const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_short_120) : AAC_RENAME(sine_120); + const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(aac_kbd_short_120) : AAC_RENAME(sine_120); + const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(aac_kbd_long_960) : AAC_RENAME(sine_960); + const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(aac_kbd_short_120) : AAC_RENAME(sine_120); INTFLOAT *buf = ac->buf_mdct; INTFLOAT *temp = ac->temp; int i; diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c index 79dd13d9cb..e886642e66 100644 --- a/libavcodec/aactab.c +++ b/libavcodec/aactab.c @@ -39,10 +39,6 @@ float ff_aac_pow34sf_tab[428]; DECLARE_ALIGNED(32, float, ff_aac_kbd_long_1024)[1024]; DECLARE_ALIGNED(32, float, ff_aac_kbd_short_128)[128]; -DECLARE_ALIGNED(32, float, ff_aac_kbd_long_960)[960]; -DECLARE_ALIGNED(32, float, ff_aac_kbd_short_120)[120]; -DECLARE_ALIGNED(32, int, ff_aac_kbd_long_1024_fixed)[1024]; -DECLARE_ALIGNED(32, int, ff_aac_kbd_short_128_fixed)[128]; const uint8_t ff_aac_num_swb_1024[] = { 41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40, 40 diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h index f950c13eee..04180b96fd 100644 --- a/libavcodec/aactab.h +++ b/libavcodec/aactab.h @@ -94,8 +94,6 @@ DECLARE_ALIGNED(32, extern float, ff_aac_kbd_long_1024)[1024]; DECLARE_ALIGNED(32, extern float, ff_aac_kbd_short_128)[128]; DECLARE_ALIGNED(32, extern float, ff_aac_kbd_long_960)[960]; DECLARE_ALIGNED(32, extern float, ff_aac_kbd_short_120)[120]; -DECLARE_ALIGNED(32, extern int, ff_aac_kbd_long_1024_fixed)[1024]; -DECLARE_ALIGNED(32, extern int, ff_aac_kbd_short_128_fixed)[128]; DECLARE_ALIGNED(32, extern const float, ff_aac_eld_window_512)[1920]; DECLARE_ALIGNED(32, extern const int, ff_aac_eld_window_512_fixed)[1920]; DECLARE_ALIGNED(32, extern const float, ff_aac_eld_window_480)[1800]; From patchwork Mon Nov 23 19:37:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23992 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 CA2C544A49B for ; Mon, 23 Nov 2020 21:38:25 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A84D968BC05; Mon, 23 Nov 2020 21:38:25 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DD4A968BBBE for ; Mon, 23 Nov 2020 21:38:18 +0200 (EET) Received: by mail-wm1-f51.google.com with SMTP id p22so314781wmg.3 for ; Mon, 23 Nov 2020 11:38: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=VusJULwoTD1Grdp2A8QsBWaSvmHqajlVanvv8FCCLFM=; b=ZLw3EqE6HUBer/0L5Oy5iXFwXT6Su5QJfTu0g91qwJkYX3d9XB6K7MX0dQKvvt2PZ/ ecGZP2RNCVrz8tyW5yCIswvNXjtXGhyr/LI+Mz+l8RONssvdX2tuiWysVBfr1zoEsE17 l7o8Io+WVgEVT+pG5N8r4L6pSmxpEuOop9UjMbvZfCoQibt72UsgdnuhfT/rr9n9yvAM R3gtM6GIGD8TEY3nyAn4sNmL/3tqv1WbbFuiUBNvw+hdBesHpRU4x5c+gLM+6pg6/Jhr NvXCOn9jDuGzJ95qieZ79+P24XvWmHLS+seT2mByzafgjkaUSMYr2qIrSuZP+jn0d6z3 GU3w== 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=VusJULwoTD1Grdp2A8QsBWaSvmHqajlVanvv8FCCLFM=; b=srHtCUSxTbu5CYjS/HjHnd5x3WPgT48FMVuxZMZlw8SbSlpdxFjZ1eCKSPIT0P8vhx ArpCfzxxzrYP22vPGff0eolLafle4wGeB7IMrrmKA9+HLWT0LFAibejvdrM1u9n75lnb z6NrOTgnfHSTdoD2k+slLWsIDvhttPl4ztPyJyHojK9fBzct0dnrEJZycK5jPneP/Ix8 +Ki0tTYbxtTwIotTALXQv8TfSM3ledeDa+CI3xT6nInR7QfvSbz/c8abqCGPkYRGub2I +nK/lgi6q+8OM3MLB98HZWep6TMPivMaV38I8Ee/GTmwL+d+JGLlqNzRlBCq8UHueETQ HA4Q== X-Gm-Message-State: AOAM533DC1kC8cC58mFA5ewYGKuZC+kaddihNoRIm30B33E/+cZo5mq1 a6i2y+a6wgzG9U9R+Me/RIl7Ib1fNWQxWA== X-Google-Smtp-Source: ABdhPJx9YNfD8YRw+kEH6ucdkiiutaEKmb7Rj/eHYa09vXLiri4DOlWMGLIZznJb5Ua4GS33KZsEng== X-Received: by 2002:a7b:c242:: with SMTP id b2mr482092wmj.162.1606160297937; Mon, 23 Nov 2020 11:38:17 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:17 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:23 +0100 Message-Id: <20201123193739.1249300-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 175/191] avcodec/aac: Share common init code of float decoder and encoder 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/aacdec_template.c | 10 ++++++---- libavcodec/aacenc.c | 6 +----- libavcodec/aactab.c | 14 ++++++++++++++ libavcodec/aactab.h | 3 +++ 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 3bf271af54..fbe3074071 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -1230,17 +1230,19 @@ static av_cold void aac_static_table_init(void) 352); // window initialization - AAC_RENAME(ff_kbd_window_init)(AAC_KBD_RENAME(kbd_long_1024), 4.0, 1024); - AAC_RENAME(ff_kbd_window_init)(AAC_KBD_RENAME(kbd_short_128), 6.0, 128); #if !USE_FIXED AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_long_960), 4.0, 960); AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120); AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_960), 960); AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_120), 120); -#endif + ff_aac_float_common_init(); +#else + AAC_RENAME(ff_kbd_window_init)(AAC_KBD_RENAME(kbd_long_1024), 4.0, 1024); + AAC_RENAME(ff_kbd_window_init)(AAC_KBD_RENAME(kbd_short_128), 6.0, 128); AAC_RENAME(ff_init_ff_sine_windows)(10); - AAC_RENAME(ff_init_ff_sine_windows)( 9); AAC_RENAME(ff_init_ff_sine_windows)( 7); +#endif + AAC_RENAME(ff_init_ff_sine_windows)( 9); AAC_RENAME(ff_cbrt_tableinit)(); } diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 274e5ca294..070a2e706a 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -36,7 +36,6 @@ #include "put_bits.h" #include "internal.h" #include "mpeg4audio.h" -#include "kbdwin.h" #include "sinewin.h" #include "profiles.h" @@ -922,10 +921,7 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s) return AVERROR(ENOMEM); // window init - ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); - ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128); - ff_init_ff_sine_windows(10); - ff_init_ff_sine_windows(7); + ff_aac_float_common_init(); if ((ret = ff_mdct_init(&s->mdct1024, 11, 0, 32768.0)) < 0) return ret; diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c index e886642e66..b9d1336d97 100644 --- a/libavcodec/aactab.c +++ b/libavcodec/aactab.c @@ -27,6 +27,7 @@ * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) */ +#include "config.h" #include "libavutil/mem.h" #include "libavutil/thread.h" #include "aac.h" @@ -37,9 +38,22 @@ float ff_aac_pow2sf_tab[428]; float ff_aac_pow34sf_tab[428]; +#if CONFIG_AAC_ENCODER || CONFIG_AAC_DECODER +#include "kbdwin.h" +#include "sinewin.h" + DECLARE_ALIGNED(32, float, ff_aac_kbd_long_1024)[1024]; DECLARE_ALIGNED(32, float, ff_aac_kbd_short_128)[128]; +av_cold void ff_aac_float_common_init(void) +{ + ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); + ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128); + ff_init_ff_sine_windows(10); + ff_init_ff_sine_windows(7); +} +#endif + const uint8_t ff_aac_num_swb_1024[] = { 41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40, 40 }; diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h index 04180b96fd..02f79a16c0 100644 --- a/libavcodec/aactab.h +++ b/libavcodec/aactab.h @@ -100,6 +100,9 @@ DECLARE_ALIGNED(32, extern const float, ff_aac_eld_window_480)[1800]; DECLARE_ALIGNED(32, extern const int, ff_aac_eld_window_480_fixed)[1800]; // @} +/* Initializes data shared between float decoder and encoder. */ +void ff_aac_float_common_init(void); + /* @name number of scalefactor window bands for long and short transform windows respectively * @{ */ From patchwork Mon Nov 23 19:37:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23994 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 8DCB344A49B for ; Mon, 23 Nov 2020 21:38:27 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6D3E768BBDD; Mon, 23 Nov 2020 21:38:27 +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 CE4BC68BBCC for ; Mon, 23 Nov 2020 21:38:19 +0200 (EET) Received: by mail-wr1-f66.google.com with SMTP id g14so4598509wrm.13 for ; Mon, 23 Nov 2020 11:38:19 -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=Na8JO5jEg538zOIvatD8OWRnguI0JUZUV41TSIQPysM=; b=FoAddYS6jj7T8X9J0JSBJqR5vJbuvQCSvzAlsSy13wp7xoMTFGARVJeCnmfqrEtZld X0qX37TSQ45YF4FBJdfxZnMm6VNrNU/LRamQIgLHjAfGVD+DpW7Dmn3xS3r07qW161zd 5J1ahpb2pYe7A1kzHlsTQ/y6UipHjNnzGcsVN6/MYkHDbX+Q5nI+WdVpBOKUGKvTJd8+ abxSjPTVmz2jQJvsMTLX4pe1Ce8zXlPjYR2z14a/uJD5Be6eHRyrVqVNIGFp03jReAue 7q8PafmRr0IamQNrQwb80xj4hkiYO8vS+mKdio2yKa96GfIw2V0Wg3NRiIyWP2DXmJul ZoQA== 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=Na8JO5jEg538zOIvatD8OWRnguI0JUZUV41TSIQPysM=; b=IHfepGohemeh9+7TKO2UOLIbjVo2d/mf6wQJq2XfvgKXhsAU4OeYYllNU+PNnJxj0Y KdpbpddQ87M26zjER84dfuxEYfrivCPYe1ll8rhdED5KzSjV+PLdgKI5LDuRU1dT8zGz A3y/VG/rTPBPfWRlqfVOLHodoIafxRxPj1pRmeB3L5Kr147dqlD1rttGQiL+tnx8OGQF P7KRqTe7zugiBkvM83WSfm7AJdp3J/Q5i3lepXWTKlIspQ0X9T9D/iWBIKTe8bCiEtjL /Q9KRRFm1G/G+aj1VasZwju587iBF1dAgboySWJRUCBjBTW7zRdj4hU3BIU1ucUerk6B difQ== X-Gm-Message-State: AOAM532ULjCDPZWDAmqNLnR1kZwJEhw2vv0+vag15DNLOmPzKpah5+ii xQJr3Zlo2G285bEiWYXiDvy4i2xVId9zCg== X-Google-Smtp-Source: ABdhPJwkHLWgPIaWBeVDjIL0GRAvHNmFL6Vob/2WIyg0L7/K/tZY/ZjjAzgYa9zbaWyLchxctz9MGA== X-Received: by 2002:adf:a3ca:: with SMTP id m10mr1321049wrb.228.1606160299048; Mon, 23 Nov 2020 11:38:19 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:18 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:24 +0100 Message-Id: <20201123193739.1249300-14-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 176/191] avcodec/aactab: Make AAC encoder and decoders actually init-threadsafe 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" Commit 1a29804558c13ef512d9ef73a9b0d782af4fa5f2 guarded several initializations of static data in the AAC decoders with an AVOnce and set the FF_CODEC_CAP_INIT_THREADSAFE flag, believing the former to be sufficient for the latter. It wasn't, because several of these static tables are shared with other components, so that there might be data races if they are initialized from multiple threads. This affected initializing the ff_sine_* tables as well as initializing the ff_aac_pow*sf_tab tables (shared between both decoders and encoder) as well as ff_aac_kbd_* tables (shared between encoder and floating point decoder). Commit 3d62e7a30fa552be52d12b31e3e0f79153aff891 set the FF_CODEC_CAP_INIT_THREADSAFE flag for the AAC encoder. More explicitly, this commit used the same AVOnce to guard initializing ff_aac_pow*sf_tab in the encoder and to guard initializing the static data of each decoder; the ensuing catastrophe was "fixed" in commit ec0719264cb9a9d5cbaf225da48929aea24997a3 by using a single AVOnce for each codec again. But the codec cap has not been removed and therefore the encoder claimed to be init-threadsafe, but wasn't, because of the same tables as above. The ff_sine_* tables as well as ff_aac_pow*sf_tab tables have already been fixed; this commit deals with the ff_aac_kbd_* tables, making the encoder as well as the floating-point decoder init-threadsafe (the fixed-point decoder is it already). Signed-off-by: Andreas Rheinhardt --- libavcodec/aactab.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c index b9d1336d97..abe5fd7567 100644 --- a/libavcodec/aactab.c +++ b/libavcodec/aactab.c @@ -45,13 +45,19 @@ float ff_aac_pow34sf_tab[428]; DECLARE_ALIGNED(32, float, ff_aac_kbd_long_1024)[1024]; DECLARE_ALIGNED(32, float, ff_aac_kbd_short_128)[128]; -av_cold void ff_aac_float_common_init(void) +static av_cold void aac_float_common_init(void) { ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128); ff_init_ff_sine_windows(10); ff_init_ff_sine_windows(7); } + +av_cold void ff_aac_float_common_init(void) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + ff_thread_once(&init_static_once, aac_float_common_init); +} #endif const uint8_t ff_aac_num_swb_1024[] = { From patchwork Mon Nov 23 19:37: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: 23996 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 DD5B044A49B for ; Mon, 23 Nov 2020 21:38:29 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CA92D68BC29; Mon, 23 Nov 2020 21:38:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BF82568BB97 for ; Mon, 23 Nov 2020 21:38:20 +0200 (EET) Received: by mail-wr1-f52.google.com with SMTP id t4so6850579wrr.12 for ; Mon, 23 Nov 2020 11:38:20 -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=5Rhr8j/GabMJLspJhMEZ2QghxjHSR3tBcrLZ8Y+olY4=; b=AZ4lecHKFTV6PrhOc1uPmwVsc7qG60MhB4UUSbpyGDH6Wqmbc9us+3HfPyD/QkOwOz PVHe+lAloraL9I9ScqtFgubPReTUW35R+CDvxCtVWaUH3sS+KKf51kZBWvikOWvVh6Vu 3WAl1qrh/y1aR9HG4wPctZK9x3spMb2LYyMZFyoJA9pb3ShLfma+2dYACx68VI7jBUeu r9vKu0AfULfI1UspVtz9lKTqhJJ+6Qa17zPrN8ZG6yZhDCvK9RmEw/tXO8et3HK3cDJ5 q0475iaYSkE4GC/VxuqpixCcOcE5fJShNfLUYIir64tFJLBT/NNP4Msao5TEshPrU7m9 PvXA== 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=5Rhr8j/GabMJLspJhMEZ2QghxjHSR3tBcrLZ8Y+olY4=; b=pGDFuzNyRggEUt/r0CaCC4TqWCyMQBlFAN0pjIMC36/9zTt8GFMZOdVQVOv/zr9mtk OwSuqrFD1o/I1kRsOXNEQv6PAOMsFj+n3Gyjym4n3lf0mr/9oTFrtHB5KTQQGFhhDKsF H34cAZmlRuHVBTLPFstCJ9P28JnZI34ySCAogPX4Y0V2lKTem7Ln8c84squgkR6KheQq PB+pui3OiixkoocaYzEauk+V6Nlye6bbNCw9GCLm4JFzB+jA0Z5psrGeQgfzjHDyspX8 dIdOqCfaHDHN2vUS08/Nd53YnouyKB1OuxuDJ802vFrkYCtUPK2Gq0vILY4X/O6dFygp bagg== X-Gm-Message-State: AOAM532ArXdxKtKIeeWIDzTRwjeb7TC+f16iXh6FcDl9sasED5OhM1KO tPn0dPvXz325ESHj37xqrucJHrwV1BrsRw== X-Google-Smtp-Source: ABdhPJzkQq7Pp+zkV4xntlWcDtniPvQ+ZpbjpF1gvpitH6ddWj1dmiCMTiNygkEyevmLQX8Xhd66Jw== X-Received: by 2002:adf:eacb:: with SMTP id o11mr1338854wrn.208.1606160300084; Mon, 23 Nov 2020 11:38:20 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:19 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:25 +0100 Message-Id: <20201123193739.1249300-15-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 177/191] avcodec/sinewin: Fix wrong number of elements of array declaration 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" There are actually only 14 elements in each ff_sine_windows array. Signed-off-by: Andreas Rheinhardt --- libavcodec/sinewin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/sinewin.h b/libavcodec/sinewin.h index 7b64096a71..1348740905 100644 --- a/libavcodec/sinewin.h +++ b/libavcodec/sinewin.h @@ -60,6 +60,6 @@ extern SINETABLE(2048); extern SINETABLE(4096); extern SINETABLE(8192); -extern SINETABLE_CONST INTFLOAT * const AAC_RENAME(ff_sine_windows)[16]; +extern SINETABLE_CONST INTFLOAT * const AAC_RENAME(ff_sine_windows)[]; #endif /* AVCODEC_SINEWIN_H */ From patchwork Mon Nov 23 19:37:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23998 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 8EAAE44A49B for ; Mon, 23 Nov 2020 21:38:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 73CE868BC5C; Mon, 23 Nov 2020 21:38:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC08268BBF2 for ; Mon, 23 Nov 2020 21:38:21 +0200 (EET) Received: by mail-wr1-f68.google.com with SMTP id m6so19781341wrg.7 for ; Mon, 23 Nov 2020 11:38: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:reply-to :mime-version:content-transfer-encoding; bh=nIm7YX5KC93u7WaitW+K6I/HutbIhm4Id9kyks3QfnU=; b=LDyJSpQBps/jCxejX4v3khfw4TzByUlfrGGbYllDPuGABYhaANBAMOWRUqqDL3nWGT k27P9MGN1HH/q7jBhJZRhk0QjkG/6CSplPvf7q/Ovt8YJxoEsW3FZz+c7vsUA+PAYNP5 /7srxDzuFKY3vxPQjBfJsMoXW5OoWYVNrl2clvl8z5khmjEKzcebLJgfCbyatb27UHT6 z9TLDOS4U9KWSOveXIDhYqVjLXJ4Ybdx0q1wu+Mgl9GZVI7rP6yijYGTbIZSWCaGkG60 B8Xukh/Wwv+h0A4JH7qx3EXNsHmYwuL6uEP09TB4bwo4FZw9sLUz5pxsFrwMzBLmHOUf FTmg== 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=nIm7YX5KC93u7WaitW+K6I/HutbIhm4Id9kyks3QfnU=; b=cgYAfDEosiOtzO+9bExEF7c1xHzRqZ3e7T1eJoZL7L6lK4168/T0JTTqaE+292WNkX inYt6MBpvbMiKfzfkReAW93QfXjCazHwqXuuJUZSDpqJUZpjLjRbLNNJePKjTe5yQRMk NR6Hk32TFbStCDA69XU6n/moN0ekEcnXDnZo4leDHT0MR5wdrQd+/wtKYYPhPCYiijnw KAPRL/t0DnSXhZB5VR12chWleHSfKYNx2z8jfWralayzxFHhSNsfzIv6Wp4PP6bncxwE wyzla8diUYthI6Z8jtym3Y0ptIHjx1pQWdKHEoUlNElNyRTFS8clUPerk9fV56HHfupz TnDQ== X-Gm-Message-State: AOAM532hDvCN8pDDYPGJRElqxd/AWk4s32zTwRqK80mWCBz1qhMXGlT0 h/6BFgLElAog6l7SwPsql/avTDyRqVxA1Q== X-Google-Smtp-Source: ABdhPJz15xVD+9xIg4Lzo2tCOv0ojNFP2fzfMaRXppkLs+WNJc92Pxao0OCBgGST/eJOwzx5Y3RZ1Q== X-Received: by 2002:adf:e387:: with SMTP id e7mr1258251wrm.177.1606160301062; Mon, 23 Nov 2020 11:38:21 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:20 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:26 +0100 Message-Id: <20201123193739.1249300-16-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 178/191] avcodec/mpeg12: Make initializing VLCs thread-safe 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" This automatically makes the eamad, eatqi and mdec init-threadsafe. Signed-off-by: Andreas Rheinhardt --- libavcodec/eamad.c | 1 + libavcodec/eatqi.c | 1 + libavcodec/mdec.c | 1 + libavcodec/mpeg12.c | 15 ++++++++------- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index 7f28abbafe..9dccddd6d3 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -349,4 +349,5 @@ AVCodec ff_eamad_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index 96536b1a08..456bd3c563 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -189,4 +189,5 @@ AVCodec ff_eatqi_decoder = { .close = tqi_decode_end, .decode = tqi_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index b16cbb6a79..d0bb1162b6 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -258,4 +258,5 @@ AVCodec ff_mdec_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index e4f007aec5..e5c611414b 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -30,6 +30,7 @@ #include "libavutil/attributes.h" #include "libavutil/avassert.h" #include "libavutil/timecode.h" +#include "libavutil/thread.h" #include "internal.h" #include "avcodec.h" @@ -134,13 +135,8 @@ VLC ff_mb_ptype_vlc; VLC ff_mb_btype_vlc; VLC ff_mb_pat_vlc; -av_cold void ff_mpeg12_init_vlcs(void) +static av_cold void mpeg12_init_vlcs(void) { - static int done = 0; - - if (!done) { - done = 1; - INIT_VLC_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_lum_bits, 1, 1, ff_mpeg12_vlc_dc_lum_code, 2, 2, 512); @@ -168,7 +164,12 @@ av_cold void ff_mpeg12_init_vlcs(void) INIT_2D_VLC_RL(ff_rl_mpeg1, 680, 0); INIT_2D_VLC_RL(ff_rl_mpeg2, 674, 0); - } +} + +av_cold void ff_mpeg12_init_vlcs(void) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + ff_thread_once(&init_static_once, mpeg12_init_vlcs); } /** From patchwork Mon Nov 23 19:37:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23999 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 7E86B44A49B for ; Mon, 23 Nov 2020 21:38:37 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6B70A68BC5E; Mon, 23 Nov 2020 21:38:37 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ABB3F68BBF1 for ; Mon, 23 Nov 2020 21:38:22 +0200 (EET) Received: by mail-wr1-f68.google.com with SMTP id g14so4598761wrm.13 for ; Mon, 23 Nov 2020 11:38:22 -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=czybI2lzfRP1cf+xh0LwfQAXVuWPEhxU43MC0DYYPQs=; b=D0yH7BGgljKoq80mJzG4kRXqKY6yXNKyHB6jqAK+lxCaQWbtnE2AQTBVCF9GJWhPq2 PDWpSD+kh4NV6cxCrKHiqDtbCmNqeGmJdv6RP61ThgQBprf1UEu58gu4HGvuNXGFi3V5 wWVKmY5pJFfJuqnofdqH3OUDKeIKT5NPAtpPgjVOCK4k2aubc4uXomgKTLHOlFXVWEzr 6lP5jSCetRTi13cIePuV4ZSmOPg8tDYrY3WCKl2tTwA2m519Yzj/z1iwldgMTHy7uszL DzxWu9X4NNIksHIrrrZioL15/GupC0XtI8Hwv7zrHvoZvPMEdsLpDOhmqEC1/Jowx8FI DpXA== 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=czybI2lzfRP1cf+xh0LwfQAXVuWPEhxU43MC0DYYPQs=; b=DwRkFwr7gpmEUCbZFy9H0osQl1GP2t67G0cB03zmM3TuMhhpAgZ6ZsTM/DV0ByK82c zPovOHZ7Vh1C7DB0f135vvMfZMz/EI24aKZjYz9Do21bgwq69ju3pA9qDd+EvmK3lGqj Zf7OPAZ5s4d0gczO3HvnlapZC8Kl9GyGcR7zykR9e79gDf2Ca+pHo09yyLTUktR5rSTU EiaS9NNNEsOvYPneYNy1JBaiAcl1zeDrjijdrbPyUmjNcPwUbitefnl+pU69aTinqq8S dp+zyryLjv0BVT8b9MhCjIh8nsUqhEt/owhkugt2nsPGdt3xwVXOJcYa4AaCKL5HRSwX TiWw== X-Gm-Message-State: AOAM531xdd9cKwg5Gzfo3UbnkvCELY+wQSUeyiOMVRRLc9Nzdvk87PPY maWxyB9I5TDFm5TjE348eCvV0ciTqTH2EQ== X-Google-Smtp-Source: ABdhPJxqpCWQRaOpeho7nOpJgxGfcyvx/dcQMTrvCOxxtRI6VsFCxT89px7GHzNdZdagoR9P+SdREg== X-Received: by 2002:a5d:56cb:: with SMTP id m11mr1327573wrw.346.1606160301953; Mon, 23 Nov 2020 11:38:21 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:21 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:27 +0100 Message-Id: <20201123193739.1249300-17-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 179/191] avcodec/mpeg12: Reindentation 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/mpeg12.c | 54 ++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index e5c611414b..e9eff0c48e 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -137,33 +137,33 @@ VLC ff_mb_pat_vlc; static av_cold void mpeg12_init_vlcs(void) { - INIT_VLC_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12, - ff_mpeg12_vlc_dc_lum_bits, 1, 1, - ff_mpeg12_vlc_dc_lum_code, 2, 2, 512); - INIT_VLC_STATIC(&ff_dc_chroma_vlc, DC_VLC_BITS, 12, - ff_mpeg12_vlc_dc_chroma_bits, 1, 1, - ff_mpeg12_vlc_dc_chroma_code, 2, 2, 514); - INIT_VLC_STATIC(&ff_mv_vlc, MV_VLC_BITS, 17, - &ff_mpeg12_mbMotionVectorTable[0][1], 2, 1, - &ff_mpeg12_mbMotionVectorTable[0][0], 2, 1, 266); - INIT_VLC_STATIC(&ff_mbincr_vlc, MBINCR_VLC_BITS, 36, - &ff_mpeg12_mbAddrIncrTable[0][1], 2, 1, - &ff_mpeg12_mbAddrIncrTable[0][0], 2, 1, 538); - INIT_VLC_STATIC(&ff_mb_pat_vlc, MB_PAT_VLC_BITS, 64, - &ff_mpeg12_mbPatTable[0][1], 2, 1, - &ff_mpeg12_mbPatTable[0][0], 2, 1, 512); - - INIT_VLC_STATIC(&ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7, - &table_mb_ptype[0][1], 2, 1, - &table_mb_ptype[0][0], 2, 1, 64); - INIT_VLC_STATIC(&ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, - &table_mb_btype[0][1], 2, 1, - &table_mb_btype[0][0], 2, 1, 64); - ff_rl_init(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]); - ff_rl_init(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]); - - INIT_2D_VLC_RL(ff_rl_mpeg1, 680, 0); - INIT_2D_VLC_RL(ff_rl_mpeg2, 674, 0); + INIT_VLC_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12, + ff_mpeg12_vlc_dc_lum_bits, 1, 1, + ff_mpeg12_vlc_dc_lum_code, 2, 2, 512); + INIT_VLC_STATIC(&ff_dc_chroma_vlc, DC_VLC_BITS, 12, + ff_mpeg12_vlc_dc_chroma_bits, 1, 1, + ff_mpeg12_vlc_dc_chroma_code, 2, 2, 514); + INIT_VLC_STATIC(&ff_mv_vlc, MV_VLC_BITS, 17, + &ff_mpeg12_mbMotionVectorTable[0][1], 2, 1, + &ff_mpeg12_mbMotionVectorTable[0][0], 2, 1, 266); + INIT_VLC_STATIC(&ff_mbincr_vlc, MBINCR_VLC_BITS, 36, + &ff_mpeg12_mbAddrIncrTable[0][1], 2, 1, + &ff_mpeg12_mbAddrIncrTable[0][0], 2, 1, 538); + INIT_VLC_STATIC(&ff_mb_pat_vlc, MB_PAT_VLC_BITS, 64, + &ff_mpeg12_mbPatTable[0][1], 2, 1, + &ff_mpeg12_mbPatTable[0][0], 2, 1, 512); + + INIT_VLC_STATIC(&ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7, + &table_mb_ptype[0][1], 2, 1, + &table_mb_ptype[0][0], 2, 1, 64); + INIT_VLC_STATIC(&ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, + &table_mb_btype[0][1], 2, 1, + &table_mb_btype[0][0], 2, 1, 64); + ff_rl_init(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]); + ff_rl_init(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]); + + INIT_2D_VLC_RL(ff_rl_mpeg1, 680, 0); + INIT_2D_VLC_RL(ff_rl_mpeg2, 674, 0); } av_cold void ff_mpeg12_init_vlcs(void) From patchwork Mon Nov 23 19:37:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24002 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 0159444B12D for ; Mon, 23 Nov 2020 21:40:42 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8985168BBDE; Mon, 23 Nov 2020 21:38:38 +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 9651768BBF8 for ; Mon, 23 Nov 2020 21:38:23 +0200 (EET) Received: by mail-wm1-f66.google.com with SMTP id w24so407126wmi.0 for ; Mon, 23 Nov 2020 11:38:23 -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=LiKWT/ZtfySG1PZbxLOwkfB4ratljq5CN4ZFCMM813A=; b=r1rPkDQ6rA4uInkUpO9UbbpKDuixZGNVr7gbVOqVj6aFgRqGA8eXqUV2XrEiIPLJfm V2gHI3+gQre9pQ1+hTOhY/TcebECC3xMtBpzrmfFMuV5ml451MdXVijy0VHCAaNI3UDc eVFJxtrsB0Rv52Q0oIBvlKGkWaR1u374NbY3ocHaC+dEaaU3uBQQCf9horoah/Am3/tJ jytWnjfxPg50gtZZ+Cwu1vhzmArxCTj9l1hypf4xFOgKfnkK9QIaZTHJ2TtCzVDrXSav mDjtfxG6o89q/S+Esg5MU/0Fa21Or9H8lAk8DJphwxuBPTn2mb4gBRChX/sfFqn0nlRM 4hTQ== 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=LiKWT/ZtfySG1PZbxLOwkfB4ratljq5CN4ZFCMM813A=; b=sN8l3+YkaDzCOsjnc+av0RJ+hGbs8tCro4SkBa21y9lfhF1Q8/ZcuvoEGLTXXro3kD eN2by3g0jQm2VyEgcpJgkmK9Tjn96HqSvjILnWZRtiDjDZVuIDcikyd5oi8QtLsrxjde I714zqAVZ8ZeOAj5eF87lb2YxOyUVwBrAq9OMTN0Do8iK79apkl9359KcSJUjxymNL4y kurHZD/cd7im2iuKJyFGgu4ZoYT58U+XA2diHCgUQpwu8aOnlQQxnunMjLQxaUU1DSh1 dj1cgA/wiWCudA6Tsj5tiP0m3cxlO8CHFFQjE6Ppq4qSTy6kC7TcV6wEf7ETHUGlEZjt TaGQ== X-Gm-Message-State: AOAM530hnsUNp812RNTCuJp3u5oKT5L8LfN6cQj3zsbKZE/m5sU+uJHX xL5Xt0PCPKx86T1XLNq+kFSXt+F0Sbt32g== X-Google-Smtp-Source: ABdhPJwamiqsNL1XsJhVvygAnmP392JeEbaDaTieYdg833MBdj0vndCb9uVffksI4QgbI2b6VvYv5g== X-Received: by 2002:a7b:cc13:: with SMTP id f19mr494458wmh.44.1606160302861; Mon, 23 Nov 2020 11:38:22 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:22 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:28 +0100 Message-Id: <20201123193739.1249300-18-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 180/191] avcodec/h261enc: Remove unused function parameter 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/h261enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index 909bc23bb4..af836e4b30 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -322,8 +322,7 @@ void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64], } } -static av_cold void init_uni_h261_rl_tab(RLTable *rl, uint32_t *bits_tab, - uint8_t *len_tab) +static av_cold void init_uni_h261_rl_tab(RLTable *rl, uint8_t *len_tab) { int slevel, run, last; @@ -372,7 +371,7 @@ av_cold void ff_h261_encode_init(MpegEncContext *s) s->c_dc_scale_table = ff_mpeg1_dc_scale_table; s->ac_esc_length = 6+6+8; - init_uni_h261_rl_tab(&ff_h261_rl_tcoeff, NULL, uni_h261_rl_len); + init_uni_h261_rl_tab(&ff_h261_rl_tcoeff, uni_h261_rl_len); s->intra_ac_vlc_length = s->inter_ac_vlc_length = uni_h261_rl_len; s->intra_ac_vlc_last_length = s->inter_ac_vlc_last_length = uni_h261_rl_len + 128*64; From patchwork Mon Nov 23 19:37:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24000 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 E0AC144A49B for ; Mon, 23 Nov 2020 21:38:39 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C771B68BBCB; Mon, 23 Nov 2020 21:38:39 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D7D8A68BBD5 for ; Mon, 23 Nov 2020 21:38:24 +0200 (EET) Received: by mail-wr1-f65.google.com with SMTP id l1so19773052wrb.9 for ; Mon, 23 Nov 2020 11:38:24 -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=B9q7pE7FlbwcpcPXUinr4r1GvYLRYy5JAwz2X73zCG4=; b=SOQSFYJUbVLtPWxXREwOcYRypW01Meo5i9N5CEdHL7cTzr/0kCjrwB7uucWdGCapCa PQFHsV7TIiOhbgl1hklyu0njoWWXV3iLMlBURJxkSGFSnDMnioHPJsTmSKYlP2eXhBtm 4v5ta/tYTk21qioh5c6F8X3EHobZgAarIwP03ZdUQP1m1eGS260rIHtarwipdzsK3sP8 mBhiFMxyN6YZ9/IlKvhetc97ER6yhtP73nM5By5QbwNyD0R+BCeB5Hh1MIbAWfArG4Hu tNx8J1aSgs/JY+7+UtVw6qvmF55LZ7wLmMTXBqSOs8PsNWq+FXzDURaEjbr2hD47fSAA 300A== 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=B9q7pE7FlbwcpcPXUinr4r1GvYLRYy5JAwz2X73zCG4=; b=lcCJjes2iPfF0UQLe2albqt4l1Mqi/b9/vUBftPG0vvMKFMIh8AYwTRjWfIv2W9Yfu QTkSl7OWOpYs2bvMlc2Zrn5KCt3azLOSu4zbBdjvzwBbTm10GozjEe+wusayYPytYhyd dTfTEuSI5HirBUaXHL+1GqIZRhdKrhFddr/yJnTNl7nd7muy3CK5C9I0Jx1JsWykbpdI G1lpASjoVIwQamRK64bkHTs0zBwHTqgUWJw7qyQQakdUoR0cIoBhJsudBMdeMWMJOmb0 QlI6bEheCRN0Abt+L/7Vi50LYg3QrGRrcl1jmsbKLQD0U1wMpys57JSsPOS/9WBS806Y 1Aqg== X-Gm-Message-State: AOAM530kbBaDjDfm5/xaytgiTGLgq9v1BOxSLpP7pFuS3Uz/r4neUK0d DwXF16caAUdv8T5utUz/oNvOK7fXh12EkA== X-Google-Smtp-Source: ABdhPJybU7SrvrjXuuV0NXTy9hQHoOEInMlMEqoF5n9qayv1KzdV45EDBboF91M1RFxxdvV/GmVSlA== X-Received: by 2002:a5d:45d0:: with SMTP id b16mr671376wrs.350.1606160303896; Mon, 23 Nov 2020 11:38:23 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:23 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:29 +0100 Message-Id: <20201123193739.1249300-19-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 181/191] avcodec/h261: Make ff_h261_common_init() thread-safe 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/h261.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libavcodec/h261.c b/libavcodec/h261.c index 47bad4e57f..9c848eb7e8 100644 --- a/libavcodec/h261.c +++ b/libavcodec/h261.c @@ -25,6 +25,8 @@ * H.261 codec */ +#include "libavutil/thread.h" + #include "avcodec.h" #include "h261.h" @@ -80,13 +82,13 @@ void ff_h261_loop_filter(MpegEncContext *s) h261_loop_filter(dest_cr, uvlinesize); } -av_cold void ff_h261_common_init(void) +static av_cold void h261_common_init(void) { - static int done = 0; - - if (done) - return; - ff_rl_init(&ff_h261_rl_tcoeff, ff_h261_rl_table_store); - done = 1; +} + +av_cold void ff_h261_common_init(void) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + ff_thread_once(&init_static_once, h261_common_init); } From patchwork Mon Nov 23 19:37:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24003 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 D4E2644B12D for ; Mon, 23 Nov 2020 21:41:00 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D9B7968BC63; Mon, 23 Nov 2020 21:38:40 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 99CAC68BBD9 for ; Mon, 23 Nov 2020 21:38:25 +0200 (EET) Received: by mail-wr1-f68.google.com with SMTP id r3so1492068wrt.2 for ; Mon, 23 Nov 2020 11:38:25 -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=23XsAFch8UHDa6HrLsZz+VpNYfoFO2pAWYJMRaMNtaM=; b=ZnXCa5Vr9XxF0hZmYCaDlWfdG54OyvQCNkyAa4D8mVDMiEywVmGviDau41V2lzvXRF lXCdU+dxA8ACOFIZ0tndgWfTcHz/uhyetTOfQUz4th5rNfJbYaszskgDaRhhYD1Bjtck l5SSTq5TYPkgQ9qferqH6pROY6ACMbNk50QpsQTCsMdG2mUrV0E6fOQ55LfjhZ/UZy16 UvFG2bhODeUQYjiOy+uIORUtxyDwq8bmOb6Wd03lXvIIHLwcYCwAuG3eOxRdnw0ltdCh u4YgVvWkdyV9OSKeTBtvTkDYQJ6+HnM4AP/Ce6S2pwW2SCeBMRTDHOZgV8c9nZqrHNfA 8U0w== 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=23XsAFch8UHDa6HrLsZz+VpNYfoFO2pAWYJMRaMNtaM=; b=QAk4jyIutZghYKtzgcBST0P+C1z+C5AJZCQ0PRZ5HyLFOKzsn7BMYQhcAizDqu50lW POQOLz4rAhi1UtV7RRxXOAhsN1OqhjyXkuwArIyDuKfpzPKqSQ4N8JvGNRAA8zHNQlxk iCL4FP5kfourpi2A4L2M3C8VnWS0YqU1Uh/eTxD/dvEr3nUjNmUeXpIDcx9buGH9AjiW vqhprbX+SKaf9DnhgnplhOm9cwS/rrfeEW8DzaD/xIMpU+h7mQJ99AsAUWKZEpdBf2ve JydPIDElWeotZRvKBgOyXJDkAFjyhfbHc0R2DfHCk+mj+F85izP6N477PE7WAoYeXiSr aLoQ== X-Gm-Message-State: AOAM5331znjcTKuttj9wrlSA4Sz/UNQ3uvDo2MpvZLmJdzbh9XZeefqV uk3K7J/92B3+aSBy4K9flWVThWgswoOCqQ== X-Google-Smtp-Source: ABdhPJxqtJ+qbqx9GMofSNwFklisg1joL3gNi3QSpif34UZkwIuYrozQiPMyOJ2M3oqlrSxB+yZxwA== X-Received: by 2002:a5d:474f:: with SMTP id o15mr1325584wrs.100.1606160304827; Mon, 23 Nov 2020 11:38:24 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:24 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:30 +0100 Message-Id: <20201123193739.1249300-20-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 182/191] avcodec/h261dec: Make decoder init-threadsafe 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/h261dec.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 8a49e7d894..377842c6fb 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -26,6 +26,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "mpeg_er.h" #include "mpegutils.h" @@ -47,12 +48,8 @@ static VLC h261_mtype_vlc; static VLC h261_mv_vlc; static VLC h261_cbp_vlc; -static av_cold void h261_decode_init_vlc(H261Context *h) +static av_cold void h261_decode_init_static(void) { - static int done = 0; - - if (!done) { - done = 1; INIT_VLC_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35, ff_h261_mba_bits, 1, 1, ff_h261_mba_code, 1, 1, 662); @@ -66,11 +63,13 @@ static av_cold void h261_decode_init_vlc(H261Context *h) &ff_h261_cbp_tab[0][1], 2, 1, &ff_h261_cbp_tab[0][0], 2, 1, 512); INIT_VLC_RL(ff_h261_rl_tcoeff, 552); - } + + ff_h261_common_init(); } static av_cold int h261_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; H261Context *h = avctx->priv_data; MpegEncContext *const s = &h->s; @@ -82,11 +81,10 @@ static av_cold int h261_decode_init(AVCodecContext *avctx) s->low_delay = 1; avctx->pix_fmt = AV_PIX_FMT_YUV420P; - ff_h261_common_init(); - h261_decode_init_vlc(h); - h->gob_start_code_skipped = 0; + ff_thread_once(&init_static_once, h261_decode_init_static); + return 0; } @@ -686,6 +684,6 @@ AVCodec ff_h261_decoder = { .close = h261_decode_end, .decode = h261_decode_frame, .capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, .max_lowres = 3, }; From patchwork Mon Nov 23 19:37:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24005 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 52DDC44B44C for ; Mon, 23 Nov 2020 21:41:10 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DFE3368BC69; Mon, 23 Nov 2020 21:38:41 +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 8E53B68BBDB for ; Mon, 23 Nov 2020 21:38:26 +0200 (EET) Received: by mail-wr1-f66.google.com with SMTP id 64so6384624wra.11 for ; Mon, 23 Nov 2020 11:38: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=GQ2U4Vfob2tEynMLGXhFZE9HxrlPDi+0HM6EiCNB/yc=; b=mKnp/4sipTogkBaQSDHagcWpkH06yUXHHvUclf0lifoWOAJrMwVXrkakEWwU57G8nY 0vUrvWvhX/Rmr2aQcrU9w0FIm5ya3rzHN4LEs0zrvhCNg2nxLqd2y61FtczHnAF/XZ+f hHyThnPak0Vu4SQp84cochsYv/d29R7OPSR5qzmSpXtpCGGkKqSjlSJG7UYZ9lg8QrdR YBcbSrvyOBOMri7BjP5jS6/eY4WaxRibH/cdlxUjnnEdP6vtVALOlk8EhmFe6w8g9hsL Y98WXYyG7eHTECt/Im9tPjrp798OgUJQ6xSp0oqR2Mldf29DOXAeHrApbsq/ls2S1Ql9 dyMw== 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=GQ2U4Vfob2tEynMLGXhFZE9HxrlPDi+0HM6EiCNB/yc=; b=bNR2DWbKOMmynBcgav7DPcwW2EbJ30qedO6KPvpPHdjwQ/PPFSjI2VgwnIvJS/chQp NMnNvdABdCJ5G4oxAbSoRRB5vHbtEcaTVa+kZBYVjP+B91oTsOSCRs09pfv2b/1O4pAz Gucro91k0IE9gKojRbkMvgTDYR8vIGvs5HiwpjaYNVp9PqBJHasyK2oWAQ/JcyiwwhvW B2BHzmKg2xqnSN92BkydYOujhfmQVCJUi+84c3U2NT3XYKiPpg41kFxYf471O8yFOZnS vFbM1Za5vFmKos2GjpLvw9HvJFYKXp0QJKTzAOeZQjqS0PNF0zRTwbfeyCrFQb8pHaG5 Mzdg== X-Gm-Message-State: AOAM532YROzREyijGi/w+hIlC3zA+ROllC4Bc6wdcd/2tIvRXF2nMe2S 3eJV5cw6iXaTcTMWZCXVEwO3O0Ad63VYbA== X-Google-Smtp-Source: ABdhPJza21RQoNnEO1oNqjoZ9k1yCIu6NMnCgdAitlG6hD1TUvaBbWAfthglvs/HtCqdP1qmnEd7/g== X-Received: by 2002:a5d:6744:: with SMTP id l4mr1273533wrw.378.1606160305804; Mon, 23 Nov 2020 11:38:25 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:25 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:31 +0100 Message-Id: <20201123193739.1249300-21-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 183/191] avcodec/h261dec: Reindentation 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/h261dec.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 377842c6fb..e7e07240ae 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -50,19 +50,19 @@ static VLC h261_cbp_vlc; 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); - INIT_VLC_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10, - ff_h261_mtype_bits, 1, 1, - ff_h261_mtype_code, 1, 1, 80); - INIT_VLC_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17, - &ff_h261_mv_tab[0][1], 2, 1, - &ff_h261_mv_tab[0][0], 2, 1, 144); - INIT_VLC_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63, - &ff_h261_cbp_tab[0][1], 2, 1, - &ff_h261_cbp_tab[0][0], 2, 1, 512); - INIT_VLC_RL(ff_h261_rl_tcoeff, 552); + INIT_VLC_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35, + ff_h261_mba_bits, 1, 1, + ff_h261_mba_code, 1, 1, 662); + INIT_VLC_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10, + ff_h261_mtype_bits, 1, 1, + ff_h261_mtype_code, 1, 1, 80); + INIT_VLC_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17, + &ff_h261_mv_tab[0][1], 2, 1, + &ff_h261_mv_tab[0][0], 2, 1, 144); + INIT_VLC_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63, + &ff_h261_cbp_tab[0][1], 2, 1, + &ff_h261_cbp_tab[0][0], 2, 1, 512); + INIT_VLC_RL(ff_h261_rl_tcoeff, 552); ff_h261_common_init(); } From patchwork Mon Nov 23 19:37:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24006 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 B119744B44C for ; Mon, 23 Nov 2020 21:41:19 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DBFB068BC38; Mon, 23 Nov 2020 21:38:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E730368BC1C for ; Mon, 23 Nov 2020 21:38:27 +0200 (EET) Received: by mail-wr1-f67.google.com with SMTP id t4so6851192wrr.12 for ; Mon, 23 Nov 2020 11:38:27 -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=De6SH3OC13JdpVzlRQNe+Q3PV8eLXN5wNkYyv83Eno4=; b=EQqM14marDY/dH/ZhZv1GQGQH6AmvLA2jJ75hJ+Wh0OR5/WxMabiMZPe6ePq6OxEcn 9W1P4TNti/ADI1gFRBe3BV53QPJurS76c/aayXrN9BtAQSL3U/9qZ8hkqrd1N0fDW8lO 5UNseUmGOn8hcjtjgyHFElSZRHAZUf/gYUhSVFZEd88A83JzhBISEilsIec/pqsUp1Bb ftKqNVc2IJmBkWzWwDO5N75g4C/Phji8dQ/Vg+N8nu5WdZw1C0/BS8OYrpXd0cFx+RX0 CkOemoImogbWcPixP+DA5bmyxvN3VCZ1s2dbr+F4IQLw8mBZGBItsMkFHyfBENHsn/Lr g9+A== 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=De6SH3OC13JdpVzlRQNe+Q3PV8eLXN5wNkYyv83Eno4=; b=RIt/zxMWWMpiiP2qx4S6B/g6LdA+oTWhPSK+TfrY9yy3pj2Jp0qXp6wuVJvY2+YopG ENTjsXQrITHUpF/gA7peSnk9/HEE3sWVU/e10PgC1lBnWZGxI5K/5BlpEwpwXygrSfgx GIrfKVzm0rR1UfemtFFNcqTGAAys5VmHuun3s9GyOtnuomSyJIem7Yl2E+s4lGifcQao wNALgKAeovNBEaSkxReVTWRwlzoK5F+EARxMWBfQMvQ3qxGTWzqBXnOWNVEN+pSBmpn1 W4X5DeGANFuQ19Gp7dlfaxyB0LePyOdaUPpi4rqR7Hd69rv99+nLzYDqCB4pqhrkF+Ec ZJ1w== X-Gm-Message-State: AOAM532mcejzh1hiWOBDnYPyQuH2EsRDSB5TiWaxQFBom5iasfS/fo32 UgIq6fraAJJE2f2qV6ILKIrW57z9C8twhQ== X-Google-Smtp-Source: ABdhPJxJFgEZszMVzvhCWbpTjsxD4duMGEBTXBni2JH3RJMosGi8utNFMccOWwV3IVPCb6EOucDBFA== X-Received: by 2002:a5d:4fc1:: with SMTP id h1mr1388950wrw.226.1606160306876; Mon, 23 Nov 2020 11:38:26 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:26 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:32 +0100 Message-Id: <20201123193739.1249300-22-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 184/191] avcodec/asvdec: Make decoders init-threadsafe 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/asvdec.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c index 6b6d7b3fa7..d40535bed4 100644 --- a/libavcodec/asvdec.c +++ b/libavcodec/asvdec.c @@ -25,6 +25,7 @@ #include "libavutil/attributes.h" #include "libavutil/mem.h" +#include "libavutil/thread.h" #include "asv.h" #include "avcodec.h" @@ -45,13 +46,8 @@ static VLC dc_ccp_vlc; static VLC ac_ccp_vlc; static VLC asv2_level_vlc; -static av_cold void init_vlcs(ASV1Context *a) +static av_cold void init_vlcs(void) { - static int done = 0; - - if (!done) { - done = 1; - INIT_VLC_STATIC(&ccp_vlc, CCP_VLC_BITS, 17, &ff_asv_ccp_tab[0][1], 2, 1, &ff_asv_ccp_tab[0][0], 2, 1, 32); @@ -67,7 +63,6 @@ static av_cold void init_vlcs(ASV1Context *a) INIT_LE_VLC_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63, &ff_asv2_level_tab[0][1], 4, 2, &ff_asv2_level_tab[0][0], 4, 2, 1024); - } } static inline int asv1_get_level(GetBitContext *gb) @@ -286,6 +281,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, static av_cold int decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; ASV1Context *const a = avctx->priv_data; const int scale = avctx->codec_id == AV_CODEC_ID_ASV1 ? 1 : 2; int i; @@ -297,7 +293,6 @@ static av_cold int decode_init(AVCodecContext *avctx) ff_asv_common_init(avctx); ff_blockdsp_init(&a->bdsp, avctx); ff_idctdsp_init(&a->idsp, avctx); - init_vlcs(a); ff_init_scantable(a->idsp.idct_permutation, &a->scantable, ff_asv_scantab); avctx->pix_fmt = AV_PIX_FMT_YUV420P; @@ -316,6 +311,8 @@ static av_cold int decode_init(AVCodecContext *avctx) a->inv_qscale; } + ff_thread_once(&init_static_once, init_vlcs); + return 0; } @@ -340,6 +337,7 @@ AVCodec ff_asv1_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -353,5 +351,6 @@ AVCodec ff_asv2_decoder = { .init = decode_init, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif From patchwork Mon Nov 23 19:37:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24007 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 A185444B44C for ; Mon, 23 Nov 2020 21:41:29 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F345068BC3F; Mon, 23 Nov 2020 21:38:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8A2F768BBD5 for ; Mon, 23 Nov 2020 21:38:28 +0200 (EET) Received: by mail-wr1-f65.google.com with SMTP id u12so19861270wrt.0 for ; Mon, 23 Nov 2020 11:38:28 -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=vKjdRB/qbadRNkVBlZxD0YI42BWl4iRTwQrv6adUJes=; b=RnN4ZOIqFmP92Vv71QpluikbFw5lh1fHNWpAZXV2z9MIMvFcm8MPMzQIFFJV15KFBQ SulfBAFpGq9J8ZylHkVRw2agnrSzrJamIwl+bsqpHXxB3b+15CqsY+Hm+l+ELCblfxUo rnYZjwKApXZHvNEhTmfWUfiPxEq76MRzar1S+nfKXh/gKm1Mt5sg0CzvC9dbn2FF57VB OKMbMZGac3JyQLfGxoYRQR1EMRbVKio3lOdrTclb9/VIkwhBBEJhNtL/C8wjUbFL2JAp 6Op+F7Hc/TlMtDIPuYNxrYTcVH7BY9Jg7vcz9Vsz+XIgNn2H4a4nLJaLubv6XTADho+w AGXQ== 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=vKjdRB/qbadRNkVBlZxD0YI42BWl4iRTwQrv6adUJes=; b=hMjZgmJT3cXPldliN2couCN6jt8syrByoojeS2HAmZDey6yvOKY4/kiMvzNV+w/VrS wD5+XwruaPcXLmYRNZ53QzDSGWTfKuf2O109FsFZvG+ysqimWg7Udfp63CVpe1sc6Ohl YQ8J6Z7FnxcFOsnGqFwXWWf6PIl1bLJhVjUXc/TtO6BOihOP3Pj7bTo/KAV7Z3oCmBNY GcMxGzN/7DTGVBf5MTjSn5mAfTlHaiMGYHR6zuhRMmm8Z2XTFQG+0gF1Cx2PS956cgxP Oke2T4Q7MtbFk2Thp2wIuDx+Tjl1GXWEtaKG/NY7foHY8cL5pLjsyjRevjHwQVanKB3G revA== X-Gm-Message-State: AOAM530e0rTL4TBpoGPG3Q+SfTP+D6x3SD9F6nmYxoerGJ4+mPVysv74 5HkZNDdL1IxBu7QCrRgwZj253L1sVJen8w== X-Google-Smtp-Source: ABdhPJxqDEN08+pBovWNe4WW9P/ek/SsvsmTrSuaHOtK8t65XjTpcusGD6/uhgRbzCSdZvNROymMuw== X-Received: by 2002:a5d:4acf:: with SMTP id y15mr1206034wrs.333.1606160307821; Mon, 23 Nov 2020 11:38:27 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:27 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:33 +0100 Message-Id: <20201123193739.1249300-23-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 185/191] avcodec/asvdec: Reindentation 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/asvdec.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c index d40535bed4..a72e11b848 100644 --- a/libavcodec/asvdec.c +++ b/libavcodec/asvdec.c @@ -48,21 +48,21 @@ static VLC asv2_level_vlc; static av_cold void init_vlcs(void) { - INIT_VLC_STATIC(&ccp_vlc, CCP_VLC_BITS, 17, - &ff_asv_ccp_tab[0][1], 2, 1, - &ff_asv_ccp_tab[0][0], 2, 1, 32); - INIT_LE_VLC_STATIC(&dc_ccp_vlc, DC_CCP_VLC_BITS, 8, - &ff_asv_dc_ccp_tab[0][1], 2, 1, - &ff_asv_dc_ccp_tab[0][0], 2, 1, 16); - INIT_LE_VLC_STATIC(&ac_ccp_vlc, AC_CCP_VLC_BITS, 16, - &ff_asv_ac_ccp_tab[0][1], 2, 1, - &ff_asv_ac_ccp_tab[0][0], 2, 1, 64); - INIT_VLC_STATIC(&level_vlc, ASV1_LEVEL_VLC_BITS, 7, - &ff_asv_level_tab[0][1], 2, 1, - &ff_asv_level_tab[0][0], 2, 1, 16); - INIT_LE_VLC_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63, - &ff_asv2_level_tab[0][1], 4, 2, - &ff_asv2_level_tab[0][0], 4, 2, 1024); + INIT_VLC_STATIC(&ccp_vlc, CCP_VLC_BITS, 17, + &ff_asv_ccp_tab[0][1], 2, 1, + &ff_asv_ccp_tab[0][0], 2, 1, 32); + INIT_LE_VLC_STATIC(&dc_ccp_vlc, DC_CCP_VLC_BITS, 8, + &ff_asv_dc_ccp_tab[0][1], 2, 1, + &ff_asv_dc_ccp_tab[0][0], 2, 1, 16); + INIT_LE_VLC_STATIC(&ac_ccp_vlc, AC_CCP_VLC_BITS, 16, + &ff_asv_ac_ccp_tab[0][1], 2, 1, + &ff_asv_ac_ccp_tab[0][0], 2, 1, 64); + INIT_VLC_STATIC(&level_vlc, ASV1_LEVEL_VLC_BITS, 7, + &ff_asv_level_tab[0][1], 2, 1, + &ff_asv_level_tab[0][0], 2, 1, 16); + INIT_LE_VLC_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63, + &ff_asv2_level_tab[0][1], 4, 2, + &ff_asv2_level_tab[0][0], 4, 2, 1024); } static inline int asv1_get_level(GetBitContext *gb) From patchwork Mon Nov 23 19:37:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24008 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 1B7B944B44C for ; Mon, 23 Nov 2020 21:41:39 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C580068BC7A; Mon, 23 Nov 2020 21:38:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CCA4C68BC2A for ; Mon, 23 Nov 2020 21:38:29 +0200 (EET) Received: by mail-wr1-f47.google.com with SMTP id e7so2263264wrv.6 for ; Mon, 23 Nov 2020 11:38:29 -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=ROgZU0gSR5XJiedKfPdrzZ/UilLtDu7090iWggS++dA=; b=cNgR/53aMPiTuJvh4UDmA4s7wdKjBtBS0fS4jBTLLEFZhGJFQCClT54mlaX0h//tTo 1NngwFTSul92jaNhmUpcSoAByO/lbr649JfPwinqj+oMJnEp43kPbR5JQdCwNJGVVL61 4rVKHV9Kobhceoe6oYlY0hHpVcrlfKp2AHaFKvyvxCIdgPi5NZtEEFXWfT7UAk4zDqa+ PulQeFCa2r+Y7t6tBEW1PINAJ8Ka8Jmue9P/Ar0S8wV6Fgn1dLjCQ35uHgxgjAwzvfPh wEOWCkLQ07tzZzO6TrZFQziSlERb94eIPqgp9BEeA4W9+T1l5IIj0YvN2QYquMSVhS8g QKEw== 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=ROgZU0gSR5XJiedKfPdrzZ/UilLtDu7090iWggS++dA=; b=bELZugPlDbUT0q1upsP9YSp1Idwh7P3UKSdTC8MGTlmP7m5hqmGlZEeuZbi2hAJjIV LQlHvF3sQwHkDnteHdJvXegNiI20pTQQ7r/ocQY907XY/et1xKRL8CCufL7C6+HO9EIy RhUr98nYpCiqWsIYd3JtocmY+30Y7K70XKI4Azu+BdcHmX+8GG+tb7a/PEIxUciAeTPj VqaIpLqgcap85wAxlE3ylqmXuwp6wHqEFzuAyN7aEMwV5hGhn2JPZKaUctB7hgp2zPAS 9E3Su9j4NpGxc/wYBjg47/efnBv6we81jMx9WnaQSLzQ6C4InA2yY9U2o6D5QmdE5mL0 e/rw== X-Gm-Message-State: AOAM531F0EEUjvqP7cAJZCWkeJTBl0jH5NEGOzYckJjmK+jzrbn1sOYb wHdOJJeVahZRiHRfbjBDwceweLCMbb+9qA== X-Google-Smtp-Source: ABdhPJx1QmAkUieKY9mrExUrKw/AO7YoDbzK8dUcRC1kjT8aRcVCeE4NTZQwq/3ewf2sSTCUSsriDg== X-Received: by 2002:adf:e5d0:: with SMTP id a16mr1396911wrn.340.1606160308768; Mon, 23 Nov 2020 11:38:28 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:28 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:34 +0100 Message-Id: <20201123193739.1249300-24-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 186/191] avcodec/wavpack: Fix leak on init failure 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/wavpack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 58122c948c..e02a56aa35 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1712,5 +1712,5 @@ AVCodec ff_wavpack_decoder = { .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS, + .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP, }; From patchwork Mon Nov 23 19:37:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24009 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 9A55C44B44C for ; Mon, 23 Nov 2020 21:41:48 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BF0DE68BBED; Mon, 23 Nov 2020 21:38:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B1E5168BC30 for ; Mon, 23 Nov 2020 21:38:30 +0200 (EET) Received: by mail-wr1-f65.google.com with SMTP id l1so19773559wrb.9 for ; Mon, 23 Nov 2020 11:38:30 -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=qeTpabb811qUz9RceAusKSISFtq33U57wvyY7d3gb9w=; b=CmTth/37/Pd44MvpZaBRQaYdWGf+8Wy/QDk/TX3z7MmSF2rI1o60r3H5Sa5/GSTNAG CYPSEKEh0o0GGQB8StV00ublafaDYrTd7kD/ItqNubqEHSmb54P+rLD0jWQ5vSt+eVwd y7Z4yIpfOTvI/Gzf2j2Qj+WL9D+OqifY1EiwpuQlomuXxGP4SlwlQvAn6o29+JQT5zof +4XwzMqIw3qwseHG6Fsdu87D2njnsdo1v0poOwdxviwo8TckplFTPTyVB2ESpDYO4lwp L6LfVj6Y+7mZMKvFW+UbnrVbXaTHQs6gD7uEmQXouVGK22dJ+7rcK6qSi1vyTZRkAMuk qRHA== 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=qeTpabb811qUz9RceAusKSISFtq33U57wvyY7d3gb9w=; b=B43M2fmvEzuVbq0yThzVW2a99tzTeY9woJ5Q1AYpq6js5Kn+XIJgR0nubIXOY0qjEq LHsGkxzaLqXx2uxpFsVyBKpGvBI+5kLxF8sfwdGezIG8GiQoaQgEl/12SkJvjjG9m4hp wfx4Y4d2rAdnvs5TodIBm4pR2kystXq+Re20gzPviMvKIapWPC7XtKLx4RRt+BelPzfm tsdMDT2TomsNozUbg2Sro1gl6WhCUat8B/PWfydrzu+bP9G6XGES4YFo2iISO8f+yeXV fQveorC8D6D3IswNa4Ic/7CIhlzwd3DKVsG02w9s7pV1so7l+h0xtHrW4hrRqHpwHaMz txOw== X-Gm-Message-State: AOAM533NgqM4KSLf9w2Algr1WMeX/k1fNBcevBYxTMPedjuTomXlwb+R behlP4hCvlVt/mRbvM8q8gzBqpAIbjo4lQ== X-Google-Smtp-Source: ABdhPJyXtFwd+44hpajHFmlykXW2UB9N30bIjO3y9rZl3ayE52wvkFFPQ9CthdaKVNEmvJQGT7dy9A== X-Received: by 2002:adf:f2d1:: with SMTP id d17mr1252056wrp.339.1606160309917; Mon, 23 Nov 2020 11:38:29 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:29 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:35 +0100 Message-Id: <20201123193739.1249300-25-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 187/191] avcodec/dsd: Make initializing DSD tables thread-safe 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" This automatically makes the DSD formats as well as DST and WavPack init-threadsafe. Signed-off-by: Andreas Rheinhardt --- libavcodec/dsd.c | 8 +++----- libavcodec/dsddec.c | 1 + libavcodec/dstdec.c | 1 + libavcodec/wavpack.c | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libavcodec/dsd.c b/libavcodec/dsd.c index d48f87fa0f..95aab61ea4 100644 --- a/libavcodec/dsd.c +++ b/libavcodec/dsd.c @@ -21,6 +21,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/thread.h" #include "libavcodec/internal.h" #include "libavcodec/mathops.h" #include "avcodec.h" @@ -45,11 +46,8 @@ static av_cold void dsd_ctables_tableinit(void) av_cold void ff_init_dsd_data(void) { - static int done = 0; - if (done) - return; - dsd_ctables_tableinit(); - done = 1; + static AVOnce init_static_once = AV_ONCE_INIT; + ff_thread_once(&init_static_once, dsd_ctables_tableinit); } void ff_dsd2pcm_translate(DSDContext* s, size_t samples, int lsbf, diff --git a/libavcodec/dsddec.c b/libavcodec/dsddec.c index 39837a5ad9..375e49341f 100644 --- a/libavcodec/dsddec.c +++ b/libavcodec/dsddec.c @@ -125,6 +125,7 @@ AVCodec ff_##name_##_decoder = { \ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, \ .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, \ AV_SAMPLE_FMT_NONE }, \ + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ }; DSD_DECODER(DSD_LSBF, dsd_lsbf, "DSD (Direct Stream Digital), least significant bit first") diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c index 41e761d7e5..3fd710d2f6 100644 --- a/libavcodec/dstdec.c +++ b/libavcodec/dstdec.c @@ -389,4 +389,5 @@ AVCodec ff_dst_decoder = { .capabilities = AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index e02a56aa35..8fdabce335 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1712,5 +1712,6 @@ AVCodec ff_wavpack_decoder = { .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Mon Nov 23 19:37:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24010 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 A8F1144B44C for ; Mon, 23 Nov 2020 21:41:57 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 01F7D68BC85; Mon, 23 Nov 2020 21:38:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A2F3968BB73 for ; Mon, 23 Nov 2020 21:38:31 +0200 (EET) Received: by mail-wr1-f65.google.com with SMTP id m6so19782158wrg.7 for ; Mon, 23 Nov 2020 11:38: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=UytiSE94algv3KgfQNDWCTavyVne2LWrjeqmf5VStjg=; b=i0l6eRrkmiyNR0v1la6yfKD1VJ9ljt3h2tCnxBHe2OsBtg8FezWvrFH80Sn+cWrY4U yrEYsENo6Omn0SyuZ3EIcjlVcP7wV418f8S10UIQ6DohU87C4jLxKM+c4+9tRzy9Me// HumYwCbbzw8l6a1OG63sfqLIC9Tou5kMr6SSV76TUm7UgpZZZgZjLJxG3lhMAI7rUSVh z/rrtQQbZ9Whq54Gu3c3bvELB1BlLTzSe493NRY28v5BTMStQDpHWuB2dgjQOsS+nRjQ nL5GLjzqjKR8Cj+N13zR6JLBNUALk5U6Z/l5eLDLLWnHRfXAnHL2GSuJUoKowv488EYu SbEg== 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=UytiSE94algv3KgfQNDWCTavyVne2LWrjeqmf5VStjg=; b=Tiwq74N6+VpYeQmyhZdxpNPXHLUW8dAMUZSZaoBMRDSnlElf6IianCuIyWc1YMy0bA 4yXb707UthhaJ4SitLVctB5F579w33+plQBFb4lIACxvsTfwdtgOPBzsyCINjivw2oEh 26lzkOxgSjRNDr5DQeg/LoggzRP6bcoiUCMvO1ZXuWwVFXJI/V+tqVoEOKpPkuvWDV3K edLyRGcZD3ljKMJfCd+g1xAbFaGs+kCvBDbctFIOWm/kOimxhwh4yXoUGIhwA+YQSvF/ uAAnHTU/12lT1BzrXXbmzUQjT2o8MXtqmIM+7SUqxLVPhWy4iYpZM3vS+G/FAsdhw0bt +yJg== X-Gm-Message-State: AOAM533jrOQtU4KDXq0hLkE1di2zXE03J7+UJweGTQBNr2FJRZv2qT9J 5afqaNevhDNmoIrQdIs9DFhIkCmq4I/THA== X-Google-Smtp-Source: ABdhPJy3YZD5AVDEnR1jOSxIM4hJwDIx+Y2thdWPgSxiunFRuJyzga53kfD6coDVNZnV2N04EJ1IaA== X-Received: by 2002:adf:eacb:: with SMTP id o11mr1339479wrn.208.1606160310770; Mon, 23 Nov 2020 11:38:30 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:30 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:36 +0100 Message-Id: <20201123193739.1249300-26-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 188/191] avcodec/dsddec: Inline constant 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/dsddec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/dsddec.c b/libavcodec/dsddec.c index 375e49341f..9814c9eb82 100644 --- a/libavcodec/dsddec.c +++ b/libavcodec/dsddec.c @@ -27,11 +27,11 @@ */ #include "libavcodec/internal.h" -#include "libavcodec/mathops.h" #include "avcodec.h" #include "dsd.h" #define DSD_SILENCE 0x69 +#define DSD_SILENCE_REVERSED 0x96 /* 0x69 = 01101001 * This pattern "on repeat" makes a low energy 352.8 kHz tone * and a high energy 1.0584 MHz tone which should be filtered @@ -53,7 +53,7 @@ static av_cold int decode_init(AVCodecContext *avctx) if (!s) return AVERROR(ENOMEM); - silence = avctx->codec_id == AV_CODEC_ID_DSD_LSBF || avctx->codec_id == AV_CODEC_ID_DSD_LSBF_PLANAR ? ff_reverse[DSD_SILENCE] : DSD_SILENCE; + silence = avctx->codec_id == AV_CODEC_ID_DSD_LSBF || avctx->codec_id == AV_CODEC_ID_DSD_LSBF_PLANAR ? DSD_SILENCE_REVERSED : DSD_SILENCE; for (i = 0; i < avctx->channels; i++) { s[i].pos = 0; memset(s[i].buf, silence, sizeof(s[i].buf)); From patchwork Mon Nov 23 19:37:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24011 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 AA79E44B44C for ; Mon, 23 Nov 2020 21:42:06 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C08D168BC92; Mon, 23 Nov 2020 21:38:47 +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 B0CFD68BC31 for ; Mon, 23 Nov 2020 21:38:32 +0200 (EET) Received: by mail-wm1-f68.google.com with SMTP id s13so381612wmh.4 for ; Mon, 23 Nov 2020 11:38:32 -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=w4Kss8n6T3thRmRWgIUYo3sJfdYVv7ArQO6HBawnjPc=; b=bCVt+9SqHjS5thpWkylPxCKJpGOkXIoHAjC2FieX8TTYQ37fXYZ7LAAE2cm/5MBSBw y/C8LnkOr5Q+Y/vrBdJRF5Mf0I5Gg9GInLWG2kV+o24q+zV7I2eboKFk2dvzyNvjtNEX m18n8krumcG1t8iA7axTGg8gHVqXR0D9IM9tJDv9mrfnKmSxPx9riXOsPqM7JGkTLxcQ LUGbNbkX4H4wWWlCVNYgfxXZooYtmSup3uSfhJpbJTDqmXZN/zdsdnVn9o6AznRZDWQE BQecCcPJbHtuZtyfUL6Oqt0iy4fHxumQITzZNNBsUC/qJ1cHjnz2PIMKRBP2E/7T8ILf NaDw== 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=w4Kss8n6T3thRmRWgIUYo3sJfdYVv7ArQO6HBawnjPc=; b=N4V0Jc/IkAdWo5VYF5OEOzNBJ0on+syzLMJZhZhXauuyMpRTAk6NQOLFw6q77c7Ecv olijEgb31Qe4x8ybGsyESRgOTJmqNmnlx8VIwEU8UDbRsO91pv3NVteOAuoyUMc5vl/h ujJs2MgW2x7M+17vKBoCgV+c+OKlx2LXKPJOkmeMOdg9Bmh/uW2JIBc6sW4fPIc3S+LV +p+OycnXpFW+mJ4IMTm9/F9UbKYngZGQjylwLtyb7rwKFLt3j5o3wOxzUl6V1eN0Kmy0 SvSurdAS+VBh4I5tuo6/Xcx9Ae0XUm/x9JgxyS3TeWYuaJbH4NJyqDOx8pOHCB+TfoqY 01lQ== X-Gm-Message-State: AOAM531orbmmgLeODLS4NIFekX6LT3n8TRkcSV5xm0YBPF9lYZbPT2Pc 6RRi5IB6TnUM5AxeHzgmy/7MvsKAk5hLMA== X-Google-Smtp-Source: ABdhPJy5MCG9dmjoNThfLvsw6fL76eIRzPG8KzmcBcPjTAMiFIN7ohPjnRArzM3cYDCH8df+91Xx+g== X-Received: by 2002:a1c:2e48:: with SMTP id u69mr512754wmu.30.1606160311895; Mon, 23 Nov 2020 11:38:31 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:31 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:37 +0100 Message-Id: <20201123193739.1249300-27-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 189/191] avcodec/ivi: Make initializing VLCs thread-safe 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" This automatically makes indeo4/5 init-threadsafe. Signed-off-by: Andreas Rheinhardt --- libavcodec/indeo4.c | 1 + libavcodec/indeo5.c | 2 +- libavcodec/ivi.c | 13 ++++++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index 4bfc6cdd74..e2778af6ca 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -713,4 +713,5 @@ AVCodec ff_indeo4_decoder = { .close = ff_ivi_decode_close, .decode = ff_ivi_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index ac15d31fef..3ee7a0e1d6 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -693,5 +693,5 @@ AVCodec ff_indeo5_decoder = { .close = ff_ivi_decode_close, .decode = ff_ivi_decode_frame, .capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ivi.c b/libavcodec/ivi.c index 5e1180a5f0..a5074e9980 100644 --- a/libavcodec/ivi.c +++ b/libavcodec/ivi.c @@ -30,6 +30,7 @@ #include "libavutil/attributes.h" #include "libavutil/imgutils.h" +#include "libavutil/thread.h" #define BITSTREAM_READER_LE #include "avcodec.h" @@ -157,14 +158,11 @@ static int ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag) (flag ? INIT_VLC_USE_NEW_STATIC : 0) | INIT_VLC_OUTPUT_LE); } -av_cold void ff_ivi_init_static_vlc(void) +static av_cold void ivi_init_static_vlc(void) { int i; static VLC_TYPE table_data[8192 * 16][2]; - static int initialized_vlcs = 0; - if (initialized_vlcs) - return; for (i = 0; i < 8; i++) { ivi_mb_vlc_tabs[i].table = table_data + i * 2 * 8192; ivi_mb_vlc_tabs[i].table_allocated = 8192; @@ -175,7 +173,12 @@ av_cold void ff_ivi_init_static_vlc(void) ivi_create_huff_from_desc(&ivi_blk_huff_desc[i], &ivi_blk_vlc_tabs[i], 1); } - initialized_vlcs = 1; +} + +av_cold void ff_ivi_init_static_vlc(void) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + ff_thread_once(&init_static_once, ivi_init_static_vlc); } /* From patchwork Mon Nov 23 19:37:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24012 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 6E2A944B5B8 for ; Mon, 23 Nov 2020 21:42:16 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A4D3968BC52; Mon, 23 Nov 2020 21:38:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BE9DB68BB73 for ; Mon, 23 Nov 2020 21:38:33 +0200 (EET) Received: by mail-wr1-f46.google.com with SMTP id 64so6385204wra.11 for ; Mon, 23 Nov 2020 11:38:33 -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=WBtSOpdcZ8z/lzzF844+vhWInQCHDMIgJfe6NYPHGe0=; b=dztcsB+VKgazn/z0olTE636Bv6x6T92PxbJ3nwnx+IIjD7cl5YmOx4YaRg8aWCxM+5 mCeTmhUK47QcG/4bg0UQ1BJR0KSzFdjjBjxejnapWDIrb+knFn5GLxZF32rB+PkeYyYx AxWcDMtLfr1sZE9ZMX4bH11cgYprqCw2LbnBLCo1y7VAoeXCDuMx4TAAwvrAoSW9IFnv OpLv4p80iwMSu7uvHryRpc7c0VBx28+zt7gSBvIYC8Nc0/83mziwj4sgqA7iNdr3Y2Hq kNZFMMfi4kbwtyfHpdIG/jc8zLTq31EPptDF7ZSPLrNVm4VzRp/ZhO9Zfjt07m0XiqRA qchw== 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=WBtSOpdcZ8z/lzzF844+vhWInQCHDMIgJfe6NYPHGe0=; b=iNIMzJryZ7/Tz0bPLWzjQYw6vw7jRxm4BVzQsy/+XSB1vg7HLyXBfaGN2m4lscYkCo xozR5XOWm42PG+utjhqi6PtJmE+WriOyIqchPdkA2wUHwaNKpai3q9Nh6TCfl8KbzSx7 RdEhx3udzUyrcUX5+tB8Q7z9tzPGdDMr7kIi/AWuOJDAAZs5kF0uJmP4Qb80i+NT5KMH 0uKkUEbv5t6ghVA8LjP/zRhNo/gExTEX29exj3BpE8+728Yp62505TYUHJmH//Pchxc7 ZY+BXPvF6qB/y6Yynw1F1bWi7cKZIwhOyb0uB/XuITi/aq95bHcCJTg0lIxB7RD+2GCU dCiA== X-Gm-Message-State: AOAM532mkZHn2Hknv6aaDQga0sbRdoFJzAk/0vxIbrQY/9PyEzxTMZj/ FHzURRWIhKq1Wk8iuHe6PXpKm5N3CSnkDA== X-Google-Smtp-Source: ABdhPJyNRymP44DrAT8l+u6Hffm4ZIrV9OWmWgUmW08oGtz2k1tpWKcpTzAKVdq1TcR7S7/asrhS/w== X-Received: by 2002:a5d:4b81:: with SMTP id b1mr1340771wrt.372.1606160312742; Mon, 23 Nov 2020 11:38:32 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:32 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:38 +0100 Message-Id: <20201123193739.1249300-28-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 190/191] avcodec/wmadec: Reduce the size of tables used to initialize 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" By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one can replace a table of codes of type uint16_t by a table of symbols of type uint8_t, saving space. Signed-off-by: Andreas Rheinhardt --- libavcodec/wma.h | 3 +-- libavcodec/wmadata.h | 20 ++++++++------------ libavcodec/wmadec.c | 6 +++--- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/libavcodec/wma.h b/libavcodec/wma.h index c7fcf5047c..7935bcdb31 100644 --- a/libavcodec/wma.h +++ b/libavcodec/wma.h @@ -139,8 +139,7 @@ typedef struct WMACodecContext { #endif /* TRACE */ } WMACodecContext; -extern const uint16_t ff_wma_hgain_huffcodes[37]; -extern const uint8_t ff_wma_hgain_huffbits[37]; +extern const uint8_t ff_wma_hgain_hufftab[37][2]; extern const float ff_wma_lsp_codebook[NB_LSP_COEFS][16]; extern const uint32_t ff_aac_scalefactor_code[121]; extern const uint8_t ff_aac_scalefactor_bits[121]; diff --git a/libavcodec/wmadata.h b/libavcodec/wmadata.h index 641cb1813c..ca485a5663 100644 --- a/libavcodec/wmadata.h +++ b/libavcodec/wmadata.h @@ -51,18 +51,14 @@ static const uint8_t exponent_band_44100[3][25] = { { 17, 4, 8, 8, 4, 12, 12, 8, 8, 24, 16, 20, 24, 32, 40, 60, 80, 152, }, }; -const uint16_t ff_wma_hgain_huffcodes[37] = { - 0x00003, 0x002e7, 0x00001, 0x005cd, 0x0005d, 0x005c9, 0x0005e, 0x00003, - 0x00016, 0x0000b, 0x00001, 0x00006, 0x00001, 0x00006, 0x00004, 0x00005, - 0x00004, 0x00007, 0x00003, 0x00007, 0x00004, 0x0000a, 0x0000a, 0x00002, - 0x00003, 0x00000, 0x00005, 0x00002, 0x0005f, 0x00004, 0x00003, 0x00002, - 0x005c8, 0x000b8, 0x005ca, 0x005cb, 0x005cc, -}; - -const uint8_t ff_wma_hgain_huffbits[37] = { - 10, 12, 10, 13, 9, 13, 9, 8, 7, 5, 5, 4, 4, 3, 3, 3, - 4, 3, 4, 4, 5, 5, 6, 8, 7, 10, 8, 10, 9, 8, 9, 9, - 13, 10, 13, 13, 13, +const uint8_t ff_wma_hgain_hufftab[37][2] = { + { 25, 10 }, { 2, 10 }, { 27, 10 }, { 0, 10 }, { 31, 9 }, { 30, 9 }, + { 23, 8 }, { 7, 8 }, { 29, 8 }, { 26, 8 }, { 24, 7 }, { 10, 5 }, + { 12, 4 }, { 20, 5 }, { 22, 6 }, { 8, 7 }, { 33, 10 }, { 32, 13 }, + { 5, 13 }, { 34, 13 }, { 35, 13 }, { 36, 13 }, { 3, 13 }, { 1, 12 }, + { 4, 9 }, { 6, 9 }, { 28, 9 }, { 18, 4 }, { 16, 4 }, { 21, 5 }, + { 9, 5 }, { 11, 4 }, { 19, 4 }, { 14, 3 }, { 15, 3 }, { 13, 3 }, + { 17, 3 }, }; const float ff_wma_lsp_codebook[NB_LSP_COEFS][16] = { diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 8504d8d6c4..2b9499eba7 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -110,9 +110,9 @@ static av_cold int wma_decode_init(AVCodecContext *avctx) ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 1, 1.0 / 32768.0); if (s->use_noise_coding) { - init_vlc(&s->hgain_vlc, HGAINVLCBITS, sizeof(ff_wma_hgain_huffbits), - ff_wma_hgain_huffbits, 1, 1, - ff_wma_hgain_huffcodes, 2, 2, 0); + ff_init_vlc_from_lengths(&s->hgain_vlc, HGAINVLCBITS, FF_ARRAY_ELEMS(ff_wma_hgain_hufftab), + &ff_wma_hgain_hufftab[0][1], 2, + &ff_wma_hgain_hufftab[0][0], 2, 1, 0, 0, avctx); } if (s->use_exp_vlc) From patchwork Mon Nov 23 19:37:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24001 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 B5A8F44A49B for ; Mon, 23 Nov 2020 21:38:49 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9872E68BC8E; Mon, 23 Nov 2020 21:38:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 869BB68BBC9 for ; Mon, 23 Nov 2020 21:38:34 +0200 (EET) Received: by mail-wr1-f68.google.com with SMTP id m6so19782370wrg.7 for ; Mon, 23 Nov 2020 11:38:34 -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=PbeqjXCa1IXIvK4tg7UTDErx7fdzzf+FarRYt1QQ0Xw=; b=TJR90nWO5Qn9x8aVXoEBst3sH2ASQA47Y8YSRI2gdrd9lPo8GSvI8eb5KYywv90DcV DnEWKW5+uT3qKByb9YQZ1GVyRv26yksUsnqO8QMcVYPp/lP6sL0fKi3eQlxtih9FGQ72 83eR5kEtFhHc8d4ODxO9eltOOkh6rMIB2ZTg0RftIqhh0IOiewIpy7rXanh5zlsAn7zQ pk1hhMb+ujFlTy931H9N2ku3qqgJMe1WCuym5Zhqc880uHJD0frihhBnkyX/Jm4NVA+x UMmTzGm/6FDygJMA6+ly6X/9WxtOJeVHaLtSdC5mA2j+0LsL4kr90L5VF38Q/XSfPrCn z6KQ== 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=PbeqjXCa1IXIvK4tg7UTDErx7fdzzf+FarRYt1QQ0Xw=; b=ZMQzCxDggzWWPXUuO3Vqk9UmuqxKznPXPOudFgqvWovuSL0eSJDzdgSFHnyxddMEUy wihYzj8qQBVoTPm+761e8aet8emamN9g678/MrktiRCnaV5t0+pWJwXOtvpHoqN+C91y 1T2tpBoP0SniHkCXvb3sS71/StqiFwQxloh8J7ui40y/AL5G4vOI1N/xbZgP6x+ztPPO XzswU+w1USNin1uPpndBBuPjSssV/qWe9zBFFvdxLiMgcy2iaQFjudbO0i2I8oDKKq5C 0Yp9jC9mITYRpEfI5e23zZZibMf/towycS9QXXqxOWfYkPfgvRKAIe+O3Ld6JjZ17yv4 PwHQ== X-Gm-Message-State: AOAM532lmeHuPnRieVKKCCxWXdchU0LUyiXb63q+lVa6E0//MVO6zCWf LrDEAOaeP1Eu0uRhq5I7UpueKqsL6/YbZw== X-Google-Smtp-Source: ABdhPJypwmlyEWmjVwOM0FtKd+xOtiXlgQ5FpySRl87R1Ss4MGHajRR+gRFTJxwUHgT46O+N35OH9g== X-Received: by 2002:adf:9787:: with SMTP id s7mr1305889wrb.286.1606160313721; Mon, 23 Nov 2020 11:38:33 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id e6sm564086wme.27.2020.11.23.11.38.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:38:33 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 20:37:39 +0100 Message-Id: <20201123193739.1249300-29-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 191/191] avcodec/wmadec: Apply VLC offset during init 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/wmadec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 2b9499eba7..9c79556bb5 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -112,7 +112,7 @@ static av_cold int wma_decode_init(AVCodecContext *avctx) if (s->use_noise_coding) { ff_init_vlc_from_lengths(&s->hgain_vlc, HGAINVLCBITS, FF_ARRAY_ELEMS(ff_wma_hgain_hufftab), &ff_wma_hgain_hufftab[0][1], 2, - &ff_wma_hgain_hufftab[0][0], 2, 1, 0, 0, avctx); + &ff_wma_hgain_hufftab[0][0], 2, 1, -18, 0, avctx); } if (s->use_exp_vlc) @@ -545,7 +545,7 @@ static int wma_decode_block(WMACodecContext *s) } for (ch = 0; ch < s->avctx->channels; ch++) { if (s->channel_coded[ch]) { - int i, n, val, code; + int i, n, val; n = s->exponent_high_sizes[bsize]; val = (int) 0x80000000; @@ -554,9 +554,8 @@ static int wma_decode_block(WMACodecContext *s) if (val == (int) 0x80000000) { val = get_bits(&s->gb, 7) - 19; } else { - code = get_vlc2(&s->gb, s->hgain_vlc.table, + val += get_vlc2(&s->gb, s->hgain_vlc.table, HGAINVLCBITS, HGAINMAX); - val += code - 18; } s->high_band_values[ch][i] = val; }